blob: c3d259e6ff20550e560326bbad1969ddf2b4c3e0 [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
Mirko Brkusanin4b63ca12019-10-23 12:24:35 +020024WebAssemblyMCAsmInfo::WebAssemblyMCAsmInfo(const Triple &T,
25 const MCTargetOptions &Options) {
Benjamin Kramer54c781a2017-04-17 19:08:41 +000026 CodePointerSize = CalleeSaveStackSlotSize = T.isArch64Bit() ? 8 : 4;
Dan Gohman18eafb62017-02-22 01:23:18 +000027
28 // TODO: What should MaxInstLength be?
29
30 UseDataRegionDirectives = true;
31
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
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
45 SupportsDebugInformation = true;
46
Dan Gohman18eafb62017-02-22 01:23:18 +000047 // TODO: UseIntegratedAssembler?
48}