]> granicus.if.org Git - clang/commitdiff
Esnure that if we have a volatile structure as the destination, that
authorMike Stump <mrs@apple.com>
Tue, 26 May 2009 18:57:45 +0000 (18:57 +0000)
committerMike Stump <mrs@apple.com>
Tue, 26 May 2009 18:57:45 +0000 (18:57 +0000)
we actually have a destination.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72429 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprAgg.cpp

index 3da7da86d82a8dd0e98b145605c6f5b7db397949..c558d137e2c8edaaa932c756704149e0a53b35f2 100644 (file)
@@ -465,13 +465,16 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
 //                        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));
 }