diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2010-04-02 01:39:03 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2010-04-02 01:39:03 +0000 |
commit | 47c24b1d94f446c43e3a64732867eabed7d9c961 (patch) | |
tree | b70b71cc2714a1c84e6493aa8c78d893f68294f1 /include/clang/Basic/PartialDiagnostic.h | |
parent | 7bbe5f6bfc2e9c79c7c692a1cf03de56662aa14b (diff) |
Resolve a layering violation by making AddTaggedVal public for
PartialDiagnostic objects, and hoisting the stream operator for QualType into
Type.h with the operator for the normal DiagnosticBuilder. Also remove the no
longer needed friend declaration for the DeclarationName stream operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100169 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/PartialDiagnostic.h')
-rw-r--r-- | include/clang/Basic/PartialDiagnostic.h | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/include/clang/Basic/PartialDiagnostic.h b/include/clang/Basic/PartialDiagnostic.h index de858eadb6..89fae87ae8 100644 --- a/include/clang/Basic/PartialDiagnostic.h +++ b/include/clang/Basic/PartialDiagnostic.h @@ -15,7 +15,6 @@ #ifndef LLVM_CLANG_PARTIALDIAGNOSTIC_H #define LLVM_CLANG_PARTIALDIAGNOSTIC_H -#include "clang/AST/Type.h" #include "clang/Basic/Diagnostic.h" #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/STLExtras.h" @@ -24,8 +23,6 @@ namespace clang { -class DeclarationName; - class PartialDiagnostic { public: struct Storage { @@ -145,16 +142,6 @@ private: DiagStorage = 0; } - void AddTaggedVal(intptr_t V, Diagnostic::ArgumentKind Kind) const { - if (!DiagStorage) - DiagStorage = getStorage(); - - assert(DiagStorage->NumDiagArgs < Storage::MaxArguments && - "Too many arguments to diagnostic!"); - DiagStorage->DiagArgumentsKind[DiagStorage->NumDiagArgs] = Kind; - DiagStorage->DiagArgumentsVal[DiagStorage->NumDiagArgs++] = V; - } - void AddSourceRange(const SourceRange &R) const { if (!DiagStorage) DiagStorage = getStorage(); @@ -219,6 +206,16 @@ public: unsigned getDiagID() const { return DiagID; } + void AddTaggedVal(intptr_t V, Diagnostic::ArgumentKind Kind) const { + if (!DiagStorage) + DiagStorage = getStorage(); + + assert(DiagStorage->NumDiagArgs < Storage::MaxArguments && + "Too many arguments to diagnostic!"); + DiagStorage->DiagArgumentsKind[DiagStorage->NumDiagArgs] = Kind; + DiagStorage->DiagArgumentsVal[DiagStorage->NumDiagArgs++] = V; + } + void Emit(const DiagnosticBuilder &DB) const { if (!DiagStorage) return; @@ -248,13 +245,6 @@ public: bool hasStorage() const { return DiagStorage != 0; } friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, - QualType T) { - PD.AddTaggedVal(reinterpret_cast<intptr_t>(T.getAsOpaquePtr()), - Diagnostic::ak_qualtype); - return PD; - } - - friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, unsigned I) { PD.AddTaggedVal(I, Diagnostic::ak_uint); return PD; @@ -279,9 +269,6 @@ public: } friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, - DeclarationName N); - - friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, const FixItHint &Hint) { PD.AddFixItHint(Hint); return PD; |