Lines Matching refs:CGF

161   static saved_type save(CodeGenFunction &CGF, llvm::Value *value);
162 static llvm::Value *restore(CodeGenFunction &CGF, saved_type value);
169 static type restore(CodeGenFunction &CGF, saved_type value) {
170 return static_cast<T*>(DominatingLLVMValue::restore(CGF, value));
187 static saved_type save(CodeGenFunction &CGF, type value) {
188 return { DominatingLLVMValue::save(CGF, value.getPointer()),
191 static type restore(CodeGenFunction &CGF, saved_type value) {
192 return Address(DominatingLLVMValue::restore(CGF, value.SavedValue),
213 static saved_type save(CodeGenFunction &CGF, RValue value);
214 RValue restore(CodeGenFunction &CGF);
222 static saved_type save(CodeGenFunction &CGF, type value) {
223 return saved_type::save(CGF, value);
225 static type restore(CodeGenFunction &CGF, saved_type value) {
226 return value.restore(CGF);
458 virtual void EmitBody(CodeGenFunction &CGF, const Stmt *S) {
459 CGF.incrementProfileCounter(S);
460 CGF.EmitStmt(S);
490 CodeGenFunction &CGF;
493 CGCapturedStmtRAII(CodeGenFunction &CGF,
495 : CGF(CGF), PrevCapturedStmtInfo(CGF.CapturedStmtInfo) {
496 CGF.CapturedStmtInfo = NewCapturedStmtInfo;
498 ~CGCapturedStmtRAII() { CGF.CapturedStmtInfo = PrevCapturedStmtInfo; }
534 CodeGenFunction *CGF;
536 SanitizerScope(CodeGenFunction *CGF);
644 void Emit(CodeGenFunction &CGF, Flags flags) override {
645 CGF.EmitLifetimeEnd(Size, Addr);
702 CodeGenFunction &CGF;
707 CodeGenFunction &CGF,
709 : CGF(CGF),
710 ParentLoopDirectiveForScan(CGF.OMPParentLoopDirectiveForScan) {
711 CGF.OMPParentLoopDirectiveForScan = &ParentLoopDirectiveForScan;
714 CGF.OMPParentLoopDirectiveForScan = ParentLoopDirectiveForScan;
725 CGFPOptionsRAII(CodeGenFunction &CGF, FPOptions FPFeatures);
726 CGFPOptionsRAII(CodeGenFunction &CGF, const Expr *E);
731 CodeGenFunction &CGF;
761 void enter(CodeGenFunction &CGF, const Stmt *Finally,
764 void exit(CodeGenFunction &CGF);
893 CodeGenFunction& CGF;
897 explicit RunCleanupsScope(CodeGenFunction &CGF)
898 : PerformCleanup(true), CGF(CGF)
900 CleanupStackDepth = CGF.EHStack.stable_begin();
902 CGF.LifetimeExtendedCleanupStack.size();
903 OldDidCallStackSave = CGF.DidCallStackSave;
904 CGF.DidCallStackSave = false;
905 OldCleanupScopeDepth = CGF.CurrentCleanupScopeDepth;
906 CGF.CurrentCleanupScopeDepth = CleanupStackDepth;
917 return CGF.EHStack.stable_begin() != CleanupStackDepth;
928 CGF.DidCallStackSave = OldDidCallStackSave;
929 CGF.PopCleanupBlocks(CleanupStackDepth, LifetimeExtendedCleanupStackSize,
932 CGF.CurrentCleanupScopeDepth = OldCleanupScopeDepth;
950 explicit LexicalScope(CodeGenFunction &CGF, SourceRange Range)
951 : RunCleanupsScope(CGF), Range(Range), ParentScope(CGF.CurLexicalScope) {
952 CGF.CurLexicalScope = this;
953 if (CGDebugInfo *DI = CGF.getDebugInfo())
954 DI->EmitLexicalBlockStart(CGF.Builder, Range.getBegin());
965 if (CGDebugInfo *DI = CGF.getDebugInfo())
966 DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
971 ApplyDebugLocation DL(CGF, Range.getEnd());
979 CGF.CurLexicalScope = ParentScope;
1011 bool setVarAddr(CodeGenFunction &CGF, const VarDecl *LocalVD,
1018 auto it = CGF.LocalDeclMap.find(LocalVD);
1019 if (it != CGF.LocalDeclMap.end())
1027 Address Temp = CGF.CreateMemTemp(VarTy);
1028 CGF.Builder.CreateStore(TempAddr.getPointer(), Temp);
1039 bool apply(CodeGenFunction &CGF) {
1040 copyInto(SavedTempAddresses, CGF.LocalDeclMap);
1046 void restore(CodeGenFunction &CGF) {
1048 copyInto(SavedLocals, CGF.LocalDeclMap);
1082 explicit OMPPrivateScope(CodeGenFunction &CGF) : RunCleanupsScope(CGF) {}
1091 return MappedVars.setVarAddr(CGF, LocalVD, Addr);
1102 bool Privatize() { return MappedVars.apply(CGF); }
1118 return !VD->isLocalVarDeclOrParm() && CGF.LocalDeclMap.count(VD) > 0;
1124 void restoreMap() { MappedVars.restore(CGF); }
1131 CodeGenFunction &CGF;
1135 OMPLocalDeclMapRAII(CodeGenFunction &CGF)
1136 : CGF(CGF), SavedMap(CGF.LocalDeclMap) {}
1137 ~OMPLocalDeclMapRAII() { SavedMap.swap(CGF.LocalDeclMap); }
1197 ConditionalEvaluation(CodeGenFunction &CGF)
1198 : StartBB(CGF.Builder.GetInsertBlock()) {}
1200 void begin(CodeGenFunction &CGF) {
1201 assert(CGF.OutermostConditional != this);
1202 if (!CGF.OutermostConditional)
1203 CGF.OutermostConditional = this;
1206 void end(CodeGenFunction &CGF) {
1207 assert(CGF.OutermostConditional != nullptr);
1208 if (CGF.OutermostConditional == this)
1209 CGF.OutermostConditional = nullptr;
1233 CodeGenFunction &CGF;
1241 StmtExprEvaluation(CodeGenFunction &CGF)
1242 : CGF(CGF), SavedOutermostConditional(CGF.OutermostConditional) {
1243 CGF.OutermostConditional = nullptr;
1247 CGF.OutermostConditional = SavedOutermostConditional;
1248 CGF.EnsureInsertPoint();
1291 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
1295 return bind(CGF, ov, CGF.EmitLValue(e));
1296 return bind(CGF, ov, CGF.EmitAnyExpr(e));
1299 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
1303 CGF.OpaqueLValues.insert(std::make_pair(ov, lv));
1307 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
1311 CGF.OpaqueRValues.insert(std::make_pair(ov, rv));
1318 data.Protection = CGF.protectFromPeepholes(rv);
1326 void unbind(CodeGenFunction &CGF) {
1330 CGF.OpaqueLValues.erase(OpaqueValue);
1332 CGF.OpaqueRValues.erase(OpaqueValue);
1333 CGF.unprotectFromPeepholes(Protection);
1340 CodeGenFunction &CGF;
1353 OpaqueValueMapping(CodeGenFunction &CGF,
1354 const AbstractConditionalOperator *op) : CGF(CGF) {
1360 Data = OpaqueValueMappingData::bind(CGF, e->getOpaqueValue(),
1366 OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *OV)
1367 : CGF(CGF) {
1371 Data = OpaqueValueMappingData::bind(CGF, OV, OV->getSourceExpr());
1375 OpaqueValueMapping(CodeGenFunction &CGF,
1378 : CGF(CGF), Data(OpaqueValueMappingData::bind(CGF, opaqueValue, lvalue)) {
1381 OpaqueValueMapping(CodeGenFunction &CGF,
1384 : CGF(CGF), Data(OpaqueValueMappingData::bind(CGF, opaqueValue, rvalue)) {
1388 Data.unbind(CGF);
1393 if (Data.isValid()) Data.unbind(CGF);
1472 void emitExit(CodeGenFunction &CGF, OpenMPDirectiveKind Kind,
1475 assert(CGF.getOMPCancelDestination(Kind).isValid());
1476 assert(CGF.HaveInsertPoint());
1478 auto IP = CGF.Builder.saveAndClearIP();
1479 CGF.EmitBlock(Stack.back().ExitBlock.getBlock());
1480 CodeGen(CGF);
1481 CGF.EmitBranch(Stack.back().ContBlock.getBlock());
1482 CGF.Builder.restoreIP(IP);
1485 CodeGen(CGF);
1491 void enter(CodeGenFunction &CGF, OpenMPDirectiveKind Kind, bool HasCancel) {
1493 HasCancel ? CGF.getJumpDestInCurrentScope("cancel.exit")
1495 HasCancel ? CGF.getJumpDestInCurrentScope("cancel.cont")
1500 void exit(CodeGenFunction &CGF) {
1502 assert(CGF.getOMPCancelDestination(Stack.back().Kind).isValid());
1503 bool HaveIP = CGF.HaveInsertPoint();
1506 CGF.EmitBranchThroughCleanup(Stack.back().ContBlock);
1507 CGF.EmitBlock(Stack.back().ExitBlock.getBlock());
1508 CGF.EmitBranchThroughCleanup(Stack.back().ContBlock);
1510 CGF.EmitBlock(Stack.back().ContBlock.getBlock());
1512 CGF.Builder.CreateUnreachable();
1513 CGF.Builder.ClearInsertionPoint();
1663 FieldConstructionScope(CodeGenFunction &CGF, Address This)
1664 : CGF(CGF), OldCXXDefaultInitExprThis(CGF.CXXDefaultInitExprThis) {
1665 CGF.CXXDefaultInitExprThis = This;
1668 CGF.CXXDefaultInitExprThis = OldCXXDefaultInitExprThis;
1672 CodeGenFunction &CGF;
1680 CXXDefaultInitExprScope(CodeGenFunction &CGF, const CXXDefaultInitExpr *E)
1681 : CGF(CGF), OldCXXThisValue(CGF.CXXThisValue),
1682 OldCXXThisAlignment(CGF.CXXThisAlignment),
1683 SourceLocScope(E, CGF.CurSourceLocExprScope) {
1684 CGF.CXXThisValue = CGF.CXXDefaultInitExprThis.getPointer();
1685 CGF.CXXThisAlignment = CGF.CXXDefaultInitExprThis.getAlignment();
1688 CGF.CXXThisValue = OldCXXThisValue;
1689 CGF.CXXThisAlignment = OldCXXThisAlignment;
1693 CodeGenFunction &CGF;
1700 CXXDefaultArgExprScope(CodeGenFunction &CGF, const CXXDefaultArgExpr *E)
1701 : SourceLocExprScopeGuard(E, CGF.CurSourceLocExprScope) {}
1708 ArrayInitLoopExprScope(CodeGenFunction &CGF, llvm::Value *Index)
1709 : CGF(CGF), OldArrayInitIndex(CGF.ArrayInitIndex) {
1710 CGF.ArrayInitIndex = Index;
1713 CGF.ArrayInitIndex = OldArrayInitIndex;
1717 CodeGenFunction &CGF;
1723 InlinedInheritingConstructorScope(CodeGenFunction &CGF, GlobalDecl GD)
1724 : CGF(CGF), OldCurGD(CGF.CurGD), OldCurFuncDecl(CGF.CurFuncDecl),
1725 OldCurCodeDecl(CGF.CurCodeDecl),
1726 OldCXXABIThisDecl(CGF.CXXABIThisDecl),
1727 OldCXXABIThisValue(CGF.CXXABIThisValue),
1728 OldCXXThisValue(CGF.CXXThisValue),
1729 OldCXXABIThisAlignment(CGF.CXXABIThisAlignment),
1730 OldCXXThisAlignment(CGF.CXXThisAlignment),
1731 OldReturnValue(CGF.ReturnValue), OldFnRetTy(CGF.FnRetTy),
1733 std::move(CGF.CXXInheritedCtorInitExprArgs)) {
1734 CGF.CurGD = GD;
1735 CGF.CurFuncDecl = CGF.CurCodeDecl =
1737 CGF.CXXABIThisDecl = nullptr;
1738 CGF.CXXABIThisValue = nullptr;
1739 CGF.CXXThisValue = nullptr;
1740 CGF.CXXABIThisAlignment = CharUnits();
1741 CGF.CXXThisAlignment = CharUnits();
1742 CGF.ReturnValue = Address::invalid();
1743 CGF.FnRetTy = QualType();
1744 CGF.CXXInheritedCtorInitExprArgs.clear();
1747 CGF.CurGD = OldCurGD;
1748 CGF.CurFuncDecl = OldCurFuncDecl;
1749 CGF.CurCodeDecl = OldCurCodeDecl;
1750 CGF.CXXABIThisDecl = OldCXXABIThisDecl;
1751 CGF.CXXABIThisValue = OldCXXABIThisValue;
1752 CGF.CXXThisValue = OldCXXThisValue;
1753 CGF.CXXABIThisAlignment = OldCXXABIThisAlignment;
1754 CGF.CXXThisAlignment = OldCXXThisAlignment;
1755 CGF.ReturnValue = OldReturnValue;
1756 CGF.FnRetTy = OldFnRetTy;
1757 CGF.CXXInheritedCtorInitExprArgs =
1762 CodeGenFunction &CGF;
1806 void Emit(CodeGenFunction &CGF, Flags /*flags*/) override {
1807 if (!CGF.HaveInsertPoint())
1809 CGF.Builder.Insert(RTLFnCI);
1819 static Address getAddrOfThreadPrivate(CodeGenFunction &CGF,
1824 static Address getAddressOfLocalVariable(CodeGenFunction &CGF,
1838 static void FinalizeOMPRegion(CodeGenFunction &CGF, InsertPointTy IP) {
1839 CGBuilderTy::InsertPointGuard IPG(CGF.Builder);
1849 CGF.Builder.SetInsertPoint(IPBB);
1850 CodeGenFunction::JumpDest Dest = CGF.getJumpDestInCurrentScope(DestBB);
1851 CGF.EmitBranchThroughCleanup(Dest);
1861 static void EmitOMPInlinedRegionBody(CodeGenFunction &CGF,
1867 static void EmitCaptureStmt(CodeGenFunction &CGF, InsertPointTy CodeGenIP,
1874 CGF.Builder.SetInsertPoint(CodeGenIPBB);
1877 CGF.EmitNounwindRuntimeCall(Fn, Args);
1879 CGF.EmitRuntimeCall(Fn, Args);
1881 if (CGF.Builder.saveIP().isSet())
1882 CGF.Builder.CreateBr(&FiniBB);
1893 static void EmitOMPOutlinedRegionBody(CodeGenFunction &CGF,
1904 CodeGenFunction &CGF;
1909 : CGF(cgf) {
1912 OldAllocaIP = CGF.AllocaInsertPt;
1913 CGF.AllocaInsertPt = &*AllocaIP.getPoint();
1915 OldReturnBlock = CGF.ReturnBlock;
1916 CGF.ReturnBlock = CGF.getJumpDestInCurrentScope(&RetBB);
1920 CGF.AllocaInsertPt = OldAllocaIP;
1921 CGF.ReturnBlock = OldReturnBlock;
1929 CodeGenFunction &CGF;
1934 : CGF(cgf) {
1940 CGF.AllocaInsertPt->getParent() == AllocaIP.getBlock()) &&
1943 OldAllocaIP = CGF.AllocaInsertPt;
1945 CGF.AllocaInsertPt = &*AllocaIP.getPoint();
1952 (void)CGF.getJumpDestInCurrentScope(&FiniBB);
1955 ~InlinedRegionBodyRAII() { CGF.AllocaInsertPt = OldAllocaIP; }
2097 typedef void Destroyer(CodeGenFunction &CGF, Address addr, QualType ty);
3201 Address getObjectAddress(CodeGenFunction &CGF) const {
3204 return CGF.emitBlockByrefAddress(Addr, Variable, /*forward*/ false);
3414 CodeGenFunction &CGF;
3417 OMPCancelStackRAII(CodeGenFunction &CGF, OpenMPDirectiveKind Kind,
3419 : CGF(CGF) {
3420 CGF.OMPCancelStack.enter(CGF, Kind, HasCancel);
3422 ~OMPCancelStackRAII() { CGF.OMPCancelStack.exit(CGF); }
3589 CodeGenFunction &CGF,
4065 LValue getReferenceLValue(CodeGenFunction &CGF, Expr *refExpr) const {
4067 return CGF.MakeNaturalAlignAddrLValue(ValueAndIsReference.getPointer(),
5008 DominatingLLVMValue::save(CodeGenFunction &CGF, llvm::Value *value) {
5013 CGF.CGM.getDataLayout().getPrefTypeAlign(value->getType()));
5015 CGF.CreateTempAlloca(value->getType(), align, "cond-cleanup.save");
5016 CGF.Builder.CreateStore(value, alloca);
5021 inline llvm::Value *DominatingLLVMValue::restore(CodeGenFunction &CGF,
5028 return CGF.Builder.CreateAlignedLoad(alloca->getAllocatedType(), alloca,