comparison gen/passes/GarbageCollect2Stack.cpp @ 1305:8215dbf0e09f

Postpone (expensive) escape analysis until we're sure it's needed.
author Frits van Bommel <fvbommel wxs.nl>
date Wed, 06 May 2009 14:11:37 +0200
parents 7e303f9f16c7
children b61db48127fd
comparison
equal deleted inserted replaced
1301:1e30cc395d2e 1305:8215dbf0e09f
164 RemoveCall(Inst); 164 RemoveCall(Inst);
165 continue; 165 continue;
166 } 166 }
167 167
168 DEBUG(DOUT << "GarbageCollect2Stack inspecting: " << *Inst); 168 DEBUG(DOUT << "GarbageCollect2Stack inspecting: " << *Inst);
169
170 if (PointerMayBeCaptured(Inst, true)) {
171 continue;
172 }
173 169
174 Value* TypeInfo = CS.getArgument(info->TypeInfoArgNr); 170 Value* TypeInfo = CS.getArgument(info->TypeInfoArgNr);
175 const Type* Ty = getTypeFor(TypeInfo); 171 const Type* Ty = getTypeFor(TypeInfo);
176 if (!Ty) { 172 if (!Ty) {
177 continue; 173 continue;
201 const PointerType* PtrTy = 197 const PointerType* PtrTy =
202 cast<PointerType>(ArrTy->getElementType(1)); 198 cast<PointerType>(ArrTy->getElementType(1));
203 Ty = PtrTy->getElementType(); 199 Ty = PtrTy->getElementType();
204 } 200 }
205 201
202 if (PointerMayBeCaptured(Inst, true)) {
203 continue;
204 }
205
206 // Let's alloca this! 206 // Let's alloca this!
207 Changed = true; 207 Changed = true;
208 208
209 IRBuilder<> Builder(BB, I); 209 IRBuilder<> Builder(BB, I);
210 210