blob: 8f6531563e1baaa2d2f90c605e7c36b4fc4aef15 [file] [log] [blame]
Dan Gohman10e730a2015-06-29 23:51:55 +00001//===-- WebAssemblyMCAsmInfo.cpp - WebAssembly asm properties -------------===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Dan Gohman10e730a2015-06-29 23:51:55 +00006//
7//===----------------------------------------------------------------------===//
8///
9/// \file
Adrian Prantl5f8f34e42018-05-01 15:54:18 +000010/// This file contains the declarations of the WebAssemblyMCAsmInfo
Dan Gohman10e730a2015-06-29 23:51:55 +000011/// properties.
12///
13//===----------------------------------------------------------------------===//
14
15#include "WebAssemblyMCAsmInfo.h"
16#include "llvm/ADT/Triple.h"
Sam Cleggcf2a9e22018-07-16 23:09:29 +000017
Dan Gohman10e730a2015-06-29 23:51:55 +000018using namespace llvm;
19
20#define DEBUG_TYPE "wasm-mc-asm-info"
21
Heejin Ahn18c56a02019-02-04 19:13:39 +000022WebAssemblyMCAsmInfo::~WebAssemblyMCAsmInfo() = default; // anchor.
Dan Gohman18eafb62017-02-22 01:23:18 +000023
24WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo(const Triple &T) {
Benjamin Kramer54c781a2017-04-17 19:08:41 +000025 CodePointerSize = CalleeSaveStackSlotSize = T.isArch64Bit() ? 8 : 4;
Dan Gohman18eafb62017-02-22 01:23:18 +000026
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
Dan Gohman18eafb62017-02-22 01:23:18 +000046 // TODO: UseIntegratedAssembler?
47}