[cfe-commits] r59713 - in /cfe/trunk/lib/Sema: Sema.cpp Sema.h SemaDecl.cpp SemaDeclCXX.cpp SemaDeclObjC.cpp

Chris Lattner sabre at nondot.org
Wed Nov 19 22:13:02 PST 2008


Author: lattner
Date: Thu Nov 20 00:13:02 2008
New Revision: 59713

URL: http://llvm.org/viewvc/llvm-project?rev=59713&view=rev
Log:
remove another old Diag method.

Modified:
    cfe/trunk/lib/Sema/Sema.cpp
    cfe/trunk/lib/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
    cfe/trunk/lib/Sema/SemaDeclObjC.cpp

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

==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Thu Nov 20 00:13:02 2008
@@ -167,12 +167,6 @@
   return true;
 }
 
-bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1,
-                const std::string &Msg2) {
-  PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID) << Msg1 << Msg2;
-  return true;
-}
-
 const LangOptions &Sema::getLangOptions() const {
   return PP.getLangOptions();
 }

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

==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Thu Nov 20 00:13:02 2008
@@ -229,8 +229,6 @@
   /// The primitive diagnostic helpers.
   DiagnosticInfo Diag(SourceLocation Loc, unsigned DiagID);
   bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg);
-  bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1,
-            const std::string &Msg2);
 
   virtual void DeleteExpr(ExprTy *E);
   virtual void DeleteStmt(StmtTy *S);

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Thu Nov 20 00:13:02 2008
@@ -324,8 +324,8 @@
   // Verify the old decl was also a typedef.
   TypedefDecl *Old = dyn_cast<TypedefDecl>(OldD);
   if (!Old) {
-    Diag(New->getLocation(), diag::err_redefinition_different_kind,
-         New->getName());
+    Diag(New->getLocation(), diag::err_redefinition_different_kind)
+      << New->getName();
     Diag(OldD->getLocation(), diag::err_previous_definition);
     return New;
   }
@@ -335,9 +335,9 @@
   if (Old->getUnderlyingType() != New->getUnderlyingType() && 
       Context.getCanonicalType(Old->getUnderlyingType()) != 
       Context.getCanonicalType(New->getUnderlyingType())) {
-    Diag(New->getLocation(), diag::err_redefinition_different_typedef,
-         New->getUnderlyingType().getAsString(),
-         Old->getUnderlyingType().getAsString());
+    Diag(New->getLocation(), diag::err_redefinition_different_typedef)
+      << New->getUnderlyingType().getAsString()
+      << Old->getUnderlyingType().getAsString();
     Diag(Old->getLocation(), diag::err_previous_definition);
     return Old;
   }
@@ -357,7 +357,7 @@
       return New;
   }
 
-  Diag(New->getLocation(), diag::err_redefinition, New->getName());
+  Diag(New->getLocation(), diag::err_redefinition) << New->getName();
   Diag(Old->getLocation(), diag::err_previous_definition);
   return New;
 }
@@ -410,8 +410,8 @@
   // Verify the old decl was also a function.
   FunctionDecl *Old = dyn_cast<FunctionDecl>(OldD);
   if (!Old) {
-    Diag(New->getLocation(), diag::err_redefinition_different_kind,
-         New->getName());
+    Diag(New->getLocation(), diag::err_redefinition_different_kind)
+      << New->getName();
     Diag(OldD->getLocation(), diag::err_previous_definition);
     return New;
   }
@@ -485,7 +485,7 @@
   // TODO: CHECK FOR CONFLICTS, multiple decls with same name in one scope.
   // TODO: This is totally simplistic.  It should handle merging functions
   // together etc, merging extern int X; int X; ...
