aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-11-18 20:06:41 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-11-18 20:06:41 +0000
commit33e4e70c8c0a17e0ccb7465d96556b077a68ecb1 (patch)
tree7f65080a9221d10495e43911e7bbaeb2724084f7 /lib/Sema/Sema.cpp
parent9313aac61d425f14fa0b82c3dfe1eb2c3626d38c (diff)
Refactoring of Diagnostic class.
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units. -The rest of the state in Diagnostic object is considered related and tied to one translation unit. -Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a SourceLocation instead of a FullSourceLoc. -Reflect the changes to various interfaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119730 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 042f605cf0..8c1d5f449c 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -438,12 +438,12 @@ Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() {
return;
if (TemplateDeductionInfo *Info = SemaRef.isSFINAEContext()) {
- switch (Diagnostic::getDiagnosticSFINAEResponse(getDiagID())) {
- case Diagnostic::SFINAE_Report:
+ switch (DiagnosticIDs::getDiagnosticSFINAEResponse(getDiagID())) {
+ case DiagnosticIDs::SFINAE_Report:
// Fall through; we'll report the diagnostic below.
break;
- case Diagnostic::SFINAE_SubstitutionFailure:
+ case DiagnosticIDs::SFINAE_SubstitutionFailure:
// Count this failure so that we know that template argument deduction
// has failed.
++SemaRef.NumSFINAEErrors;
@@ -452,7 +452,7 @@ Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() {
Clear();
return;
- case Diagnostic::SFINAE_Suppress:
+ case DiagnosticIDs::SFINAE_Suppress:
// Make a copy of this suppressed diagnostic and store it with the
// template-deduction information;
FlushCounts();
@@ -478,7 +478,7 @@ Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() {
// that is different from the last template instantiation where
// we emitted an error, print a template instantiation
// backtrace.
- if (!SemaRef.Diags.isBuiltinNote(DiagID) &&
+ if (!DiagnosticIDs::isBuiltinNote(DiagID) &&
!SemaRef.ActiveTemplateInstantiations.empty() &&
SemaRef.ActiveTemplateInstantiations.back()
!= SemaRef.LastTemplateInstantiationErrorContext) {
@@ -489,7 +489,7 @@ Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() {
}
Sema::SemaDiagnosticBuilder Sema::Diag(SourceLocation Loc, unsigned DiagID) {
- DiagnosticBuilder DB = Diags.Report(FullSourceLoc(Loc, SourceMgr), DiagID);
+ DiagnosticBuilder DB = Diags.Report(Loc, DiagID);
return SemaDiagnosticBuilder(DB, *this, DiagID);
}