diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-01-05 05:58:35 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-01-05 05:58:35 +0000 |
commit | a76a7c902ad4daa8b8d20f73ee2ed5e6f3d63d9b (patch) | |
tree | ea431241d7026c779b0241e8ddb25ca0afc6bb36 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | c905b9decd10c0e47282b5b8c012c12968a94015 (diff) | |
download | bcm5719-llvm-a76a7c902ad4daa8b8d20f73ee2ed5e6f3d63d9b.tar.gz bcm5719-llvm-a76a7c902ad4daa8b8d20f73ee2ed5e6f3d63d9b.zip |
Emit debug info for unnamed parameters.
LLVM ignores this data for now - patch for that to follow.
llvm-svn: 171605
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index f14834f03a1..1ec9464e8ad 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -2428,23 +2428,9 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope)); return; } - - // Create the descriptor for the variable. - llvm::DIVariable D = - DBuilder.createLocalVariable(Tag, llvm::DIDescriptor(Scope), - Name, Unit, Line, Ty, - CGM.getLangOpts().Optimize, Flags, 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; - } - - // If VD is an anonymous union then Storage represents value for - // all union fields. - if (const RecordType *RT = dyn_cast<RecordType>(VD->getType())) { + } else if (const RecordType *RT = dyn_cast<RecordType>(VD->getType())) { + // If VD is an anonymous union then Storage represents value for + // all union fields. const RecordDecl *RD = cast<RecordDecl>(RT->getDecl()); if (RD->isUnion()) { for (RecordDecl::field_iterator I = RD->field_begin(), @@ -2471,7 +2457,19 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope)); } } + return; } + + // Create the descriptor for the variable. + llvm::DIVariable D = + DBuilder.createLocalVariable(Tag, llvm::DIDescriptor(Scope), + Name, Unit, Line, Ty, + CGM.getLangOpts().Optimize, Flags, 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)); } void CGDebugInfo::EmitDeclareOfAutoVariable(const VarDecl *VD, |