diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-06-01 20:58:36 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-06-01 20:58:36 +0000 |
commit | f382538d471e38a9b98f016c4caebd24c8d60b62 (patch) | |
tree | d30f3d58b1044b5355d50c17a6a96c6a0b35703a /include/llvm/DebugInfo/CodeView/SymbolDeserializer.h | |
parent | ee2f195dd3e40f49698ca4dc2666ec09c770e80d (diff) |
Notes
Diffstat (limited to 'include/llvm/DebugInfo/CodeView/SymbolDeserializer.h')
-rw-r--r-- | include/llvm/DebugInfo/CodeView/SymbolDeserializer.h | 13 |
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) { |