LLVM: lib/CodeGen/AsmPrinter/AddressPool.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

15

16using namespace llvm;

17

20 auto IterBool = Pool.try_emplace(Sym, Pool.size(), TLS);

21 return IterBool.first->second.Number;

22}

23

25 static const uint8_t AddrSize = Asm.MAI->getCodePointerSize();

26

28 Asm.emitDwarfUnitLength("debug_addr", "Length of contribution");

29 Asm.OutStreamer->AddComment("DWARF version number");

30 Asm.emitInt16(Asm.getDwarfVersion());

31 Asm.OutStreamer->AddComment("Address size");

32 Asm.emitInt8(AddrSize);

33 Asm.OutStreamer->AddComment("Segment selector size");

34 Asm.emitInt8(0);

35

36 return EndLabel;

37}

38

39

42 return;

43

44

45 Asm.OutStreamer->switchSection(AddrSection);

46

48

49 if (Asm.getDwarfVersion() >= 5)

50 EndLabel = emitHeader(Asm, AddrSection);

51

52

53

54 Asm.OutStreamer->emitLabel(AddressTableBaseSym);

55

56

58

59 for (const auto &I : Pool)

60 Entries[I.second.Number] =

61 I.second.TLS

62 ? Asm.getObjFileLowering().getDebugThreadLocalSymbol(I.first)

64

65 for (const MCExpr *Entry : Entries)

66 Asm.OutStreamer->emitValue(Entry, Asm.MAI->getCodePointerSize());

67

68 if (EndLabel)

69 Asm.OutStreamer->emitLabel(EndLabel);

70}

This file defines the SmallVector class.

unsigned getIndex(const MCSymbol *Sym, bool TLS=false)

Returns the index into the address pool with the given label/symbol.

Definition AddressPool.cpp:18

void emit(AsmPrinter &Asm, MCSection *AddrSection)

Definition AddressPool.cpp:40

void resetUsedFlag(bool HasBeenUsed=false)

This class is intended to be used as a driving class for all asm writers.

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

Instances of this class represent a uniqued identifier for a section in the current translation unit.

static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())

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

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

This is an optimization pass for GlobalISel generic memory operations.