[cfe-commits] r140455 - in /cfe/trunk: include/clang/Sema/Sema.h lib/Sema/SemaInit.cpp

Sebastian Redl sebastian.redl at getdesigned.at
Sat Sep 24 10:47:46 PDT 2011


Author: cornedbee
Date: Sat Sep 24 12:47:46 2011
New Revision: 140455

URL: http://llvm.org/viewvc/llvm-project?rev=140455&view=rev
Log:
Inline Sema::CheckInitList into its only user.

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

Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=140455&r1=140454&r2=140455&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Sat Sep 24 12:47:46 2011
@@ -5680,8 +5680,6 @@
                                       SourceLocation Loc, bool isRelational);
 
   /// type checking declaration initializers (C99 6.7.8)
-  bool CheckInitList(const InitializedEntity &Entity,
-                     InitListExpr *&InitList, QualType &DeclType);
   bool CheckForConstantInitializer(Expr *e, QualType t);
 
   // type checking C++ declaration initializers (C++ [dcl.init]).

Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=140455&r1=140454&r2=140455&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Sat Sep 24 12:47:46 2011
@@ -2085,15 +2085,6 @@
   return Owned(DIE);
 }
 
-bool Sema::CheckInitList(const InitializedEntity &Entity,
-                         InitListExpr *&InitList, QualType &DeclType) {
-  InitListChecker CheckInitList(*this, Entity, InitList, DeclType);
-  if (!CheckInitList.HadError())
-    InitList = CheckInitList.getFullyStructuredList();
-
-  return CheckInitList.HadError();
-}
-
 //===----------------------------------------------------------------------===//
 // Initialization entity
 //===----------------------------------------------------------------------===//
@@ -4510,11 +4501,13 @@
     case SK_ListInitialization: {
       InitListExpr *InitList = cast<InitListExpr>(CurInit.get());
       QualType Ty = Step->Type;
-      if (S.CheckInitList(Entity, InitList, ResultType? *ResultType : Ty))
+      InitListChecker CheckInitList(S, Entity, InitList,
+          ResultType ? *ResultType : Ty);
+      if (CheckInitList.HadError())
         return ExprError();
 
       CurInit.release();
-      CurInit = S.Owned(InitList);
+      CurInit = S.Owned(CheckInitList.getFullyStructuredList());
       break;
     }
 





More information about the cfe-commits mailing list