diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-11-18 20:06:41 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-11-18 20:06:41 +0000 |
| commit | d00406486421143c5e4eb79f9ce97e30442b1ab2 (patch) | |
| tree | eb2ff8461358578c978f17ddfa7f597b9f6a1022 /clang/lib/CodeGen | |
| parent | 4fadc5b20a3afbad542e0841692dc851d0507136 (diff) | |
| download | bcm5719-llvm-d00406486421143c5e4eb79f9ce97e30442b1ab2.tar.gz bcm5719-llvm-d00406486421143c5e4eb79f9ce97e30442b1ab2.zip | |
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.
llvm-svn: 119730
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CodeGenAction.cpp | 5 | ||||
| -rw-r--r-- | clang/lib/CodeGen/Mangle.cpp | 6 |
3 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 29276c3636b..cc5b1986a9c 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1529,7 +1529,7 @@ llvm::DIType CGDebugInfo::CreateTypeNode(QualType Ty, assert(Diag && "Fall through without a diagnostic?"); unsigned DiagID = CGM.getDiags().getCustomDiagID(Diagnostic::Error, "debug information for %0 is not yet supported"); - CGM.getDiags().Report(FullSourceLoc(), DiagID) + CGM.getDiags().Report(DiagID) << Diag; return llvm::DIType(); } diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index 6614531779c..9660e68c707 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -209,8 +209,7 @@ void BackendConsumer::InlineAsmDiagHandler2(const llvm::SMDiagnostic &D, // issue as being an error in the source with a note showing the instantiated // code. if (LocCookie.isValid()) { - Diags.Report(FullSourceLoc(LocCookie, Context->getSourceManager()), - diag::err_fe_inline_asm).AddString(Message); + Diags.Report(LocCookie, diag::err_fe_inline_asm).AddString(Message); if (D.getLoc().isValid()) Diags.Report(Loc, diag::note_fe_inline_asm_here); @@ -318,7 +317,7 @@ void CodeGenAction::ExecuteAction() { unsigned DiagID = CI.getDiagnostics().getCustomDiagID(Diagnostic::Error, Msg); - CI.getDiagnostics().Report(FullSourceLoc(Loc, SM), DiagID); + CI.getDiagnostics().Report(Loc, DiagID); return; } diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp index 602c5f065fb..b240103639f 100644 --- a/clang/lib/CodeGen/Mangle.cpp +++ b/clang/lib/CodeGen/Mangle.cpp @@ -525,7 +525,7 @@ void CXXNameMangler::mangleUnscopedTemplateName(TemplateName Template) { Diagnostic &Diags = Context.getDiags(); unsigned DiagID = Diags.getCustomDiagID(Diagnostic::Error, "cannot mangle dependent operator name"); - Diags.Report(FullSourceLoc(), DiagID); + Diags.Report(DiagID); return; } @@ -1672,9 +1672,7 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) { Diagnostic &Diags = Context.getDiags(); unsigned DiagID = Diags.getCustomDiagID(Diagnostic::Error, "cannot yet mangle expression type %0"); - Diags.Report(FullSourceLoc(E->getExprLoc(), - getASTContext().getSourceManager()), - DiagID) + Diags.Report(E->getExprLoc(), DiagID) << E->getStmtClassName() << E->getSourceRange(); break; } |

