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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222217 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Frederic Riss
2014-11-18 02:46:11 +00:00
parent f0e7ccce9e
commit 60a8349a7d
2 changed files with 211 additions and 96 deletions

View File

@@ -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);