Debug info: Explicitly set the DIVariable::isIndirect() flag for VLAs.

This allows us to get rid of an ugly hack in the backend.
Paired commit with LLVM.

llvm-svn: 190960
This commit is contained in:
Adrian Prantl 2013-09-18 22:08:57 +00:00
parent 5977d875c1
commit 0315f38a92
2 changed files with 3 additions and 1 deletions

View File

@ -2747,6 +2747,8 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag,
DBuilder.insertDeclare(Storage, D, Builder.GetInsertBlock());
Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope));
return;
} else if (isa<VariableArrayType>(VD->getType())) {
Flags |= llvm::DIDescriptor::FlagIndirectVariable;
}
} else if (const RecordType *RT = dyn_cast<RecordType>(VD->getType())) {
// If VD is an anonymous union then Storage represents value for

View File

@ -2,7 +2,7 @@
void testVLAwithSize(int s)
{
// CHECK: metadata !{i32 {{.*}}, metadata {{.*}}, metadata !"vla", metadata {{.*}}, i32 [[@LINE+1]], metadata {{.*}}, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [vla] [line [[@LINE+1]]]
// CHECK: metadata !{i32 {{.*}}, metadata {{.*}}, metadata !"vla", metadata {{.*}}, i32 [[@LINE+1]], metadata {{.*}}, i32 8192, i32 0} ; [ DW_TAG_auto_variable ] [vla] [line [[@LINE+1]]]
int vla[s];
int i;
for (i = 0; i < s; i++) {