Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.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
23 const MCTargetOptions &Options) {
24 IsLittleEndian = false;
26 WeakRefDirective = "\t.weak\t";
28
29 // Lanai assembly requires ".section" before ".bss"
31
32 // Use '!' as comment string to correspond with old toolchain.
33 CommentString = "!";
34
35 // Target supports emission of debugging information.
37
38 // Set the instruction alignment. Currently used only for address adjustment
39 // in dwarf generation.
41}
42
44 const MCSpecifierExpr &Expr) const {
45 if (Expr.getSpecifier() == 0) {
46 printExpr(OS, *Expr.getSubExpr());
47 return;
48 }
49
50 switch (Expr.getSpecifier()) {
51 default:
52 llvm_unreachable("Invalid kind!");
53 case Lanai::S_ABS_HI:
54 OS << "hi";
55 break;
56 case Lanai::S_ABS_LO:
57 OS << "lo";
58 break;
59 }
60
61 OS << '(';
62 printExpr(OS, *Expr.getSubExpr());
63 OS << ')';
64}
static LVOptions Options
Definition LVOptions.cpp:25
LanaiMCAsmInfo(const Triple &TheTriple, const MCTargetOptions &Options)
void printSpecifierExpr(raw_ostream &OS, const MCSpecifierExpr &Expr) const override
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:359
StringRef PrivateGlobalPrefix
This prefix is used for globals like constant pool entries that are completely private to the ....
Definition MCAsmInfo.h:160
const char * WeakRefDirective
This directive, if non-null, is used to declare a global as being a weak undefined symbol.
Definition MCAsmInfo.h:325
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:263
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition MCAsmInfo.h:356
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