Fix silent failure with no input files.
authorMikhail Glushenkov <foldr@codedgers.com>
Tue, 27 Jul 2010 11:19:40 +0000 (11:19 +0000)
committerMikhail Glushenkov <foldr@codedgers.com>
Tue, 27 Jul 2010 11:19:40 +0000 (11:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109500 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CompilerDriver/CompilationGraph.cpp

index 9ea69c129f773c1558ec1be9e7d9a8d4853ba6de..259911f713705981a6fdfaa4ab82f6db87c8a299 100644 (file)
@@ -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;
 }