Lines Matching refs:CGF
166 static saved_type save(CodeGenFunction &CGF, llvm::Value *value);
167 static llvm::Value *restore(CodeGenFunction &CGF, saved_type value);
174 static type restore(CodeGenFunction &CGF, saved_type value) {
175 return static_cast<T*>(DominatingLLVMValue::restore(CGF, value));
191 static saved_type save(CodeGenFunction &CGF, type value) {
192 return { DominatingLLVMValue::save(CGF, value.getPointer()),
195 static type restore(CodeGenFunction &CGF, saved_type value) {
196 return Address(DominatingLLVMValue::restore(CGF, value.SavedValue),
216 static saved_type save(CodeGenFunction &CGF, RValue value);
217 RValue restore(CodeGenFunction &CGF);
225 static saved_type save(CodeGenFunction &CGF, type value) {
226 return saved_type::save(CGF, value);
228 static type restore(CodeGenFunction &CGF, saved_type value) {
229 return value.restore(CGF);
422 virtual void EmitBody(CodeGenFunction &CGF, const Stmt *S) {
423 CGF.incrementProfileCounter(S);
424 CGF.EmitStmt(S);
449 CodeGenFunction &CGF;
452 CGCapturedStmtRAII(CodeGenFunction &CGF,
454 : CGF(CGF), PrevCapturedStmtInfo(CGF.CapturedStmtInfo) {
455 CGF.CapturedStmtInfo = NewCapturedStmtInfo;
457 ~CGCapturedStmtRAII() { CGF.CapturedStmtInfo = PrevCapturedStmtInfo; }
493 CodeGenFunction *CGF;
495 SanitizerScope(CodeGenFunction *CGF);
597 void Emit(CodeGenFunction &CGF, Flags flags) override {
598 CGF.EmitLifetimeEnd(Size, Addr);
655 CodeGenFunction &CGF;
660 CodeGenFunction &CGF,
662 : CGF(CGF),
663 ParentLoopDirectiveForScan(CGF.OMPParentLoopDirectiveForScan) {
664 CGF.OMPParentLoopDirectiveForScan = &ParentLoopDirectiveForScan;
667 CGF.OMPParentLoopDirectiveForScan = ParentLoopDirectiveForScan;
678 CGFPOptionsRAII(CodeGenFunction &CGF, FPOptions FPFeatures);
679 CGFPOptionsRAII(CodeGenFunction &CGF, const Expr *E);
684 CodeGenFunction &CGF;
714 void enter(CodeGenFunction &CGF, const Stmt *Finally,
717 void exit(CodeGenFunction &CGF);
846 CodeGenFunction& CGF;
850 explicit RunCleanupsScope(CodeGenFunction &CGF)
851 : PerformCleanup(true), CGF(CGF)
853 CleanupStackDepth = CGF.EHStack.stable_begin();
855 CGF.LifetimeExtendedCleanupStack.size();
856 OldDidCallStackSave = CGF.DidCallStackSave;
857 CGF.DidCallStackSave = false;
858 OldCleanupScopeDepth = CGF.CurrentCleanupScopeDepth;
859 CGF.CurrentCleanupScopeDepth = CleanupStackDepth;
870 return CGF.EHStack.stable_begin() != CleanupStackDepth;
881 CGF.DidCallStackSave = OldDidCallStackSave;
882 CGF.PopCleanupBlocks(CleanupStackDepth, LifetimeExtendedCleanupStackSize,
885 CGF.CurrentCleanupScopeDepth = OldCleanupScopeDepth;
903 explicit LexicalScope(CodeGenFunction &CGF, SourceRange Range)
904 : RunCleanupsScope(CGF), Range(Range), ParentScope(CGF.CurLexicalScope) {
905 CGF.CurLexicalScope = this;
906 if (CGDebugInfo *DI = CGF.getDebugInfo())
907 DI->EmitLexicalBlockStart(CGF.Builder, Range.getBegin());
918 if (CGDebugInfo *DI = CGF.getDebugInfo())
919 DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
924 ApplyDebugLocation DL(CGF, Range.getEnd());
932 CGF.CurLexicalScope = ParentScope;
964 bool setVarAddr(CodeGenFunction &CGF, const VarDecl *LocalVD,
971 auto it = CGF.LocalDeclMap.find(LocalVD);
972 if (it != CGF.LocalDeclMap.end())
980 Address Temp = CGF.CreateMemTemp(VarTy);
981 CGF.Builder.CreateStore(TempAddr.getPointer(), Temp);
992 bool apply(CodeGenFunction &CGF) {
993 copyInto(SavedTempAddresses, CGF.LocalDeclMap);
999 void restore(CodeGenFunction &CGF) {
1001 copyInto(SavedLocals, CGF.LocalDeclMap);
1035 explicit OMPPrivateScope(CodeGenFunction &CGF) : RunCleanupsScope(CGF) {}
1045 return MappedVars.setVarAddr(CGF, LocalVD, PrivateGen());
1056 bool Privatize() { return MappedVars.apply(CGF); }
1060 MappedVars.restore(CGF);
1072 return !VD->isLocalVarDeclOrParm() && CGF.LocalDeclMap.count(VD) > 0;
1080 CodeGenFunction &CGF;
1084 OMPLocalDeclMapRAII(CodeGenFunction &CGF)
1085 : CGF(CGF), SavedMap(CGF.LocalDeclMap) {}
1086 ~OMPLocalDeclMapRAII() { SavedMap.swap(CGF.LocalDeclMap); }
1146 ConditionalEvaluation(CodeGenFunction &CGF)
1147 : StartBB(CGF.Builder.GetInsertBlock()) {}
1149 void begin(CodeGenFunction &CGF) {
1150 assert(CGF.OutermostConditional != this);
1151 if (!CGF.OutermostConditional)
1152 CGF.OutermostConditional = this;
1155 void end(CodeGenFunction &CGF) {
1156 assert(CGF.OutermostConditional != nullptr);
1157 if (CGF.OutermostConditional == this)
1158 CGF.OutermostConditional = nullptr;
1182 CodeGenFunction &CGF;
1190 StmtExprEvaluation(CodeGenFunction &CGF)
1191 : CGF(CGF), SavedOutermostConditional(CGF.OutermostConditional) {
1192 CGF.OutermostConditional = nullptr;
1196 CGF.OutermostConditional = SavedOutermostConditional;
1197 CGF.EnsureInsertPoint();
1240 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
1244 return bind(CGF, ov, CGF.EmitLValue(e));
1245 return bind(CGF, ov, CGF.EmitAnyExpr(e));
1248 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
1252 CGF.OpaqueLValues.insert(std::make_pair(ov, lv));
1256 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
1260 CGF.OpaqueRValues.insert(std::make_pair(ov, rv));
1267 data.Protection = CGF.protectFromPeepholes(rv);
1275 void unbind(CodeGenFunction &CGF) {
1279 CGF.OpaqueLValues.erase(OpaqueValue);
1281 CGF.OpaqueRValues.erase(OpaqueValue);
1282 CGF.unprotectFromPeepholes(Protection);
1289 CodeGenFunction &CGF;
1302 OpaqueValueMapping(CodeGenFunction &CGF,
1303 const AbstractConditionalOperator *op) : CGF(CGF) {
1309 Data = OpaqueValueMappingData::bind(CGF, e->getOpaqueValue(),
1315 OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *OV)
1316 : CGF(CGF) {
1320 Data = OpaqueValueMappingData::bind(CGF, OV, OV->getSourceExpr());
1324 OpaqueValueMapping(CodeGenFunction &CGF,
1327 : CGF(CGF), Data(OpaqueValueMappingData::bind(CGF, opaqueValue, lvalue)) {
1330 OpaqueValueMapping(CodeGenFunction &CGF,
1333 : CGF(CGF), Data(OpaqueValueMappingData::bind(CGF, opaqueValue, rvalue)) {
1337 Data.unbind(CGF);
1342 if (Data.isValid()) Data.unbind(CGF);
1421 void emitExit(CodeGenFunction &CGF, OpenMPDirectiveKind Kind,
1424 assert(CGF.getOMPCancelDestination(Kind).isValid());
1425 assert(CGF.HaveInsertPoint());
1427 auto IP = CGF.Builder.saveAndClearIP();
1428 CGF.EmitBlock(Stack.back().ExitBlock.getBlock());
1429 CodeGen(CGF);
1430 CGF.EmitBranch(Stack.back().ContBlock.getBlock());
1431 CGF.Builder.restoreIP(IP);
1434 CodeGen(CGF);
1440 void enter(CodeGenFunction &CGF, OpenMPDirectiveKind Kind, bool HasCancel) {
1442 HasCancel ? CGF.getJumpDestInCurrentScope("cancel.exit")
1444 HasCancel ? CGF.getJumpDestInCurrentScope("cancel.cont")
1449 void exit(CodeGenFunction &CGF) {
1451 assert(CGF.getOMPCancelDestination(Stack.back().Kind).isValid());
1452 bool HaveIP = CGF.HaveInsertPoint();
1455 CGF.EmitBranchThroughCleanup(Stack.back().ContBlock);
1456 CGF.EmitBlock(Stack.back().ExitBlock.getBlock());
1457 CGF.EmitBranchThroughCleanup(Stack.back().ContBlock);
1459 CGF.EmitBlock(Stack.back().ContBlock.getBlock());
1461 CGF.Builder.CreateUnreachable();
1462 CGF.Builder.ClearInsertionPoint();
1565 FieldConstructionScope(CodeGenFunction &CGF, Address This)
1566 : CGF(CGF), OldCXXDefaultInitExprThis(CGF.CXXDefaultInitExprThis) {
1567 CGF.CXXDefaultInitExprThis = This;
1570 CGF.CXXDefaultInitExprThis = OldCXXDefaultInitExprThis;
1574 CodeGenFunction &CGF;
1582 CXXDefaultInitExprScope(CodeGenFunction &CGF, const CXXDefaultInitExpr *E)
1583 : CGF(CGF), OldCXXThisValue(CGF.CXXThisValue),
1584 OldCXXThisAlignment(CGF.CXXThisAlignment),
1585 SourceLocScope(E, CGF.CurSourceLocExprScope) {
1586 CGF.CXXThisValue = CGF.CXXDefaultInitExprThis.getPointer();
1587 CGF.CXXThisAlignment = CGF.CXXDefaultInitExprThis.getAlignment();
1590 CGF.CXXThisValue = OldCXXThisValue;
1591 CGF.CXXThisAlignment = OldCXXThisAlignment;
1595 CodeGenFunction &CGF;
1602 CXXDefaultArgExprScope(CodeGenFunction &CGF, const CXXDefaultArgExpr *E)
1603 : SourceLocExprScopeGuard(E, CGF.CurSourceLocExprScope) {}
1610 ArrayInitLoopExprScope(CodeGenFunction &CGF, llvm::Value *Index)
1611 : CGF(CGF), OldArrayInitIndex(CGF.ArrayInitIndex) {
1612 CGF.ArrayInitIndex = Index;
1615 CGF.ArrayInitIndex = OldArrayInitIndex;
1619 CodeGenFunction &CGF;
1625 InlinedInheritingConstructorScope(CodeGenFunction &CGF, GlobalDecl GD)
1626 : CGF(CGF), OldCurGD(CGF.CurGD), OldCurFuncDecl(CGF.CurFuncDecl),
1627 OldCurCodeDecl(CGF.CurCodeDecl),
1628 OldCXXABIThisDecl(CGF.CXXABIThisDecl),
1629 OldCXXABIThisValue(CGF.CXXABIThisValue),
1630 OldCXXThisValue(CGF.CXXThisValue),
1631 OldCXXABIThisAlignment(CGF.CXXABIThisAlignment),
1632 OldCXXThisAlignment(CGF.CXXThisAlignment),
1633 OldReturnValue(CGF.ReturnValue), OldFnRetTy(CGF.FnRetTy),
1635 std::move(CGF.CXXInheritedCtorInitExprArgs)) {
1636 CGF.CurGD = GD;
1637 CGF.CurFuncDecl = CGF.CurCodeDecl =
1639 CGF.CXXABIThisDecl = nullptr;
1640 CGF.CXXABIThisValue = nullptr;
1641 CGF.CXXThisValue = nullptr;
1642 CGF.CXXABIThisAlignment = CharUnits();
1643 CGF.CXXThisAlignment = CharUnits();
1644 CGF.ReturnValue = Address::invalid();
1645 CGF.FnRetTy = QualType();
1646 CGF.CXXInheritedCtorInitExprArgs.clear();
1649 CGF.CurGD = OldCurGD;
1650 CGF.CurFuncDecl = OldCurFuncDecl;
1651 CGF.CurCodeDecl = OldCurCodeDecl;
1652 CGF.CXXABIThisDecl = OldCXXABIThisDecl;
1653 CGF.CXXABIThisValue = OldCXXABIThisValue;
1654 CGF.CXXThisValue = OldCXXThisValue;
1655 CGF.CXXABIThisAlignment = OldCXXABIThisAlignment;
1656 CGF.CXXThisAlignment = OldCXXThisAlignment;
1657 CGF.ReturnValue = OldReturnValue;
1658 CGF.FnRetTy = OldFnRetTy;
1659 CGF.CXXInheritedCtorInitExprArgs =
1664 CodeGenFunction &CGF;
1708 void Emit(CodeGenFunction &CGF, Flags /*flags*/) override {
1709 if (!CGF.HaveInsertPoint())
1711 CGF.Builder.Insert(RTLFnCI);
1721 static Address getAddrOfThreadPrivate(CodeGenFunction &CGF,
1726 static Address getAddressOfLocalVariable(CodeGenFunction &CGF,
1740 static void FinalizeOMPRegion(CodeGenFunction &CGF, InsertPointTy IP) {
1741 CGBuilderTy::InsertPointGuard IPG(CGF.Builder);
1751 CGF.Builder.SetInsertPoint(IPBB);
1752 CodeGenFunction::JumpDest Dest = CGF.getJumpDestInCurrentScope(DestBB);
1753 CGF.EmitBranchThroughCleanup(Dest);
1762 static void EmitOMPRegionBody(CodeGenFunction &CGF,
1770 CGF.Builder.SetInsertPoint(CodeGenIPBB);
1772 CGF.EmitStmt(RegionBodyStmt);
1774 if (CGF.Builder.saveIP().isSet())
1775 CGF.Builder.CreateBr(&FiniBB);
1784 CodeGenFunction &CGF;
1789 : CGF(cgf) {
1792 OldAllocaIP = CGF.AllocaInsertPt;
1793 CGF.AllocaInsertPt = &*AllocaIP.getPoint();
1794 IP = CGF.Builder.saveIP();
1796 OldReturnBlock = CGF.ReturnBlock;
1797 CGF.ReturnBlock = CGF.getJumpDestInCurrentScope(&RetBB);
1801 CGF.AllocaInsertPt = OldAllocaIP;
1802 CGF.ReturnBlock = OldReturnBlock;
1803 CGF.Builder.restoreIP(IP);
1811 CodeGenFunction &CGF;
1816 : CGF(cgf) {
1822 CGF.AllocaInsertPt->getParent() == AllocaIP.getBlock()) &&
1825 OldAllocaIP = CGF.AllocaInsertPt;
1827 CGF.AllocaInsertPt = &*AllocaIP.getPoint();
1834 (void)CGF.getJumpDestInCurrentScope(&FiniBB);
1837 ~InlinedRegionBodyRAII() { CGF.AllocaInsertPt = OldAllocaIP; }
1977 typedef void Destroyer(CodeGenFunction &CGF, Address addr, QualType ty);
3060 Address getObjectAddress(CodeGenFunction &CGF) const {
3063 return CGF.emitBlockByrefAddress(Addr, Variable, /*forward*/ false);
3269 CodeGenFunction &CGF;
3272 OMPCancelStackRAII(CodeGenFunction &CGF, OpenMPDirectiveKind Kind,
3274 : CGF(CGF) {
3275 CGF.OMPCancelStack.enter(CGF, Kind, HasCancel);
3277 ~OMPCancelStackRAII() { CGF.OMPCancelStack.exit(CGF); }
3886 LValue getReferenceLValue(CodeGenFunction &CGF, Expr *refExpr) const {
3888 return CGF.MakeNaturalAlignAddrLValue(ValueAndIsReference.getPointer(),
4817 DominatingLLVMValue::save(CodeGenFunction &CGF, llvm::Value *value) {
4822 CGF.CGM.getDataLayout().getPrefTypeAlignment(value->getType()));
4824 CGF.CreateTempAlloca(value->getType(), align, "cond-cleanup.save");
4825 CGF.Builder.CreateStore(value, alloca);
4830 inline llvm::Value *DominatingLLVMValue::restore(CodeGenFunction &CGF,
4837 return CGF.Builder.CreateAlignedLoad(alloca->getAllocatedType(), alloca,