Attach aritifical attribute with implicit parameters.

Radar 8493141.

llvm-svn: 115104
This commit is contained in:
Devang Patel 2010-09-29 23:09:21 +00:00
parent a3dc31d8ee
commit 7c086227e6
2 changed files with 22 additions and 3 deletions

View File

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

View File

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