From 8af7bb28aa225fe30e0a682325b5b9f4df74d6fe Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Fri, 1 Apr 2016 22:58:55 +0000 Subject: [CodeGen] Emit lifetime.end intrinsic after objects are destructed in landing pads. Previously, lifetime.end intrinsics were inserted only on normal control flows. This prevented StackColoring from merging stack slots for objects that were destroyed on the exception handling control flow since it couldn't tell their lifetime ranges were disjoint. This patch fixes code-gen to emit the intrinsic on both control flows. rdar://problem/22181976 Differential Revision: http://reviews.llvm.org/D18196 llvm-svn: 265197 --- clang/lib/CodeGen/CGDecl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CGDecl.cpp') diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index e0c297508fa..c39b980ef2c 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -1388,7 +1388,7 @@ void CodeGenFunction::EmitAutoVarCleanups(const AutoVarEmission &emission) { // Make sure we call @llvm.lifetime.end. This needs to happen // *last*, so the cleanup needs to be pushed *first*. if (emission.useLifetimeMarkers()) { - EHStack.pushCleanup(NormalCleanup, + EHStack.pushCleanup(NormalAndEHCleanup, emission.getAllocatedAddress(), emission.getSizeForLifetimeMarkers()); EHCleanupScope &cleanup = cast(*EHStack.begin()); -- cgit v1.2.3