[cfe-commits] r72429 - /cfe/trunk/lib/CodeGen/CGExprAgg.cpp

Mike Stump mrs at apple.com
Tue May 26 11:57:46 PDT 2009


Author: mrs
Date: Tue May 26 13:57:45 2009
New Revision: 72429

URL: http://llvm.org/viewvc/llvm-project?rev=72429&view=rev
Log:
Esnure that if we have a volatile structure as the destination, that
we actually have a destination.

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

Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=72429&r1=72428&r2=72429&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Tue May 26 13:57:45 2009
@@ -465,13 +465,16 @@
 //                        Entry Points into this File
 //===----------------------------------------------------------------------===//
 
-/// EmitAggExpr - Emit the computation of the specified expression of
-/// aggregate type.  The result is computed into DestPtr.  Note that if
-/// DestPtr is null, the value of the aggregate expression is not needed.
+/// EmitAggExpr - Emit the computation of the specified expression of aggregate
+/// type.  The result is computed into DestPtr.  Note that if DestPtr is null,
+/// the value of the aggregate expression is not needed.  If VolatileDest is
+/// true, DestPtr cannot be 0.
 void CodeGenFunction::EmitAggExpr(const Expr *E, llvm::Value *DestPtr,
                                   bool VolatileDest) {
   assert(E && hasAggregateLLVMType(E->getType()) &&
          "Invalid aggregate expression to emit");
+  assert ((DestPtr != 0 || VolatileDest == false)
+          && "volatile aggregate can't be 0");
   
   AggExprEmitter(*this, DestPtr, VolatileDest).Visit(const_cast<Expr*>(E));
 }





More information about the cfe-commits mailing list