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 using namespace llvm; 19 20 #define DEBUG_TYPE "wasm-mc-asm-info" 21 22 WebAssemblyMCAsmInfoELF::~WebAssemblyMCAsmInfoELF() {} 23 24 WebAssemblyMCAsmInfoELF::WebAssemblyMCAsmInfoELF(const Triple &T) { 25 CodePointerSize = CalleeSaveStackSlotSize = T.isArch64Bit() ? 8 : 4; 26 27 // TODO: What should MaxInstLength be? 28 29 UseDataRegionDirectives = true; 30 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"; 34 35 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 44 SupportsDebugInformation = true; 45 46 // TODO: UseIntegratedAssembler? 47 48 // WebAssembly's stack is never executable. 49 UsesNonexecutableStackSection = false; 50 } 51 52 WebAssemblyMCAsmInfo::~WebAssemblyMCAsmInfo() {} 53 54 WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo(const Triple &T) { 55 CodePointerSize = CalleeSaveStackSlotSize = T.isArch64Bit() ? 8 : 4; 56 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 76 // TODO: UseIntegratedAssembler? 77 } 78