summaryrefslogtreecommitdiff
path: root/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/DebugInfo/CodeView/SymbolDeserializer.h')
-rw-r--r--include/llvm/DebugInfo/CodeView/SymbolDeserializer.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h b/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
index c1a5152930fff..428ff153d5d1c 100644
--- a/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
+++ b/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
@@ -34,6 +34,17 @@ class SymbolDeserializer : public SymbolVisitorCallbacks {
};
public:
+ template <typename T> static Error deserializeAs(CVSymbol Symbol, T &Record) {
+ SymbolDeserializer S(nullptr);
+ if (auto EC = S.visitSymbolBegin(Symbol))
+ return EC;
+ if (auto EC = S.visitKnownRecord(Symbol, Record))
+ return EC;
+ if (auto EC = S.visitSymbolEnd(Symbol))
+ return EC;
+ return Error::success();
+ }
+
explicit SymbolDeserializer(SymbolVisitorDelegate *Delegate)
: Delegate(Delegate) {}
@@ -54,7 +65,7 @@ public:
return visitKnownRecordImpl(CVR, Record); \
}
#define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
-#include "CVSymbolTypes.def"
+#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
private:
template <typename T> Error visitKnownRecordImpl(CVSymbol &CVR, T &Record) {