1 //===-- WebAssemblyMCAsmInfo.cpp - WebAssembly asm properties -------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// This file contains the declarations of the WebAssemblyMCAsmInfo
11 /// properties.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #include "WebAssemblyMCAsmInfo.h"
16 #include "llvm/ADT/Triple.h"
17 
18 using namespace llvm;
19 
20 #define DEBUG_TYPE "wasm-mc-asm-info"
21 
22 WebAssemblyMCAsmInfo::~WebAssemblyMCAsmInfo() = default; // anchor.
23 
24 WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo(const Triple &T,
25                                            const MCTargetOptions &Options) {
26   CalleeSaveStackSlotSize = T.isArch64Bit() ? 8 : 4;
27   // So far this is used for DWARF DW_AT_low_pc which is always 32-bit in Wasm.
28   CodePointerSize = 4;
29 
30   // TODO: What should MaxInstLength be?
31 
32   UseDataRegionDirectives = true;
33 
34   // Use .skip instead of .zero because .zero is confusing when used with two
35   // arguments (it doesn't actually zero things out).
36   ZeroDirective = "\t.skip\t";
37 
38   Data8bitsDirective = "\t.int8\t";
39   Data16bitsDirective = "\t.int16\t";
40   Data32bitsDirective = "\t.int32\t";
41   Data64bitsDirective = "\t.int64\t";
42 
43   AlignmentIsInBytes = false;
44   COMMDirectiveAlignmentIsInBytes = false;
45   LCOMMDirectiveAlignmentType = LCOMM::Log2Alignment;
46 
47   SupportsDebugInformation = true;
48 
49   // TODO: UseIntegratedAssembler?
50 }
51