diff options
author | Adrian Prantl <aprantl@apple.com> | 2013-04-30 22:17:36 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2013-04-30 22:17:36 +0000 |
commit | 826374a4de73088a8abfaa5f031ba54f1d9fbee0 (patch) | |
tree | 2c39ef63327b1b85d2f1f5c29553879ca8b99faa | |
parent | 1c18759b45140c85e62ac6367fbee51f363e3c81 (diff) |
Do not generate VLAs as complex variables any more, as they are now
correctly represented as breg+0 locations in the backend.
(Paired commit with LLVM: r180815)
rdar://problem/13658587
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180817 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 16 | ||||
-rw-r--r-- | test/CodeGen/debug-info-vla.c | 3 |
2 files changed, 1 insertions, 18 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 6beba66c79..bb2c300ed8 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -2511,22 +2511,6 @@ 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())) { - // These are "complex" variables in that they need an op_deref. - // Create the descriptor for the variable. - llvm::Value *Addr = llvm::ConstantInt::get(CGM.Int64Ty, - llvm::DIBuilder::OpDeref); - llvm::DIVariable D = - DBuilder.createComplexVariable(Tag, - llvm::DIDescriptor(Scope), - Name, Unit, Line, Ty, - Addr, ArgNo); - - // Insert an llvm.dbg.declare into the current block. - llvm::Instruction *Call = - DBuilder.insertDeclare(Storage, D, Builder.GetInsertBlock()); - Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope)); - return; } } else if (const RecordType *RT = dyn_cast<RecordType>(VD->getType())) { // If VD is an anonymous union then Storage represents value for diff --git a/test/CodeGen/debug-info-vla.c b/test/CodeGen/debug-info-vla.c index 20fb6aace4..2e173e4a3f 100644 --- a/test/CodeGen/debug-info-vla.c +++ b/test/CodeGen/debug-info-vla.c @@ -1,9 +1,8 @@ // RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s -// CHECK: metadata !{i32 {{.*}}, metadata {{.*}}, metadata !"vla", metadata {{.*}}, i32 7, metadata {{.*}}, i32 0, i32 0, i64 2} ; [ DW_TAG_auto_variable ] - 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]]] int vla[s]; int i; for (i = 0; i < s; i++) { |