[llvm-commits] [llvm-gcc-4.2] r86734 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Devang Patel
dpatel at apple.com
Tue Nov 10 14:23:59 PST 2009
Author: dpatel
Date: Tue Nov 10 16:23:59 2009
New Revision: 86734
URL: http://llvm.org/viewvc/llvm-project?rev=86734&view=rev
Log:
Use "<stdin>" as input file name if stdin is input source.
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=86734&r1=86733&r2=86734&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Tue Nov 10 16:23:59 2009
@@ -934,15 +934,22 @@
// 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);
+ if (!strcmp (main_input_filename, ""))
+ getOrCreateCompileUnit("<stdin>", true);
+ else
+ 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,
bool isMain) {
- if (!FullPath)
- FullPath = main_input_filename;
+ if (!FullPath) {
+ if (!strcmp (main_input_filename, ""))
+ FullPath = "<stdin>";
+ else
+ FullPath = main_input_filename;
+ }
std::map<std::string, WeakVH >::iterator I = CUCache.find(FullPath);
if (I != CUCache.end())
if (Value *M = I->second)
More information about the llvm-commits
mailing list