aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CompilerDriver/Main.cpp
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2010-07-27 11:19:36 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2010-07-27 11:19:36 +0000
commit67d985ffb2d02941dd4e34ecea3f3b8c0fcfaf4f (patch)
treec7414f5ee29f8837a3feffc91f156f30ece6a3a3 /lib/CompilerDriver/Main.cpp
parent978bb87f8871b953d159c2846b379bc93be27972 (diff)
downloadexternal_llvm-67d985ffb2d02941dd4e34ecea3f3b8c0fcfaf4f.zip
external_llvm-67d985ffb2d02941dd4e34ecea3f3b8c0fcfaf4f.tar.gz
external_llvm-67d985ffb2d02941dd4e34ecea3f3b8c0fcfaf4f.tar.bz2
Return -1 only on failure to execute a program.
Also fix some comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CompilerDriver/Main.cpp')
-rw-r--r--lib/CompilerDriver/Main.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/CompilerDriver/Main.cpp b/lib/CompilerDriver/Main.cpp
index 28b2737..898f16d 100644
--- a/lib/CompilerDriver/Main.cpp
+++ b/lib/CompilerDriver/Main.cpp
@@ -30,7 +30,9 @@ namespace {
std::stringstream* GlobalTimeLog;
- int getTempDir(sys::Path& tempDir) {
+ /// GetTempDir - Get the temporary directory location. Returns non-zero value
+ /// on error.
+ int GetTempDir(sys::Path& tempDir) {
// The --temp-dir option.
if (!TempDirname.empty()) {
tempDir = TempDirname;
@@ -53,20 +55,20 @@ namespace {
std::string ErrMsg;
if (tempDir.createDirectoryOnDisk(true, &ErrMsg)) {
PrintError(ErrMsg);
- return -1;
+ return 1;
}
}
return 0;
}
- /// BuildTargets - A small wrapper for CompilationGraph::Build.
+ /// BuildTargets - A small wrapper for CompilationGraph::Build. Returns non-zero value
int BuildTargets(CompilationGraph& graph, const LanguageMap& langMap) {
int ret;
sys::Path tempDir;
bool toDelete = (SaveTemps == SaveTempsEnum::Unset);
- if (int ret = getTempDir(tempDir))
+ if (int ret = GetTempDir(tempDir))
return ret;
ret = graph.Build(tempDir, langMap);