From 1b1a70f1725804fc1cd9cc490576791e01b01223 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Mon, 10 Apr 2017 06:14:09 +0000 Subject: 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() method to PDBSymbol that can shorten some usage patterns. llvm-svn: 299831 --- llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp') diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp index 35251c0cc1c..3c0bd25ed09 100644 --- a/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp +++ b/llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp @@ -85,10 +85,8 @@ private: PDBSymbolFunc::PDBSymbolFunc(const IPDBSession &PDBSession, std::unique_ptr Symbol) - : PDBSymbol(PDBSession, std::move(Symbol)) {} - -std::unique_ptr PDBSymbolFunc::getSignature() const { - return Session.getConcreteSymbolById(getTypeId()); + : PDBSymbol(PDBSession, std::move(Symbol)) { + assert(RawSymbol->getSymTag() == PDB_SymType::Function); } std::unique_ptr> @@ -96,8 +94,4 @@ PDBSymbolFunc::getArguments() const { return llvm::make_unique(Session, *this); } -std::unique_ptr PDBSymbolFunc::getClassParent() const { - return Session.getConcreteSymbolById(getClassParentId()); -} - void PDBSymbolFunc::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); } -- cgit v1.2.3