[llvm-commits] [llvm-gcc-4.2] r70801 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Duncan Sands
baldrick at free.fr
Mon May 4 00:05:18 PDT 2009
Hi Bill,
> Don'e create debug info for ObjC metadata.
how about setting DECL_ARTIFICIAL for such globals, and then teach
the backend not to output debug info for globals with DECL_ARTIFICIAL
set?
/* Used to indicate that this DECL represents a compiler-generated entity. */
#define DECL_ARTIFICIAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.artificial_flag)
Ciao,
Duncan.
>
> Modified:
> llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
>
> Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=70801&r1=70800&r2=70801&view=diff
>
> ==============================================================================
> --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
> +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Sun May 3 16:36:23 2009
> @@ -1390,8 +1390,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);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list