]> granicus.if.org Git - clang/commitdiff
Remove the PrintType argument from RequireCompleteType.
authorAnders Carlsson <andersca@mac.com>
Wed, 26 Aug 2009 22:59:12 +0000 (22:59 +0000)
committerAnders Carlsson <andersca@mac.com>
Wed, 26 Aug 2009 22:59:12 +0000 (22:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80174 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.h
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaType.cpp

index 324090556fcff888dd9f94a71ae6385879d8f1b3..972f7ad2d30e01c059cef33cc17ef146dc0f80f0 100644 (file)
@@ -484,9 +484,8 @@ public:
   virtual TypeResult ActOnTypeName(Scope *S, Declarator &D);
 
   bool RequireCompleteType(SourceLocation Loc, QualType T, unsigned diag,
-                              SourceRange Range1 = SourceRange(),
-                              SourceRange Range2 = SourceRange(),
-                              QualType PrintType = QualType());
+                           SourceRange Range1 = SourceRange(),
+                           SourceRange Range2 = SourceRange());
   bool RequireCompleteType(SourceLocation Loc, QualType T,
                            const PartialDiagnostic &PD);
   
index e73708981891909ced354075ad64906ef61e88b2..ef924fee4282b9294ed826251b4bf82d84a743ef 100644 (file)
 #include "Sema.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/DeclObjC.h"
+#include "clang/AST/DeclTemplate.h"
 #include "clang/AST/ExprCXX.h"
 #include "clang/AST/ExprObjC.h"
-#include "clang/AST/DeclTemplate.h"
-#include "clang/Lex/Preprocessor.h"
-#include "clang/Lex/LiteralSupport.h"
+#include "clang/Basic/PartialDiagnostic.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/TargetInfo.h"
+#include "clang/Lex/LiteralSupport.h"
+#include "clang/Lex/Preprocessor.h"
 #include "clang/Parse/DeclSpec.h"
 #include "clang/Parse/Designator.h"
 #include "clang/Parse/Scope.h"
@@ -3989,9 +3990,9 @@ inline QualType Sema::CheckAdditionOperands( // C99 6.5.6
               !PExp->getType()->isDependentType()) ||
               PExp->getType()->isObjCObjectPointerType()) &&
              RequireCompleteType(Loc, PointeeTy,
-                                 diag::err_typecheck_arithmetic_incomplete_type,
-                                 PExp->getSourceRange(), SourceRange(),
-                                 PExp->getType()))
+                           PDiag(diag::err_typecheck_arithmetic_incomplete_type) 
+                             << PExp->getSourceRange() 
+                             << PExp->getType()))
           return QualType();
       }
       // Diagnose bad cases where we step over interface counts.
@@ -4065,10 +4066,9 @@ QualType Sema::CheckSubtractionOperands(Expr *&lex, Expr *&rex,
       ComplainAboutFunc = lex;
     } else if (!lpointee->isDependentType() &&
                RequireCompleteType(Loc, lpointee, 
-                                   diag::err_typecheck_sub_ptr_object,
-                                   lex->getSourceRange(),
-                                   SourceRange(),
-                                   lex->getType()))
+                                   PDiag(diag::err_typecheck_sub_ptr_object)
+                                     << lex->getSourceRange() 
+                                     << lex->getType()))
       return QualType();
 
     // Diagnose bad cases where we step over interface counts.
@@ -4118,10 +4118,9 @@ QualType Sema::CheckSubtractionOperands(Expr *&lex, Expr *&rex,
           ComplainAboutFunc = rex;
       } else if (!rpointee->isDependentType() &&
                  RequireCompleteType(Loc, rpointee,
-                                     diag::err_typecheck_sub_ptr_object,
-                                     rex->getSourceRange(),
-                                     SourceRange(),
-                                     rex->getType()))
+                                     PDiag(diag::err_typecheck_sub_ptr_object)
+                                       << rex->getSourceRange()
+                                       << rex->getType()))
         return QualType();
 
       if (getLangOptions().CPlusPlus) {
@@ -4772,9 +4771,9 @@ QualType Sema::CheckIncrementDecrementOperand(Expr *Op, SourceLocation OpLoc,
       Diag(OpLoc, diag::ext_gnu_ptr_func_arith)
         << ResType << Op->getSourceRange();
     } else if (RequireCompleteType(OpLoc, PointeeTy,
-                               diag::err_typecheck_arithmetic_incomplete_type,
-                                   Op->getSourceRange(), SourceRange(),
-                                   ResType))
+                           PDiag(diag::err_typecheck_arithmetic_incomplete_type)
+                             << Op->getSourceRange() 
+                             << ResType))
       return QualType();
     // Diagnose bad cases where we step over interface counts.
     else if (PointeeTy->isObjCInterfaceType() && LangOpts.ObjCNonFragileABI) {
index ae5010cfac329d1952c3d323718b8c728f2f0583..a8eb2cbc7e6165cae17c9c930b21e4a297b1d4a2 100644 (file)
 
 #include "SemaInherit.h"
 #include "Sema.h"
-#include "clang/AST/ExprCXX.h"
 #include "clang/AST/ASTContext.h"
-#include "clang/Parse/DeclSpec.h"
-#include "clang/Lex/Preprocessor.h"
+#include "clang/AST/ExprCXX.h"
+#include "clang/Basic/PartialDiagnostic.h"
 #include "clang/Basic/TargetInfo.h"
+#include "clang/Lex/Preprocessor.h"
+#include "clang/Parse/DeclSpec.h"
 #include "llvm/ADT/STLExtras.h"
 using namespace clang;
 
@@ -147,9 +148,9 @@ bool Sema::CheckCXXThrowOperand(SourceLocation ThrowLoc, Expr *&E) {
   }
   if (!isPointer || !Ty->isVoidType()) {
     if (RequireCompleteType(ThrowLoc, Ty,
-                            isPointer ? diag::err_throw_incomplete_ptr
-                                      : diag::err_throw_incomplete,
-                            E->getSourceRange(), SourceRange(), QualType()))
+                            PDiag(isPointer ? diag::err_throw_incomplete_ptr
+                                            : diag::err_throw_incomplete)
+                              << E->getSourceRange()))
       return true;
   }
 
@@ -1081,8 +1082,7 @@ Sema::OwningExprResult Sema::ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
   // to be complete.
   if (OTT != UTT_IsClass && OTT != UTT_IsEnum && OTT != UTT_IsUnion) {
     if (RequireCompleteType(KWLoc, T, 
-                            diag::err_incomplete_type_used_in_type_trait_expr,
-                            SourceRange(), SourceRange(), T))
+                            diag::err_incomplete_type_used_in_type_trait_expr))
       return ExprError();
   }
 
index 7775c25142e88282b88c102bca5616199fcab50f..2a74a874fa9d283420c4ea91426daf1cb247649c 100644 (file)
@@ -1771,12 +1771,7 @@ void Sema::ProcessTypeAttributeList(QualType &Result, const AttributeList *AL) {
 /// @returns @c true if @p T is incomplete and a diagnostic was emitted,
 /// @c false otherwise.
 bool Sema::RequireCompleteType(SourceLocation Loc, QualType T, unsigned diag,
-                               SourceRange Range1, SourceRange Range2,
-                               QualType PrintType) {
-  if (!PrintType.isNull())
-    return RequireCompleteType(Loc, T, 
-                               PDiag(diag) << Range1 << Range2 << PrintType);
-  
+                               SourceRange Range1, SourceRange Range2) {
   return RequireCompleteType(Loc, T, 
                              PDiag(diag) << Range1 << Range2);
 }