diff options
author | Devang Patel <dpatel@apple.com> | 2010-09-29 23:09:21 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-09-29 23:09:21 +0000 |
commit | aca745b8b2eb58dc149ea7e65dfe133df2b0ab93 (patch) | |
tree | ceb36a5ddec75b5aab8d0a23c8c16a33bf172ded | |
parent | 638bb114199590534d684585155807f0a4cfcd3d (diff) |
Attach aritifical attribute with implicit parameters.
Radar 8493141.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115104 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 9 | ||||
-rw-r--r-- | test/CodeGenObjC/debug-info-self.m | 16 |
2 files changed, 22 insertions, 3 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index e2ad3e1b56..45a887b1bb 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1729,12 +1729,15 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, // Get location information. unsigned Line = getLineNumber(VD->getLocation()); unsigned Column = getColumnNumber(VD->getLocation()); - + unsigned Flags = 0; + if (VD->isImplicit()) + Flags |= llvm::DIDescriptor::FlagArtificial; // Create the descriptor for the variable. llvm::DIVariable D = DebugFactory.CreateVariable(Tag, llvm::DIDescriptor(RegionStack.back()), - VD->getName(), - Unit, Line, Ty, CGM.getLangOptions().Optimize); + VD->getName(), Unit, Line, Ty, + CGM.getLangOptions().Optimize, Flags); + // Insert an llvm.dbg.declare into the current block. llvm::Instruction *Call = DebugFactory.InsertDeclare(Storage, D, Builder.GetInsertBlock()); diff --git a/test/CodeGenObjC/debug-info-self.m b/test/CodeGenObjC/debug-info-self.m new file mode 100644 index 0000000000..9146ab3973 --- /dev/null +++ b/test/CodeGenObjC/debug-info-self.m @@ -0,0 +1,16 @@ +// RUN: %clang -fverbose-asm -g -S %s -o - | grep DW_AT_artificial | count 3 +// self and _cmd are marked as DW_AT_artificial. +// abbrev code emits another DT_artificial comment. +// myarg is not marked as DW_AT_artificial. + +@interface MyClass { +} +- (id)init:(int) myarg; +@end + +@implementation MyClass +- (id) init:(int) myarg +{ + return self; +} +@end |