From fdccfc1e199a2ec27e9bfc5b6839dcc37d33839c Mon Sep 17 00:00:00 2001 From: Frederic Riss Date: Tue, 18 Nov 2014 02:46:11 +0000 Subject: Allow DwarfCompileUnit::constructImportedEntityDIE to instanciate a GlobalVariable DIE. Usually global variables are in a retain list and instanciated before any call to constructImportedEntityDIE is made. This isn't true for forward declarations though. The testcase for this change is generated by a clang patched to emit such forward declarations (patch at http://reviews.llvm.org/D6173 which will land soon). The updated testcase tests more than just global variables, it now tests every type of 'using' clause we support. llvm-svn: 222217 --- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 4dc1224c4a4..2f1b0e5b161 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -646,6 +646,8 @@ DwarfCompileUnit::constructImportedEntityDIE(const DIImportedEntity &Module) { EntityDie = getOrCreateSubprogramDIE(DISubprogram(Entity)); else if (Entity.isType()) EntityDie = getOrCreateTypeDIE(DIType(Entity)); + else if (Entity.isGlobalVariable()) + EntityDie = getOrCreateGlobalVariableDIE(DIGlobalVariable(Entity)); else EntityDie = getDIE(Entity); assert(EntityDie); -- cgit v1.2.3