aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-08-16 07:36:22 +0000
committerAnders Carlsson <andersca@mac.com>2009-08-16 07:36:22 +0000
commit14c5cbf59cffee52275230922283a247de407712 (patch)
treeea9e1adf02b4ddb7905f369acb8ceae2480f1f30 /lib/CodeGen/CodeGenFunction.h
parent5add6835b0c6b0f67e19fd5366825d3e41eb0dcf (diff)
Add an IsInitializer flag to EmitAnyExpr. This is used to prevent temporaries from being destroyed when they're bound to a reference variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79179 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r--lib/CodeGen/CodeGenFunction.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 3110ac00af..3bf17b32b3 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -513,7 +513,8 @@ public:
///
/// \param IgnoreResult - True if the resulting value isn't used.
RValue EmitAnyExpr(const Expr *E, llvm::Value *AggLoc = 0,
- bool isAggLocVolatile = false, bool IgnoreResult = false);
+ bool IsAggLocVolatile = false, bool IgnoreResult = false,
+ bool IsInitializer = false);
// EmitVAListRef - Emit a "reference" to a va_list; this is either the address
// or the value of the expression, depending on how va_list is defined.
@@ -521,8 +522,8 @@ public:
/// EmitAnyExprToTemp - Similary to EmitAnyExpr(), however, the result will
/// always be accessible even if no aggregate location is provided.
- RValue EmitAnyExprToTemp(const Expr *E, llvm::Value *AggLoc = 0,
- bool isAggLocVolatile = false);
+ RValue EmitAnyExprToTemp(const Expr *E, bool IsAggLocVolatile = false,
+ bool IsInitializer = false);
/// EmitAggregateCopy - Emit an aggrate copy.
///
@@ -862,7 +863,8 @@ public:
/// EmitReferenceBindingToExpr - Emits a reference binding to the passed in
/// expression. Will emit a temporary variable if E is not an LValue.
- RValue EmitReferenceBindingToExpr(const Expr* E, QualType DestType);
+ RValue EmitReferenceBindingToExpr(const Expr* E, QualType DestType,
+ bool IsInitializer = false);
//===--------------------------------------------------------------------===//
// Expression Emission
@@ -872,7 +874,7 @@ public:
/// EmitScalarExpr - Emit the computation of the specified expression of LLVM
/// scalar type, returning the result.
- llvm::Value *EmitScalarExpr(const Expr *E , bool IgnoreResultAssign=false);
+ llvm::Value *EmitScalarExpr(const Expr *E , bool IgnoreResultAssign = false);
/// EmitScalarConversion - Emit a conversion from the specified type to the
/// specified destination type, both of which are LLVM scalar types.
@@ -890,7 +892,7 @@ public:
/// aggregate type. The result is computed into DestPtr. Note that if
/// DestPtr is null, the value of the aggregate expression is not needed.
void EmitAggExpr(const Expr *E, llvm::Value *DestPtr, bool VolatileDest,
- bool IgnoreResult = false);
+ bool IgnoreResult = false, bool IsInitializer = false);
/// EmitGCMemmoveCollectable - Emit special API for structs with object
/// pointers.
@@ -946,7 +948,8 @@ public:
RValue EmitCXXExprWithTemporaries(const CXXExprWithTemporaries *E,
llvm::Value *AggLoc = 0,
- bool isAggLocVolatile = false);
+ bool IsAggLocVolatile = false,
+ bool IsInitializer = false);
//===--------------------------------------------------------------------===//
// Internal Helpers