blob: ee0d3704d75c6ca50e114789512f5e07ca6c86b4 [file] [log] [blame]
Dan Gohman10e730a2015-06-29 23:51:55 +00001//===-- WebAssemblyMCAsmInfo.cpp - WebAssembly asm properties -------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9///
10/// \file
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000011/// This file contains the declarations of the WebAssemblyMCAsmInfo
Dan Gohman10e730a2015-06-29 23:51:55 +000012/// properties.
13///
14//===----------------------------------------------------------------------===//
15
16#include "WebAssemblyMCAsmInfo.h"
17#include "llvm/ADT/Triple.h"
Dan Gohman10e730a2015-06-29 23:51:55 +000018using namespace llvm;
19
20#define DEBUG_TYPE "wasm-mc-asm-info"
21
Dan Gohman18eafb62017-02-22 01:23:18 +000022WebAssemblyMCAsmInfoELF::~WebAssemblyMCAsmInfoELF() {}
Dan Gohman10e730a2015-06-29 23:51:55 +000023
Dan Gohman18eafb62017-02-22 01:23:18 +000024WebAssemblyMCAsmInfoELF::WebAssemblyMCAsmInfoELF(const Triple &T) {
Benjamin Kramer54c781a2017-04-17 19:08:41 +000025 CodePointerSize = CalleeSaveStackSlotSize = T.isArch64Bit() ? 8 : 4;
Dan Gohman10e730a2015-06-29 23:51:55 +000026
27 // TODO: What should MaxInstLength be?
28
Dan Gohman10e730a2015-06-29 23:51:55 +000029 UseDataRegionDirectives = true;
30
JF Bastienb9ec4c62016-01-07 23:18:29 +000031 // Use .skip instead of .zero because .zero is confusing when used with two
32 // arguments (it doesn't actually zero things out).
33 ZeroDirective = "\t.skip\t";
34
Dan Gohman10e730a2015-06-29 23:51:55 +000035 Data8bitsDirective = "\t.int8\t";
36 Data16bitsDirective = "\t.int16\t";
37 Data32bitsDirective = "\t.int32\t";
38 Data64bitsDirective = "\t.int64\t";
39
40 AlignmentIsInBytes = false;
41 COMMDirectiveAlignmentIsInBytes = false;
42 LCOMMDirectiveAlignmentType = LCOMM::Log2Alignment;
43
Dan Gohman10e730a2015-06-29 23:51:55 +000044 SupportsDebugInformation = true;
45
Dan Gohman10e730a2015-06-29 23:51:55 +000046 // TODO: UseIntegratedAssembler?
Dan Gohman2f301f32016-01-15 23:59:13 +000047
48 // WebAssembly's stack is never executable.
49 UsesNonexecutableStackSection = false;
Dan Gohman10e730a2015-06-29 23:51:55 +000050}
Dan Gohman18eafb62017-02-22 01:23:18 +000051
52WebAssemblyMCAsmInfo::~WebAssemblyMCAsmInfo() {}
53
54WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo(const Triple &T) {
Benjamin Kramer54c781a2017-04-17 19:08:41 +000055 CodePointerSize = CalleeSaveStackSlotSize = T.isArch64Bit() ? 8 : 4;
Dan Gohman18eafb62017-02-22 01:23:18 +000056
57 // TODO: What should MaxInstLength be?
58
59 UseDataRegionDirectives = true;
60
61 // Use .skip instead of .zero because .zero is confusing when used with two
62 // arguments (it doesn't actually zero things out).
63 ZeroDirective = "\t.skip\t";
64
65 Data8bitsDirective = "\t.int8\t";
66 Data16bitsDirective = "\t.int16\t";
67 Data32bitsDirective = "\t.int32\t";
68 Data64bitsDirective = "\t.int64\t";
69
70 AlignmentIsInBytes = false;
71 COMMDirectiveAlignmentIsInBytes = false;
72 LCOMMDirectiveAlignmentType = LCOMM::Log2Alignment;
73
74 SupportsDebugInformation = true;
75
Dan Gohman18eafb62017-02-22 01:23:18 +000076 // TODO: UseIntegratedAssembler?
77}