[llvm-commits] [llvm-gcc-4.2] r64938 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp

Evan Cheng evan.cheng at apple.com
Wed Feb 18 10:55:59 PST 2009


Author: evancheng
Date: Wed Feb 18 12:55:59 2009
New Revision: 64938

URL: http://llvm.org/viewvc/llvm-project?rev=64938&view=rev
Log:
If FullPath is null, use main_input_filename. This avoids initializing a std::string with null.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=64938&r1=64937&r2=64938&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Wed Feb 18 12:55:59 2009
@@ -828,9 +828,10 @@
 /// getOrCreateCompileUnit - Get the compile unit from the cache or 
 /// create a new one if necessary.
 DICompileUnit DebugInfo::getOrCreateCompileUnit(const char *FullPath,
-                                                bool isMain){
-
-  GlobalVariable *&CU = CUCache[FullPath ? FullPath : main_input_filename];
+                                                bool isMain) {
+  if (!FullPath)
+    FullPath = main_input_filename;
+  GlobalVariable *&CU = CUCache[FullPath];
   if (CU)
     return DICompileUnit(CU);
 





More information about the llvm-commits mailing list