Lines Matching full:cgf
220 virtual void EmitBody(CodeGenFunction &CGF, const Stmt *S) {
221 CGF.incrementProfileCounter(S);
222 CGF.EmitStmt(S);
247 CodeGenFunction &CGF;
250 CGCapturedStmtRAII(CodeGenFunction &CGF,
252 : CGF(CGF), PrevCapturedStmtInfo(CGF.CapturedStmtInfo) {
253 CGF.CapturedStmtInfo = NewCapturedStmtInfo;
255 ~CGCapturedStmtRAII() { CGF.CapturedStmtInfo = PrevCapturedStmtInfo; }
266 CodeGenFunction *CGF;
268 SanitizerScope(CodeGenFunction *CGF);
313 void Emit(CodeGenFunction &CGF, Flags flags) override {
314 CGF.EmitLifetimeEnd(Size, Addr);
388 void enter(CodeGenFunction &CGF, const Stmt *Finally,
391 void exit(CodeGenFunction &CGF);
494 CodeGenFunction& CGF;
498 explicit RunCleanupsScope(CodeGenFunction &CGF)
499 : PerformCleanup(true), CGF(CGF)
501 CleanupStackDepth = CGF.EHStack.stable_begin();
503 CGF.LifetimeExtendedCleanupStack.size();
504 OldDidCallStackSave = CGF.DidCallStackSave;
505 CGF.DidCallStackSave = false;
512 CGF.DidCallStackSave = OldDidCallStackSave;
513 CGF.PopCleanupBlocks(CleanupStackDepth,
520 return CGF.EHStack.stable_begin() != CleanupStackDepth;
527 CGF.DidCallStackSave = OldDidCallStackSave;
528 CGF.PopCleanupBlocks(CleanupStackDepth,
544 explicit LexicalScope(CodeGenFunction &CGF, SourceRange Range)
545 : RunCleanupsScope(CGF), Range(Range), ParentScope(CGF.CurLexicalScope) {
546 CGF.CurLexicalScope = this;
547 if (CGDebugInfo *DI = CGF.getDebugInfo())
548 DI->EmitLexicalBlockStart(CGF.Builder, Range.getBegin());
559 if (CGDebugInfo *DI = CGF.getDebugInfo())
560 DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
565 ApplyDebugLocation DL(CGF, Range.getEnd());
573 CGF.CurLexicalScope = ParentScope;
598 explicit OMPPrivateScope(CodeGenFunction &CGF) : RunCleanupsScope(CGF) {}
614 auto it = CGF.LocalDeclMap.find(LocalVD);
615 if (it != CGF.LocalDeclMap.end()) {
625 Address Temp = CGF.CreateMemTemp(VarTy);
626 CGF.Builder.CreateStore(Addr.getPointer(), Temp);
643 copyInto(SavedPrivates, CGF.LocalDeclMap);
650 copyInto(SavedLocals, CGF.LocalDeclMap);
662 return !VD->isLocalVarDeclOrParm() && CGF.LocalDeclMap.count(VD) > 0;
737 ConditionalEvaluation(CodeGenFunction &CGF)
738 : StartBB(CGF.Builder.GetInsertBlock()) {}
740 void begin(CodeGenFunction &CGF) {
741 assert(CGF.OutermostConditional != this);
742 if (!CGF.OutermostConditional)
743 CGF.OutermostConditional = this;
746 void end(CodeGenFunction &CGF) {
747 assert(CGF.OutermostConditional != nullptr);
748 if (CGF.OutermostConditional == this)
749 CGF.OutermostConditional = nullptr;
773 CodeGenFunction &CGF;
781 StmtExprEvaluation(CodeGenFunction &CGF)
782 : CGF(CGF), SavedOutermostConditional(CGF.OutermostConditional) {
783 CGF.OutermostConditional = nullptr;
787 CGF.OutermostConditional = SavedOutermostConditional;
788 CGF.EnsureInsertPoint();
831 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
835 return bind(CGF, ov, CGF.EmitLValue(e));
836 return bind(CGF, ov, CGF.EmitAnyExpr(e));
839 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
843 CGF.OpaqueLValues.insert(std::make_pair(ov, lv));
847 static OpaqueValueMappingData bind(CodeGenFunction &CGF,
851 CGF.OpaqueRValues.insert(std::make_pair(ov, rv));
858 data.Protection = CGF.protectFromPeepholes(rv);
866 void unbind(CodeGenFunction &CGF) {
870 CGF.OpaqueLValues.erase(OpaqueValue);
872 CGF.OpaqueRValues.erase(OpaqueValue);
873 CGF.unprotectFromPeepholes(Protection);
880 CodeGenFunction &CGF;
893 OpaqueValueMapping(CodeGenFunction &CGF,
894 const AbstractConditionalOperator *op) : CGF(CGF) {
900 Data = OpaqueValueMappingData::bind(CGF, e->getOpaqueValue(),
904 OpaqueValueMapping(CodeGenFunction &CGF,
907 : CGF(CGF), Data(OpaqueValueMappingData::bind(CGF, opaqueValue, lvalue)) {
910 OpaqueValueMapping(CodeGenFunction &CGF,
913 : CGF(CGF), Data(OpaqueValueMappingData::bind(CGF, opaqueValue, rvalue)) {
917 Data.unbind(CGF);
922 if (Data.isValid()) Data.unbind(CGF);
1047 FieldConstructionScope(CodeGenFunction &CGF, Address This)
1048 : CGF(CGF), OldCXXDefaultInitExprThis(CGF.CXXDefaultInitExprThis) {
1049 CGF.CXXDefaultInitExprThis = This;
1052 CGF.CXXDefaultInitExprThis = OldCXXDefaultInitExprThis;
1056 CodeGenFunction &CGF;
1064 CXXDefaultInitExprScope(CodeGenFunction &CGF)
1065 : CGF(CGF), OldCXXThisValue(CGF.CXXThisValue),
1066 OldCXXThisAlignment(CGF.CXXThisAlignment) {
1067 CGF.CXXThisValue = CGF.CXXDefaultInitExprThis.getPointer();
1068 CGF.CXXThisAlignment = CGF.CXXDefaultInitExprThis.getAlignment();
1071 CGF.CXXThisValue = OldCXXThisValue;
1072 CGF.CXXThisAlignment = OldCXXThisAlignment;
1076 CodeGenFunction &CGF;
1083 InlinedInheritingConstructorScope(CodeGenFunction &CGF, GlobalDecl GD)
1084 : CGF(CGF), OldCurGD(CGF.CurGD), OldCurFuncDecl(CGF.CurFuncDecl),
1085 OldCurCodeDecl(CGF.CurCodeDecl),
1086 OldCXXABIThisDecl(CGF.CXXABIThisDecl),
1087 OldCXXABIThisValue(CGF.CXXABIThisValue),
1088 OldCXXThisValue(CGF.CXXThisValue),
1089 OldCXXABIThisAlignment(CGF.CXXABIThisAlignment),
1090 OldCXXThisAlignment(CGF.CXXThisAlignment),
1091 OldReturnValue(CGF.ReturnValue), OldFnRetTy(CGF.FnRetTy),
1093 std::move(CGF.CXXInheritedCtorInitExprArgs)) {
1094 CGF.CurGD = GD;
1095 CGF.CurFuncDecl = CGF.CurCodeDecl =
1097 CGF.CXXABIThisDecl = nullptr;
1098 CGF.CXXABIThisValue = nullptr;
1099 CGF.CXXThisValue = nullptr;
1100 CGF.CXXABIThisAlignment = CharUnits();
1101 CGF.CXXThisAlignment = CharUnits();
1102 CGF.ReturnValue = Address::invalid();
1103 CGF.FnRetTy = QualType();
1104 CGF.CXXInheritedCtorInitExprArgs.clear();
1107 CGF.CurGD = OldCurGD;
1108 CGF.CurFuncDecl = OldCurFuncDecl;
1109 CGF.CurCodeDecl = OldCurCodeDecl;
1110 CGF.CXXABIThisDecl = OldCXXABIThisDecl;
1111 CGF.CXXABIThisValue = OldCXXABIThisValue;
1112 CGF.CXXThisValue = OldCXXThisValue;
1113 CGF.CXXABIThisAlignment = OldCXXABIThisAlignment;
1114 CGF.CXXThisAlignment = OldCXXThisAlignment;
1115 CGF.ReturnValue = OldReturnValue;
1116 CGF.FnRetTy = OldFnRetTy;
1117 CGF.CXXInheritedCtorInitExprArgs =
1122 CodeGenFunction &CGF;
1245 typedef void Destroyer(CodeGenFunction &CGF, Address addr, QualType ty);
2175 Address getObjectAddress(CodeGenFunction &CGF) const {
2178 return CGF.emitBlockByrefAddress(Addr, Variable, /*forward*/ false);
2459 typedef const llvm::function_ref<void(CodeGenFunction & /*CGF*/,
2764 LValue getReferenceLValue(CodeGenFunction &CGF, Expr *refExpr) const {
2766 return CGF.MakeNaturalAlignAddrLValue(ValueAndIsReference.getPointer(),
3423 static saved_type save(CodeGenFunction &CGF, llvm::Value *value) {
3428 CGF.CGM.getDataLayout().getPrefTypeAlignment(value->getType()));
3430 CGF.CreateTempAlloca(value->getType(), align, "cond-cleanup.save");
3431 CGF.Builder.CreateStore(value, alloca);
3436 static llvm::Value *restore(CodeGenFunction &CGF, saved_type value) {
3442 return CGF.Builder.CreateAlignedLoad(alloca, alloca->getAlignment());
3450 static type restore(CodeGenFunction &CGF, saved_type value) {
3451 return static_cast<T*>(DominatingLLVMValue::restore(CGF, value));
3467 static saved_type save(CodeGenFunction &CGF, type value) {
3468 return { DominatingLLVMValue::save(CGF, value.getPointer()),
3471 static type restore(CodeGenFunction &CGF, saved_type value) {
3472 return Address(DominatingLLVMValue::restore(CGF, value.SavedValue),
3492 static saved_type save(CodeGenFunction &CGF, RValue value);
3493 RValue restore(CodeGenFunction &CGF);
3501 static saved_type save(CodeGenFunction &CGF, type value) {
3502 return saved_type::save(CGF, value);
3504 static type restore(CodeGenFunction &CGF, saved_type value) {
3505 return value.restore(CGF);