Emit debug info for objc getters and setters.

llvm-svn: 100462
This commit is contained in:
Devang Patel 2010-04-05 21:09:15 +00:00
parent 7dd816097a
commit a2c048eaf8
3 changed files with 24 additions and 4 deletions

View File

@ -1380,7 +1380,9 @@ void CGDebugInfo::EmitStopPoint(llvm::Function *Fn, CGBuilderTy &Builder) {
|| (SM.getInstantiationLineNumber(CurLoc) ==
SM.getInstantiationLineNumber(PrevLoc)
&& SM.isFromSameFile(CurLoc, PrevLoc)))
return;
// New Builder may not be in sync with CGDebugInfo.
if (!Builder.getCurrentDebugLocation().isUnknown())
return;
// Update last state.
PrevLoc = CurLoc;

View File

@ -108,6 +108,10 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E) {
void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD,
const ObjCContainerDecl *CD) {
FunctionArgList Args;
// Check if we should generate debug info for this method.
if (CGM.getDebugInfo() && !OMD->hasAttr<NoDebugAttr>())
DebugInfo = CGM.getDebugInfo();
llvm::Function *Fn = CGM.getObjCRuntime().GenerateMethod(OMD, CD);
const CGFunctionInfo &FI = CGM.getTypes().getFunctionInfo(OMD);
@ -128,9 +132,6 @@ void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD,
/// Generate an Objective-C method. An Objective-C method is a C function with
/// its pointer, name, and types registered in the class struture.
void CodeGenFunction::GenerateObjCMethod(const ObjCMethodDecl *OMD) {
// Check if we should generate debug info for this method.
if (CGM.getDebugInfo() && !OMD->hasAttr<NoDebugAttr>())
DebugInfo = CGM.getDebugInfo();
StartObjCMethod(OMD, OMD->getClassInterface());
EmitStmt(OMD->getBody());
FinishFunction(OMD->getBodyRBrace());

View File

@ -0,0 +1,17 @@
// RUN: %clang_cc1 -S -g -masm-verbose -x objective-c < %s | grep setI | grep DW_AT_name
@interface Foo {
int i;
}
@property int i;
@end
@implementation Foo
@synthesize i;
@end
int bar(Foo *f) {
int i = 1;
f.i = 2;
i = f.i;
return i;
}