From c6b6d1874a9a3b7e8b3ab0e051cdbfd8390aed87 Mon Sep 17 00:00:00 2001 From: Frits van Bommel Date: Wed, 6 May 2009 14:11:37 +0200 Subject: [PATCH] Postpone (expensive) escape analysis until we're sure it's needed. --- gen/passes/GarbageCollect2Stack.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gen/passes/GarbageCollect2Stack.cpp b/gen/passes/GarbageCollect2Stack.cpp index d8f974c8..055b08b1 100644 --- a/gen/passes/GarbageCollect2Stack.cpp +++ b/gen/passes/GarbageCollect2Stack.cpp @@ -167,10 +167,6 @@ bool GarbageCollect2Stack::runOnFunction(Function &F) { DEBUG(DOUT << "GarbageCollect2Stack inspecting: " << *Inst); - if (PointerMayBeCaptured(Inst, true)) { - continue; - } - Value* TypeInfo = CS.getArgument(info->TypeInfoArgNr); const Type* Ty = getTypeFor(TypeInfo); if (!Ty) { @@ -203,6 +199,10 @@ bool GarbageCollect2Stack::runOnFunction(Function &F) { Ty = PtrTy->getElementType(); } + if (PointerMayBeCaptured(Inst, true)) { + continue; + } + // Let's alloca this! Changed = true;