[cfe-commits] [PATCH] Fix PR14474.

Alexey Samsonov samsonov at google.com
Fri Nov 30 19:00:38 PST 2012


Hi echristo,

Don't emit debug info for interface types in -gline-tables-only mode.

http://llvm-reviews.chandlerc.com/D151

Files:
  lib/CodeGen/CodeGenModule.cpp
  test/CodeGenObjCXX/pr14474-gline-tables-only.mm

Index: lib/CodeGen/CodeGenModule.cpp
===================================================================
--- lib/CodeGen/CodeGenModule.cpp
+++ lib/CodeGen/CodeGenModule.cpp
@@ -2691,9 +2691,9 @@
     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: {
Index: test/CodeGenObjCXX/pr14474-gline-tables-only.mm
===================================================================
--- /dev/null
+++ test/CodeGenObjCXX/pr14474-gline-tables-only.mm
@@ -0,0 +1,26 @@
+// PR 14474
+// RUN: %clang_cc1 -triple i386-apple-macosx10.6.0 -emit-obj \
+// RUN:   -gline-tables-only -x objective-c++ -o /dev/null %s
+
+typedef signed char BOOL;
+ at class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
+ at protocol NSObject - (BOOL)isEqual:(id)object;
+ at end
+ at protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder;
+ at end 
+ at interface NSObject <NSObject> {
+}
+ at end    
+ at interface NSResponder : NSObject <NSCoding> { }
+ at end
+ at protocol NSValidatedUserInterfaceItem - (SEL)action;
+ at end
+ at protocol NSUserInterfaceValidations - (BOOL)validateUserInterfaceItem:(id
+<NSValidatedUserInterfaceItem>)anItem;
+ at end
+ at interface NSRunningApplication : NSObject { }
+ at end
+ at interface NSApplication : NSResponder <NSUserInterfaceValidations> { }
+ at end
+ at implementation MockCrApp + (NSApplication*)sharedApplication { }
+ at end
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151.1.patch
Type: text/x-patch
Size: 1786 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121130/15aa1152/attachment.bin>


More information about the cfe-commits mailing list