Path: blob/main/contrib/llvm-project/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp
35294 views
//===-- WebAssemblyMCAsmInfo.cpp - WebAssembly asm properties -------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7///8/// \file9/// This file contains the declarations of the WebAssemblyMCAsmInfo10/// properties.11///12//===----------------------------------------------------------------------===//1314#include "WebAssemblyMCAsmInfo.h"15#include "WebAssemblyMCTargetDesc.h"16#include "llvm/TargetParser/Triple.h"1718using namespace llvm;1920#define DEBUG_TYPE "wasm-mc-asm-info"2122WebAssemblyMCAsmInfo::~WebAssemblyMCAsmInfo() = default; // anchor.2324WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo(const Triple &T,25const MCTargetOptions &Options) {26CodePointerSize = CalleeSaveStackSlotSize = T.isArch64Bit() ? 8 : 4;2728// TODO: What should MaxInstLength be?2930UseDataRegionDirectives = true;3132// Use .skip instead of .zero because .zero is confusing when used with two33// arguments (it doesn't actually zero things out).34ZeroDirective = "\t.skip\t";3536Data8bitsDirective = "\t.int8\t";37Data16bitsDirective = "\t.int16\t";38Data32bitsDirective = "\t.int32\t";39Data64bitsDirective = "\t.int64\t";4041AlignmentIsInBytes = false;42COMMDirectiveAlignmentIsInBytes = false;43LCOMMDirectiveAlignmentType = LCOMM::Log2Alignment;4445SupportsDebugInformation = true;4647// When compilation is done on a cpp file by clang, the exception model info48// is stored in LangOptions, which is later used to set the info in49// TargetOptions and then MCAsmInfo in LLVMTargetMachine::initAsmInfo(). But50// this process does not happen when compiling bitcode directly with clang, so51// we make sure this info is set correctly.52if (WebAssembly::WasmEnableEH || WebAssembly::WasmEnableSjLj)53ExceptionsType = ExceptionHandling::Wasm;54}555657