LLVM: lib/DebugInfo/PDB/PDBSymbolTypeFunctionSig.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

10

18

19#include

20

21using namespace llvm;

23

24namespace {

26public:

27 typedef ConcreteSymbolEnumerator ArgEnumeratorType;

28

29 FunctionArgEnumerator(const IPDBSession &PDBSession,

30 const PDBSymbolTypeFunctionSig &Sig)

31 : Session(PDBSession),

32 Enumerator(Sig.findAllChildren()) {}

33

34 FunctionArgEnumerator(const IPDBSession &PDBSession,

35 std::unique_ptr ArgEnumerator)

36 : Session(PDBSession), Enumerator(std::move(ArgEnumerator)) {}

37

38 uint32_t getChildCount() const override {

40 }

41

42 std::unique_ptr getChildAtIndex(uint32_t Index) const override {

43 auto FunctionArgSymbol = Enumerator->getChildAtIndex(Index);

44 if (!FunctionArgSymbol)

45 return nullptr;

46 return Session.getSymbolById(FunctionArgSymbol->getTypeId());

47 }

48

49 std::unique_ptr getNext() override {

50 auto FunctionArgSymbol = Enumerator->getNext();

51 if (!FunctionArgSymbol)

52 return nullptr;

53 return Session.getSymbolById(FunctionArgSymbol->getTypeId());

54 }

55

56 void reset() override { Enumerator->reset(); }

57

58private:

59 const IPDBSession &Session;

60 std::unique_ptr Enumerator;

61};

62}

63

64std::unique_ptr

66 return std::make_unique(Session, *this);

67}

68

70 Dumper.dump(*this);

71}

72

76

79 if (!SigArguments)

80 return false;

81 uint32_t NumArgs = SigArguments->getChildCount();

82 if (NumArgs == 0)

83 return false;

84 auto Last = SigArguments->getChildAtIndex(NumArgs - 1);

87 return true;

88 }

89

90

91

92 return false;

93}

virtual void dump(const PDBSymbolAnnotation &Symbol)

virtual void dumpRight(const PDBSymbolTypeArray &Symbol)

bool isCVarArgs() const

Definition PDBSymbolTypeFunctionSig.cpp:77

void dump(PDBSymDumper &Dumper) const override

Dumps the contents of a symbol a raw_ostream.

Definition PDBSymbolTypeFunctionSig.cpp:69

std::unique_ptr< IPDBEnumSymbols > getArguments() const

Definition PDBSymbolTypeFunctionSig.cpp:65

void dumpRight(PDBSymDumper &Dumper) const override

For certain PDBSymbolTypes, dumps additional information for the type that normally goes on the right...

Definition PDBSymbolTypeFunctionSig.cpp:73

const IPDBSession & Session

IPDBEnumChildren< PDBSymbol > IPDBEnumSymbols

This is an optimization pass for GlobalISel generic memory operations.

auto dyn_cast_or_null(const Y &Val)

OutputIt move(R &&Range, OutputIt Out)

Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.