[cfe-commits] r94427 - /cfe/trunk/lib/Sema/SemaInit.cpp

Eli Friedman eli.friedman at gmail.com
Mon Jan 25 09:04:55 PST 2010


Author: efriedma
Date: Mon Jan 25 11:04:54 2010
New Revision: 94427

URL: http://llvm.org/viewvc/llvm-project?rev=94427&view=rev
Log:
Code simplification; this should have no visible effects.


Modified:
    cfe/trunk/lib/Sema/SemaInit.cpp

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Mon Jan 25 11:04:54 2010
@@ -66,38 +66,6 @@
   return 0;
 }
 
-static Sema::OwningExprResult 
-CheckSingleInitializer(const InitializedEntity &Entity,
-                       Sema::OwningExprResult Init, QualType DeclType, Sema &S){
-  assert(Entity.getType() == DeclType);
-  Expr *InitExpr = Init.takeAs<Expr>();
-
-  // Get the type before calling CheckSingleAssignmentConstraints(), since
-  // it can promote the expression.
-  QualType InitType = InitExpr->getType();
-
-  if (S.getLangOptions().CPlusPlus) {
-    // C++ [dcl.init.aggr]p2:
-    //   Each member is copy-initialized from the corresponding
-    //   initializer-clause.
-    // FIXME: Use a better EqualLoc here.
-    Sema::OwningExprResult Result = 
-      S.PerformCopyInitialization(Entity, InitExpr->getLocStart(),
-                                  S.Owned(InitExpr));
-
-      return move(Result);
-  }
-
-  Sema::AssignConvertType ConvTy =
-    S.CheckSingleAssignmentConstraints(DeclType, InitExpr);
-  if (S.DiagnoseAssignmentResult(ConvTy, InitExpr->getLocStart(), DeclType,
-                                 InitType, InitExpr, Sema::AA_Initializing))
-    return S.ExprError();
-
-  Init.release();
-  return S.Owned(InitExpr);
-}
-
 static void CheckStringInit(Expr *Str, QualType &DeclT, Sema &S) {
   // Get the length of the string as parsed.
   uint64_t StrLength =
@@ -771,7 +739,8 @@
     }
 
     Sema::OwningExprResult Result =
-      CheckSingleInitializer(Entity, SemaRef.Owned(expr), DeclType, SemaRef);
+      SemaRef.PerformCopyInitialization(Entity, expr->getLocStart(),
+                                        SemaRef.Owned(expr));
 
     Expr *ResultExpr;
 





More information about the cfe-commits mailing list