diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-06-15 18:00:01 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-06-15 18:00:01 +0000 |
commit | 3128b10cdc5c83e79aad7fa3600445c494170498 (patch) | |
tree | f446ca9d3eb49f8ddefcb3dac5e77b0aafebafa1 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h | |
parent | cc70da39ffec467a1fbc85070eec81ef68bdb303 (diff) | |
download | bcm5719-llvm-3128b10cdc5c83e79aad7fa3600445c494170498.tar.gz bcm5719-llvm-3128b10cdc5c83e79aad7fa3600445c494170498.zip |
[CodeView] Add support for emitting S_UDT for typedefs
Emit a S_UDT record for typedefs. We still need to do something for
class types.
Differential Revision: http://reviews.llvm.org/D21149
llvm-svn: 272813
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h index ea88ff0aee6..4e90c770742 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h @@ -144,6 +144,13 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase { /// always looked up in the normal TypeIndices map. DenseMap<const DICompositeType *, codeview::TypeIndex> CompleteTypeIndices; + const DISubprogram *CurrentSubprogram = nullptr; + + // The UDTs we have seen while processing types; each entry is a pair of type + // index and type name. + std::vector<std::pair<std::string, codeview::TypeIndex>> LocalUDTs, + GlobalUDTs; + typedef std::map<const DIFile *, std::string> FileToFilepathMapTy; FileToFilepathMapTy FileToFilepathMap; StringRef getFullFilepath(const DIFile *S); @@ -157,6 +164,13 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase { FileIdMap.clear(); FnDebugInfo.clear(); FileToFilepathMap.clear(); + LocalUDTs.clear(); + GlobalUDTs.clear(); + } + + void setCurrentSubprogram(const DISubprogram *SP) { + CurrentSubprogram = SP; + LocalUDTs.clear(); } /// Emit the magic version number at the start of a CodeView type or symbol @@ -171,6 +185,9 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase { void emitDebugInfoForGlobals(); + void emitDebugInfoForUDTs( + ArrayRef<std::pair<std::string, codeview::TypeIndex>> UDTs); + void emitDebugInfoForGlobal(const DIGlobalVariable *DIGV, MCSymbol *GVSym); /// Opens a subsection of the given kind in a .debug$S codeview section. |