diff options
| author | Zachary Turner <zturner@google.com> | 2018-09-17 21:08:11 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2018-09-17 21:08:11 +0000 |
| commit | bdf0381e216e2aaa1aa736fd288d94786e4447e0 (patch) | |
| tree | c3aa3cf7b6a308538953cf7a6623ca21c7b4d146 /llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp | |
| parent | 4727ac23947013a1f1cdd1f8ced7002f3bc06c72 (diff) | |
| download | bcm5719-llvm-bdf0381e216e2aaa1aa736fd288d94786e4447e0.tar.gz bcm5719-llvm-bdf0381e216e2aaa1aa736fd288d94786e4447e0.zip | |
[PDB] Make the native reader support enumerators.
Previously we would dump the names of enum types, but not their
enumerator values. This adds support for enumerator values. In
doing so, we have to introduce a general purpose mechanism for
caching symbol indices of field list members. Unlike global
types, FieldList members do not have a TypeIndex. So instead,
we identify them by the pair {TypeIndexOfFieldList, IndexInFieldList}.
llvm-svn: 342415
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp')
| -rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp b/llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp index d8b4d591a97..a4b1ecfb770 100644 --- a/llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp @@ -26,14 +26,17 @@ static const struct BuiltinTypeEntry { PDB_BuiltinType Type; uint32_t Size; } BuiltinTypes[] = { + {codeview::SimpleTypeKind::Int16Short, PDB_BuiltinType::Int, 2}, + {codeview::SimpleTypeKind::UInt16Short, PDB_BuiltinType::UInt, 2}, {codeview::SimpleTypeKind::Int32, PDB_BuiltinType::Int, 4}, {codeview::SimpleTypeKind::UInt32, PDB_BuiltinType::UInt, 4}, + {codeview::SimpleTypeKind::Int32Long, PDB_BuiltinType::Int, 4}, {codeview::SimpleTypeKind::UInt32Long, PDB_BuiltinType::UInt, 4}, + {codeview::SimpleTypeKind::Int64Quad, PDB_BuiltinType::Int, 8}, {codeview::SimpleTypeKind::UInt64Quad, PDB_BuiltinType::UInt, 8}, {codeview::SimpleTypeKind::NarrowCharacter, PDB_BuiltinType::Char, 1}, {codeview::SimpleTypeKind::SignedCharacter, PDB_BuiltinType::Char, 1}, {codeview::SimpleTypeKind::UnsignedCharacter, PDB_BuiltinType::UInt, 1}, - {codeview::SimpleTypeKind::UInt16Short, PDB_BuiltinType::UInt, 2}, {codeview::SimpleTypeKind::Boolean8, PDB_BuiltinType::Bool, 1} // This table can be grown as necessary, but these are the only types we've // needed so far. @@ -169,6 +172,8 @@ SymIndexId SymbolCache::findSymbolByTypeIndex(codeview::TypeIndex Index) { std::unique_ptr<PDBSymbol> SymbolCache::getSymbolById(SymIndexId SymbolId) const { + assert(SymbolId < Cache.size()); + // Id 0 is reserved. if (SymbolId == 0) return nullptr; |

