diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-04 13:02:15 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-04 13:02:15 +0000 |
commit | 02c746de10c118c594d815262d84b5562453e076 (patch) | |
tree | 8d65a65ac34e00087e05d245a4fdfccfd992afa4 /clang/lib/Lex/Preprocessor.cpp | |
parent | 3307c508c932ad6f9686b15f187c06da21306c27 (diff) | |
download | bcm5719-llvm-02c746de10c118c594d815262d84b5562453e076.tar.gz bcm5719-llvm-02c746de10c118c594d815262d84b5562453e076.zip |
Remove Diagnostic.h include from Preprocessor.h.
- Move the offending methods out of line and fix transitive includers.
- This required changing an enum in the PPCallback API into an unsigned.
llvm-svn: 149782
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index fc6efb60689..7b1ddf66f9b 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -336,6 +336,21 @@ void Preprocessor::CodeCompleteNaturalLanguage() { setCodeCompletionReached(); } +void Preprocessor::setCodeCompletionReached() { + assert(isCodeCompletionEnabled() && "Code-completion not enabled!"); + CodeCompletionReached = true; + // Silence any diagnostics that occur after we hit the code-completion. + getDiagnostics().setSuppressAllDiagnostics(true); +} + +DiagnosticBuilder Preprocessor::Diag(SourceLocation Loc, unsigned DiagID) const{ + return Diags->Report(Loc, DiagID); +} + +DiagnosticBuilder Preprocessor::Diag(const Token &Tok, unsigned DiagID) const { + return Diags->Report(Tok.getLocation(), DiagID); +} + /// getSpelling - This method is used to get the spelling of a token into a /// SmallVector. Note that the returned StringRef may not point to the /// supplied buffer if a copy can be avoided. |