diff options
author | Zachary Turner <zturner@google.com> | 2018-09-07 00:12:34 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2018-09-07 00:12:34 +0000 |
commit | 8ab7dd6028ed5084db849206bddc1b50987749d8 (patch) | |
tree | 723034959637514fbd62860d496a44a3d0cc7b8a /llvm/lib/DebugInfo/PDB/Native/NativeEnumSymbol.cpp | |
parent | f0954dd27597d202229a3a9f97a0c36d33c09223 (diff) | |
download | bcm5719-llvm-8ab7dd6028ed5084db849206bddc1b50987749d8.tar.gz bcm5719-llvm-8ab7dd6028ed5084db849206bddc1b50987749d8.zip |
[PDB] Create a SymbolCache class.
Part of the responsibility of the native PDB reader is to cache
symbols the first time they are accessed, so they can then be
looked up by an ID. Furthermore, we need to resolve type indices
to records that we vend to the user, and other things. Previously
this code was all thrown together a bit haphazardly in the native
session class, but it makes sense to collect all of this into a
single class whose sole responsibility is to manage the collection
of known symbols.
llvm-svn: 341608
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/NativeEnumSymbol.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/NativeEnumSymbol.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/NativeEnumSymbol.cpp b/llvm/lib/DebugInfo/PDB/Native/NativeEnumSymbol.cpp index 5dbdff7e746..893afd44d61 100644 --- a/llvm/lib/DebugInfo/PDB/Native/NativeEnumSymbol.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/NativeEnumSymbol.cpp @@ -12,6 +12,7 @@ #include "llvm/DebugInfo/CodeView/CVTypeVisitor.h" #include "llvm/DebugInfo/CodeView/TypeRecord.h" #include "llvm/DebugInfo/PDB/Native/NativeEnumTypes.h" +#include "llvm/DebugInfo/PDB/Native/SymbolCache.h" #include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h" #include <cassert> @@ -78,7 +79,8 @@ bool NativeEnumSymbol::hasCastOperator() const { } uint64_t NativeEnumSymbol::getLength() const { - const auto Id = Session.findSymbolByTypeIndex(Record.getUnderlyingType()); + const auto Id = Session.getSymbolCache().findSymbolByTypeIndex( + Record.getUnderlyingType()); const auto UnderlyingType = Session.getConcreteSymbolById<PDBSymbolTypeBuiltin>(Id); return UnderlyingType ? UnderlyingType->getLength() : 0; @@ -104,5 +106,6 @@ bool NativeEnumSymbol::isScoped() const { } uint32_t NativeEnumSymbol::getTypeId() const { - return Session.findSymbolByTypeIndex(Record.getUnderlyingType()); + return Session.getSymbolCache().findSymbolByTypeIndex( + Record.getUnderlyingType()); } |