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);
450 virtual void EmitBody(CodeGenFunction &CGF, const Stmt *S) {
451 CGF.incrementProfileCounter(S);
452 CGF.EmitStmt(S);
482 CodeGenFunction &CGF;
485 CGCapturedStmtRAII(CodeGenFunction &CGF,
487 : CGF(CGF), PrevCapturedStmtInfo(CGF.CapturedStmtInfo) {
488 CGF.CapturedStmtInfo = NewCapturedStmtInfo;
490 ~CGCapturedStmtRAII() { CGF.CapturedStmtInfo = PrevCapturedStmtInfo; }
526 CodeGenFunction *CGF;
528 SanitizerScope(CodeGenFunction *CGF);
636 void Emit(CodeGenFunction &CGF, Flags flags) override {
637 CGF.EmitLifetimeEnd(Size, Addr);
694 CodeGenFunction &CGF;
699 CodeGenFunction &CGF,
701 : CGF(CGF),
702 ParentLoopDirectiveForScan(CGF.OMPParentLoopDirectiveForScan) {
703 CGF.OMPParentLoopDirectiveForScan = &ParentLoopDirectiveForScan;
706 CGF.OMPParentLoopDirectiveForScan = ParentLoopDirectiveForScan;
717 CGFPOptionsRAII(CodeGenFunction &CGF, FPOptions FPFeatures);
718 CGFPOptionsRAII(CodeGenFunction &CGF, const Expr *E);
723 CodeGenFunction &CGF;
753 void enter(CodeGenFunction &CGF, const Stmt *Finally,
756 void exit(CodeGenFunction &CGF);
885 CodeGenFunction& CGF;
889 explicit RunCleanupsScope(CodeGenFunction &CGF)
890 : PerformCleanup(true), CGF(CGF)
892 CleanupStackDepth = CGF.EHStack.stable_begin();
894 CGF.LifetimeExtendedCleanupStack.size();
895 OldDidCallStackSave = CGF.DidCallStackSave;
896 CGF.DidCallStackSave = false;
897 OldCleanupScopeDepth = CGF.CurrentCleanupScopeDepth;
898 CGF.CurrentCleanupScopeDepth = CleanupStackDepth;
909 return CGF.EHStack.stable_begin() != CleanupStackDepth;
920 CGF.DidCallStackSave = OldDidCallStackSave;
921 CGF.PopCleanupBlocks(CleanupStackDepth, LifetimeExtendedCleanupStackSize,
924 CGF.CurrentCleanupScopeDepth = OldCleanupScopeDepth;
942 explicit LexicalScope(CodeGenFunction &CGF, SourceRange Range)
943 : RunCleanupsScope(CGF), Range(Range), ParentScope(CGF.CurLexicalScope) {
944 CGF.CurLexicalScope = this;
945 if (CGDebugInfo *DI = CGF.getDebugInfo())
946 DI->EmitLexicalBlockStart(CGF.Builder, Range.getBegin());
957 if (CGDebugInfo *DI = CGF.getDebugInfo())
958 DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
963 ApplyDebugLocation DL(CGF, Range.getEnd());
971 CGF.CurLexicalScope = ParentScope;
1003 bool setVarAddr(CodeGenFunction &CGF, const VarDecl *LocalVD,
1010 auto it = CGF.LocalDeclMap.find(LocalVD);
1011 if (it != CGF.LocalDeclMap.end())
1019 Address Temp = CGF.CreateMemTemp(VarTy);
1020 CGF.Builder.CreateStore(TempAddr.getPointer(), Temp);
1031 bool apply(CodeGenFunction &CGF) {
1032 copyInto(SavedTempAddresses, CGF.LocalDeclMap);
1038 void restore(CodeGenFunction &CGF) {
1040 copyInto(SavedLocals, CGF.LocalDeclMap);
1074 explicit OMPPrivateScope(CodeGenFunction &CGF) : RunCleanupsScope(CGF) {}
1083 return MappedVars.setVarAddr(CGF, LocalVD, Addr);
1094 bool Privatize() { return MappedVars.apply(CGF); }
1110 return !VD->isLocalVarDeclOrParm() && CGF.LocalDeclMap.count(VD) > 0;
1116 void restoreMap() { MappedVars.restore(CGF); }
1123 CodeGenFunction &CGF;
1127 OMPLocalDeclMapRAII(CodeGenFunction &CGF)
1128 : CGF(CGF), SavedMap(CGF.LocalDeclMap) {}
1129 ~OMPLocalDeclMapRAII() { SavedMap.swap(CGF.LocalDeclMap); }
1189 ConditionalEvaluation(CodeGenFunction &CGF)
1190 : StartBB(CGF.Builder.GetInsertBlock()) {}
1192 void begin(CodeGenFunction &CGF) {
1193 assert(CGF.OutermostConditional != this);
1194 if (!CGF.OutermostConditional)
1195 CGF.OutermostConditional = this;
1198 void end(CodeGenFunction &CGF) {
1199 assert(CGF.OutermostConditional != nullptr);
1200 if (CGF.OutermostConditional == this)
1201 CGF.OutermostConditional = nullptr;
1225 CodeGenFunction &CGF;
1233 StmtExprEvaluation(CodeGenFunction &CGF)
1234 : CGF(CGF), SavedOutermostConditional(CGF.OutermostConditional) {
1235 CGF.OutermostConditional = nullptr;
1239 CGF.OutermostConditional = SavedOutermostConditional;
1240 CGF.EnsureInsertPoint();
1283 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
1287 return bind(CGF, ov, CGF.EmitLValue(e));
1288 return bind(CGF, ov, CGF.EmitAnyExpr(e));
1291 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
1295 CGF.OpaqueLValues.insert(std::make_pair(ov, lv));
1299 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
1303 CGF.OpaqueRValues.insert(std::make_pair(ov, rv));
1310 data.Protection = CGF.protectFromPeepholes(rv);
1318 void unbind(CodeGenFunction &CGF) {
1322 CGF.OpaqueLValues.erase(OpaqueValue);
1324 CGF.OpaqueRValues.erase(OpaqueValue);
1325 CGF.unprotectFromPeepholes(Protection);
1332 CodeGenFunction &CGF;
1345 OpaqueValueMapping(CodeGenFunction &CGF,
1346 const AbstractConditionalOperator *op) : CGF(CGF) {
1352 Data = OpaqueValueMappingData::bind(CGF, e->getOpaqueValue(),
1358 OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *OV)
1359 : CGF(CGF) {
1363 Data = OpaqueValueMappingData::bind(CGF, OV, OV->getSourceExpr());
1367 OpaqueValueMapping(CodeGenFunction &CGF,
1370 : CGF(CGF), Data(OpaqueValueMappingData::bind(CGF, opaqueValue, lvalue)) {
1373 OpaqueValueMapping(CodeGenFunction &CGF,
1376 : CGF(CGF), Data(OpaqueValueMappingData::bind(CGF, opaqueValue, rvalue)) {
1380 Data.unbind(CGF);
1385 if (Data.isValid()) Data.unbind(CGF);
1464 void emitExit(CodeGenFunction &CGF, OpenMPDirectiveKind Kind,
1467 assert(CGF.getOMPCancelDestination(Kind).isValid());
1468 assert(CGF.HaveInsertPoint());
1470 auto IP = CGF.Builder.saveAndClearIP();
1471 CGF.EmitBlock(Stack.back().ExitBlock.getBlock());
1472 CodeGen(CGF);
1473 CGF.EmitBranch(Stack.back().ContBlock.getBlock());
1474 CGF.Builder.restoreIP(IP);
1477 CodeGen(CGF);
1483 void enter(CodeGenFunction &CGF, OpenMPDirectiveKind Kind, bool HasCancel) {
1485 HasCancel ? CGF.getJumpDestInCurrentScope("cancel.exit")
1487 HasCancel ? CGF.getJumpDestInCurrentScope("cancel.cont")
1492 void exit(CodeGenFunction &CGF) {
1494 assert(CGF.getOMPCancelDestination(Stack.back().Kind).isValid());
1495 bool HaveIP = CGF.HaveInsertPoint();
1498 CGF.EmitBranchThroughCleanup(Stack.back().ContBlock);
1499 CGF.EmitBlock(Stack.back().ExitBlock.getBlock());
1500 CGF.EmitBranchThroughCleanup(Stack.back().ContBlock);
1502 CGF.EmitBlock(Stack.back().ContBlock.getBlock());
1504 CGF.Builder.CreateUnreachable();
1505 CGF.Builder.ClearInsertionPoint();
1606 FieldConstructionScope(CodeGenFunction &CGF, Address This)
1607 : CGF(CGF), OldCXXDefaultInitExprThis(CGF.CXXDefaultInitExprThis) {
1608 CGF.CXXDefaultInitExprThis = This;
1611 CGF.CXXDefaultInitExprThis = OldCXXDefaultInitExprThis;
1615 CodeGenFunction &CGF;
1623 CXXDefaultInitExprScope(CodeGenFunction &CGF, const CXXDefaultInitExpr *E)
1624 : CGF(CGF), OldCXXThisValue(CGF.CXXThisValue),
1625 OldCXXThisAlignment(CGF.CXXThisAlignment),
1626 SourceLocScope(E, CGF.CurSourceLocExprScope) {
1627 CGF.CXXThisValue = CGF.CXXDefaultInitExprThis.getPointer();
1628 CGF.CXXThisAlignment = CGF.CXXDefaultInitExprThis.getAlignment();
1631 CGF.CXXThisValue = OldCXXThisValue;
1632 CGF.CXXThisAlignment = OldCXXThisAlignment;
1636 CodeGenFunction &CGF;
1643 CXXDefaultArgExprScope(CodeGenFunction &CGF, const CXXDefaultArgExpr *E)
1644 : SourceLocExprScopeGuard(E, CGF.CurSourceLocExprScope) {}
1651 ArrayInitLoopExprScope(CodeGenFunction &CGF, llvm::Value *Index)
1652 : CGF(CGF), OldArrayInitIndex(CGF.ArrayInitIndex) {
1653 CGF.ArrayInitIndex = Index;
1656 CGF.ArrayInitIndex = OldArrayInitIndex;
1660 CodeGenFunction &CGF;
1666 InlinedInheritingConstructorScope(CodeGenFunction &CGF, GlobalDecl GD)
1667 : CGF(CGF), OldCurGD(CGF.CurGD), OldCurFuncDecl(CGF.CurFuncDecl),
1668 OldCurCodeDecl(CGF.CurCodeDecl),
1669 OldCXXABIThisDecl(CGF.CXXABIThisDecl),
1670 OldCXXABIThisValue(CGF.CXXABIThisValue),
1671 OldCXXThisValue(CGF.CXXThisValue),
1672 OldCXXABIThisAlignment(CGF.CXXABIThisAlignment),
1673 OldCXXThisAlignment(CGF.CXXThisAlignment),
1674 OldReturnValue(CGF.ReturnValue), OldFnRetTy(CGF.FnRetTy),
1676 std::move(CGF.CXXInheritedCtorInitExprArgs)) {
1677 CGF.CurGD = GD;
1678 CGF.CurFuncDecl = CGF.CurCodeDecl =
1680 CGF.CXXABIThisDecl = nullptr;
1681 CGF.CXXABIThisValue = nullptr;
1682 CGF.CXXThisValue = nullptr;
1683 CGF.CXXABIThisAlignment = CharUnits();
1684 CGF.CXXThisAlignment = CharUnits();
1685 CGF.ReturnValue = Address::invalid();
1686 CGF.FnRetTy = QualType();
1687 CGF.CXXInheritedCtorInitExprArgs.clear();
1690 CGF.CurGD = OldCurGD;
1691 CGF.CurFuncDecl = OldCurFuncDecl;
1692 CGF.CurCodeDecl = OldCurCodeDecl;
1693 CGF.CXXABIThisDecl = OldCXXABIThisDecl;
1694 CGF.CXXABIThisValue = OldCXXABIThisValue;
1695 CGF.CXXThisValue = OldCXXThisValue;
1696 CGF.CXXABIThisAlignment = OldCXXABIThisAlignment;
1697 CGF.CXXThisAlignment = OldCXXThisAlignment;
1698 CGF.ReturnValue = OldReturnValue;
1699 CGF.FnRetTy = OldFnRetTy;
1700 CGF.CXXInheritedCtorInitExprArgs =
1705 CodeGenFunction &CGF;
1749 void Emit(CodeGenFunction &CGF, Flags /*flags*/) override {
1750 if (!CGF.HaveInsertPoint())
1752 CGF.Builder.Insert(RTLFnCI);
1762 static Address getAddrOfThreadPrivate(CodeGenFunction &CGF,
1767 static Address getAddressOfLocalVariable(CodeGenFunction &CGF,
1781 static void FinalizeOMPRegion(CodeGenFunction &CGF, InsertPointTy IP) {
1782 CGBuilderTy::InsertPointGuard IPG(CGF.Builder);
1792 CGF.Builder.SetInsertPoint(IPBB);
1793 CodeGenFunction::JumpDest Dest = CGF.getJumpDestInCurrentScope(DestBB);
1794 CGF.EmitBranchThroughCleanup(Dest);
1804 static void EmitOMPInlinedRegionBody(CodeGenFunction &CGF,
1810 static void EmitCaptureStmt(CodeGenFunction &CGF, InsertPointTy CodeGenIP,
1817 CGF.Builder.SetInsertPoint(CodeGenIPBB);
1820 CGF.EmitNounwindRuntimeCall(Fn, Args);
1822 CGF.EmitRuntimeCall(Fn, Args);
1824 if (CGF.Builder.saveIP().isSet())
1825 CGF.Builder.CreateBr(&FiniBB);
1836 static void EmitOMPOutlinedRegionBody(CodeGenFunction &CGF,
1847 CodeGenFunction &CGF;
1852 : CGF(cgf) {
1855 OldAllocaIP = CGF.AllocaInsertPt;
1856 CGF.AllocaInsertPt = &*AllocaIP.getPoint();
1858 OldReturnBlock = CGF.ReturnBlock;
1859 CGF.ReturnBlock = CGF.getJumpDestInCurrentScope(&RetBB);
1863 CGF.AllocaInsertPt = OldAllocaIP;
1864 CGF.ReturnBlock = OldReturnBlock;
1872 CodeGenFunction &CGF;
1877 : CGF(cgf) {
1883 CGF.AllocaInsertPt->getParent() == AllocaIP.getBlock()) &&
1886 OldAllocaIP = CGF.AllocaInsertPt;
1888 CGF.AllocaInsertPt = &*AllocaIP.getPoint();
1895 (void)CGF.getJumpDestInCurrentScope(&FiniBB);
1898 ~InlinedRegionBodyRAII() { CGF.AllocaInsertPt = OldAllocaIP; }
2037 typedef void Destroyer(CodeGenFunction &CGF, Address addr, QualType ty);
3117 Address getObjectAddress(CodeGenFunction &CGF) const {
3120 return CGF.emitBlockByrefAddress(Addr, Variable, /*forward*/ false);
3329 CodeGenFunction &CGF;
3332 OMPCancelStackRAII(CodeGenFunction &CGF, OpenMPDirectiveKind Kind,
3334 : CGF(CGF) {
3335 CGF.OMPCancelStack.enter(CGF, Kind, HasCancel);
3337 ~OMPCancelStackRAII() { CGF.OMPCancelStack.exit(CGF); }
3502 CodeGenFunction &CGF,
3956 LValue getReferenceLValue(CodeGenFunction &CGF, Expr *refExpr) const {
3958 return CGF.MakeNaturalAlignAddrLValue(ValueAndIsReference.getPointer(),
4850 DominatingLLVMValue::save(CodeGenFunction &CGF, llvm::Value *value) {
4855 CGF.CGM.getDataLayout().getPrefTypeAlign(value->getType()));
4857 CGF.CreateTempAlloca(value->getType(), align, "cond-cleanup.save");
4858 CGF.Builder.CreateStore(value, alloca);
4863 inline llvm::Value *DominatingLLVMValue::restore(CodeGenFunction &CGF,
4870 return CGF.Builder.CreateAlignedLoad(alloca->getAllocatedType(), alloca,