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 | a88b509d233d3f42382130c159c05cafa006b3e0 (patch) | |
tree | c3315d70fd600de83a17fd570d71b1c152872798 /lib/Sema/Sema.cpp | |
parent | 897e7a38c73a28731f8cdbaa4385ca15ab65820c (diff) |
Pass SourceRanges by reference to the various Diag methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55284 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r-- | lib/Sema/Sema.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index fa8ba5953c..30ada28d8b 100644 --- a/lib/Sema/Sema.cpp +++ b/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); |