summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-09-17 00:50:28 +0000
committerJohn McCall <rjmccall@apple.com>2010-09-17 00:50:28 +0000
commit7f9c92a9a0740c2e198ae3a38770b59150555ea0 (patch)
tree00928edca348bfd85e66495833d671c7cc77d299 /clang/lib/CodeGen/CodeGenFunction.h
parent2cc3f17a26417de82ccd8f3e381f30afff78afed (diff)
downloadbcm5719-llvm-7f9c92a9a0740c2e198ae3a38770b59150555ea0.tar.gz
bcm5719-llvm-7f9c92a9a0740c2e198ae3a38770b59150555ea0.zip
When emitting a new-expression inside a conditional expression,
the cleanup might not be dominated by the allocation code. In this case, we have to store aside all the delete arguments in case we need them later. There's room for optimization here in cases where we end up not actually needing the cleanup in different branches (or being able to pop it after the initialization code). Also make sure we only call this operator delete along the path where we actually allocated something. Fixes rdar://problem/8439196. llvm-svn: 114145
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 26b262ccb1c..a77044324a0 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -674,6 +674,10 @@ public:
--ConditionalBranchLevel;
}
+ /// isInConditionalBranch - Return true if we're currently emitting
+ /// one branch or the other of a conditional expression.
+ bool isInConditionalBranch() const { return ConditionalBranchLevel != 0; }
+
private:
CGDebugInfo *DebugInfo;
OpenPOWER on IntegriCloud