[llvm-commits] [llvm-gcc-4.2] r66666 - in /llvm-gcc-4.2/branches/Apple/Dib/gcc: llvm-backend.cpp llvm-debug.cpp llvm-debug.h
Bill Wendling
isanbard at gmail.com
Wed Mar 11 10:48:57 PDT 2009
Author: void
Date: Wed Mar 11 12:48:57 2009
New Revision: 66666
URL: http://llvm.org/viewvc/llvm-project?rev=66666&view=rev
Log:
--- Merging (from foreign repository) r66644 into '.':
U gcc/llvm-backend.cpp
U gcc/llvm-debug.cpp
U gcc/llvm-debug.h
When PCH is read, TheDebugInfo is re-created. However, this set up loses main
compile unit already created from main_input_filename because CUCache is reset.
Re-initialize this by creating new main compile unit.
Modified:
llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-backend.cpp
llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp
llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.h
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=66666&r1=66665&r2=66666&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 Wed Mar 11 12:48:57 2009
@@ -265,18 +265,8 @@
}
void llvm_lang_dependent_init(const char *Name) {
-
- // Each input file is encoded as a separate compile unit in LLVM
- // debugging information output. However, many target specific tool chains
- // prefer to encode only one compile unit in an object file. In this
- // situation, the LLVM code generator will include debugging information
- // entities in the compile unit that is marked as main compile unit. The
- // code generator accepts maximum one main compile unit per module. If a
- // module does not contain any main compile unit then the code generator
- // will emit multiple compile units in the output object file.
if (TheDebugInfo)
- TheDebugInfo->getOrCreateCompileUnit(main_input_filename, true);
-
+ TheDebugInfo->Initialize();
if (Name)
TheModule->setModuleIdentifier(Name);
}
@@ -303,8 +293,10 @@
delete MB;
// FIXME - Do not disable debug info while writing pch.
- if (!flag_pch_file && debug_info_level > DINFO_LEVEL_NONE)
+ if (!flag_pch_file && debug_info_level > DINFO_LEVEL_NONE) {
TheDebugInfo = new DebugInfo(TheModule);
+ TheDebugInfo->Initialize();
+ }
if (!TheModule) {
cerr << "Error reading bytecodes from PCH file\n";
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=66666&r1=66665&r2=66666&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 Wed Mar 11 12:48:57 2009
@@ -830,6 +830,22 @@
return Ty;
}
+/// Initialize - Initialize debug info by creating compile unit for
+/// main_input_filename. This must be inovked after language dependent
+/// initialization is done.
+void DebugInfo::Initialize() {
+
+ // Each input file is encoded as a separate compile unit in LLVM
+ // debugging information output. However, many target specific tool chains
+ // prefer to encode only one compile unit in an object file. In this
+ // situation, the LLVM code generator will include debugging information
+ // entities in the compile unit that is marked as main compile unit. The
+ // code generator accepts maximum one main compile unit per module. If a
+ // module does not contain any main compile unit then the code generator
+ // will emit multiple compile units in the output object file.
+ getOrCreateCompileUnit(main_input_filename, true);
+}
+
/// getOrCreateCompileUnit - Get the compile unit from the cache or
/// create a new one if necessary.
DICompileUnit DebugInfo::getOrCreateCompileUnit(const char *FullPath,
Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.h?rev=66666&r1=66665&r2=66666&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.h (original)
+++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.h Wed Mar 11 12:48:57 2009
@@ -70,6 +70,11 @@
public:
DebugInfo(Module *m);
+ /// Initialize - Initialize debug info by creating compile unit for
+ /// main_input_filename. This must be inovked after language dependent
+ /// initialization is done.
+ void Initialize();
+
// Accessors.
void setLocationFile(const char *FullPath) { CurFullPath = FullPath; }
void setLocationLine(int LineNo) { CurLineNo = LineNo; }
More information about the llvm-commits
mailing list