[cfe-commits] r55284 - in /cfe/trunk: include/clang/Parse/Parser.h lib/Parse/Parser.cpp lib/Sema/Sema.cpp lib/Sema/Sema.h

Argiris Kirtzidis akyrtzi at gmail.com
Sun Aug 24 06:14:18 PDT 2008


Author: akirtzidis
Date: Sun Aug 24 08:14:02 2008
New Revision: 55284

URL: http://llvm.org/viewvc/llvm-project?rev=55284&view=rev
Log:
Pass SourceRanges by reference to the various Diag methods.

Modified:
    cfe/trunk/include/clang/Parse/Parser.h
    cfe/trunk/lib/Parse/Parser.cpp
    cfe/trunk/lib/Sema/Sema.cpp
    cfe/trunk/lib/Sema/Sema.h

Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=55284&r1=55283&r2=55284&view=diff

==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Sun Aug 24 08:14:02 2008
@@ -246,7 +246,7 @@
             const std::string &Msg = std::string());
   bool Diag(SourceLocation Loc, unsigned DiagID, const SourceRange &R);
   bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg,
-            SourceRange R1);
+            const SourceRange& R1);
   bool Diag(const Token &Tok, unsigned DiagID,
             const std::string &M = std::string()) {
     return Diag(Tok.getLocation(), DiagID, M);

Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=55284&r1=55283&r2=55284&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Sun Aug 24 08:14:02 2008
@@ -39,7 +39,7 @@
 }
 
 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;
 }

Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=55284&r1=55283&r2=55284&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Sun Aug 24 08:14:02 2008
@@ -160,19 +160,19 @@
   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, 
                 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);

Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=55284&r1=55283&r2=55284&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Sun Aug 24 08:14:02 2008
@@ -179,20 +179,21 @@
             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);





More information about the cfe-commits mailing list