#include "clang/Lex/DirectoryLookup.h"
#include "clang/Basic/SourceLocation.h"
-#include "clang/Basic/DiagnosticIDs.h"
#include "llvm/ADT/StringRef.h"
#include <string>
}
/// 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
}
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);
}
#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>
#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"
/// like the #include stack, token expansion, etc.
///
class Preprocessor : public llvm::RefCountedBase<Preprocessor> {
- DiagnosticsEngine *Diags;
+ DiagnosticsEngine *Diags;
LangOptions &Features;
const TargetInfo *Target;
FileManager &FileMgr;
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
/// 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
virtual void PragmaDiagnosticPop(SourceLocation Loc,
StringRef Namespace);
virtual void PragmaDiagnostic(SourceLocation Loc, StringRef Namespace,
- diag::Mapping Map, StringRef Str);
+ unsigned Map, StringRef Str);
bool HandleFirstTokOnLine(Token &Tok);
bool MoveToLine(SourceLocation Loc) {
void PrintPPOutputPPCallbacks::
PragmaDiagnostic(SourceLocation Loc, StringRef Namespace,
- diag::Mapping Map, StringRef Str) {
+ unsigned Map, StringRef Str) {
MoveToLine(Loc);
OS << "#pragma " << Namespace << " diagnostic ";
- switch (Map) {
+ switch ((diag::Mapping)Map) {
case diag::MAP_WARNING:
OS << "warning";
break;
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.
#include "clang/Rewrite/HTMLRewrite.h"
#include "clang/Lex/TokenConcatenation.h"
#include "clang/Lex/Preprocessor.h"
+#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/OwningPtr.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/Lex/Preprocessor.h"
+#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/FileSystemStatCache.h"
#include "llvm/Bitcode/BitstreamWriter.h"
#include "clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h"
#include "clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h"
+#include "clang/Basic/Diagnostic.h"
#include "clang/Lex/Preprocessor.h"
#include "llvm/Support/raw_ostream.h"
using namespace clang;
#include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
#include "clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h"
+#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Frontend/AnalyzerOptions.h"