Lines Matching refs:CGF
35 DominatingValue<RValue>::saved_type::save(CodeGenFunction &CGF, RValue rv) {
44 llvm::Value *addr = CGF.CreateTempAlloca(V->getType(), "saved-rvalue");
45 CGF.Builder.CreateStore(V, addr);
54 llvm::Value *addr = CGF.CreateTempAlloca(ComplexTy, "saved-complex");
55 CGF.Builder.CreateStore(V.first, CGF.Builder.CreateStructGEP(addr, 0));
56 CGF.Builder.CreateStore(V.second, CGF.Builder.CreateStructGEP(addr, 1));
65 llvm::Value *addr = CGF.CreateTempAlloca(V->getType(), "saved-rvalue");
66 CGF.Builder.CreateStore(V, addr);
73 RValue DominatingValue<RValue>::saved_type::restore(CodeGenFunction &CGF) {
78 return RValue::get(CGF.Builder.CreateLoad(Value));
82 return RValue::getAggregate(CGF.Builder.CreateLoad(Value));
85 CGF.Builder.CreateLoad(CGF.Builder.CreateStructGEP(Value, 0));
87 CGF.Builder.CreateLoad(CGF.Builder.CreateStructGEP(Value, 1));
278 static void ResolveAllBranchFixups(CodeGenFunction &CGF,
283 for (unsigned I = 0, E = CGF.EHStack.getNumBranchFixups(); I != E; ++I) {
285 BranchFixup &Fixup = CGF.EHStack.getBranchFixup(I);
297 new llvm::StoreInst(CGF.Builder.getInt32(Fixup.DestinationIndex),
298 CGF.getNormalCleanupDestSlot(),
306 Switch->addCase(CGF.Builder.getInt32(Fixup.DestinationIndex),
310 CGF.EHStack.clearFixups();
315 static llvm::SwitchInst *TransitionToCleanupSwitch(CodeGenFunction &CGF,
325 new llvm::LoadInst(CGF.getNormalCleanupDestSlot(), "cleanup.dest", Term);
417 static llvm::BasicBlock *CreateNormalEntry(CodeGenFunction &CGF,
422 Entry = CGF.createBasicBlock("cleanup");
433 static llvm::BasicBlock *SimplifyCleanupEntry(CodeGenFunction &CGF,
445 bool WasInsertBlock = CGF.Builder.GetInsertBlock() == Entry;
446 assert(!WasInsertBlock || CGF.Builder.GetInsertPoint() == Entry->end());
462 CGF.Builder.SetInsertPoint(Pred);
467 static void EmitCleanup(CodeGenFunction &CGF,
472 if (flags.isForEHCleanup()) CGF.EHStack.pushTerminate();
478 ContBB = CGF.createBasicBlock("cleanup.done");
479 llvm::BasicBlock *CleanupBB = CGF.createBasicBlock("cleanup.action");
481 = CGF.Builder.CreateLoad(ActiveFlag, "cleanup.is_active");
482 CGF.Builder.CreateCondBr(IsActive, CleanupBB, ContBB);
483 CGF.EmitBlock(CleanupBB);
487 Fn->Emit(CGF, flags);
488 assert(CGF.HaveInsertPoint() && "cleanup ended with no insertion point?");
492 CGF.EmitBlock(ContBB);
495 if (flags.isForEHCleanup()) CGF.EHStack.popTerminate();
522 static void destroyOptimisticNormalEntry(CodeGenFunction &CGF,
528 llvm::BasicBlock *unreachableBB = CGF.getUnreachableBlock();
549 assert(condition->getOperand(0) == CGF.NormalCleanupDest);
1042 static void SetupCleanupBlockActivation(CodeGenFunction &CGF,
1046 EHCleanupScope &Scope = cast<EHCleanupScope>(*CGF.EHStack.find(C));
1052 (kind == ForActivation && CGF.isInConditionalBranch());
1060 (isActivatedInConditional || IsUsedAsNormalCleanup(CGF.EHStack, C))) {
1067 (isActivatedInConditional || IsUsedAsEHCleanup(CGF.EHStack, C))) {
1077 var = CGF.CreateTempAlloca(CGF.Builder.getInt1Ty(), "cleanup.isactive");
1084 llvm::Value *value = CGF.Builder.getInt1(kind == ForDeactivation);
1088 if (CGF.isInConditionalBranch()) {
1089 CGF.setBeforeOutermostConditional(value, var);
1095 CGF.Builder.CreateStore(CGF.Builder.getInt1(kind == ForActivation), var);