LLVM: lib/DebugInfo/PDB/PDBSymbolData.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
14
15using namespace llvm;
17
19
21 auto Len = RawSymbol->getLength();
22 Len = Len ? Len : 1;
23 if (auto RVA = RawSymbol->getRelativeVirtualAddress())
24 return Session.findLineNumbersByRVA(RVA, Len);
25
26 if (auto Section = RawSymbol->getAddressSection())
27 return Session.findLineNumbersBySectOffset(
28 Section, RawSymbol->getAddressOffset(), Len);
29
30 return nullptr;
31}
32
35 if (auto FirstLine = Lines->getNext())
36 return FirstLine->getCompilandId();
37 }
38
41 if (DataSection == 0) {
42 if (auto RVA = RawSymbol->getRelativeVirtualAddress())
43 Session.addressForRVA(RVA, DataSection, DataOffset);
44 }
45
46 if (DataSection) {
47 if (auto SecContribs = Session.getSectionContribs()) {
48 while (auto Section = SecContribs->getNext()) {
49 if (Section->getAddressSection() == DataSection &&
50 Section->getAddressOffset() <= DataOffset &&
51 (Section->getAddressOffset() + Section->getLength()) > DataOffset)
52 return Section->getCompilandId();
53 }
54 }
55 } else {
56 auto LexParentId = RawSymbol->getLexicalParentId();
57 while (auto LexParent = Session.getSymbolById(LexParentId)) {
59 break;
61 return LexParentId;
62 LexParentId = LexParent->getRawSymbol().getLexicalParentId();
63 }
64 }
65
66 return 0;
67}
virtual void dump(const PDBSymbolAnnotation &Symbol)
std::unique_ptr< IPDBEnumLineNumbers > getLineNumbers() const
Definition PDBSymbolData.cpp:20
void dump(PDBSymDumper &Dumper) const override
Dumps the contents of a symbol a raw_ostream.
Definition PDBSymbolData.cpp:18
uint32_t getCompilandId() const
Definition PDBSymbolData.cpp:33
const IPDBSession & Session
IPDBRawSymbol * RawSymbol
This is an optimization pass for GlobalISel generic memory operations.