summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-02-05 19:38:31 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-02-05 19:38:31 +0000
commitd0bc7b9d136c964ad230160d7350c09d1c075381 (patch)
treefbc6acbc597492d77ce553996491840014b6a5b2 /clang/lib/CodeGen/CGExprAgg.cpp
parent89f7dfff21909203c25da9f70bd76de8f859b388 (diff)
downloadbcm5719-llvm-d0bc7b9d136c964ad230160d7350c09d1c075381.tar.gz
bcm5719-llvm-d0bc7b9d136c964ad230160d7350c09d1c075381.zip
IRgen: Factor out EmitAggExprToLValue.
llvm-svn: 95416
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index ba25f358e87..bdeecb85be1 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/lib/CodeGen/CGExprAgg.cpp
@@ -685,6 +685,8 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
/// 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.
+//
+// FIXME: Take Qualifiers object.
void CodeGenFunction::EmitAggExpr(const Expr *E, llvm::Value *DestPtr,
bool VolatileDest, bool IgnoreResult,
bool IsInitializer,
@@ -699,6 +701,14 @@ void CodeGenFunction::EmitAggExpr(const Expr *E, llvm::Value *DestPtr,
.Visit(const_cast<Expr*>(E));
}
+LValue CodeGenFunction::EmitAggExprToLValue(const Expr *E) {
+ assert(hasAggregateLLVMType(E->getType()) && "Invalid argument!");
+ Qualifiers Q = MakeQualifiers(E->getType());
+ llvm::Value *Temp = CreateTempAlloca(ConvertTypeForMem(E->getType()));
+ EmitAggExpr(E, Temp, Q.hasVolatile());
+ return LValue::MakeAddr(Temp, Q);
+}
+
void CodeGenFunction::EmitAggregateClear(llvm::Value *DestPtr, QualType Ty) {
assert(!Ty->isAnyComplexType() && "Shouldn't happen for complex");
OpenPOWER on IntegriCloud