[llvm-commits] [llvm-gcc-4.2] r62890 - in /llvm-gcc-4.2/branches/Apple/Dib/gcc: llvm-backend.cpp llvm-debug.cpp
Bill Wendling
isanbard at gmail.com
Fri Jan 23 14:46:36 PST 2009
Author: void
Date: Fri Jan 23 16:46:36 2009
New Revision: 62890
URL: http://llvm.org/viewvc/llvm-project?rev=62890&view=rev
Log:
Pull r62889 into Dib:
Set DW_AT_APPLE_optimized and DW_AT_APPLE_flags attribute while building
DICompileUnit.
Right now, llvm-gcc does not emit debug info when optimization is ON. However,
emit llvm.dbg.compile_unit and preserve it even when optimization is ON. This
allows DW_AT_APPLE_flags to find its way in final binary.
Modified:
llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp
llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.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=62890&r1=62889&r2=62890&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 Fri Jan 23 16:46:36 2009
@@ -592,6 +592,13 @@
writeLLVMValues();
}
+ if (!flag_pch_file
+ && optimize && debug_info_level > DINFO_LEVEL_NONE && !TheDebugInfo) {
+ DebugInfo DI(TheModule);
+ DICompileUnit CU = DI.createCompileUnit(main_input_filename);
+ AttributeUsedGlobals.insert(CU.getGV());
+ }
+
// Add an llvm.global_ctors global if needed.
if (!StaticCtors.empty())
CreateStructorsList(StaticCtors, "llvm.global_ctors");
Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp?rev=62890&r1=62889&r2=62890&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp Fri Jan 23 16:46:36 2009
@@ -813,8 +813,15 @@
else
LangTag = DW_LANG_C89;
+ const char *Flags = "";
+ // Do this only when RC_DEBUG_OPTIONS environment variable is set to
+ // a nonempty string. This is intended only for internal Apple use.
+ char * debugopt = getenv("RC_DEBUG_OPTIONS");
+ if (debugopt && debugopt[0])
+ Flags = get_arguments();
+
return DebugFactory.CreateCompileUnit(LangTag, FileName, Directory,
- version_string);
+ version_string, optimize, Flags);
}
/* LLVM LOCAL end (ENTIRE FILE!) */
More information about the llvm-commits
mailing list