summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAdam Balogh <adam.balogh@ericsson.com>2018-06-15 06:45:39 +0000
committerAdam Balogh <adam.balogh@ericsson.com>2018-06-15 06:45:39 +0000
commite4192a86dc564b5d3e19e477179275f1b2a71f4e (patch)
treec63d8b0b6e4604ec136812b1809b054e8c37ec16 /clang/lib
parentc8a763ed84ba75f3513a7a4d3a119d96d143f7e6 (diff)
downloadbcm5719-llvm-e4192a86dc564b5d3e19e477179275f1b2a71f4e.tar.gz
bcm5719-llvm-e4192a86dc564b5d3e19e477179275f1b2a71f4e.zip
[ASTImporter] Corrected diagnostic client handling in tests.
ASTImporter tests may produce source file related warnings, the diagnostic client should be in correct state to handle it. Added 'beginSourceFile' to set the client state. Patch by: Balázs Kéri Differential Revision: https://reviews.llvm.org/D47445 llvm-svn: 334804
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index d7bbf6fe4ae..e4c313fed30 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -275,6 +275,12 @@ void ASTUnit::setPreprocessor(std::shared_ptr<Preprocessor> PP) {
this->PP = std::move(PP);
}
+void ASTUnit::enableSourceFileDiagnostics() {
+ assert(getDiagnostics().getClient() && Ctx &&
+ "Bad context for source file");
+ getDiagnostics().getClient()->BeginSourceFile(Ctx->getLangOpts(), PP.get());
+}
+
/// Determine the set of code-completion contexts in which this
/// declaration should be shown.
static unsigned getDeclShowContexts(const NamedDecl *ND,
OpenPOWER on IntegriCloud