1 //===-- WebAssemblyMCAsmInfo.cpp - WebAssembly asm properties -------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief This file contains the declarations of the WebAssemblyMCAsmInfo
14 //===----------------------------------------------------------------------===//
16 #include "WebAssemblyMCAsmInfo.h"
17 #include "llvm/ADT/Triple.h"
20 #define DEBUG_TYPE "wasm-mc-asm-info"
22 WebAssemblyMCAsmInfo::~WebAssemblyMCAsmInfo() {}
24 WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo(const Triple &T) {
25 PointerSize = CalleeSaveStackSlotSize = T.isArch64Bit() ? 8 : 4;
27 // TODO: What should MaxInstLength be?
29 UseDataRegionDirectives = true;
31 // 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";
35 Data8bitsDirective = "\t.int8\t";
36 Data16bitsDirective = "\t.int16\t";
37 Data32bitsDirective = "\t.int32\t";
38 Data64bitsDirective = "\t.int64\t";
40 AlignmentIsInBytes = false;
41 COMMDirectiveAlignmentIsInBytes = false;
42 LCOMMDirectiveAlignmentType = LCOMM::Log2Alignment;
44 SupportsDebugInformation = true;
46 // For now, WebAssembly does not support exceptions.
47 ExceptionsType = ExceptionHandling::None;
49 // TODO: UseIntegratedAssembler?
51 // WebAssembly's stack is never executable.
52 UsesNonexecutableStackSection = false;