From 3128b10cdc5c83e79aad7fa3600445c494170498 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Wed, 15 Jun 2016 18:00:01 +0000 Subject: [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 --- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h') 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 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> LocalUDTs, + GlobalUDTs; + typedef std::map 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> UDTs); + void emitDebugInfoForGlobal(const DIGlobalVariable *DIGV, MCSymbol *GVSym); /// Opens a subsection of the given kind in a .debug$S codeview section. -- cgit v1.2.3