[cfe-commits] r91794 - in /cfe/trunk: examples/wpa/CMakeLists.txt lib/Sema/SemaDecl.cpp

Douglas Gregor dgregor at apple.com
Sun Dec 20 12:56:31 PST 2009


Author: dgregor
Date: Sun Dec 20 14:56:30 2009
New Revision: 91794

URL: http://llvm.org/viewvc/llvm-project?rev=91794&view=rev
Log:
Fix CMake build on windows, from Cedric Venet

Modified:
    cfe/trunk/examples/wpa/CMakeLists.txt
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/examples/wpa/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/wpa/CMakeLists.txt?rev=91794&r1=91793&r2=91794&view=diff

==============================================================================
--- cfe/trunk/examples/wpa/CMakeLists.txt (original)
+++ cfe/trunk/examples/wpa/CMakeLists.txt Sun Dec 20 14:56:30 2009
@@ -17,10 +17,6 @@
   core
   )
 
-set( LLVM_LINK_COMPONENTS
-    mc
-  )
-
 add_clang_executable(clang-wpa
   clang-wpa.cpp
   )

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Sun Dec 20 14:56:30 2009
@@ -3745,28 +3745,19 @@
           InitType->isRecordType() && !InitType->isDependentType()) {
         if (!RequireCompleteType(Var->getLocation(), InitType,
                                  diag::err_invalid_incomplete_type_use)) {
-          ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(*this);
-
-          CXXConstructorDecl *Constructor
-            = PerformInitializationByConstructor(InitType, 
-                                                 MultiExprArg(*this, 0, 0),
-                                                 Var->getLocation(),
-                                               SourceRange(Var->getLocation(),
-                                                           Var->getLocation()),
-                                                 Var->getDeclName(),
-                         InitializationKind::CreateDefault(Var->getLocation()),
-                                                 ConstructorArgs);
-          
-          // FIXME: Location info for the variable initialization?
-          if (!Constructor)
+          InitializedEntity Entity
+            = InitializedEntity::InitializeVariable(Var);
+          InitializationKind Kind
+            = InitializationKind::CreateDefault(Var->getLocation());
+
+          InitializationSequence InitSeq(*this, Entity, Kind, 0, 0);
+          OwningExprResult Init = InitSeq.Perform(*this, Entity, Kind,
+                                                  MultiExprArg(*this, 0, 0));
+          if (Init.isInvalid())
             Var->setInvalidDecl();
           else {
-            // FIXME: Cope with initialization of arrays
-            if (!Constructor->isTrivial() &&
-                InitializeVarWithConstructor(Var, Constructor, 
-                                             move_arg(ConstructorArgs)))
-              Var->setInvalidDecl();
-            
+            Var->setInit(Context, 
+                       MaybeCreateCXXExprWithTemporaries(Init.takeAs<Expr>()));
             FinalizeVarWithDestructor(Var, InitType);
           }
         } else {





More information about the cfe-commits mailing list