summaryrefslogtreecommitdiffstats
path: root/lib/Frontend/VerifyDiagnosticsClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Frontend/VerifyDiagnosticsClient.cpp')
-rw-r--r--lib/Frontend/VerifyDiagnosticsClient.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Frontend/VerifyDiagnosticsClient.cpp b/lib/Frontend/VerifyDiagnosticsClient.cpp
index 2891aec..99ec910 100644
--- a/lib/Frontend/VerifyDiagnosticsClient.cpp
+++ b/lib/Frontend/VerifyDiagnosticsClient.cpp
@@ -164,12 +164,14 @@ static void FindExpectedDiags(Preprocessor &PP,
DiagList &ExpectedNotes) {
// Create a raw lexer to pull all the comments out of the main file. We don't
// want to look in #include'd headers for expected-error strings.
- FileID FID = PP.getSourceManager().getMainFileID();
- if (PP.getSourceManager().getMainFileID().isInvalid())
+ SourceManager &SM = PP.getSourceManager();
+ FileID FID = SM.getMainFileID();
+ if (SM.getMainFileID().isInvalid())
return;
// Create a lexer to lex all the tokens of the main file in raw mode.
- Lexer RawLex(FID, PP.getSourceManager(), PP.getLangOptions());
+ const llvm::MemoryBuffer *FromFile = SM.getBuffer(FID);
+ Lexer RawLex(FID, FromFile, SM, PP.getLangOptions());
// Return comments as tokens, this is how we find expected diagnostics.
RawLex.SetCommentRetentionState(true);
OpenPOWER on IntegriCloud