diff options
author | David Blaikie <dblaikie@gmail.com> | 2011-09-25 23:23:43 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2011-09-25 23:23:43 +0000 |
commit | d6471f7c1921c7802804ce3ff6fe9768310f72b9 (patch) | |
tree | f8559e8ca7afb0328fab36e22a34e55ce566008d /include | |
parent | 026cb7604c8ef0bc7032e4c067500907d03b67a3 (diff) |
Rename Diagnostic to DiagnosticsEngine as per issue 5397
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
48 files changed, 208 insertions, 203 deletions
diff --git a/include/clang/ARCMigrate/FileRemapper.h b/include/clang/ARCMigrate/FileRemapper.h index 181e130add..9a0b690ad6 100644 --- a/include/clang/ARCMigrate/FileRemapper.h +++ b/include/clang/ARCMigrate/FileRemapper.h @@ -23,7 +23,7 @@ namespace llvm { namespace clang { class FileManager; class FileEntry; - class Diagnostic; + class DiagnosticsEngine; class CompilerInvocation; namespace arcmt { @@ -42,11 +42,11 @@ public: FileRemapper(); ~FileRemapper(); - bool initFromDisk(StringRef outputDir, Diagnostic &Diag, + bool initFromDisk(StringRef outputDir, DiagnosticsEngine &Diag, bool ignoreIfFilesChanged); - bool flushToDisk(StringRef outputDir, Diagnostic &Diag); + bool flushToDisk(StringRef outputDir, DiagnosticsEngine &Diag); - bool overwriteOriginal(Diagnostic &Diag, + bool overwriteOriginal(DiagnosticsEngine &Diag, StringRef outputDir = StringRef()); void remap(StringRef filePath, llvm::MemoryBuffer *memBuf); @@ -65,7 +65,7 @@ private: const FileEntry *getOriginalFile(StringRef filePath); void resetTarget(Target &targ); - bool report(const Twine &err, Diagnostic &Diag); + bool report(const Twine &err, DiagnosticsEngine &Diag); std::string getRemapInfoFile(StringRef outputDir); }; diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index e1a89b35df..9d8aa537a3 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -44,7 +44,7 @@ namespace clang { class ASTRecordLayout; class BlockExpr; class CharUnits; - class Diagnostic; + class DiagnosticsEngine; class Expr; class ExternalASTSource; class ASTMutationListener; @@ -374,7 +374,7 @@ public: const LangOptions& getLangOptions() const { return LangOpts; } - Diagnostic &getDiagnostics() const; + DiagnosticsEngine &getDiagnostics() const; FullSourceLoc getFullLoc(SourceLocation Loc) const { return FullSourceLoc(Loc,SourceMgr); diff --git a/include/clang/AST/ASTDiagnostic.h b/include/clang/AST/ASTDiagnostic.h index ffd5e1e2eb..846321bd39 100644 --- a/include/clang/AST/ASTDiagnostic.h +++ b/include/clang/AST/ASTDiagnostic.h @@ -24,23 +24,23 @@ namespace clang { }; } // end namespace diag - /// \brief Diagnostic argument formatting function for diagnostics that + /// \brief DiagnosticsEngine argument formatting function for diagnostics that /// involve AST nodes. /// /// This function formats diagnostic arguments for various AST nodes, /// including types, declaration names, nested name specifiers, and /// declaration contexts, into strings that can be printed as part of /// diagnostics. It is meant to be used as the argument to - /// \c Diagnostic::SetArgToStringFn(), where the cookie is an \c ASTContext - /// pointer. + /// \c DiagnosticsEngine::SetArgToStringFn(), where the cookie is an \c + /// ASTContext pointer. void FormatASTNodeDiagnosticArgument( - Diagnostic::ArgumentKind Kind, + DiagnosticsEngine::ArgumentKind Kind, intptr_t Val, const char *Modifier, unsigned ModLen, const char *Argument, unsigned ArgLen, - const Diagnostic::ArgumentValue *PrevArgs, + const DiagnosticsEngine::ArgumentValue *PrevArgs, unsigned NumPrevArgs, SmallVectorImpl<char> &Output, void *Cookie, diff --git a/include/clang/AST/ASTImporter.h b/include/clang/AST/ASTImporter.h index a0bd9c6997..b583fbf906 100644 --- a/include/clang/AST/ASTImporter.h +++ b/include/clang/AST/ASTImporter.h @@ -25,7 +25,7 @@ namespace clang { class ASTContext; class Decl; class DeclContext; - class Diagnostic; + class DiagnosticsEngine; class Expr; class FileManager; class IdentifierInfo; diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index c28242d118..841aa3b59c 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -3043,7 +3043,8 @@ public: /// into a diagnostic with <<. inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, const NamedDecl* ND) { - DB.AddTaggedVal(reinterpret_cast<intptr_t>(ND), Diagnostic::ak_nameddecl); + DB.AddTaggedVal(reinterpret_cast<intptr_t>(ND), + DiagnosticsEngine::ak_nameddecl); return DB; } diff --git a/include/clang/AST/DeclarationName.h b/include/clang/AST/DeclarationName.h index 7c670c4741..2170f2b1ef 100644 --- a/include/clang/AST/DeclarationName.h +++ b/include/clang/AST/DeclarationName.h @@ -520,7 +520,7 @@ public: inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, DeclarationName N) { DB.AddTaggedVal(N.getAsOpaqueInteger(), - Diagnostic::ak_declarationname); + DiagnosticsEngine::ak_declarationname); return DB; } @@ -529,7 +529,7 @@ inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, inline const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, DeclarationName N) { PD.AddTaggedVal(N.getAsOpaqueInteger(), - Diagnostic::ak_declarationname); + DiagnosticsEngine::ak_declarationname); return PD; } diff --git a/include/clang/AST/Mangle.h b/include/clang/AST/Mangle.h index fcb7ebdba5..f58a83b54b 100644 --- a/include/clang/AST/Mangle.h +++ b/include/clang/AST/Mangle.h @@ -65,21 +65,21 @@ private: /// calls to the C++ name mangler. class MangleContext { ASTContext &Context; - Diagnostic &Diags; + DiagnosticsEngine &Diags; llvm::DenseMap<const BlockDecl*, unsigned> GlobalBlockIds; llvm::DenseMap<const BlockDecl*, unsigned> LocalBlockIds; public: explicit MangleContext(ASTContext &Context, - Diagnostic &Diags) + DiagnosticsEngine &Diags) : Context(Context), Diags(Diags) { } virtual ~MangleContext() { } ASTContext &getASTContext() const { return Context; } - Diagnostic &getDiags() const { return Diags; } + DiagnosticsEngine &getDiags() const { return Diags; } virtual void startNewFunction() { LocalBlockIds.clear(); } @@ -141,9 +141,9 @@ public: }; MangleContext *createItaniumMangleContext(ASTContext &Context, - Diagnostic &Diags); + DiagnosticsEngine &Diags); MangleContext *createMicrosoftMangleContext(ASTContext &Context, - Diagnostic &Diags); + DiagnosticsEngine &Diags); } diff --git a/include/clang/AST/NestedNameSpecifier.h b/include/clang/AST/NestedNameSpecifier.h index d1d6e72ca7..c81c06e332 100644 --- a/include/clang/AST/NestedNameSpecifier.h +++ b/include/clang/AST/NestedNameSpecifier.h @@ -465,7 +465,7 @@ public: inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, NestedNameSpecifier *NNS) { DB.AddTaggedVal(reinterpret_cast<intptr_t>(NNS), - Diagnostic::ak_nestednamespec); + DiagnosticsEngine::ak_nestednamespec); return DB; } diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index a33a806f60..90e29ba741 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -4761,7 +4761,7 @@ inline const Type *Type::getBaseElementTypeUnsafe() const { inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, QualType T) { DB.AddTaggedVal(reinterpret_cast<intptr_t>(T.getAsOpaquePtr()), - Diagnostic::ak_qualtype); + DiagnosticsEngine::ak_qualtype); return DB; } @@ -4770,7 +4770,7 @@ inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, inline const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, QualType T) { PD.AddTaggedVal(reinterpret_cast<intptr_t>(T.getAsOpaquePtr()), - Diagnostic::ak_qualtype); + DiagnosticsEngine::ak_qualtype); return PD; } diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index ca0197b14c..5015f64876 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -100,12 +100,12 @@ public: } }; -/// Diagnostic - This concrete class is used by the front-end to report +/// DiagnosticsEngine - This concrete class is used by the front-end to report /// problems and issues. It massages the diagnostics (e.g. handling things like /// "report warnings as errors" and passes them off to the DiagnosticClient for -/// reporting to the user. Diagnostic is tied to one translation unit and +/// reporting to the user. DiagnosticsEngine is tied to one translation unit and /// one SourceManager. -class Diagnostic : public llvm::RefCountedBase<Diagnostic> { +class DiagnosticsEngine : public llvm::RefCountedBase<DiagnosticsEngine> { public: /// Level - The level of the diagnostic, after it has been through mapping. enum Level { @@ -303,10 +303,11 @@ private: std::string DelayedDiagArg2; public: - explicit Diagnostic(const llvm::IntrusiveRefCntPtr<DiagnosticIDs> &Diags, + explicit DiagnosticsEngine( + const llvm::IntrusiveRefCntPtr<DiagnosticIDs> &Diags, DiagnosticClient *client = 0, bool ShouldOwnClient = true); - ~Diagnostic(); + ~DiagnosticsEngine(); const llvm::IntrusiveRefCntPtr<DiagnosticIDs> &getDiagnosticIDs() const { return Diags; @@ -315,7 +316,7 @@ public: DiagnosticClient *getClient() { return Client; } const DiagnosticClient *getClient() const { return Client; } - /// \brief Determine whether this \c Diagnostic object own its client. + /// \brief Determine whether this \c DiagnosticsEngine object own its client. bool ownsClient() const { return OwnsDiagClient; } /// \brief Return the current diagnostic client along with ownership of that @@ -333,8 +334,8 @@ public: void setSourceManager(SourceManager *SrcMgr) { SourceMgr = SrcMgr; } //===--------------------------------------------------------------------===// - // Diagnostic characterization methods, used by a client to customize how - // diagnostics are emitted. + // DiagnosticsEngine characterization methods, used by a client to customize + // how diagnostics are emitted. // /// pushMappings - Copies the current DiagMappings and pushes the new copy @@ -495,10 +496,10 @@ public: void Reset(); //===--------------------------------------------------------------------===// - // Diagnostic classification and reporting interfaces. + // DiagnosticsEngine classification and reporting interfaces. // - /// \brief Based on the way the client configured the Diagnostic + /// \brief Based on the way the client configured the DiagnosticsEngine /// object, classify the specified diagnostic ID into a Level, consumable by /// the DiagnosticClient. /// @@ -538,11 +539,11 @@ public: /// /// \param Arg1 A string argument that will be provided to the /// diagnostic. A copy of this string will be stored in the - /// Diagnostic object itself. + /// DiagnosticsEngine object itself. /// /// \param Arg2 A string argument that will be provided to the /// diagnostic. A copy of this string will be stored in the - /// Diagnostic object itself. + /// DiagnosticsEngine object itself. void SetDelayedDiagnostic(unsigned DiagID, StringRef Arg1 = "", StringRef Arg2 = ""); @@ -648,12 +649,12 @@ private: /// between the time the instance was created and the time it was /// queried. class DiagnosticErrorTrap { - Diagnostic &Diag; + DiagnosticsEngine &Diag; unsigned NumErrors; unsigned NumUnrecoverableErrors; public: - explicit DiagnosticErrorTrap(Diagnostic &Diag) + explicit DiagnosticErrorTrap(DiagnosticsEngine &Diag) : Diag(Diag) { reset(); } /// \brief Determine whether any errors have occurred since this @@ -680,9 +681,9 @@ public: //===----------------------------------------------------------------------===// /// DiagnosticBuilder - This is a little helper class used to produce -/// diagnostics. This is constructed by the Diagnostic::Report method, and -/// allows insertion of extra information (arguments and source ranges) into the -/// currently "in flight" diagnostic. When the temporary for the builder is +/// diagnostics. This is constructed by the DiagnosticsEngine::Report method, +/// and allows insertion of extra information (arguments and source ranges) into +/// the currently "in flight" diagnostic. When the temporary for the builder is /// destroyed, the diagnostic is issued. /// /// Note that many of these will be created as temporary objects (many call @@ -691,12 +692,12 @@ public: /// the common fields to registers, eliminating increments of the NumArgs field, /// for example. class DiagnosticBuilder { - mutable Diagnostic *DiagObj; + mutable DiagnosticsEngine *DiagObj; mutable unsigned NumArgs, NumRanges, NumFixItHints; void operator=(const DiagnosticBuilder&); // DO NOT IMPLEMENT - friend class Diagnostic; - explicit DiagnosticBuilder(Diagnostic *diagObj) + friend class DiagnosticsEngine; + explicit DiagnosticBuilder(DiagnosticsEngine *diagObj) : DiagObj(diagObj), NumArgs(0), NumRanges(0), NumFixItHints(0) {} friend class PartialDiagnostic; @@ -744,7 +745,7 @@ public: /// /// \pre \c isActive() unsigned getDiagID() const { - assert(isActive() && "Diagnostic is inactive"); + assert(isActive() && "DiagnosticsEngine is inactive"); return DiagObj->CurDiagID; } @@ -757,16 +758,16 @@ public: operator bool() const { return true; } void AddString(StringRef S) const { - assert(NumArgs < Diagnostic::MaxArguments && + assert(NumArgs < DiagnosticsEngine::MaxArguments && "Too many arguments to diagnostic!"); if (DiagObj) { - DiagObj->DiagArgumentsKind[NumArgs] = Diagnostic::ak_std_string; + DiagObj->DiagArgumentsKind[NumArgs] = DiagnosticsEngine::ak_std_string; DiagObj->DiagArgumentsStr[NumArgs++] = S; } } - void AddTaggedVal(intptr_t V, Diagnostic::ArgumentKind Kind) const { - assert(NumArgs < Diagnostic::MaxArguments && + void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const { + assert(NumArgs < DiagnosticsEngine::MaxArguments && "Too many arguments to diagnostic!"); if (DiagObj) { DiagObj->DiagArgumentsKind[NumArgs] = Kind; @@ -783,7 +784,7 @@ public: } void AddFixItHint(const FixItHint &Hint) const { - assert(NumFixItHints < Diagnostic::MaxFixItHints && + assert(NumFixItHints < DiagnosticsEngine::MaxFixItHints && "Too many fix-it hints!"); if (DiagObj) DiagObj->FixItHints[NumFixItHints++] = Hint; @@ -799,30 +800,30 @@ inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, const char *Str) { DB.AddTaggedVal(reinterpret_cast<intptr_t>(Str), - Diagnostic::ak_c_string); + DiagnosticsEngine::ak_c_string); return DB; } inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, int I) { - DB.AddTaggedVal(I, Diagnostic::ak_sint); + DB.AddTaggedVal(I, DiagnosticsEngine::ak_sint); return DB; } inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,bool I) { - DB.AddTaggedVal(I, Diagnostic::ak_sint); + DB.AddTaggedVal(I, DiagnosticsEngine::ak_sint); return DB; } inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, unsigned I) { - DB.AddTaggedVal(I, Diagnostic::ak_uint); + DB.AddTaggedVal(I, DiagnosticsEngine::ak_uint); return DB; } inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, const IdentifierInfo *II) { DB.AddTaggedVal(reinterpret_cast<intptr_t>(II), - Diagnostic::ak_identifierinfo); + DiagnosticsEngine::ak_identifierinfo); return DB; } @@ -836,7 +837,7 @@ typename llvm::enable_if<llvm::is_same<T, DeclContext>, const DiagnosticBuilder &>::type operator<<(const DiagnosticBuilder &DB, T *DC) { DB.AddTaggedVal(reinterpret_cast<intptr_t>(DC), - Diagnostic::ak_declcontext); + DiagnosticsEngine::ak_declcontext); return DB; } @@ -861,14 +862,14 @@ inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, /// Report - Issue the message to the client. DiagID is a member of the /// diag::kind enum. This actually returns a new instance of DiagnosticBuilder /// which emits the diagnostics (through ProcessDiag) when it is destroyed. -inline DiagnosticBuilder Diagnostic::Report(SourceLocation Loc, +inline DiagnosticBuilder DiagnosticsEngine::Report(SourceLocation Loc, unsigned DiagID){ assert(CurDiagID == ~0U && "Multiple diagnostics in flight at once!"); CurDiagLoc = Loc; CurDiagID = DiagID; return DiagnosticBuilder(this); } -inline DiagnosticBuilder Diagnostic::Report(unsigned DiagID) { +inline DiagnosticBuilder DiagnosticsEngine::Report(unsigned DiagID) { return Report(SourceLocation(), DiagID); } @@ -877,17 +878,17 @@ inline DiagnosticBuilder Diagnostic::Report(unsigned DiagID) { //===----------------------------------------------------------------------===// /// DiagnosticInfo - This is a little helper class (which is basically a smart -/// pointer that forward info from Diagnostic) that allows clients to enquire -/// about the currently in-flight diagnostic. +/// pointer that forward info from DiagnosticsEngine) that allows clients to +/// enquire about the currently in-flight diagnostic. class DiagnosticInfo { - const Diagnostic *DiagObj; + const DiagnosticsEngine *DiagObj; StringRef StoredDiagMessage; public: - explicit DiagnosticInfo(const Diagnostic *DO) : DiagObj(DO) {} - DiagnosticInfo(const Diagnostic *DO, StringRef storedDiagMessage) + explicit DiagnosticInfo(const DiagnosticsEngine *DO) : DiagObj(DO) {} + DiagnosticInfo(const DiagnosticsEngine *DO, StringRef storedDiagMessage) : DiagObj(DO), StoredDiagMessage(storedDiagMessage) {} - const Diagnostic *getDiags() const { return DiagObj; } + const DiagnosticsEngine *getDiags() const { return DiagObj; } unsigned getID() const { return DiagObj->CurDiagID; } const SourceLocation &getLocation() const { return DiagObj->CurDiagLoc; } bool hasSourceManager() const { return DiagObj->hasSourceManager(); } @@ -897,49 +898,49 @@ public: /// getArgKind - Return the kind of the specified index. Based on the kind /// of argument, the accessors below can be used to get the value. - Diagnostic::ArgumentKind getArgKind(unsigned Idx) const { + DiagnosticsEngine::ArgumentKind getArgKind(unsigned Idx) const { assert(Idx < getNumArgs() && "Argument index out of range!"); - return (Diagnostic::ArgumentKind)DiagObj->DiagArgumentsKind[Idx]; + return (DiagnosticsEngine::ArgumentKind)DiagObj->DiagArgumentsKind[Idx]; } /// getArgStdStr - Return the provided argument string specified by Idx. const std::string &getArgStdStr(unsigned Idx) const { - assert(getArgKind(Idx) == Diagnostic::ak_std_string && + assert(getArgKind(Idx) == DiagnosticsEngine::ak_std_string && "invalid argument accessor!"); return DiagObj->DiagArgumentsStr[Idx]; } /// getArgCStr - Return the specified C string argument. const char *getArgCStr(unsigned Idx) const { - assert(getArgKind(Idx) == Diagnostic::ak_c_string && + assert(getArgKind(Idx) == DiagnosticsEngine::ak_c_string && "invalid argument accessor!"); return reinterpret_cast<const char*>(DiagObj->DiagArgumentsVal[Idx]); } /// getArgSInt - Return the specified signed integer argument. int getArgSInt(unsigned Idx) const { - assert(getArgKind(Idx) == Diagnostic::ak_sint && + assert(getArgKind(Idx) == DiagnosticsEngine::ak_sint && "invalid argument accessor!"); return (int)DiagObj->DiagArgumentsVal[Idx]; } /// getArgUInt - Return the specified unsigned integer argument. unsigned getArgUInt(unsigned Idx) const { - assert(getArgKind(Idx) == Diagnostic::ak_uint && + assert(getArgKind(Idx) == DiagnosticsEngine::ak_uint && "invalid argument accessor!"); return (unsigned)DiagObj->DiagArgumentsVal[Idx]; } /// getArgIdentifier - Return the specified IdentifierInfo argument. const IdentifierInfo *getArgIdentifier(unsigned Idx) const { - assert(getArgKind(Idx) == Diagnostic::ak_identifierinfo && + assert(getArgKind(Idx) == DiagnosticsEngine::ak_identifierinfo && "invalid argument accessor!"); return reinterpret_cast<IdentifierInfo*>(DiagObj->DiagArgumentsVal[Idx]); } /// getRawArg - Return the specified non-string argument in an opaque form. intptr_t getRawArg(unsigned Idx) const { - assert(getArgKind(Idx) != Diagnostic::ak_std_string && + assert(getArgKind(Idx) != DiagnosticsEngine::ak_std_string && "invalid argument accessor!"); return DiagObj->DiagArgumentsVal[Idx]; } @@ -986,7 +987,7 @@ public: */ class StoredDiagnostic { unsigned ID; - Diagnostic::Level Level; + DiagnosticsEngine::Level Level; FullSourceLoc Loc; std::string Message; std::vector<CharSourceRange> Ranges; @@ -994,10 +995,10 @@ class StoredDiagnostic { public: StoredDiagnostic(); - StoredDiagnostic(Diagnostic::Level Level, const DiagnosticInfo &Info); - StoredDiagnostic(Diagnostic::Level Level, unsigned ID, + StoredDiagnostic(DiagnosticsEngine::Level Level, const DiagnosticInfo &Info); + StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID, StringRef Message); - StoredDiagnostic(Diagnostic::Level Level, unsigned ID, + StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID, StringRef Message, FullSourceLoc Loc, ArrayRef<CharSourceRange> Ranges, ArrayRef<FixItHint> Fixits); @@ -1007,7 +1008,7 @@ public: operator bool() const { return Message.size() > 0; } unsigned getID() const { return ID; } - Diagnostic::Level getLevel() const { return Level; } + DiagnosticsEngine::Level getLevel() const { return Level; } const FullSourceLoc &getLocation() const { return Loc; } StringRef getMessage() const { return Message; } @@ -1061,7 +1062,7 @@ public: /// IncludeInDiagnosticCounts - This method (whose default implementation /// returns true) indicates whether the diagnostics handled by this /// DiagnosticClient should be included in the number of diagnostics reported - /// by Diagnostic. + /// by DiagnosticsEngine. virtual bool IncludeInDiagnosticCounts() const; /// HandleDiagnostic - Handle this diagnostic, reporting it to the user or @@ -1069,7 +1070,7 @@ public: /// /// Default implementation just keeps track of the total number of warnings /// and errors. - virtual void HandleDiagnostic(Diagnostic::Level DiagLevel, + virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const DiagnosticInfo &Info); }; diff --git a/include/clang/Basic/DiagnosticIDs.h b/include/clang/Basic/DiagnosticIDs.h index 76fe54f1ef..1169f9ce3f 100644 --- a/include/clang/Basic/DiagnosticIDs.h +++ b/include/clang/Basic/DiagnosticIDs.h @@ -19,7 +19,7 @@ #include "clang/Basic/LLVM.h" namespace clang { - class Diagnostic; + class DiagnosticsEngine; class SourceLocation; // Import the diagnostic enums themselves. @@ -220,16 +220,17 @@ private: /// "unknown-pragmas" to have the specified mapping. This returns true and /// ignores the request if "Group" was unknown, false otherwise. bool setDiagnosticGroupMapping(StringRef Group, diag::Mapping Map, - SourceLocation Loc, Diagnostic &Diag) const; + SourceLocation Loc, + DiagnosticsEngine &Diag) const; - /// \brief Based on the way the client configured the Diagnostic + /// \brief Based on the way the client configured the DiagnosticsEngine /// object, classify the specified diagnostic ID into a Level, consumable by /// the DiagnosticClient. /// /// \param Loc The source location we are interested in finding out the /// diagnostic state. Can be null in order to query the latest state. DiagnosticIDs::Level getDiagnosticLevel(unsigned DiagID, SourceLocation Loc, - const Diagnostic &Diag, + const DiagnosticsEngine &Diag, diag::Mapping *mapping = 0) const; /// getDiagnosticLevel - This is an internal implementation helper used when @@ -237,7 +238,7 @@ private: DiagnosticIDs::Level getDiagnosticLevel(unsigned DiagID, unsigned DiagClass, SourceLocation Loc, - const Diagnostic &Diag, + const DiagnosticsEngine &Diag, diag::Mapping *mapping = 0) const; /// ProcessDiag - This is the method used to report a diagnostic that is @@ -245,13 +246,13 @@ private: /// /// \returns true if the diagnostic was emitted, false if it was /// suppressed. - bool ProcessDiag(Diagnostic &Diag) const; + bool ProcessDiag(DiagnosticsEngine &Diag) const; /// \brief Whether the diagnostic may leave the AST in a state where some /// invariants can break. bool isUnrecoverable(unsigned DiagID) const; - friend class Diagnostic; + friend class DiagnosticsEngine; }; } // end namespace clang diff --git a/include/clang/Basic/PartialDiagnostic.h b/include/clang/Basic/PartialDiagnostic.h index 489b64e6f8..fac5580f85 100644 --- a/include/clang/Basic/PartialDiagnostic.h +++ b/include/clang/Basic/PartialDiagnostic.h @@ -195,7 +195,7 @@ public: { // Copy arguments. for (unsigned I = 0, N = Other.getNumArgs(); I != N; ++I) { - if (Other.getArgKind(I) == Diagnostic::ak_std_string) + if (Other.getArgKind(I) == DiagnosticsEngine::ak_std_string) AddString(Other.getArgStdStr(I)); else AddTaggedVal(Other.getRawArg(I), Other.getArgKind(I)); @@ -230,7 +230,7 @@ public: unsigned getDiagID() const { return DiagID; } - void AddTaggedVal(intptr_t V, Diagnostic::ArgumentKind Kind) const { + void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const { if (!DiagStorage) DiagStorage = getStorage(); @@ -247,7 +247,7 @@ public: assert(DiagStorage->NumDiagArgs < Storage::MaxArguments && "Too many arguments to diagnostic!"); DiagStorage->DiagArgumentsKind[DiagStorage->NumDiagArgs] - = Diagnostic::ak_std_string; + = DiagnosticsEngine::ak_std_string; DiagStorage->DiagArgumentsStr[DiagStorage->NumDiagArgs++] = V; } @@ -257,12 +257,12 @@ public: // Add all arguments. for (unsigned i = 0, e = DiagStorage->NumDiagArgs; i != e; ++i) { - if ((Diagnostic::ArgumentKind)DiagStorage->DiagArgumentsKind[i] - == Diagnostic::ak_std_string) + if ((DiagnosticsEngine::ArgumentKind)DiagStorage->DiagArgumentsKind[i] + == DiagnosticsEngine::ak_std_string) DB.AddString(DiagStorage->DiagArgumentsStr[i]); else DB.AddTaggedVal(DiagStorage->DiagArgumentsVal[i], - (Diagnostic::ArgumentKind)DiagStorage->DiagArgumentsKind[i]); + (DiagnosticsEngine::ArgumentKind)DiagStorage->DiagArgumentsKind[i]); } // Add all ranges. @@ -285,19 +285,20 @@ public: friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, unsigned I) { - PD.AddTaggedVal(I, Diagnostic::ak_uint); + PD.AddTaggedVal(I, DiagnosticsEngine::ak_uint); return PD; } friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, int I) { - PD.AddTaggedVal(I, Diagnostic::ak_sint); + PD.AddTaggedVal(I, DiagnosticsEngine::ak_sint); return PD; } friend inline const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, const char *S) { - PD.AddTaggedVal(reinterpret_cast<intptr_t>(S), Diagnostic::ak_c_string); + PD.AddTaggedVal(reinterpret_cast<intptr_t>(S), + DiagnosticsEngine::ak_c_string); return PD; } diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index 46fdbe5066..9178447a72 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -29,7 +29,7 @@ namespace clang { -class Diagnostic; +class DiagnosticsEngine; class SourceManager; class FileManager; class FileEntry; @@ -118,7 +118,7 @@ namespace SrcMgr { /// will be emitted at. /// /// \param Invalid If non-NULL, will be set \c true if an error occurred. - const llvm::MemoryBuffer *getBuffer(Diagnostic &Diag, + const llvm::MemoryBuffer *getBuffer(DiagnosticsEngine &Diag, const SourceManager &SM, SourceLocation Loc = SourceLocation(), bool *Invalid = 0) const; @@ -479,8 +479,8 @@ public: /// where the expanded token came from and the expansion location specifies /// where it was expanded. class SourceManager : public llvm::RefCountedBase<SourceManager> { - /// \brief Diagnostic object. - Diagnostic &Diag; + /// \brief DiagnosticsEngine object. + DiagnosticsEngine &Diag; FileManager &FileMgr; @@ -575,12 +575,12 @@ class SourceManager : public llvm::RefCountedBase<SourceManager> { explicit SourceManager(const SourceManager&); void operator=(const SourceManager&); public: - SourceManager(Diagnostic &Diag, FileManager &FileMgr); + SourceManager(DiagnosticsEngine &Diag, FileManager &FileMgr); ~SourceManager(); void clearIDTables(); - Diagnostic &getDiagnostics() const { return Diag; } + DiagnosticsEngine &getDiagnostics() const { return Diag; } FileManager &getFileManager() const { return FileMgr; } diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index aad72e35be..fbca54d6f1 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -32,7 +32,7 @@ struct fltSemantics; } namespace clang { -class Diagnostic; +class DiagnosticsEngine; class LangOptions; class MacroBuilder; class SourceLocation; @@ -98,7 +98,8 @@ public: /// \param Opts - The options to use to initialize the target. The target may /// modify the options to canonicalize the target feature information to match /// what the backend expects. - static TargetInfo* CreateTargetInfo(Diagnostic &Diags, TargetOptions &Opts); + static TargetInfo* CreateTargetInfo(DiagnosticsEngine &Diags, + TargetOptions &Opts); virtual ~TargetInfo(); diff --git a/include/clang/CodeGen/BackendUtil.h b/include/clang/CodeGen/BackendUtil.h index 5003d675b6..135b6a927f 100644 --- a/include/clang/CodeGen/BackendUtil.h +++ b/include/clang/CodeGen/BackendUtil.h @@ -17,7 +17,7 @@ namespace llvm { } namespace clang { - class Diagnostic; + class DiagnosticsEngine; class CodeGenOptions; class TargetOptions; class LangOptions; @@ -31,7 +31,7 @@ namespace clang { Backend_EmitObj ///< Emit native object files }; - void EmitBackendOutput(Diagnostic &Diags, const CodeGenOptions &CGOpts, + void EmitBackendOutput(DiagnosticsEngine &Diags, const CodeGenOptions &CGOpts, const TargetOptions &TOpts, const LangOptions &LOpts, llvm::Module *M, BackendAction Action, raw_ostream *OS); diff --git a/include/clang/CodeGen/ModuleBuilder.h b/include/clang/CodeGen/ModuleBuilder.h index c45ad08716..38aba89002 100644 --- a/include/clang/CodeGen/ModuleBuilder.h +++ b/include/clang/CodeGen/ModuleBuilder.h @@ -23,7 +23,7 @@ namespace llvm { } namespace clang { - class Diagnostic; + class DiagnosticsEngine; class LangOptions; class CodeGenOptions; @@ -36,7 +36,7 @@ namespace clang { /// CreateLLVMCodeGen - Create a CodeGenerator instance. /// It is the responsibility of the caller to call delete on /// the allocated CodeGenerator instance. - CodeGenerator *CreateLLVMCodeGen(Diagnostic &Diags, + CodeGenerator *CreateLLVMCodeGen(DiagnosticsEngine &Diags, const std::string &ModuleName, const CodeGenOptions &CGO, llvm::LLVMContext& C); diff --git a/include/clang/Driver/ArgList.h b/include/clang/Driver/ArgList.h index b31eea5b5b..04faf64dc5 100644 --- a/include/clang/Driver/ArgList.h +++ b/include/clang/Driver/ArgList.h @@ -21,7 +21,7 @@ #include <vector> namespace clang { - class Diagnostic; + class DiagnosticsEngine; namespace driver { class Arg; @@ -205,7 +205,7 @@ namespace driver { /// getLastArgValue - Return the value of the last argument as an integer, /// or a default. Emits an error if the argument is given, but non-integral. int getLastArgIntValue(OptSpecifier Id, int Default, - Diagnostic &Diags) const; + DiagnosticsEngine &Diags) const; /// getAllArgValues - Get the values of all instances of the given argument /// as strings. diff --git a/include/clang/Driver/Driver.h b/include/clang/Driver/Driver.h index bcb75b3a28..549893e6bf 100644 --- a/include/clang/Driver/Driver.h +++ b/include/clang/Driver/Driver.h @@ -47,7 +47,7 @@ namespace driver { class Driver { OptTable *Opts; - Diagnostic &Diags; + DiagnosticsEngine &Diags; public: // Diag - Forwarding function for diagnostics. @@ -190,7 +190,7 @@ public: StringRef _DefaultHostTriple, StringRef _DefaultImageName, bool IsProduction, bool CXXIsProduction, - Diagnostic &_Diags); + DiagnosticsEngine &_Diags); ~Driver(); /// @name Accessors @@ -202,7 +202,7 @@ public: const OptTable &getOpts() const { return *Opts; } - const Diagnostic &getDiags() const { return Diags; } + const DiagnosticsEngine &getDiags() const { return Diags; } bool getCheckInputsExist() const { return CheckInputsExist; } diff --git a/include/clang/Frontend/ASTConsumers.h b/include/clang/Frontend/ASTConsumers.h index dd6dd9ddb6..cef9509a97 100644 --- a/include/clang/Frontend/ASTConsumers.h +++ b/include/clang/Frontend/ASTConsumers.h @@ -23,7 +23,7 @@ namespace clang { class ASTConsumer; class CodeGenOptions; -class Diagnostic; +class DiagnosticsEngine; class FileManager; class LangOptions; class Preprocessor; diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index 37ae4e2932..86f9b0670e 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -46,7 +46,7 @@ class ASTReader; class CodeCompleteConsumer; class CompilerInvocation; class Decl; -class Diagnostic; +class DiagnosticsEngine; class FileEntry; class FileManager; class HeaderSearch; @@ -69,13 +69,13 @@ class GlobalCodeCompletionAllocator /// class ASTUnit : public ModuleLoader { private: - llvm::IntrusiveRefCntPtr<Diagnostic> Diagnostics; - llvm::IntrusiveRefCntPtr<FileManager> FileMgr; - llvm::IntrusiveRefCntPtr<SourceManager> SourceMgr; - llvm::OwningPtr<HeaderSearch> HeaderInfo; - llvm::IntrusiveRefCntPtr<TargetInfo> Target; - llvm::IntrusiveRefCntPtr<Preprocessor> PP; - llvm::IntrusiveRefCntPtr<ASTContext> Ctx; + llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diagnostics; + llvm::IntrusiveRefCntPtr<FileManager> FileMgr; + llvm::IntrusiveRefCntPtr<SourceManager> SourceMgr; + llvm::OwningPtr<HeaderSearch> HeaderInfo; + llvm::IntrusiveRefCntPtr<TargetInfo> Target; + llvm::IntrusiveRefCntPtr<Preprocessor> PP; + llvm::IntrusiveRefCntPtr<ASTContext> Ctx; FileSystemOptions FileSystemOpts; @@ -240,8 +240,8 @@ private: /// \brief The number of warnings that occurred while parsing the preamble. /// - /// This value will be used to restore the state of the \c Diagnostic object - /// when re-using the precompiled preamble. Note that only the + /// This value will be used to restore the state of the \c DiagnosticsEngine + /// object when re-using the precompiled preamble. Note that only the /// number of warnings matters, since we will not save the preamble /// when any errors are present. unsigned NumWarningsInPreamble; @@ -260,7 +260,7 @@ private: /// \brief The language options used when we load an AST file. LangOptions ASTFileLangOpts; - static void ConfigureDiags(llvm::IntrusiveRefCntPtr<Diagnostic> &Diags, + static void ConfigureDiags(llvm::IntrusiveRefCntPtr<DiagnosticsEngine> &Diags, const char **ArgBegin, const char **ArgEnd, ASTUnit &AST, bool CaptureDiagnostics); @@ -420,8 +420,8 @@ public: bool isUnsafeToFree() const { return UnsafeToFree; } void setUnsafeToFree(bool Value) { UnsafeToFree = Value; } - const Diagnostic &getDiagnostics() const { return *Diagnostics; } - Diagnostic &getDiagnostics() { return *Diagnostics; } + const DiagnosticsEngine &getDiagnostics() const { return *Diagnostics; } + DiagnosticsEngine &getDiagnostics() { return *Diagnostics; } const SourceManager &getSourceManager() const { return *SourceMgr; } SourceManager &getSourceManager() { return *SourceMgr; } @@ -563,7 +563,7 @@ public: /// \brief Create a ASTUnit. Gets ownership of the passed CompilerInvocation. static ASTUnit *create(CompilerInvocation *CI, - llvm::IntrusiveRefCntPtr<Diagnostic> Diags); + llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags); /// \brief Create a ASTUnit from an AST file. /// @@ -574,7 +574,7 @@ public: /// /// \returns - The initialized ASTUnit or null if the AST failed to load. static ASTUnit *LoadFromASTFile(const std::string &Filename, - llvm::IntrusiveRefCntPtr<Diagnostic> Diags, + llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags, const FileSystemOptions &FileSystemOpts, bool OnlyLocalDecls = false, RemappedFile *RemappedFiles = 0, @@ -606,7 +606,7 @@ public: /// \param Action - The ASTFrontendAction to invoke. Its ownership is not /// transfered. static ASTUnit *LoadFromCompilerInvocationAction(CompilerInvocation *CI, - llvm::IntrusiveRefCntPtr<Diagnostic> Diags, + llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags, ASTFrontendAction *Action = 0); /// LoadFromCompilerInvocation - Create an ASTUnit from a source file, via a @@ -621,7 +621,7 @@ public: // FIXME: Move OnlyLocalDecls, UseBumpAllocator to setters on the ASTUnit, we // shouldn't need to specify them at construction time. static ASTUnit *LoadFromCompilerInvocation(CompilerInvocation *CI, - llvm::IntrusiveRefCntPtr<Diagnostic> Diags, + llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags, bool OnlyLocalDecls = false, bool CaptureDiagnostics = false, bool PrecompilePreamble = false, @@ -645,7 +645,7 @@ public: // shouldn't need to specify them at construction time. static ASTUnit *LoadFromCommandLine(const char **ArgBegin, const char **ArgEnd, - llvm::IntrusiveRefCntPtr<Diagnostic> Diags, + llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags, StringRef ResourceFilesPath, bool OnlyLocalDecls = false, bool CaptureDiagnostics = false, @@ -686,7 +686,7 @@ public: RemappedFile *RemappedFiles, unsigned NumRemappedFiles, bool IncludeMacros, bool IncludeCodePatterns, CodeCompleteConsumer &Consumer, - Diagnostic &Diag, LangOptions &LangOpts, + DiagnosticsEngine &Diag, LangOptions &LangOpts, SourceManager &SourceMgr, FileManager &FileMgr, SmallVectorImpl<StoredDiagnostic> &StoredDiagnostics, SmallVectorImpl<const llvm::MemoryBuffer *> &OwnedBuffers); diff --git a/include/clang/Frontend/AnalyzerOptions.h b/include/clang/Frontend/AnalyzerOptions.h index b2da2c4891..20e4156ad6 100644 --- a/include/clang/Frontend/AnalyzerOptions.h +++ b/include/clang/Frontend/AnalyzerOptions.h @@ -20,7 +20,7 @@ namespace clang { class ASTConsumer; -class Diagnostic; +class DiagnosticsEngine; class Preprocessor; class LangOptions; diff --git a/include/clang/Frontend/ChainedDiagnosticClient.h b/include/clang/Frontend/ChainedDiagnosticClient.h index 70f21901db..cd513dc8a1 100644 --- a/include/clang/Frontend/ChainedDiagnosticClient.h +++ b/include/clang/Frontend/ChainedDiagnosticClient.h @@ -46,7 +46,7 @@ public: return Primary->IncludeInDiagnosticCounts(); } - virtual void HandleDiagnostic(Diagnostic::Level DiagLevel, + virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const DiagnosticInfo &Info) { // Default implementation (Warnings/errors count). DiagnosticClient::HandleDiagnostic(DiagLevel, Info); diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h index c61d6df196..1d204335f1 100644 --- a/include/clang/Frontend/CompilerInstance.h +++ b/include/clang/Frontend/CompilerInstance.h @@ -29,7 +29,7 @@ class ASTContext; class ASTConsumer; class ASTReader; class CodeCompleteConsumer; -class Diagnostic; +class DiagnosticsEngine; class DiagnosticClient; class ExternalASTSource; class FileManager; @@ -62,7 +62,7 @@ class CompilerInstance : public ModuleLoader { llvm::IntrusiveRefCntPtr<CompilerInvocation> Invocation; /// The diagnostics engine instance. - llvm::IntrusiveRefCntPtr<Diagnostic> Diagnostics; + llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diagnostics; /// The target being compiled for. llvm::IntrusiveRefCntPtr<TargetInfo> Target; @@ -252,13 +252,13 @@ public: bool hasDiagnostics() const { return Diagnostics != 0; } /// Get the current diagnostics engine. - Diagnostic &getDiagnostics() const { + DiagnosticsEngine &getDiagnostics() const { assert(Diagnostics && "Compiler instance has no diagnostics!"); return *Diagnostics; } /// setDiagnostics - Replace the current diagnostics engine. - void setDiagnostics(Diagnostic *Value); + void setDiagnostics(DiagnosticsEngine *Value); DiagnosticClient &getDiagnosticClient() const { assert(Diagnostics && Diagnostics->getClient() && @@ -455,7 +455,7 @@ public: /// allocating one if one is not provided. /// /// \param Client If non-NULL, a diagnostic client that will be - /// attached to (and, then, owned by) the Diagnostic inside this AST + /// attached to (and, then, owned by) the DiagnosticsEngine inside this AST /// unit. /// /// \param ShouldOwnClient If Client is non-NULL, specifies whether @@ -464,7 +464,7 @@ public: DiagnosticClient *Client = 0, bool ShouldOwnClient = true); - /// Create a Diagnostic object with a the TextDiagnosticPrinter. + /// Create a DiagnosticsEngine object with a the TextDiagnosticPrinter. /// /// The \arg Argc and \arg Argv arguments are used only for logging purposes, /// when the diagnostic options indicate that the compiler should output @@ -473,21 +473,21 @@ public: /// If no diagnostic client is provided, this creates a /// DiagnosticClient that is owned by the returned diagnostic /// object, if using directly the caller is responsible for - /// releasing the returned Diagnostic's client eventually. + /// releasing the returned DiagnosticsEngine's client eventually. /// /// \param Opts - The diagnostic options; note that the created text /// diagnostic object contains a reference to these options and its lifetime /// must extend past that of the diagnostic engine. /// /// \param Client If non-NULL, a diagnostic client that will be - /// attached to (and, then, owned by) the returned Diagnostic + /// attached to (and, then, owned by) the returned DiagnosticsEngine /// object. /// /// \param CodeGenOpts If non-NULL, the code gen options in use, which may be /// used by some diagnostics printers (for logging purposes only). /// /// \return The new object on success, or null on failure. - static llvm::IntrusiveRefCntPtr<Diagnostic> + static llvm::IntrusiveRefCntPtr<DiagnosticsEngine> createDiagnostics(const DiagnosticOptions &Opts, int Argc, const char* const *Argv, DiagnosticClient *Client = 0, @@ -612,7 +612,7 @@ public: /// /// \return True on success. static bool InitializeSourceManager(StringRef InputFile, - Diagnostic &Diags, + DiagnosticsEngine &Diags, FileManager &FileMgr, SourceManager &SourceMgr, const FrontendOptions &Opts); diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h index f09c97ec3f..47c70311dd 100644 --- a/include/clang/Frontend/CompilerInvocation.h +++ b/include/clang/Frontend/CompilerInvocation.h @@ -30,7 +30,7 @@ namespace clang { -class Diagnostic; +class DiagnosticsEngine; /// CompilerInvocation - Helper class for holding the data necessary to invoke /// the compiler. @@ -88,7 +88,7 @@ public: static void CreateFromArgs(CompilerInvocation &Res, const char* const *ArgBegin, const char* const *ArgEnd, - Diagnostic &Diags); + DiagnosticsEngine &Diags); /// GetBuiltinIncludePath - Get the directory where the compiler headers /// reside, relative to the compiler binary (found by the passed in diff --git a/include/clang/Frontend/DiagnosticOptions.h b/include/clang/Frontend/DiagnosticOptions.h index 5ae8eb3677..319abeb4fb 100644 --- a/include/clang/Frontend/DiagnosticOptions.h +++ b/include/clang/Frontend/DiagnosticOptions.h @@ -43,7 +43,7 @@ public: unsigned ShowColors : 1; /// Show diagnostics with ANSI color sequences. unsigned ShowOverloads : 1; /// Overload candidates to show. Values from - /// Diagnostic::OverloadsShown + /// DiagnosticsEngine::OverloadsShown unsigned VerifyDiagnostics: 1; /// Check that diagnostics match the expected /// diagnostics, indicated by markers in the /// input source file. @@ -82,7 +82,7 @@ public: PedanticErrors = 0; ShowCarets = 1; ShowColors = 0; - ShowOverloads = Diagnostic::Ovl_All; + ShowOverloads = DiagnosticsEngine::Ovl_All; ShowColumn = 1; ShowFixits = 1; ShowLocation = 1; diff --git a/include/clang/Frontend/LogDiagnosticPrinter.h b/include/clang/Frontend/LogDiagnosticPrinter.h index ee53a71d2f..7631bedf8c 100644 --- a/include/clang/Frontend/LogDiagnosticPrinter.h +++ b/include/clang/Frontend/LogDiagnosticPrinter.h @@ -37,7 +37,7 @@ class LogDiagnosticPrinter : public DiagnosticClient { unsigned DiagnosticID; /// The level of the diagnostic. - Diagnostic::Level DiagnosticLevel; + DiagnosticsEngine::Level DiagnosticLevel; }; raw_ostream &OS; @@ -68,7 +68,7 @@ public: void EndSourceFile(); - virtual void HandleDiagnostic(Diagnostic::Level DiagLevel, + virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const DiagnosticInfo &Info); }; diff --git a/include/clang/Frontend/TextDiagnosticBuffer.h b/include/clang/Frontend/TextDiagnosticBuffer.h index 380a1dd224..11564f6688 100644 --- a/include/clang/Frontend/TextDiagnosticBuffer.h +++ b/include/clang/Frontend/TextDiagnosticBuffer.h @@ -39,12 +39,12 @@ public: const_iterator note_begin() const { return Notes.begin(); } const_iterator note_end() const { return Notes.end(); } - virtual void HandleDiagnostic(Diagnostic::Level DiagLevel, + virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const DiagnosticInfo &Info); /// FlushDiagnostics - Flush the buffered diagnostics to an given /// diagnostic engine. - void FlushDiagnostics(Diagnostic &Diags) const; + void FlushDiagnostics(DiagnosticsEngine &Diags) const; }; } // end namspace clang diff --git a/include/clang/Frontend/TextDiagnosticPrinter.h b/include/clang/Frontend/TextDiagnosticPrinter.h index 52c95c9c2d..8369c7df58 100644 --- a/include/clang/Frontend/TextDiagnosticPrinter.h +++ b/include/clang/Frontend/TextDiagnosticPrinter.h @@ -53,14 +53,14 @@ public: LangOpts = 0; } - void PrintIncludeStack(Diagnostic::Level Level, SourceLocation Loc, + void PrintIncludeStack(DiagnosticsEngine::Level Level, SourceLocation Loc, const SourceManager &SM); - virtual void HandleDiagnostic(Diagnostic::Level Level, + virtual void HandleDiagnostic(DiagnosticsEngine::Level Level, const DiagnosticInfo &Info); private: - void EmitDiagnosticLoc(Diagnostic::Level Level, + void EmitDiagnosticLoc(DiagnosticsEngine::Level Level, const DiagnosticInfo &Info, const SourceManager &SM, PresumedLoc PLoc); diff --git a/include/clang/Frontend/Utils.h b/include/clang/Frontend/Utils.h index b3ecb363ba..929beb079e 100644 --- a/include/clang/Frontend/Utils.h +++ b/include/clang/Frontend/Utils.h @@ -31,7 +31,7 @@ class CompilerInstance; class CompilerInvocation; class Decl; class DependencyOutputOptions; -class Diagnostic; +class DiagnosticsEngine; class DiagnosticOptions; class FileManager; class HeaderSearch; @@ -66,7 +66,7 @@ void InitializePreprocessor(Preprocessor &PP, /// ProcessWarningOptions - Initialize the diagnostic client and process the /// warning options specified on the command line. -void ProcessWarningOptions(Diagnostic &Diags, const DiagnosticOptions &Opts); +void ProcessWarningOptions(DiagnosticsEngine &Diags, const DiagnosticOptions &Opts); /// DoPrintPreprocessedInput - Implement -E mode. void DoPrintPreprocessedInput(Preprocessor &PP, raw_ostream* OS, @@ -101,8 +101,8 @@ void CacheTokens(Preprocessor &PP, llvm::raw_fd_ostream* OS); /// argument vector. CompilerInvocation * createInvocationFromCommandLine(ArrayRef<const char *> Args, - llvm::IntrusiveRefCntPtr<Diagnostic> Diags = - llvm::IntrusiveRefCntPtr<Diagnostic>()); + llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags = + llvm::IntrusiveRefCntPtr<DiagnosticsEngine>()); } // end namespace clang diff --git a/include/clang/Frontend/VerifyDiagnosticsClient.h b/include/clang/Frontend/VerifyDiagnosticsClient.h index 0c789ff86d..df84ab46cb 100644 --- a/include/clang/Frontend/VerifyDiagnosticsClient.h +++ b/include/clang/Frontend/VerifyDiagnosticsClient.h @@ -15,7 +15,7 @@ namespace clang { -class Diagnostic; +class DiagnosticsEngine; class TextDiagnosticBuffer; /// VerifyDiagnosticsClient - Create a diagnostic client which will use markers @@ -64,7 +64,7 @@ class TextDiagnosticBuffer; /// class VerifyDiagnosticsClient : public DiagnosticClient { public: - Diagnostic &Diags; + DiagnosticsEngine &Diags; DiagnosticClient *PrimaryClient; bool OwnsPrimaryClient; llvm::OwningPtr<TextDiagnosticBuffer> Buffer; @@ -78,7 +78,7 @@ public: /// Create a new verifying diagnostic client, which will issue errors to \arg /// the currently-attached diagnostic client when a diagnostic does not match /// what is expected (as indicated in the source file). - VerifyDiagnosticsClient(Diagnostic &Diags); + VerifyDiagnosticsClient(DiagnosticsEngine &Diags); ~VerifyDiagnosticsClient(); virtual void BeginSourceFile(const LangOptions &LangOpts, @@ -86,7 +86,7 @@ public: virtual void EndSourceFile(); - virtual void HandleDiagnostic(Diagnostic::Level DiagLevel, + virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const DiagnosticInfo &Info); }; diff --git a/include/clang/Index/TranslationUnit.h b/include/clang/Index/TranslationUnit.h index 0099d630f1..ba5d48d373 100644 --- a/include/clang/Index/TranslationUnit.h +++ b/include/clang/Index/TranslationUnit.h @@ -16,7 +16,7 @@ namespace clang { class ASTContext; - class Diagnostic; + class DiagnosticsEngine; class Preprocessor; namespace idx { @@ -29,7 +29,7 @@ public: virtual ~TranslationUnit(); virtual ASTContext &getASTContext() = 0; virtual Preprocessor &getPreprocessor() = 0; - virtual Diagnostic &getDiagnostic() = 0; + virtual DiagnosticsEngine &getDiagnostic() = 0; virtual DeclReferenceMap &getDeclReferenceMap() = 0; virtual SelectorMap &getSelectorMap() = 0; }; diff --git a/include/clang/Lex/Lexer.h b/include/clang/Lex/Lexer.h index 65ade1f360..e67013c10e 100644 --- a/include/clang/Lex/Lexer.h +++ b/include/clang/Lex/Lexer.h @@ -21,7 +21,7 @@ #include <cassert> namespace clang { -class Diagnostic; +class DiagnosticsEngine; class SourceManager; class Preprocessor; class DiagnosticBuilder; diff --git a/include/clang/Lex/LiteralSupport.h b/include/clang/Lex/LiteralSupport.h index 5d7feb3a1a..b33092c753 100644 --- a/include/clang/Lex/LiteralSupport.h +++ b/include/clang/Lex/LiteralSupport.h @@ -24,7 +24,7 @@ namespace clang { -class Diagnostic; +class DiagnosticsEngine; class Preprocessor; class Token; class SourceLocation; @@ -149,7 +149,7 @@ class StringLiteralParser { const SourceManager &SM; const LangOptions &Features; const TargetInfo &Target; - Diagnostic *Diags; + DiagnosticsEngine *Diags; unsigned MaxTokenLength; unsigned SizeBound; @@ -162,7 +162,7 @@ public: Preprocessor &PP, bool Complain = true); StringLiteralParser(const Token *StringToks, unsigned NumStringToks, const SourceManager &sm, const LangOptions &features, - const TargetInfo &target, Diagnostic *diags = 0) + const TargetInfo &target, DiagnosticsEngine *diags = 0) : SM(sm), Features(features), Target(target), Diags(diags), MaxTokenLength(0), SizeBound(0), CharByteWidth(0), Kind(tok::unknown), ResultPtr(ResultBuf.data()), hadError(false), Pascal(false) { diff --git a/include/clang/Lex/PTHManager.h b/include/clang/Lex/PTHManager.h index c6242112d0..25a49038a8 100644 --- a/include/clang/Lex/PTHManager.h +++ b/include/clang/Lex/PTHManager.h @@ -30,7 +30,7 @@ namespace clang { class FileEntry; class PTHLexer; -class Diagnostic; +class DiagnosticsEngine; class FileSystemStatCache; class PTHManager : public IdentifierInfoLookup { @@ -119,7 +119,7 @@ public: /// Create - This method creates PTHManager objects. The 'file' argument /// is the name of the PTH file. This method returns NULL upon failure. - static PTHManager *Create(const std::string& file, Diagnostic &Diags); + static PTHManager *Create(const std::string& file, DiagnosticsEngine &Diags); void setPreprocessor(Preprocessor *pp) { PP = pp; } diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index fc0e98b8b8..8123f57726 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -57,7 +57,7 @@ class ModuleLoader; /// like the #include stack, token expansion, etc. /// class Preprocessor : public llvm::RefCountedBase<Preprocessor> { - Diagnostic *Diags; + DiagnosticsEngine *Diags; LangOptions &Features; const TargetInfo *Target; FileManager &FileMgr; @@ -322,7 +322,7 @@ private: // Cached tokens state. MacroInfo *getInfoForMacro(IdentifierInfo *II) const; public: - Preprocessor(Diagnostic &diags, LangOptions &opts, + Preprocessor(DiagnosticsEngine &diags, LangOptions &opts, const TargetInfo *target, SourceManager &SM, HeaderSearch &Headers, ModuleLoader &TheModuleLoader, @@ -338,8 +338,8 @@ public: /// \param Target Information about the target. void Initialize(const TargetInfo &Target); - Diagnostic &getDiagnostics() const { return *Diags; } - void setDiagnostics(Diagnostic &D) { Diags = &D; } + DiagnosticsEngine &getDiagnostics() const { return *Diags; } + void setDiagnostics(DiagnosticsEngine &D) { Diags = &D; } const LangOptions &getLangOptions() const { return Features; } const TargetInfo &getTargetInfo() const { return *Target; } diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index 2234920597..afcfda0425 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -99,7 +99,7 @@ class Parser : public CodeCompletionHandler { /// in the file. Sema &Actions; - Diagnostic &Diags; + DiagnosticsEngine &Diags; /// ScopeCache - Cache scopes to reduce malloc traffic. enum { ScopeCacheSize = 16 }; diff --git a/include/clang/Rewrite/ASTConsumers.h b/include/clang/Rewrite/ASTConsumers.h index da5153c61f..7a636e5369 100644 --- a/include/clang/Rewrite/ASTConsumers.h +++ b/include/clang/Rewrite/ASTConsumers.h @@ -20,7 +20,7 @@ namespace clang { class ASTConsumer; -class Diagnostic; +class DiagnosticsEngine; class LangOptions; class Preprocessor; @@ -28,7 +28,7 @@ class Preprocessor; // This is considered experimental, and only works with Apple's ObjC runtime. ASTConsumer *CreateObjCRewriter(const std::string &InFile, raw_ostream *OS, - Diagnostic &Diags, + DiagnosticsEngine &Diags, const LangOptions &LOpts, bool SilenceRewriteMacroWarning); diff --git a/include/clang/Rewrite/FixItRewriter.h b/include/clang/Rewrite/FixItRewriter.h index f96d307f72..649e7f61cc 100644 --- a/include/clang/Rewrite/FixItRewriter.h +++ b/include/clang/Rewrite/FixItRewriter.h @@ -38,7 +38,7 @@ public: class FixItRewriter : public DiagnosticClient { /// \brief The diagnostics machinery. - Diagnostic &Diags; + DiagnosticsEngine &Diags; /// \brief The rewriter used to perform the various code /// modifications. @@ -59,7 +59,7 @@ public: typedef Rewriter::buffer_iterator iterator; /// \brief Initialize a new fix-it rewriter. - FixItRewriter(Diagnostic &Diags, SourceManager &SourceMgr, + FixItRewriter(DiagnosticsEngine &Diags, SourceManager &SourceMgr, const LangOptions &LangOpts, FixItOptions *FixItOpts); /// \brief Destroy the fix-it rewriter. @@ -87,12 +87,12 @@ public: /// IncludeInDiagnosticCounts - This method (whose default implementation /// returns true) indicates whether the diagnostics handled by this /// DiagnosticClient should be included in the number of diagnostics - /// reported by Diagnostic. + /// reported by DiagnosticsEngine. virtual bool IncludeInDiagnosticCounts() const; /// HandleDiagnostic - Handle this diagnostic, reporting it to the user or /// capturing it to a log as needed. - virtual void HandleDiagnostic(Diagnostic::Level DiagLevel, + virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const DiagnosticInfo &Info); /// \brief Emit a diagnostic via the adapted diagnostic client. diff --git a/include/clang/Sema/DeclSpec.h b/include/clang/Sema/DeclSpec.h index 392284f8d5..0c357f1e66 100644 --- a/include/clang/Sema/DeclSpec.h +++ b/include/clang/Sema/DeclSpec.h @@ -34,7 +34,7 @@ namespace clang { class ASTContext; class TypeLoc; class LangOptions; - class Diagnostic; + class DiagnosticsEngine; class IdentifierInfo; class NamespaceAliasDecl; class NamespaceDecl; @@ -661,7 +661,7 @@ public: /// Finish - This does final analysis of the declspec, issuing diagnostics for /// things like "_Imaginary" (lacking an FP type). After calling this method, /// DeclSpec is guaranteed self-consistent, even if an error occurred. - void Finish(Diagnostic &D, Preprocessor &PP); + void Finish(DiagnosticsEngine &D, Preprocessor &PP); const WrittenBuiltinSpecs& getWrittenBuiltinSpecs() const { return writtenBS; diff --git a/include/clang/Sema/Scope.h b/include/clang/Sema/Scope.h index 359cc062f2..cff8b3338d 100644 --- a/include/clang/Sema/Scope.h +++ b/include/clang/Sema/Scope.h @@ -156,7 +156,7 @@ private: DiagnosticErrorTrap ErrorTrap; public: - Scope(Scope *Parent, unsigned ScopeFlags, Diagnostic &Diag) + Scope(Scope *Parent, unsigned ScopeFlags, DiagnosticsEngine &Diag) : ErrorTrap(Diag) { Init(Parent, ScopeFlags); } diff --git a/include/clang/Sema/ScopeInfo.h b/include/clang/Sema/ScopeInfo.h index 52b42a8b71..9ef6d3c4b3 100644 --- a/include/clang/Sema/ScopeInfo.h +++ b/include/clang/Sema/ScopeInfo.h @@ -95,7 +95,7 @@ public: (HasBranchProtectedScope && HasBranchIntoScope); } - FunctionScopeInfo(Diagnostic &Diag) + FunctionScopeInfo(DiagnosticsEngine &Diag) : IsBlockInfo(false), HasBranchProtectedScope(false), HasBranchIntoScope(false), @@ -137,7 +137,7 @@ public: /// CapturesCXXThis - Whether this block captures 'this'. bool CapturesCXXThis; - BlockScopeInfo(Diagnostic &Diag, Scope *BlockScope, BlockDecl *Block) + BlockScopeInfo(DiagnosticsEngine &Diag, Scope *BlockScope, BlockDecl *Block) : FunctionScopeInfo(Diag), TheDecl(Block), TheScope(BlockScope), CapturesCXXThis(false) { diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index e52d2fefbc..aefa031a72 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -187,7 +187,7 @@ public: Preprocessor &PP; ASTContext &Context; ASTConsumer &Consumer; - Diagnostic &Diags; + DiagnosticsEngine &Diags; SourceManager &SourceMgr; /// \brief Flag indicating whether or not to collect detailed statistics. @@ -694,7 +694,7 @@ public: OpenCLOptions &getOpenCLOptions() { return OpenCLFeatures; } FPOptions &getFPOptions() { return FPFeatures; } - Diagnostic &getDiagnostics() const { return Diags; } + DiagnosticsEngine &getDiagnostics() const { return Diags; } SourceManager &getSourceManager() const { return SourceMgr; } const TargetAttributesSema &getTargetAttributesSema() const; Preprocessor &getPreprocessor() const { return PP; } diff --git a/include/clang/Sema/Template.h b/include/clang/Sema/Template.h index e68daed91f..78f50fa9ff 100644 --- a/include/clang/Sema/Template.h +++ b/include/clang/Sema/Template.h @@ -374,7 +374,7 @@ namespace clang { // Base case. FIXME: Remove once we can instantiate everything. Decl *VisitDecl(Decl *D) { unsigned DiagID = SemaRef.getDiagnostics().getCustomDiagID( - Diagnostic::Error, + DiagnosticsEngine::Error, "cannot instantiate %0 yet"); SemaRef.Diag(D->getLocation(), DiagID) << D->getDeclKindName(); diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h index 1061ed05b5..996a134659 100644 --- a/include/clang/Serialization/ASTReader.h +++ b/include/clang/Serialization/ASTReader.h @@ -223,7 +223,7 @@ private: SourceManager &SourceMgr; FileManager &FileMgr; - Diagnostic &Diags; + DiagnosticsEngine &Diags; /// \brief The semantic analysis object that will be processing the /// AST files and the translation unit that uses it. @@ -412,7 +412,7 @@ private: //@} - /// \name Diagnostic-relevant special data + /// \name DiagnosticsEngine-relevant special data /// \brief Fields containing data that is used for generating diagnostics //@{ @@ -783,7 +783,7 @@ public: /// the AST file, without actually loading the AST file. static std::string getOriginalSourceFile(const std::string &ASTFileName, FileManager &FileMgr, - Diagnostic &Diags); + DiagnosticsEngine &Diags); /// \brief Returns the suggested contents of the predefines buffer, /// which contains a (typically-empty) subset of the predefines @@ -804,7 +804,7 @@ public: /// \brief Read the header file information for the given file entry. virtual HeaderFileInfo GetHeaderFileInfo(const FileEntry *FE); - void ReadPragmaDiagnosticMappings(Diagnostic &Diag); + void ReadPragmaDiagnosticMappings(DiagnosticsEngine &Diag); /// \brief Returns the number of source locations found in the chain. unsigned getTotalNumSLocs() const { diff --git a/include/clang/Serialization/ASTWriter.h b/include/clang/Serialization/ASTWriter.h index b8ac8fa183..7a49e485f2 100644 --- a/include/clang/Serialization/ASTWriter.h +++ b/include/clang/Serialization/ASTWriter.h @@ -344,7 +344,7 @@ private: void WritePreprocessor(const Preprocessor &PP, bool IsModule); void WriteHeaderSearch(HeaderSearch &HS, StringRef isysroot); void WritePreprocessorDetail(PreprocessingRecord &PPRec); - void WritePragmaDiagnosticMappings(const Diagnostic &Diag); + void WritePragmaDiagnosticMappings(const DiagnosticsEngine &Diag); void WriteCXXBaseSpecifiersOffsets(); void WriteType(QualType T); uint64_t WriteDeclContextLexicalBlock(ASTContext &Context, DeclContext *DC); diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h index 66542550bc..91355fb4b4 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h @@ -28,7 +28,7 @@ namespace clang { class ASTContext; -class Diagnostic; +class DiagnosticsEngine; class Stmt; class ParentMap; @@ -217,7 +217,7 @@ public: class BugReporterData { public: virtual ~BugReporterData(); - virtual Diagnostic& getDiagnostic() = 0; + virtual DiagnosticsEngine& getDiagnostic() = 0; virtual PathDiagnosticClient* getPathDiagnosticClient() = 0; virtual ASTContext &getASTContext() = 0; virtual SourceManager& getSourceManager() = 0; @@ -260,7 +260,7 @@ public: Kind getKind() const { return kind; } - Diagnostic& getDiagnostic() { + DiagnosticsEngine& getDiagnostic() { return D.getDiagnostic(); } diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h b/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h index 49b7063b35..47c12cbd5d 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h @@ -34,7 +34,7 @@ class AnalysisManager : public BugReporterData { LocationContextManager LocCtxMgr; ASTContext &Ctx; - Diagnostic &Diags; + DiagnosticsEngine &Diags; const LangOptions &LangInfo; llvm::OwningPtr<PathDiagnosticClient> PD; @@ -75,7 +75,7 @@ class AnalysisManager : public BugReporterData { bool EagerlyTrimEGraph; public: - AnalysisManager(ASTContext &ctx, Diagnostic &diags, + AnalysisManager(ASTContext &ctx, DiagnosticsEngine &diags, const LangOptions &lang, PathDiagnosticClient *pd, StoreManagerCreator storemgr, ConstraintManagerCreator constraintmgr, @@ -118,7 +118,7 @@ public: return getASTContext().getSourceManager(); } - virtual Diagnostic &getDiagnostic() { + virtual DiagnosticsEngine &getDiagnostic() { return Diags; } diff --git a/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h b/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h index d662e2cb98..492edd4ccb 100644 --- a/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h +++ b/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h @@ -16,7 +16,7 @@ namespace clang { class AnalyzerOptions; class LangOptions; - class Diagnostic; + class DiagnosticsEngine; namespace ento { class CheckerManager; @@ -24,7 +24,7 @@ namespace ento { CheckerManager *createCheckerManager(const AnalyzerOptions &opts, const LangOptions &langOpts, ArrayRef<std::string> plugins, - Diagnostic &diags); + DiagnosticsEngine &diags); } // end ento namespace |