-  Diag(New->getLocation(), diag::err_conflicting_types, New->getName());
+  Diag(New->getLocation(), diag::err_conflicting_types) << New->getName();
   Diag(Old->getLocation(), PrevDiag);
   return New;
 }

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Nov 20 00:13:02 2008
@@ -1211,15 +1211,14 @@
   if (ConvType->isRecordType()) {
     ConvType = Context.getCanonicalType(ConvType).getUnqualifiedType();
     if (ConvType == ClassType)
-      Diag(Conversion->getLocation(), diag::warn_conv_to_self_not_used,
-           ClassType.getAsString());
+      Diag(Conversion->getLocation(), diag::warn_conv_to_self_not_used)
+        << ClassType.getAsString();
     else if (IsDerivedFrom(ClassType, ConvType))
-      Diag(Conversion->getLocation(), diag::warn_conv_to_base_not_used,
-           ClassType.getAsString(),
-           ConvType.getAsString());
+      Diag(Conversion->getLocation(), diag::warn_conv_to_base_not_used)
+        <<  ClassType.getAsString() << ConvType.getAsString();
   } else if (ConvType->isVoidType()) {
-    Diag(Conversion->getLocation(), diag::warn_conv_to_void_not_used,
-         ClassType.getAsString(), ConvType.getAsString());
+    Diag(Conversion->getLocation(), diag::warn_conv_to_void_not_used)
+      << ClassType.getAsString() << ConvType.getAsString();
   }
 
   ClassDecl->addConversionFunction(Context, Conversion);
