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

1

2

3

4

5

6

7

8

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

18#include

19#include

20

21using namespace llvm;

22

23

24

25static_assert(sizeof(MCSymbol) <= 24, "Keep the base symbol small");

26

27

29

30

32

35

36

38

39

40

41

43 "Bad alignment of MCSymbol");

47 return End;

48}

49

51 assert(Value && "Invalid equated expression");

53 "Cannot equate a common symbol");

54 this->Value = Value;

57}

58

60

61

62

65 OS << Name;

66 return;

67 }

68

71

72 OS << '"';

73 for (char C : Name) {

74 if (C == '\n')

75 OS << "\\n";

76 else if (C == '"')

77 OS << "\\\"";

78 else if (C == '\\')

79 OS << "\\\\";

80 else

81 OS << C;

82 }

83 OS << '"';

84}

85

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

88#endif

89

90

91

92

93

95 assert(Begin && "Range without a begin symbol?");

96 assert(End && "Range without an end symbol?");

97 for (const auto *Fragment = Begin->getFragment();

100 if (Fragment->isLinkerRelaxable())

101 return true;

102 }

103 return false;

104}

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.

static MCFragment SentinelFragment

Definition MCSymbol.cpp:28

This class is intended to be used as a base class for asm properties and features specific to the tar...

bool supportsNameQuoting() const

virtual bool isValidUnquotedName(StringRef Name) const

Return true if the identifier Name does not need quotes to be syntactically correct.

MCFragment * getNext() const

MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...

MCSymbol(const MCSymbolTableEntry *Name, bool isTemporary)

LLVM_ABI void print(raw_ostream &OS, const MCAsmInfo *MAI) const

print - Print the value to the stream OS.

Definition MCSymbol.cpp:59

StringRef getName() const

getName - Get the symbol name.

LLVM_ABI void setVariableValue(const MCExpr *Value)

Definition MCSymbol.cpp:50

MCFragment * Fragment

If a symbol has a Fragment, the section is implied, so we only need one pointer.

unsigned kind

The symbol kind.

static LLVM_ABI MCFragment * AbsolutePseudoFragment

LLVM_ABI void dump() const

dump - Print the value to stderr.

Definition MCSymbol.cpp:87

union { const MCSymbolTableEntry *NameEntry; uint64_t AlignmentPadding; } NameEntryStorageTy

The name for a symbol.

const MCExpr * Value

If non-null, the value for a variable symbol.

MCFragment * getFragment() 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.

@ C

The default llvm calling convention, compatible with C.

This is an optimization pass for GlobalISel generic memory operations.

bool isRangeRelaxable(const MCSymbol *Begin, const MCSymbol *End)

Definition MCSymbol.cpp:94

LLVM_ABI raw_ostream & dbgs()

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

LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)

StringMapEntry< MCSymbolTableValue > MCSymbolTableEntry

MCContext stores MCSymbolTableValue in a string map (see MCSymbol::operator new).