[llvm-branch-commits] [llvm-gcc-branch] r70802 - /llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp

Bill Wendling isanbard at gmail.com
Sun May 3 14:39:30 PDT 2009


Author: void
Date: Sun May  3 16:39:30 2009
New Revision: 70802

URL: http://llvm.org/viewvc/llvm-project?rev=70802&view=rev
Log:
--- Merging r70801 into '.':
U    gcc/llvm-backend.cpp

Don't create debug info for ObjC metadata.

Modified:
    llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp

Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp?rev=70802&r1=70801&r2=70802&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp Sun May  3 16:39:30 2009
@@ -1389,8 +1389,15 @@
   // No debug info for globals when optimization is on.  While this is
   // something that would be accurate and useful to a user, it currently
   // affects some optimizations that, e.g., count uses.
-  if (TheDebugInfo && !optimize)
-    TheDebugInfo->EmitGlobalVariable(GV, decl);
+  if (TheDebugInfo && !optimize) {
+    const char *Name = GV->getName().c_str();
+    const char LPrefix[] = "\01L_OBJC_";
+    const char lPrefix[] = "\01l_OBJC_";
+
+    if (strncmp(Name, LPrefix, sizeof(LPrefix) - 1) != 0 &&
+        strncmp(Name, lPrefix, sizeof(lPrefix) - 1) != 0)
+      TheDebugInfo->EmitGlobalVariable(GV, decl);
+  }
 
   TREE_ASM_WRITTEN(decl) = 1;
   timevar_pop(TV_LLVM_GLOBALS);





More information about the llvm-branch-commits mailing list