[cfe-commits] r106875 - /cfe/trunk/lib/CodeGen/CGExprCXX.cpp

Fariborz Jahanian fjahanian at apple.com
Fri Jun 25 13:01:13 PDT 2010


Author: fjahanian
Date: Fri Jun 25 15:01:13 2010
New Revision: 106875

URL: http://llvm.org/viewvc/llvm-project?rev=106875&view=rev
Log:
Minor change to my last patch to fix PR7490.


Modified:
    cfe/trunk/lib/CodeGen/CGExprCXX.cpp

Modified: cfe/trunk/lib/CodeGen/CGExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprCXX.cpp?rev=106875&r1=106874&r2=106875&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprCXX.cpp Fri Jun 25 15:01:13 2010
@@ -483,9 +483,6 @@
 
 static void StoreAnyExprIntoOneUnit(CodeGenFunction &CGF, const CXXNewExpr *E,
                                     llvm::Value *NewPtr) {
-  // We have a POD type.
-  if (E->getNumConstructorArgs() == 0)
-    return;
   
   assert(E->getNumConstructorArgs() == 1 &&
          "Can only have one argument to initializer of POD type.");
@@ -507,6 +504,10 @@
 CodeGenFunction::EmitNewArrayInitializer(const CXXNewExpr *E, 
                                          llvm::Value *NewPtr,
                                          llvm::Value *NumElements) {
+  // We have a POD type.
+  if (E->getNumConstructorArgs() == 0)
+    return;
+  
   const llvm::Type *SizeTy = ConvertType(getContext().getSizeType());
   
   // Create a temporary for the loop index and initialize it with 0.
@@ -577,7 +578,10 @@
 
     return;
   }
-    
+  // We have a POD type.
+  if (E->getNumConstructorArgs() == 0)
+    return;
+  
   StoreAnyExprIntoOneUnit(CGF, E, NewPtr);
 }
 





More information about the cfe-commits mailing list