WebAssembly: minor MCAsmInfo fixes
[oota-llvm.git] / lib / Target / WebAssembly / MCTargetDesc / WebAssemblyMCAsmInfo.cpp
1 //===-- 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
11 /// \brief This file contains the declarations of the WebAssemblyMCAsmInfo
12 /// properties.
13 ///
14 //===----------------------------------------------------------------------===//
15
16 #include "WebAssemblyMCAsmInfo.h"
17 #include "llvm/ADT/Triple.h"
18 #include "llvm/Support/CommandLine.h"
19 using namespace llvm;
20
21 #define DEBUG_TYPE "wasm-mc-asm-info"
22
23 WebAssemblyMCAsmInfo::~WebAssemblyMCAsmInfo() {}
24
25 WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo(const Triple &T) {
26   PointerSize = CalleeSaveStackSlotSize = T.isArch64Bit() ? 8 : 4;
27
28   // TODO: What should MaxInstLength be?
29
30   // WebAssembly's text format uses s-expressions to represent its AST,
31   // LISP-style comments are therefore suitable.
32   CommentString = ";";
33
34   PrivateGlobalPrefix = "";
35   PrivateLabelPrefix = "";
36
37   InlineAsmStart = ";APP\n";
38   InlineAsmEnd = ";NO_APP\n";
39
40   UseDataRegionDirectives = true;
41
42   Data8bitsDirective = "\t.int8\t";
43   Data16bitsDirective = "\t.int16\t";
44   Data32bitsDirective = "\t.int32\t";
45   Data64bitsDirective = "\t.int64\t";
46
47   AlignmentIsInBytes = false;
48   COMMDirectiveAlignmentIsInBytes = false;
49   LCOMMDirectiveAlignmentType = LCOMM::Log2Alignment;
50
51   HasDotTypeDotSizeDirective = false;
52   HasSingleParameterDotFile = false;
53
54   SupportsDebugInformation = true;
55
56   // For now, WebAssembly does not support exceptions.
57   ExceptionsType = ExceptionHandling::None;
58
59   // TODO: UseIntegratedAssembler?
60 }