summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/FrontendAction.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-08-10 01:06:08 +0000
committerJordan Rose <jordan_rose@apple.com>2012-08-10 01:06:08 +0000
commitea762b046017664e38b149e6cdba88b943bb30c0 (patch)
tree39b4975d341f1fe147d186249c2a351abcc77607 /clang/lib/Frontend/FrontendAction.cpp
parentf5697e5222a4eb59511436f145243ced225de6fa (diff)
downloadbcm5719-llvm-ea762b046017664e38b149e6cdba88b943bb30c0.tar.gz
bcm5719-llvm-ea762b046017664e38b149e6cdba88b943bb30c0.zip
Make sure to call EndSourceFile even if we can't continue compiling.
Patch by Andy Gibbs! llvm-svn: 161649
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r--clang/lib/Frontend/FrontendAction.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp
index fb53c71fa9b..a4321e720ed 100644
--- a/clang/lib/Frontend/FrontendAction.cpp
+++ b/clang/lib/Frontend/FrontendAction.cpp
@@ -162,6 +162,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
setCurrentInput(Input);
setCompilerInstance(&CI);
+ bool HasBegunSourceFile = false;
if (!BeginInvocation(CI))
goto failure;
@@ -214,6 +215,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
// Inform the diagnostic client we are processing a source file.
CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(), 0);
+ HasBegunSourceFile = true;
// Initialize the action.
if (!BeginSourceFileAction(CI, Input.File))
@@ -228,6 +230,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
// Inform the diagnostic client we are processing a source file.
CI.getDiagnosticClient().BeginSourceFile(CI.getLangOpts(),
&CI.getPreprocessor());
+ HasBegunSourceFile = true;
// Initialize the action.
if (!BeginSourceFileAction(CI, Input.File))
@@ -309,7 +312,8 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
CI.setFileManager(0);
}
- CI.getDiagnosticClient().EndSourceFile();
+ if (HasBegunSourceFile)
+ CI.getDiagnosticClient().EndSourceFile();
setCurrentInput(FrontendInputFile());
setCompilerInstance(0);
return false;
OpenPOWER on IntegriCloud