[llvm-commits] [dragonegg] r88783 - /dragonegg/trunk/llvm-debug.cpp
Duncan Sands
baldrick at free.fr
Sat Nov 14 04:25:58 PST 2009
Author: baldrick
Date: Sat Nov 14 06:25:58 2009
New Revision: 88783
URL: http://llvm.org/viewvc/llvm-project?rev=88783&view=rev
Log:
Port commit 86734 (dpatel) from llvm-gcc:
Use "<stdin>" as input file name if stdin is input source.
Modified:
dragonegg/trunk/llvm-debug.cpp
Modified: dragonegg/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.cpp?rev=88783&r1=88782&r2=88783&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Sat Nov 14 06:25:58 2009
@@ -882,15 +882,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