summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/PDBSymbolData.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-04-10 06:14:09 +0000
committerZachary Turner <zturner@google.com>2017-04-10 06:14:09 +0000
commit1b1a70f1725804fc1cd9cc490576791e01b01223 (patch)
treeb72cb3cb9d87ff84658ff8c7b4d6561776923ef0 /llvm/lib/DebugInfo/PDB/PDBSymbolData.cpp
parent34888c08bc72813f959ce8f3bee85d313bebcf69 (diff)
downloadbcm5719-llvm-1b1a70f1725804fc1cd9cc490576791e01b01223.tar.gz
bcm5719-llvm-1b1a70f1725804fc1cd9cc490576791e01b01223.zip
General usability improvements to generic PDB library.
1. Added some asserts to make sure concrete symbol types don't get constructed with RawSymbols that have an incompatible SymTag enum value. 2. Added new forwarding macros that auto-define an Id/Sym method pair whenever there is a method that returns a SymIndexId. Previously we would just provide one method that returned only the SymIndexId and it was up to the caller to use the Session object to get a pointer to the symbol. Now we automatically get both the method that returns the Id, as well as a method that returns the pointer directly with just one macro. 3. Added some methods for dumping straight to stdout that can be used from inside the debugger for diagnostics during a debug session. 4. Added a clone() method and a cast<T>() method to PDBSymbol that can shorten some usage patterns. llvm-svn: 299831
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/PDBSymbolData.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/PDBSymbolData.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbolData.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbolData.cpp
index 62bb6f3f41e..60026689c6f 100644
--- a/llvm/lib/DebugInfo/PDB/PDBSymbolData.cpp
+++ b/llvm/lib/DebugInfo/PDB/PDBSymbolData.cpp
@@ -19,10 +19,8 @@ using namespace llvm::pdb;
PDBSymbolData::PDBSymbolData(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> DataSymbol)
- : PDBSymbol(PDBSession, std::move(DataSymbol)) {}
-
-std::unique_ptr<PDBSymbol> PDBSymbolData::getType() const {
- return Session.getSymbolById(getTypeId());
+ : PDBSymbol(PDBSession, std::move(DataSymbol)) {
+ assert(RawSymbol->getSymTag() == PDB_SymType::Data);
}
void PDBSymbolData::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); }
OpenPOWER on IntegriCloud