Lines Matching refs:CGF

158   static saved_type save(CodeGenFunction &CGF, llvm::Value *value);
159 static llvm::Value *restore(CodeGenFunction &CGF, saved_type value);
166 static type restore(CodeGenFunction &CGF, saved_type value) {
167 return static_cast<T*>(DominatingLLVMValue::restore(CGF, value));
183 static saved_type save(CodeGenFunction &CGF, type value) {
184 return { DominatingLLVMValue::save(CGF, value.getPointer()),
187 static type restore(CodeGenFunction &CGF, saved_type value) {
188 return Address(DominatingLLVMValue::restore(CGF, value.SavedValue),
208 static saved_type save(CodeGenFunction &CGF, RValue value);
209 RValue restore(CodeGenFunction &CGF);
217 static saved_type save(CodeGenFunction &CGF, type value) {
218 return saved_type::save(CGF, value);
220 static type restore(CodeGenFunction &CGF, saved_type value) {
221 return value.restore(CGF);
386 virtual void EmitBody(CodeGenFunction &CGF, const Stmt *S) {
387 CGF.incrementProfileCounter(S);
388 CGF.EmitStmt(S);
413 CodeGenFunction &CGF;
416 CGCapturedStmtRAII(CodeGenFunction &CGF,
418 : CGF(CGF), PrevCapturedStmtInfo(CGF.CapturedStmtInfo) {
419 CGF.CapturedStmtInfo = NewCapturedStmtInfo;
421 ~CGCapturedStmtRAII() { CGF.CapturedStmtInfo = PrevCapturedStmtInfo; }
457 CodeGenFunction *CGF;
459 SanitizerScope(CodeGenFunction *CGF);
504 void Emit(CodeGenFunction &CGF, Flags flags) override {
505 CGF.EmitLifetimeEnd(Size, Addr);
582 void enter(CodeGenFunction &CGF, const Stmt *Finally,
585 void exit(CodeGenFunction &CGF);
712 CodeGenFunction& CGF;
716 explicit RunCleanupsScope(CodeGenFunction &CGF)
717 : PerformCleanup(true), CGF(CGF)
719 CleanupStackDepth = CGF.EHStack.stable_begin();
721 CGF.LifetimeExtendedCleanupStack.size();
722 OldDidCallStackSave = CGF.DidCallStackSave;
723 CGF.DidCallStackSave = false;
724 OldCleanupScopeDepth = CGF.CurrentCleanupScopeDepth;
725 CGF.CurrentCleanupScopeDepth = CleanupStackDepth;
736 return CGF.EHStack.stable_begin() != CleanupStackDepth;
747 CGF.DidCallStackSave = OldDidCallStackSave;
748 CGF.PopCleanupBlocks(CleanupStackDepth, LifetimeExtendedCleanupStackSize,
751 CGF.CurrentCleanupScopeDepth = OldCleanupScopeDepth;
769 explicit LexicalScope(CodeGenFunction &CGF, SourceRange Range)
770 : RunCleanupsScope(CGF), Range(Range), ParentScope(CGF.CurLexicalScope) {
771 CGF.CurLexicalScope = this;
772 if (CGDebugInfo *DI = CGF.getDebugInfo())
773 DI->EmitLexicalBlockStart(CGF.Builder, Range.getBegin());
784 if (CGDebugInfo *DI = CGF.getDebugInfo())
785 DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
790 ApplyDebugLocation DL(CGF, Range.getEnd());
798 CGF.CurLexicalScope = ParentScope;
830 bool setVarAddr(CodeGenFunction &CGF, const VarDecl *LocalVD,
837 auto it = CGF.LocalDeclMap.find(LocalVD);
838 if (it != CGF.LocalDeclMap.end())
846 Address Temp = CGF.CreateMemTemp(VarTy);
847 CGF.Builder.CreateStore(TempAddr.getPointer(), Temp);
858 bool apply(CodeGenFunction &CGF) {
859 copyInto(SavedTempAddresses, CGF.LocalDeclMap);
865 void restore(CodeGenFunction &CGF) {
867 copyInto(SavedLocals, CGF.LocalDeclMap);
901 explicit OMPPrivateScope(CodeGenFunction &CGF) : RunCleanupsScope(CGF) {}
911 return MappedVars.setVarAddr(CGF, LocalVD, PrivateGen());
922 bool Privatize() { return MappedVars.apply(CGF); }
926 MappedVars.restore(CGF);
938 return !VD->isLocalVarDeclOrParm() && CGF.LocalDeclMap.count(VD) > 0;
999 ConditionalEvaluation(CodeGenFunction &CGF)
1000 : StartBB(CGF.Builder.GetInsertBlock()) {}
1002 void begin(CodeGenFunction &CGF) {
1003 assert(CGF.OutermostConditional != this);
1004 if (!CGF.OutermostConditional)
1005 CGF.OutermostConditional = this;
1008 void end(CodeGenFunction &CGF) {
1009 assert(CGF.OutermostConditional != nullptr);
1010 if (CGF.OutermostConditional == this)
1011 CGF.OutermostConditional = nullptr;
1035 CodeGenFunction &CGF;
1043 StmtExprEvaluation(CodeGenFunction &CGF)
1044 : CGF(CGF), SavedOutermostConditional(CGF.OutermostConditional) {
1045 CGF.OutermostConditional = nullptr;
1049 CGF.OutermostConditional = SavedOutermostConditional;
1050 CGF.EnsureInsertPoint();
1093 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
1097 return bind(CGF, ov, CGF.EmitLValue(e));
1098 return bind(CGF, ov, CGF.EmitAnyExpr(e));
1101 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
1105 CGF.OpaqueLValues.insert(std::make_pair(ov, lv));
1109 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
1113 CGF.OpaqueRValues.insert(std::make_pair(ov, rv));
1120 data.Protection = CGF.protectFromPeepholes(rv);
1128 void unbind(CodeGenFunction &CGF) {
1132 CGF.OpaqueLValues.erase(OpaqueValue);
1134 CGF.OpaqueRValues.erase(OpaqueValue);
1135 CGF.unprotectFromPeepholes(Protection);
1142 CodeGenFunction &CGF;
1155 OpaqueValueMapping(CodeGenFunction &CGF,
1156 const AbstractConditionalOperator *op) : CGF(CGF) {
1162 Data = OpaqueValueMappingData::bind(CGF, e->getOpaqueValue(),
1168 OpaqueValueMapping(CodeGenFunction &CGF, const OpaqueValueExpr *OV)
1169 : CGF(CGF) {
1173 Data = OpaqueValueMappingData::bind(CGF, OV, OV->getSourceExpr());
1177 OpaqueValueMapping(CodeGenFunction &CGF,
1180 : CGF(CGF), Data(OpaqueValueMappingData::bind(CGF, opaqueValue, lvalue)) {
1183 OpaqueValueMapping(CodeGenFunction &CGF,
1186 : CGF(CGF), Data(OpaqueValueMappingData::bind(CGF, opaqueValue, rvalue)) {
1190 Data.unbind(CGF);
1195 if (Data.isValid()) Data.unbind(CGF);
1274 void emitExit(CodeGenFunction &CGF, OpenMPDirectiveKind Kind,
1277 assert(CGF.getOMPCancelDestination(Kind).isValid());
1278 assert(CGF.HaveInsertPoint());
1280 auto IP = CGF.Builder.saveAndClearIP();
1281 CGF.EmitBlock(Stack.back().ExitBlock.getBlock());
1282 CodeGen(CGF);
1283 CGF.EmitBranch(Stack.back().ContBlock.getBlock());
1284 CGF.Builder.restoreIP(IP);
1287 CodeGen(CGF);
1293 void enter(CodeGenFunction &CGF, OpenMPDirectiveKind Kind, bool HasCancel) {
1295 HasCancel ? CGF.getJumpDestInCurrentScope("cancel.exit")
1297 HasCancel ? CGF.getJumpDestInCurrentScope("cancel.cont")
1302 void exit(CodeGenFunction &CGF) {
1304 assert(CGF.getOMPCancelDestination(Stack.back().Kind).isValid());
1305 bool HaveIP = CGF.HaveInsertPoint();
1308 CGF.EmitBranchThroughCleanup(Stack.back().ContBlock);
1309 CGF.EmitBlock(Stack.back().ExitBlock.getBlock());
1310 CGF.EmitBranchThroughCleanup(Stack.back().ContBlock);
1312 CGF.EmitBlock(Stack.back().ContBlock.getBlock());
1314 CGF.Builder.CreateUnreachable();
1315 CGF.Builder.ClearInsertionPoint();
1403 FieldConstructionScope(CodeGenFunction &CGF, Address This)
1404 : CGF(CGF), OldCXXDefaultInitExprThis(CGF.CXXDefaultInitExprThis) {
1405 CGF.CXXDefaultInitExprThis = This;
1408 CGF.CXXDefaultInitExprThis = OldCXXDefaultInitExprThis;
1412 CodeGenFunction &CGF;
1420 CXXDefaultInitExprScope(CodeGenFunction &CGF)
1421 : CGF(CGF), OldCXXThisValue(CGF.CXXThisValue),
1422 OldCXXThisAlignment(CGF.CXXThisAlignment) {
1423 CGF.CXXThisValue = CGF.CXXDefaultInitExprThis.getPointer();
1424 CGF.CXXThisAlignment = CGF.CXXDefaultInitExprThis.getAlignment();
1427 CGF.CXXThisValue = OldCXXThisValue;
1428 CGF.CXXThisAlignment = OldCXXThisAlignment;
1432 CodeGenFunction &CGF;
1441 ArrayInitLoopExprScope(CodeGenFunction &CGF, llvm::Value *Index)
1442 : CGF(CGF), OldArrayInitIndex(CGF.ArrayInitIndex) {
1443 CGF.ArrayInitIndex = Index;
1446 CGF.ArrayInitIndex = OldArrayInitIndex;
1450 CodeGenFunction &CGF;
1456 InlinedInheritingConstructorScope(CodeGenFunction &CGF, GlobalDecl GD)
1457 : CGF(CGF), OldCurGD(CGF.CurGD), OldCurFuncDecl(CGF.CurFuncDecl),
1458 OldCurCodeDecl(CGF.CurCodeDecl),
1459 OldCXXABIThisDecl(CGF.CXXABIThisDecl),
1460 OldCXXABIThisValue(CGF.CXXABIThisValue),
1461 OldCXXThisValue(CGF.CXXThisValue),
1462 OldCXXABIThisAlignment(CGF.CXXABIThisAlignment),
1463 OldCXXThisAlignment(CGF.CXXThisAlignment),
1464 OldReturnValue(CGF.ReturnValue), OldFnRetTy(CGF.FnRetTy),
1466 std::move(CGF.CXXInheritedCtorInitExprArgs)) {
1467 CGF.CurGD = GD;
1468 CGF.CurFuncDecl = CGF.CurCodeDecl =
1470 CGF.CXXABIThisDecl = nullptr;
1471 CGF.CXXABIThisValue = nullptr;
1472 CGF.CXXThisValue = nullptr;
1473 CGF.CXXABIThisAlignment = CharUnits();
1474 CGF.CXXThisAlignment = CharUnits();
1475 CGF.ReturnValue = Address::invalid();
1476 CGF.FnRetTy = QualType();
1477 CGF.CXXInheritedCtorInitExprArgs.clear();
1480 CGF.CurGD = OldCurGD;
1481 CGF.CurFuncDecl = OldCurFuncDecl;
1482 CGF.CurCodeDecl = OldCurCodeDecl;
1483 CGF.CXXABIThisDecl = OldCXXABIThisDecl;
1484 CGF.CXXABIThisValue = OldCXXABIThisValue;
1485 CGF.CXXThisValue = OldCXXThisValue;
1486 CGF.CXXABIThisAlignment = OldCXXABIThisAlignment;
1487 CGF.CXXThisAlignment = OldCXXThisAlignment;
1488 CGF.ReturnValue = OldReturnValue;
1489 CGF.FnRetTy = OldFnRetTy;
1490 CGF.CXXInheritedCtorInitExprArgs =
1495 CodeGenFunction &CGF;
1648 typedef void Destroyer(CodeGenFunction &CGF, Address addr, QualType ty);
2734 Address getObjectAddress(CodeGenFunction &CGF) const {
2737 return CGF.emitBlockByrefAddress(Addr, Variable, /*forward*/ false);
2945 CodeGenFunction &CGF;
2948 OMPCancelStackRAII(CodeGenFunction &CGF, OpenMPDirectiveKind Kind,
2950 : CGF(CGF) {
2951 CGF.OMPCancelStack.enter(CGF, Kind, HasCancel);
2953 ~OMPCancelStackRAII() { CGF.OMPCancelStack.exit(CGF); }
3526 LValue getReferenceLValue(CodeGenFunction &CGF, Expr *refExpr) const {
3528 return CGF.MakeNaturalAlignAddrLValue(ValueAndIsReference.getPointer(),
4347 DominatingLLVMValue::save(CodeGenFunction &CGF, llvm::Value *value) {
4352 CGF.CGM.getDataLayout().getPrefTypeAlignment(value->getType()));
4354 CGF.CreateTempAlloca(value->getType(), align, "cond-cleanup.save");
4355 CGF.Builder.CreateStore(value, alloca);
4360 inline llvm::Value *DominatingLLVMValue::restore(CodeGenFunction &CGF,
4367 return CGF.Builder.CreateAlignedLoad(alloca, alloca->getAlignment());