summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitd359cf2e441742296c11ed04855a6d9a6a3831ab (patch)
tree82e797cfe46244c5efbca67e3e22be49fce3234c /llvm/lib/CompilerDriver/Main.cpp
parenteb58ed8b5a4e05fda1faa1df52e925e4c79bcc28 (diff)
downloadbcm5719-llvm-d359cf2e441742296c11ed04855a6d9a6a3831ab.tar.gz
bcm5719-llvm-d359cf2e441742296c11ed04855a6d9a6a3831ab.zip
Return -1 only on failure to execute a program.
Also fix some comments. llvm-svn: 109499
Diffstat (limited to 'llvm/lib/CompilerDriver/Main.cpp')
-rw-r--r--llvm/lib/CompilerDriver/Main.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CompilerDriver/Main.cpp b/llvm/lib/CompilerDriver/Main.cpp
index 28b2737f38b..898f16d515f 100644
--- a/llvm/lib/CompilerDriver/Main.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud