diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-12-12 22:39:36 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-12-12 22:39:36 +0000 |
commit | 1daa3cfbae60569c33a0c695f10fb4ccf243a173 (patch) | |
tree | ca998daf9a0daf346031c7619359511c22ef4bef /clang/Sema/Sema.cpp | |
parent | f44cb63859352415ea2a1b3a04b51131eacf1d1f (diff) | |
download | bcm5719-llvm-1daa3cfbae60569c33a0c695f10fb4ccf243a173.tar.gz bcm5719-llvm-1daa3cfbae60569c33a0c695f10fb4ccf243a173.zip |
TargetInfo no longer includes a reference to SourceManager.
Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation.
Added many utility methods to FullSourceLoc to provide shorthand for:
FullLoc.getManager().someMethod(FullLoc.getLocation());
instead we have:
FullLoc.someMethod();
Modified TextDiagnostics (and related classes) to use this short-hand.
llvm-svn: 44957
Diffstat (limited to 'clang/Sema/Sema.cpp')
-rw-r--r-- | clang/Sema/Sema.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/clang/Sema/Sema.cpp b/clang/Sema/Sema.cpp index 5ec5fa7ede4..3f5b24f37c1 100644 --- a/clang/Sema/Sema.cpp +++ b/clang/Sema/Sema.cpp @@ -118,54 +118,51 @@ void Sema::DeleteStmt(StmtTy *S) { //===----------------------------------------------------------------------===// bool Sema::Diag(SourceLocation Loc, unsigned DiagID) { - PP.getDiagnostics().Report(Loc, DiagID, PP.getSourceManager()); + PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID); return true; } bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg) { - PP.getDiagnostics().Report(Loc, DiagID, PP.getSourceManager(), &Msg, 1); + PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, &Msg, 1); return true; } bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1, const std::string &Msg2) { std::string MsgArr[] = { Msg1, Msg2 }; - PP.getDiagnostics().Report(Loc, DiagID, PP.getSourceManager(), MsgArr, 2); + PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, MsgArr, 2); return true; } bool Sema::Diag(SourceLocation Loc, unsigned DiagID, SourceRange Range) { - PP.getDiagnostics().Report(Loc, DiagID, PP.getSourceManager(), 0,0, &Range,1); + PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, 0, 0, &Range,1); return true; } bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg, SourceRange Range) { - PP.getDiagnostics().Report(Loc,DiagID,PP.getSourceManager(),&Msg,1,&Range,1); + PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, &Msg, 1, &Range,1); return true; } bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1, const std::string &Msg2, SourceRange Range) { std::string MsgArr[] = { Msg1, Msg2 }; - PP.getDiagnostics().Report(Loc,DiagID,PP.getSourceManager(), - MsgArr,2,&Range,1); + PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, MsgArr, 2, &Range, 1); return true; } bool Sema::Diag(SourceLocation Loc, unsigned DiagID, SourceRange R1, SourceRange R2) { SourceRange RangeArr[] = { R1, R2 }; - PP.getDiagnostics().Report(Loc, DiagID, PP.getSourceManager(), - 0, 0, RangeArr, 2); + PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, 0, 0, RangeArr, 2); return true; } bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg, SourceRange R1, SourceRange R2) { SourceRange RangeArr[] = { R1, R2 }; - PP.getDiagnostics().Report(Loc, DiagID, PP.getSourceManager(), &Msg, - 1, RangeArr, 2); + PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, &Msg, 1, RangeArr, 2); return true; } @@ -173,8 +170,7 @@ bool Sema::Diag(SourceLocation Range, unsigned DiagID, const std::string &Msg1, const std::string &Msg2, SourceRange R1, SourceRange R2) { std::string MsgArr[] = { Msg1, Msg2 }; SourceRange RangeArr[] = { R1, R2 }; - PP.getDiagnostics().Report(Range, DiagID, PP.getSourceManager(), MsgArr, 2, - RangeArr, 2); + PP.getDiagnostics().Report(PP.getFullLoc(Range),DiagID, MsgArr,2,RangeArr, 2); return true; } |