From: Alexey Samsonov Date: Mon, 3 Dec 2012 18:28:12 +0000 (+0000) Subject: Fix PR14474: don't emit debug info for interface types in -gline-tables-only mode. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96a66392649f23e19bb9b2d512f2779b9dd420d0;p=clang Fix PR14474: don't emit debug info for interface types in -gline-tables-only mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169138 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 17972e29b6..deeda43adf 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -2691,9 +2691,9 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { ObjCRuntime->GenerateClass(OMD); // Emit global variable debug information. if (CGDebugInfo *DI = getModuleDebugInfo()) - DI->getOrCreateInterfaceType(getContext().getObjCInterfaceType(OMD->getClassInterface()), - OMD->getLocation()); - + if (getCodeGenOpts().getDebugInfo() >= CodeGenOptions::LimitedDebugInfo) + DI->getOrCreateInterfaceType(getContext().getObjCInterfaceType( + OMD->getClassInterface()), OMD->getLocation()); break; } case Decl::ObjCMethod: { diff --git a/test/CodeGenObjCXX/pr14474-gline-tables-only.mm b/test/CodeGenObjCXX/pr14474-gline-tables-only.mm new file mode 100644 index 0000000000..e927ab96f3 --- /dev/null +++ b/test/CodeGenObjCXX/pr14474-gline-tables-only.mm @@ -0,0 +1,25 @@ +// PR 14474 +// RUN: %clang_cc1 -triple i386-apple-macosx10.6.0 -emit-llvm \ +// RUN: -gline-tables-only -x objective-c++ -o /dev/null %s + +typedef signed char BOOL; +@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator; +@protocol NSObject - (BOOL)isEqual:(id)object; +@end +@protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; +@end +@interface NSObject { } +@end +@interface NSResponder : NSObject { } +@end +@protocol NSValidatedUserInterfaceItem - (SEL)action; +@end +@protocol NSUserInterfaceValidations - (BOOL)validateUserInterfaceItem:(id +)anItem; +@end +@interface NSRunningApplication : NSObject { } +@end +@interface NSApplication : NSResponder { } +@end +@implementation MockCrApp + (NSApplication*)sharedApplication { } +@end