LLVM: lib/MC/MCInst.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

10#include "llvm/Config/llvm-config.h"

20

21using namespace llvm;

22

24 OS << "<MCOperand ";

26 OS << "INVALID";

27 else if (isReg()) {

28 OS << "Reg:";

29 if (Ctx && Ctx->getRegisterInfo())

30 OS << Ctx->getRegisterInfo()->getName(getReg());

31 else

33 } else if (isImm())

34 OS << "Imm:" << getImm();

40 OS << "Expr:";

41 if (Ctx)

42 Ctx->getAsmInfo()->printExpr(OS, *getExpr());

43 else

44 getExpr()->print(OS, nullptr);

45 } else if (isInst()) {

46 OS << "Inst:(";

47 if (const auto *Inst = getInst())

48 Inst->print(OS, Ctx);

49 else

50 OS << "NULL";

51 OS << ")";

52 } else

53 OS << "UNDEFINED";

54 OS << ">";

55}

56

60 return true;

61 }

62 return false;

63}

64

67 "isBareSymbolRef expects only expressions");

72}

73

74#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)

79#endif

80

83 for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {

84 OS << " ";

86 }

87 OS << ">";

88}

89

95

99

100

101 if (!Name.empty())

102 OS << ' ' << Name;

103

104 for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {

105 OS << Separator;

107 }

108 OS << ">";

109}

110

111#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)

116#endif

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

#define LLVM_DUMP_METHOD

Mark debug helper function definitions like dump() that should not be stripped from debug builds.

dxil pretty DXIL Metadata Pretty Printer

Context object for machine code objects.

Base class for the full range of assembler expressions which are needed for parsing.

@ SymbolRef

References to labels and assigned expressions.

This is an instance of a target assembly language printer that converts an MCInst to valid target ass...

LLVM_ABI void print(raw_ostream &OS, const MCContext *Ctx=nullptr) const

Definition MCInst.cpp:81

unsigned getNumOperands() const

unsigned getOpcode() const

LLVM_ABI void dump_pretty(raw_ostream &OS, const MCInstPrinter *Printer=nullptr, StringRef Separator=" ", const MCContext *Ctx=nullptr) const

Dump the MCInst as prettily as possible using the additional MC structures, if given.

Definition MCInst.cpp:90

LLVM_ABI void dump() const

Definition MCInst.cpp:112

const MCOperand & getOperand(unsigned i) const

LLVM_ABI bool isBareSymbolRef() const

Definition MCInst.cpp:65

LLVM_ABI void print(raw_ostream &OS, const MCContext *Ctx=nullptr) const

Definition MCInst.cpp:23

MCRegister getReg() const

Returns the register number.

LLVM_ABI bool evaluateAsConstantImm(int64_t &Imm) const

Definition MCInst.cpp:57

LLVM_ABI void dump() const

Definition MCInst.cpp:75

const MCInst * getInst() const

const MCExpr * getExpr() const

uint32_t getSFPImm() const

uint64_t getDFPImm() const

constexpr unsigned id() const

StringRef - Represent a constant reference to a string, i.e.

This class implements an extremely fast bulk output stream that can only output to a stream.

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI raw_ostream & dbgs()

dbgs() - This returns a reference to a raw_ostream for debugging messages.

To bit_cast(const From &from) noexcept

decltype(auto) cast(const From &Val)

cast - Return the argument parameter cast to the specified type.