diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-08-24 13:14:02 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-08-24 13:14:02 +0000 |
| commit | bf667e23d113319bc2161879a0f588ba6509105c (patch) | |
| tree | 507f5a9bd711559d98645a4386fddd2823969ef3 /clang/lib | |
| parent | 26da1f46e4c892d3705a12fb7667637e4af4259a (diff) | |
| download | bcm5719-llvm-bf667e23d113319bc2161879a0f588ba6509105c.tar.gz bcm5719-llvm-bf667e23d113319bc2161879a0f588ba6509105c.zip | |
Pass SourceRanges by reference to the various Diag methods.
llvm-svn: 55284
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Parse/Parser.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Sema/Sema.cpp | 15 | ||||
| -rw-r--r-- | clang/lib/Sema/Sema.h | 15 |
3 files changed, 17 insertions, 15 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index c6b0a80e02e..7598ff79969 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -39,7 +39,7 @@ bool Parser::Diag(SourceLocation Loc, unsigned DiagID, } bool Parser::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg, - SourceRange Range) { + const SourceRange& Range) { Diags.Report(PP.getFullLoc(Loc), DiagID, &Msg, 1, &Range,1); return true; } diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index fa8ba5953cf..30ada28d8bc 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -160,19 +160,19 @@ bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1, return true; } -bool Sema::Diag(SourceLocation Loc, unsigned DiagID, SourceRange Range) { +bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const SourceRange& Range) { 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) { + const SourceRange& Range) { 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) { + const std::string &Msg2, const SourceRange& Range) { std::string MsgArr[] = { Msg1, Msg2 }; PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, MsgArr, 2, &Range, 1); return true; @@ -180,28 +180,29 @@ bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1, bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1, const std::string &Msg2, const std::string &Msg3, - SourceRange R1) { + const SourceRange& R1) { std::string MsgArr[] = { Msg1, Msg2, Msg3 }; PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, MsgArr, 3, &R1, 1); return true; } bool Sema::Diag(SourceLocation Loc, unsigned DiagID, - SourceRange R1, SourceRange R2) { + const SourceRange& R1, const SourceRange& R2) { SourceRange RangeArr[] = { R1, R2 }; 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) { + const SourceRange& R1, const SourceRange& R2) { SourceRange RangeArr[] = { R1, R2 }; PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID, &Msg, 1, RangeArr, 2); return true; } bool Sema::Diag(SourceLocation Range, unsigned DiagID, const std::string &Msg1, - const std::string &Msg2, SourceRange R1, SourceRange R2) { + const std::string &Msg2, const SourceRange& R1, + const SourceRange& R2) { std::string MsgArr[] = { Msg1, Msg2 }; SourceRange RangeArr[] = { R1, R2 }; PP.getDiagnostics().Report(PP.getFullLoc(Range),DiagID, MsgArr,2,RangeArr, 2); diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index c5ab94a7e4c..4bfbcb9939a 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -179,20 +179,21 @@ public: const std::string &Msg2); /// More expressive diagnostic helpers for expressions (say that 6 times:-) - bool Diag(SourceLocation Loc, unsigned DiagID, SourceRange R1); + bool Diag(SourceLocation Loc, unsigned DiagID, const SourceRange& R1); bool Diag(SourceLocation Loc, unsigned DiagID, - SourceRange R1, SourceRange R2); + const SourceRange& R1, const SourceRange& R2); bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg, - SourceRange R1); + const SourceRange& R1); bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg, - SourceRange R1, SourceRange R2); + const SourceRange& R1, const SourceRange& R2); bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1, - const std::string &Msg2, SourceRange R1); + const std::string &Msg2, const SourceRange& R1); bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1, - const std::string &Msg2, const std::string &Msg3, SourceRange R1); + const std::string &Msg2, const std::string &Msg3, + const SourceRange& R1); bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1, const std::string &Msg2, - SourceRange R1, SourceRange R2); + const SourceRange& R1, const SourceRange& R2); virtual void DeleteExpr(ExprTy *E); virtual void DeleteStmt(StmtTy *S); |

