Undo following patch for now.
----
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.
----
llvm-svn: 63216
diff --git a/llvm-gcc-4.2/gcc/llvm-backend.cpp b/llvm-gcc-4.2/gcc/llvm-backend.cpp
index f920d6e..a2ead60 100644
--- a/llvm-gcc-4.2/gcc/llvm-backend.cpp
+++ b/llvm-gcc-4.2/gcc/llvm-backend.cpp
@@ -592,13 +592,6 @@
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");
diff --git a/llvm-gcc-4.2/gcc/llvm-debug.cpp b/llvm-gcc-4.2/gcc/llvm-debug.cpp
index 81457f8..28f4f10 100644
--- a/llvm-gcc-4.2/gcc/llvm-debug.cpp
+++ b/llvm-gcc-4.2/gcc/llvm-debug.cpp
@@ -828,15 +828,8 @@
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, optimize, Flags);
+ version_string);
}
/* LLVM LOCAL end (ENTIRE FILE!) */