@@ -1271,8 +1270,8 @@
         // name to return the original namespace decl during a name lookup.
       } else {
         // This is an invalid name redefinition.
-        Diag(Namespc->getLocation(), diag::err_redefinition_different_kind,
-          Namespc->getName());
+        Diag(Namespc->getLocation(), diag::err_redefinition_different_kind)
+          << Namespc->getName();
         Diag(PrevDecl->getLocation(), diag::err_previous_definition);
         Namespc->setInvalidDecl();
         // Continue on to push Namespc as current DeclContext and return it.
@@ -1442,7 +1441,7 @@
     
   case OR_No_Viable_Function:
     if (CandidateSet.empty())
-      Diag(Loc, diag::err_ovl_no_viable_function_in_init) << InitEntity, Range;
+      Diag(Loc, diag::err_ovl_no_viable_function_in_init) << InitEntity <<Range;
     else {
       Diag(Loc, diag::err_ovl_no_viable_function_in_init_with_cands)
         << InitEntity << Range;

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Thu Nov 20 00:13:02 2008
@@ -904,8 +904,8 @@
                               : false;
       if (isInterfaceDeclKind && PrevMethod && !match 
           || checkIdenticalMethods && match) {
-          Diag(Method->getLocation(), diag::error_duplicate_method_decl,
-               Method->getSelector().getName());
+          Diag(Method->getLocation(), diag::error_duplicate_method_decl)
+            << Method->getSelector().getName();
           Diag(PrevMethod->getLocation(), diag::err_previous_declaration);
       } else {
         insMethods.push_back(Method);
@@ -921,8 +921,8 @@
                               : false;
       if (isInterfaceDeclKind && PrevMethod && !match 
           || checkIdenticalMethods && match) {
-        Diag(Method->getLocation(), diag::error_duplicate_method_decl,
-             Method->getSelector().getName());
+        Diag(Method->getLocation(), diag::error_duplicate_method_decl)
+          << Method->getSelector().getName();
         Diag(PrevMethod->getLocation(), diag::err_previous_declaration);
       } else {
         clsMethods.push_back(Method);
@@ -1114,8 +1114,8 @@
   }
   if (PrevMethod) {
     // You can never have two method definitions with the same name.
-    Diag(ObjCMethod->getLocation(), diag::error_duplicate_method_decl,
-        ObjCMethod->getSelector().getName());
+    Diag(ObjCMethod->getLocation(), diag::error_duplicate_method_decl)
+      << ObjCMethod->getSelector().getName();
     Diag(PrevMethod->getLocation(), diag::err_previous_declaration);
   } 
   return ObjCMethod;
@@ -1129,36 +1129,36 @@
   // readonly and readwrite conflict.
   if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) &&
       (Attributes & ObjCDeclSpec::DQ_PR_readwrite)) {
-    Diag(Loc, diag::err_objc_property_attr_mutually_exclusive,
-         "readonly", "readwrite");
-    Attributes ^= ObjCDeclSpec::DQ_PR_readonly;
+    Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
+      << "readonly" << "readwrite";
+    Attributes &= ~ObjCDeclSpec::DQ_PR_readonly;
   }
 
   // Check for copy or retain on non-object types.
   if ((Attributes & (ObjCDeclSpec::DQ_PR_copy | ObjCDeclSpec::DQ_PR_retain)) &&
       !Context.isObjCObjectPointerType(PropertyTy)) {
-    Diag(Loc, diag::err_objc_property_requires_object,
-         Attributes & ObjCDeclSpec::DQ_PR_copy ? "copy" : "retain");
+    Diag(Loc, diag::err_objc_property_requires_object)
+      << (Attributes & ObjCDeclSpec::DQ_PR_copy ? "copy" : "retain");
     Attributes &= ~(ObjCDeclSpec::DQ_PR_copy | ObjCDeclSpec::DQ_PR_retain);
   }
 
   // Check for more than one of { assign, copy, retain }.
   if (Attributes & ObjCDeclSpec::DQ_PR_assign) {
     if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
-      Diag(Loc, diag::err_objc_property_attr_mutually_exclusive,
-           "assign", "copy");
-      Attributes ^= ObjCDeclSpec::DQ_PR_copy;
+      Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
+        << "assign" << "copy";
+      Attributes &= ~ObjCDeclSpec::DQ_PR_copy;
     } 
     if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
-      Diag(Loc, diag::err_objc_property_attr_mutually_exclusive,
-           "assign", "retain");
-      Attributes ^= ObjCDeclSpec::DQ_PR_retain;
+      Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
+        << "assign" << "retain";
+      Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
     }
   } else if (Attributes & ObjCDeclSpec::DQ_PR_copy) {
     if (Attributes & ObjCDeclSpec::DQ_PR_retain) {
-      Diag(Loc, diag::err_objc_property_attr_mutually_exclusive,
-           "copy", "retain");
-      Attributes ^= ObjCDeclSpec::DQ_PR_retain;
+      Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
+        << "copy" << "retain";
+      Attributes &= ~ObjCDeclSpec::DQ_PR_retain;
     }
   }
 
@@ -1266,7 +1266,7 @@
     // Look for this property declaration in the @implementation's @interface
     property = IDecl->FindPropertyDeclaration(PropertyId);
     if (!property) {
-      Diag(PropertyLoc, diag::error_bad_property_decl, IDecl->getName());
+      Diag(PropertyLoc, diag::error_bad_property_decl) << IDecl->getName();
       return 0;
     }
   }
@@ -1290,8 +1290,8 @@
     // Look for this property declaration in @implementation's category
     property = Category->FindPropertyDeclaration(PropertyId);
     if (!property) {
-      Diag(PropertyLoc, diag::error_bad_category_property_decl, 
-           Category->getName());
+      Diag(PropertyLoc, diag::error_bad_category_property_decl)
+        << Category->getName();
       return 0;
     }
   }
@@ -1317,8 +1317,8 @@
     // Check that type of property and its ivar are type compatible.
     if (PropType != IvarType) {
       if (CheckAssignmentConstraints(PropType, IvarType) != Compatible) {
-        Diag(PropertyLoc, diag::error_property_ivar_type, property->getName(),
-            Ivar->getName());
+        Diag(PropertyLoc, diag::error_property_ivar_type)
+          << property->getName() << Ivar->getName();
         return 0;
       }
     }





More information about the cfe-commits mailing list