Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 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) { |
JF Bastien | 1a12bf1 | 2015-07-27 20:46:51 +0000 | [diff] [blame] | 26 | PointerSize = CalleeSaveStackSlotSize = T.isArch64Bit() ? 8 : 4; |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 27 | |
| 28 | // TODO: What should MaxInstLength be? |
| 29 | |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 30 | UseDataRegionDirectives = true; |
| 31 | |
JF Bastien | b9ec4c6 | 2016-01-07 23:18:29 +0000 | [diff] [blame] | 32 | // Use .skip instead of .zero because .zero is confusing when used with two |
| 33 | // arguments (it doesn't actually zero things out). |
| 34 | ZeroDirective = "\t.skip\t"; |
| 35 | |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 36 | Data8bitsDirective = "\t.int8\t"; |
| 37 | Data16bitsDirective = "\t.int16\t"; |
| 38 | Data32bitsDirective = "\t.int32\t"; |
| 39 | Data64bitsDirective = "\t.int64\t"; |
| 40 | |
| 41 | AlignmentIsInBytes = false; |
| 42 | COMMDirectiveAlignmentIsInBytes = false; |
| 43 | LCOMMDirectiveAlignmentType = LCOMM::Log2Alignment; |
| 44 | |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 45 | SupportsDebugInformation = true; |
| 46 | |
| 47 | // For now, WebAssembly does not support exceptions. |
| 48 | ExceptionsType = ExceptionHandling::None; |
| 49 | |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 50 | // TODO: UseIntegratedAssembler? |
Dan Gohman | 2f301f3 | 2016-01-15 23:59:13 +0000 | [diff] [blame^] | 51 | |
| 52 | // WebAssembly's stack is never executable. |
| 53 | UsesNonexecutableStackSection = false; |
Dan Gohman | 10e730a | 2015-06-29 23:51:55 +0000 | [diff] [blame] | 54 | } |