summaryrefslogtreecommitdiffstats
path: root/clang/Driver/clang.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Driver/clang.cpp')
-rw-r--r--clang/Driver/clang.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/Driver/clang.cpp b/clang/Driver/clang.cpp
index 9c0ce109017..160c2523049 100644
--- a/clang/Driver/clang.cpp
+++ b/clang/Driver/clang.cpp
@@ -1156,15 +1156,20 @@ public:
if (!TokenCache.empty() && !ImplicitIncludePTH.empty()) {
fprintf(stderr, "error: cannot use both -token-cache and -include-pth "
"options\n");
- exit (1);
+ exit(1);
}
// Use PTH?
if (!TokenCache.empty() || !ImplicitIncludePTH.empty()) {
const std::string& x = TokenCache.empty() ? ImplicitIncludePTH:TokenCache;
- PTHMgr.reset(PTHManager::Create(x, &Diags));
+ PTHMgr.reset(PTHManager::Create(x, &Diags,
+ TokenCache.empty() ? Diagnostic::Error
+ : Diagnostic::Warning));
}
+ if (Diags.hasErrorOccurred())
+ exit(1);
+
// Create the Preprocessor.
llvm::OwningPtr<Preprocessor> PP(new Preprocessor(Diags, LangInfo, Target,
SourceMgr, HeaderInfo,
OpenPOWER on IntegriCloud