diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-12-03 18:28:12 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-12-03 18:28:12 +0000 |
commit | 96a66392649f23e19bb9b2d512f2779b9dd420d0 (patch) | |
tree | bfb3672ed9af70eb824eb2395f9c58c6d61e36e0 | |
parent | bac016bd3f67ca2f4db1ddc619e611759352b84d (diff) |
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
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 6 | ||||
-rw-r--r-- | test/CodeGenObjCXX/pr14474-gline-tables-only.mm | 25 |
2 files changed, 28 insertions, 3 deletions
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 <NSObject> { } +@end +@interface NSResponder : NSObject <NSCoding> { } +@end +@protocol NSValidatedUserInterfaceItem - (SEL)action; +@end +@protocol NSUserInterfaceValidations - (BOOL)validateUserInterfaceItem:(id +<NSValidatedUserInterfaceItem>)anItem; +@end +@interface NSRunningApplication : NSObject { } +@end +@interface NSApplication : NSResponder <NSUserInterfaceValidations> { } +@end +@implementation MockCrApp + (NSApplication*)sharedApplication { } +@end |