LLVM  15.0.0git
WebAssemblyMCAsmInfo.cpp
Go to the documentation of this file.
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"
17 #include "llvm/ADT/Triple.h"
18 
19 using namespace llvm;
20 
21 #define DEBUG_TYPE "wasm-mc-asm-info"
22 
23 WebAssemblyMCAsmInfo::~WebAssemblyMCAsmInfo() = default; // anchor.
24 
26  const MCTargetOptions &Options) {
27  CodePointerSize = CalleeSaveStackSlotSize = T.isArch64Bit() ? 8 : 4;
28 
29  // TODO: What should MaxInstLength be?
30 
32 
33  // Use .skip instead of .zero because .zero is confusing when used with two
34  // arguments (it doesn't actually zero things out).
35  ZeroDirective = "\t.skip\t";
36 
37  Data8bitsDirective = "\t.int8\t";
38  Data16bitsDirective = "\t.int16\t";
39  Data32bitsDirective = "\t.int32\t";
40  Data64bitsDirective = "\t.int64\t";
41 
42  AlignmentIsInBytes = false;
45 
47 
48  // When compilation is done on a cpp file by clang, the exception model info
49  // is stored in LangOptions, which is later used to set the info in
50  // TargetOptions and then MCAsmInfo in LLVMTargetMachine::initAsmInfo(). But
51  // this process does not happen when compiling bitcode directly with clang, so
52  // we make sure this info is set correctly.
55 }
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::MCAsmInfo::SupportsDebugInformation
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:449
llvm::MCAsmInfo::AlignmentIsInBytes
bool AlignmentIsInBytes
If this is true (the default) then the asmprinter emits ".align N" directives, where N is the number ...
Definition: MCAsmInfo.h:329
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
llvm::LCOMM::Log2Alignment
@ Log2Alignment
Definition: MCAsmInfo.h:50
llvm::WebAssemblyMCAsmInfo::~WebAssemblyMCAsmInfo
~WebAssemblyMCAsmInfo() override
llvm::MCAsmInfo::Data64bitsDirective
const char * Data64bitsDirective
Definition: MCAsmInfo.h:288
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::MCAsmInfo::UseDataRegionDirectives
bool UseDataRegionDirectives
This is true if data region markers should be printed as ".data_region/.end_data_region" directives.
Definition: MCAsmInfo.h:234
llvm::MCAsmInfo::Data32bitsDirective
const char * Data32bitsDirective
Definition: MCAsmInfo.h:287
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
llvm::ExceptionHandling::Wasm
@ Wasm
WebAssembly Exception Handling.
WebAssemblyUtilities.h
llvm::WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo
WebAssemblyMCAsmInfo(const Triple &T, const MCTargetOptions &Options)
Definition: WebAssemblyMCAsmInfo.cpp:25
llvm::MCAsmInfo::COMMDirectiveAlignmentIsInBytes
bool COMMDirectiveAlignmentIsInBytes
True is .comm's and .lcomms optional alignment is to be specified in bytes instead of log2(n).
Definition: MCAsmInfo.h:365
llvm::MCAsmInfo::CodePointerSize
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:72
llvm::MCAsmInfo::ZeroDirective
const char * ZeroDirective
This should be set to the directive used to get some number of zero (and non-zero if supported by the...
Definition: MCAsmInfo.h:249
llvm::WebAssembly::WasmEnableSjLj
cl::opt< bool > WasmEnableSjLj
llvm::MCAsmInfo::Data16bitsDirective
const char * Data16bitsDirective
Definition: MCAsmInfo.h:286
llvm::MCTargetOptions
Definition: MCTargetOptions.h:36
Triple.h
llvm::MCAsmInfo::Data8bitsDirective
const char * Data8bitsDirective
These directives are used to output some unit of integer data to the current section.
Definition: MCAsmInfo.h:285
llvm::WebAssembly::WasmEnableEH
cl::opt< bool > WasmEnableEH
llvm::MCAsmInfo::CalleeSaveStackSlotSize
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition: MCAsmInfo.h:76
WebAssemblyMCAsmInfo.h
llvm::MCAsmInfo::LCOMMDirectiveAlignmentType
LCOMM::LCOMMType LCOMMDirectiveAlignmentType
Describes if the .lcomm directive for the target supports an alignment argument and how it is interpr...
Definition: MCAsmInfo.h:369
llvm::MCAsmInfo::ExceptionsType
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:452