LLVM 24.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
22 IsLittleEndian = false;
24 WeakRefDirective = "\t.weak\t";
25
26 // Use '!' as comment string to correspond with old toolchain.
27 CommentString = "!";
28
29 // Target supports emission of debugging information.
31
32 // Set the instruction alignment. Currently used only for address adjustment
33 // in dwarf generation.
35
36 SpecifierExprPrintFn = [](const MCAsmInfo &MAI, raw_ostream &OS,
37 const MCSpecifierExpr &Expr) {
38 if (Expr.getSpecifier() == 0) {
39 MAI.printExpr(OS, *Expr.getSubExpr());
40 return;
41 }
42
43 switch (Expr.getSpecifier()) {
44 default:
45 llvm_unreachable("Invalid kind!");
46 case Lanai::S_ABS_HI:
47 OS << "hi";
48 break;
49 case Lanai::S_ABS_LO:
50 OS << "lo";
51 break;
52 }
53
54 OS << '(';
55 MAI.printExpr(OS, *Expr.getSubExpr());
56 OS << ')';
57 };
58}
static LVOptions Options
Definition LVOptions.cpp:25
#define T
LanaiMCAsmInfo(const Triple &TheTriple, const MCTargetOptions &Options)
MCAsmInfoELF(const Triple &TT, const MCTargetOptions &Options)
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition MCAsmInfo.h:69
StringRef InternalSymbolPrefix
For internal use by compiler and assembler, not meant to be visible externally.
Definition MCAsmInfo.h:169
unsigned MinInstAlignment
Every possible instruction length is a multiple of this value.
Definition MCAsmInfo.h:132
const char * WeakRefDirective
This directive, if non-null, is used to declare a global as being a weak undefined symbol.
Definition MCAsmInfo.h:341
void printExpr(raw_ostream &, const MCExpr &) const
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition MCAsmInfo.h:372
void(* SpecifierExprPrintFn)(const MCAsmInfo &, raw_ostream &, const MCSpecifierExpr &)
Definition MCAsmInfo.h:228
bool IsLittleEndian
True if target is little endian. Default is true.
Definition MCAsmInfo.h:95
StringRef CommentString
This indicates the comment string used by the assembler.
Definition MCAsmInfo.h:144
Extension point for target-specific MCExpr subclasses with a relocation specifier,...
Definition MCExpr.h:491
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
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.