LLVM 23.0.0git
LanaiMCAsmInfo.cpp
Go to the documentation of this file.
1//===-- LanaiMCAsmInfo.cpp - Lanai 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// This file contains the declarations of the LanaiMCAsmInfo properties.
10//
11//===----------------------------------------------------------------------===//
12
13#include "LanaiMCAsmInfo.h"
14#include "llvm/MC/MCExpr.h"
17
18using namespace llvm;
19
20void LanaiMCAsmInfo::anchor() {}
21
25 IsLittleEndian = false;
27 WeakRefDirective = "\t.weak\t";
29
30 // Lanai assembly requires ".section" before ".bss"
32
33 // Use '!' as comment string to correspond with old toolchain.
34 CommentString = "!";
35
36 // Target supports emission of debugging information.
38
39 // Set the instruction alignment. Currently used only for address adjustment
40 // in dwarf generation.
42}
43
45 const MCSpecifierExpr &Expr) const {
46 if (Expr.getSpecifier() == 0) {
47 printExpr(OS, *Expr.getSubExpr());
48 return;
49 }
50
51 switch (Expr.getSpecifier()) {
52 default:
53 llvm_unreachable("Invalid kind!");
54 case Lanai::S_ABS_HI:
55 OS << "hi";
56 break;
57 case Lanai::S_ABS_LO:
58 OS << "lo";
59 break;
60 }
61
62 OS << '(';
63 printExpr(OS, *Expr.getSubExpr());
64 OS << ')';
65}
static LVOptions Options
Definition LVOptions.cpp:25
LanaiMCAsmInfo(const Triple &TheTriple, const MCTargetOptions &Options)
void printSpecifierExpr(raw_ostream &OS, const MCSpecifierExpr &Expr) const override
MCAsmInfoELF(const MCTargetOptions &Options)
StringRef InternalSymbolPrefix
For internal use by compiler and assembler, not meant to be visible externally.
Definition MCAsmInfo.h:160
unsigned MinInstAlignment
Every possible instruction length is a multiple of this value.
Definition MCAsmInfo.h:123
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition MCAsmInfo.h:361
const char * WeakRefDirective
This directive, if non-null, is used to declare a global as being a weak undefined symbol.
Definition MCAsmInfo.h:327
void printExpr(raw_ostream &, const MCExpr &) const
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
Definition MCAsmInfo.h:262
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition MCAsmInfo.h:358
bool IsLittleEndian
True if target is little endian. Default is true.
Definition MCAsmInfo.h:94
StringRef CommentString
This indicates the comment string used by the assembler.
Definition MCAsmInfo.h:135
Extension point for target-specific MCExpr subclasses with a relocation specifier,...
Definition MCExpr.h:495
const MCExpr * getSubExpr() const
Definition MCExpr.h:509
Spec getSpecifier() const
Definition MCExpr.h:508
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:47
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
@ DwarfCFI
DWARF-like instruction based exceptions.
Definition CodeGen.h:55