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"
18 #include "llvm/Support/CommandLine.h"
21 #define DEBUG_TYPE "wasm-mc-asm-info"
23 WebAssemblyMCAsmInfo::~WebAssemblyMCAsmInfo() {}
25 WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo(const Triple &T) {
26 PointerSize = CalleeSaveStackSlotSize = T.isArch64Bit() ? 8 : 4;
28 // TODO: What should MaxInstLength be?
30 // The s-expression format of WebAssembly uses LISP-style comments.
33 PrivateGlobalPrefix = "";
34 PrivateLabelPrefix = "";
36 UseDataRegionDirectives = true;
38 Data8bitsDirective = "\t.int8\t";
39 Data16bitsDirective = "\t.int16\t";
40 Data32bitsDirective = "\t.int32\t";
41 Data64bitsDirective = "\t.int64\t";
43 AlignmentIsInBytes = false;
44 COMMDirectiveAlignmentIsInBytes = false;
45 LCOMMDirectiveAlignmentType = LCOMM::Log2Alignment;
47 HasDotTypeDotSizeDirective = false;
48 HasSingleParameterDotFile = false;
50 SupportsDebugInformation = true;
52 // For now, WebAssembly does not support exceptions.
53 ExceptionsType = ExceptionHandling::None;
55 WeakDirective = "\t;; .weak\t";
56 GlobalDirective = "\t;; .globl\t";
58 // TODO: UseIntegratedAssembler?