aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CompilerDriver/CompilationGraph.cpp
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2010-07-27 11:19:40 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2010-07-27 11:19:40 +0000
commitee68696c5f8efd1c68ce497526c3b570c2f6e208 (patch)
tree5f56a2a055593fdaaa826da150ce195c6f393d91 /llvm/lib/CompilerDriver/CompilationGraph.cpp
parentd359cf2e441742296c11ed04855a6d9a6a3831ab (diff)
downloadllvm-ee68696c5f8efd1c68ce497526c3b570c2f6e208.zip
llvm-ee68696c5f8efd1c68ce497526c3b570c2f6e208.tar.gz
llvm-ee68696c5f8efd1c68ce497526c3b570c2f6e208.tar.bz2
Fix silent failure with no input files.
llvm-svn: 109500
Diffstat (limited to 'llvm/lib/CompilerDriver/CompilationGraph.cpp')
-rw-r--r--llvm/lib/CompilerDriver/CompilationGraph.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CompilerDriver/CompilationGraph.cpp b/llvm/lib/CompilerDriver/CompilationGraph.cpp
index 9ea69c1..259911f 100644
--- a/llvm/lib/CompilerDriver/CompilationGraph.cpp
+++ b/llvm/lib/CompilerDriver/CompilationGraph.cpp
@@ -355,6 +355,7 @@ TopologicalSortFilterJoinNodes(std::vector<const Node*>& Out) {
int CompilationGraph::Build (const sys::Path& TempDir,
const LanguageMap& LangMap) {
InputLanguagesSet InLangs;
+ bool WasSomeActionGenerated = !InputFilenames.empty();
// Traverse initial parts of the toolchains and fill in InLangs.
if (int ret = BuildInitial(InLangs, TempDir, LangMap))
@@ -375,6 +376,7 @@ int CompilationGraph::Build (const sys::Path& TempDir,
if (JT->JoinListEmpty() && !(JT->WorksOnEmpty() && InputFilenames.empty()))
continue;
+ WasSomeActionGenerated = true;
Action CurAction;
if (int ret = JT->GenerateAction(CurAction, CurNode->HasChildren(),
TempDir, InLangs, LangMap)) {
@@ -401,6 +403,11 @@ int CompilationGraph::Build (const sys::Path& TempDir,
}
}
+ if (!WasSomeActionGenerated) {
+ PrintError("no input files");
+ return 1;
+ }
+
return 0;
}