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/PDBSymbolFuncDebugStart.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp') diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp index 9c653879176..ae23c7619e2 100644 --- a/llvm/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp +++ b/llvm/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp @@ -19,7 +19,9 @@ using namespace llvm::pdb; PDBSymbolFuncDebugStart::PDBSymbolFuncDebugStart( const IPDBSession &PDBSession, std::unique_ptr Symbol) - : PDBSymbol(PDBSession, std::move(Symbol)) {} + : PDBSymbol(PDBSession, std::move(Symbol)) { + assert(RawSymbol->getSymTag() == PDB_SymType::FuncDebugStart); +} void PDBSymbolFuncDebugStart::dump(PDBSymDumper &Dumper) const { Dumper.dump(*this); -- cgit v1.2.3