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 | fdd15602a42bbe26185978ef1e17019f6d969aa7 (patch) | |
tree | ccbaf7edee98ff7893e5d30535d62bb30a9a566a /include | |
parent | 00bd44d5677783527d7517c1ffe45e4d75a0f56f (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149782 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Lex/PPCallbacks.h | 8 | ||||
-rw-r--r-- | include/clang/Lex/PTHManager.h | 1 | ||||
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 18 |
3 files changed, 8 insertions, 19 deletions
diff --git a/include/clang/Lex/PPCallbacks.h b/include/clang/Lex/PPCallbacks.h index 19e8521ea1..987d6167c6 100644 --- a/include/clang/Lex/PPCallbacks.h +++ b/include/clang/Lex/PPCallbacks.h @@ -16,7 +16,6 @@ #include "clang/Lex/DirectoryLookup.h" #include "clang/Basic/SourceLocation.h" -#include "clang/Basic/DiagnosticIDs.h" #include "llvm/ADT/StringRef.h" #include <string> @@ -158,9 +157,10 @@ public: } /// PragmaDiagnostic - This callback is invoked when a - /// #pragma gcc dianostic directive is read. + /// #pragma gcc diagnostic directive is read. + /// Mapping is an element of the diag::Mapping enum. virtual void PragmaDiagnostic(SourceLocation Loc, StringRef Namespace, - diag::Mapping mapping, StringRef Str) { + unsigned mapping, StringRef Str) { } /// MacroExpands - This is called by @@ -303,7 +303,7 @@ public: } virtual void PragmaDiagnostic(SourceLocation Loc, StringRef Namespace, - diag::Mapping mapping, StringRef Str) { + unsigned mapping, StringRef Str) { First->PragmaDiagnostic(Loc, Namespace, mapping, Str); Second->PragmaDiagnostic(Loc, Namespace, mapping, Str); } diff --git a/include/clang/Lex/PTHManager.h b/include/clang/Lex/PTHManager.h index 25a49038a8..6ae3a7167e 100644 --- a/include/clang/Lex/PTHManager.h +++ b/include/clang/Lex/PTHManager.h @@ -17,7 +17,6 @@ #include "clang/Lex/PTHLexer.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/IdentifierTable.h" -#include "clang/Basic/Diagnostic.h" #include "llvm/ADT/DenseMap.h" #include "llvm/Support/Allocator.h" #include <string> diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 33efbd960c..dc93b625c3 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -21,7 +21,6 @@ #include "clang/Lex/TokenLexer.h" #include "clang/Lex/PTHManager.h" #include "clang/Basic/Builtins.h" -#include "clang/Basic/Diagnostic.h" #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/DenseMap.h" @@ -57,7 +56,7 @@ class ModuleLoader; /// like the #include stack, token expansion, etc. /// class Preprocessor : public llvm::RefCountedBase<Preprocessor> { - DiagnosticsEngine *Diags; + DiagnosticsEngine *Diags; LangOptions &Features; const TargetInfo *Target; FileManager &FileMgr; @@ -725,12 +724,7 @@ public: bool isCodeCompletionReached() const { return CodeCompletionReached; } /// \brief Note that we hit the code-completion point. - void setCodeCompletionReached() { - assert(isCodeCompletionEnabled() && "Code-completion not enabled!"); - CodeCompletionReached = true; - // Silence any diagnostics that occur after we hit the code-completion. - getDiagnostics().setSuppressAllDiagnostics(true); - } + void setCodeCompletionReached(); /// \brief The location of the currently-active #pragma clang /// arc_cf_code_audited begin. Returns an invalid location if there @@ -760,13 +754,9 @@ public: /// Diag - Forwarding function for diagnostics. This emits a diagnostic at /// the specified Token's location, translating the token's start /// position in the current buffer into a SourcePosition object for rendering. - DiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID) const { - return Diags->Report(Loc, DiagID); - } + DiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID) const; - DiagnosticBuilder Diag(const Token &Tok, unsigned DiagID) const { - return Diags->Report(Tok.getLocation(), DiagID); - } + DiagnosticBuilder Diag(const Token &Tok, unsigned DiagID) const; /// getSpelling() - Return the 'spelling' of the token at the given /// location; does not go up to the spelling location or down to the |