Skip to content

Commit d3b1029

Browse files
Melanie Blowermemfrob
Melanie Blower
authored and
memfrob
committed
[NFC] Rename Sema.FPFeatures to CurFPFeatures and accessor to getCurFPFeatures
1 parent 61efc89 commit d3b1029

File tree

10 files changed

+39
-39
lines changed

10 files changed

+39
-39
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class Sema final {
392392
typedef OpaquePtr<QualType> TypeTy;
393393

394394
OpenCLOptions OpenCLFeatures;
395-
FPOptions FPFeatures;
395+
FPOptions CurFPFeatures;
396396

397397
const LangOptions &LangOpts;
398398
Preprocessor &PP;
@@ -1354,8 +1354,8 @@ class Sema final {
13541354
/// statements.
13551355
class FPFeaturesStateRAII {
13561356
public:
1357-
FPFeaturesStateRAII(Sema &S) : S(S), OldFPFeaturesState(S.FPFeatures) {}
1358-
~FPFeaturesStateRAII() { S.FPFeatures = OldFPFeaturesState; }
1357+
FPFeaturesStateRAII(Sema &S) : S(S), OldFPFeaturesState(S.CurFPFeatures) {}
1358+
~FPFeaturesStateRAII() { S.CurFPFeatures = OldFPFeaturesState; }
13591359

13601360
private:
13611361
Sema& S;
@@ -1378,7 +1378,7 @@ class Sema final {
13781378

13791379
const LangOptions &getLangOpts() const { return LangOpts; }
13801380
OpenCLOptions &getOpenCLOptions() { return OpenCLFeatures; }
1381-
FPOptions &getFPOptions() { return FPFeatures; }
1381+
FPOptions &getCurFPFeatures() { return CurFPFeatures; }
13821382

13831383
DiagnosticsEngine &getDiagnostics() const { return Diags; }
13841384
SourceManager &getSourceManager() const { return SourceMgr; }

clang/lib/Sema/Sema.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const unsigned Sema::MaximumAlignment;
150150
Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
151151
TranslationUnitKind TUKind, CodeCompleteConsumer *CodeCompleter)
152152
: ExternalSource(nullptr), isMultiplexExternalSource(false),
153-
FPFeatures(pp.getLangOpts()), LangOpts(pp.getLangOpts()), PP(pp),
153+
CurFPFeatures(pp.getLangOpts()), LangOpts(pp.getLangOpts()), PP(pp),
154154
Context(ctxt), Consumer(consumer), Diags(PP.getDiagnostics()),
155155
SourceMgr(PP.getSourceManager()), CollectStats(false),
156156
CodeCompleter(CodeCompleter), CurContext(nullptr),

clang/lib/Sema/SemaAttr.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -929,32 +929,32 @@ void Sema::ActOnPragmaVisibility(const IdentifierInfo* VisType,
929929
void Sema::ActOnPragmaFPContract(LangOptions::FPContractModeKind FPC) {
930930
switch (FPC) {
931931
case LangOptions::FPC_On:
932-
FPFeatures.setAllowFPContractWithinStatement();
932+
CurFPFeatures.setAllowFPContractWithinStatement();
933933
break;
934934
case LangOptions::FPC_Fast:
935-
FPFeatures.setAllowFPContractAcrossStatement();
935+
CurFPFeatures.setAllowFPContractAcrossStatement();
936936
break;
937937
case LangOptions::FPC_Off:
938-
FPFeatures.setDisallowFPContract();
938+
CurFPFeatures.setDisallowFPContract();
939939
break;
940940
}
941941
}
942942

943943
void Sema::setRoundingMode(llvm::RoundingMode FPR) {
944-
FPFeatures.setRoundingMode(FPR);
944+
CurFPFeatures.setRoundingMode(FPR);
945945
}
946946

947947
void Sema::setExceptionMode(LangOptions::FPExceptionModeKind FPE) {
948-
FPFeatures.setExceptionMode(FPE);
948+
CurFPFeatures.setExceptionMode(FPE);
949949
}
950950

951951
void Sema::ActOnPragmaFEnvAccess(LangOptions::FEnvAccessModeKind FPC) {
952952
switch (FPC) {
953953
case LangOptions::FEA_On:
954-
FPFeatures.setAllowFEnvAccess();
954+
CurFPFeatures.setAllowFEnvAccess();
955955
break;
956956
case LangOptions::FEA_Off:
957-
FPFeatures.setDisallowFEnvAccess();
957+
CurFPFeatures.setDisallowFEnvAccess();
958958
break;
959959
}
960960
}

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13698,7 +13698,7 @@ buildSingleCopyAssignRecursively(Sema &S, SourceLocation Loc, QualType T,
1369813698
Expr *Comparison = BinaryOperator::Create(
1369913699
S.Context, IterationVarRefRVal.build(S, Loc),
1370013700
IntegerLiteral::Create(S.Context, Upper, SizeType, Loc), BO_NE,
13701-
S.Context.BoolTy, VK_RValue, OK_Ordinary, Loc, S.FPFeatures);
13701+
S.Context.BoolTy, VK_RValue, OK_Ordinary, Loc, S.CurFPFeatures);
1370213702

1370313703
// Create the pre-increment of the iteration variable. We can determine
1370413704
// whether the increment will overflow based on the value of the array

clang/lib/Sema/SemaExpr.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13693,9 +13693,9 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
1369313693
if (CompResultTy.isNull()) {
1369413694
if (ConvertHalfVec)
1369513695
return convertHalfVecBinOp(*this, LHS, RHS, Opc, ResultTy, VK, OK, false,
13696-
OpLoc, FPFeatures);
13696+
OpLoc, CurFPFeatures);
1369713697
return BinaryOperator::Create(Context, LHS.get(), RHS.get(), Opc, ResultTy,
13698-
VK, OK, OpLoc, FPFeatures);
13698+
VK, OK, OpLoc, CurFPFeatures);
1369913699
}
1370013700

1370113701
// Handle compound assignments.
@@ -13707,10 +13707,10 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
1370713707

1370813708
if (ConvertHalfVec)
1370913709
return convertHalfVecBinOp(*this, LHS, RHS, Opc, ResultTy, VK, OK, true,
13710-
OpLoc, FPFeatures);
13710+
OpLoc, CurFPFeatures);
1371113711

1371213712
return CompoundAssignOperator::Create(Context, LHS.get(), RHS.get(), Opc,
13713-
ResultTy, VK, OK, OpLoc, FPFeatures,
13713+
ResultTy, VK, OK, OpLoc, CurFPFeatures,
1371413714
CompLHSTy, CompResultTy);
1371513715
}
1371613716

clang/lib/Sema/SemaOverload.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12975,7 +12975,7 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc,
1297512975
/*ADL*/ true, IsOverloaded(Fns), Fns.begin(), Fns.end());
1297612976
return CXXOperatorCallExpr::Create(Context, Op, Fn, ArgsArray,
1297712977
Context.DependentTy, VK_RValue, OpLoc,
12978-
FPFeatures);
12978+
CurFPFeatures);
1297912979
}
1298012980

1298112981
// Build an empty overload set.
@@ -13048,8 +13048,8 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc,
1304813048

1304913049
Args[0] = Input;
1305013050
CallExpr *TheCall = CXXOperatorCallExpr::Create(
13051-
Context, Op, FnExpr.get(), ArgsArray, ResultTy, VK, OpLoc, FPFeatures,
13052-
Best->IsADLCandidate);
13051+
Context, Op, FnExpr.get(), ArgsArray, ResultTy, VK, OpLoc,
13052+
CurFPFeatures, Best->IsADLCandidate);
1305313053

1305413054
if (CheckCallReturnType(FnDecl->getReturnType(), OpLoc, TheCall, FnDecl))
1305513055
return ExprError();
@@ -13220,10 +13220,10 @@ ExprResult Sema::CreateOverloadedBinOp(SourceLocation OpLoc,
1322013220
if (Opc <= BO_Assign || Opc > BO_OrAssign)
1322113221
return BinaryOperator::Create(Context, Args[0], Args[1], Opc,
1322213222
Context.DependentTy, VK_RValue,
13223-
OK_Ordinary, OpLoc, FPFeatures);
13223+
OK_Ordinary, OpLoc, CurFPFeatures);
1322413224
return CompoundAssignOperator::Create(
1322513225
Context, Args[0], Args[1], Opc, Context.DependentTy, VK_LValue,
13226-
OK_Ordinary, OpLoc, FPFeatures, Context.DependentTy,
13226+
OK_Ordinary, OpLoc, CurFPFeatures, Context.DependentTy,
1322713227
Context.DependentTy);
1322813228
}
1322913229

@@ -13237,7 +13237,7 @@ ExprResult Sema::CreateOverloadedBinOp(SourceLocation OpLoc,
1323713237
/*ADL*/ PerformADL, IsOverloaded(Fns), Fns.begin(), Fns.end());
1323813238
return CXXOperatorCallExpr::Create(Context, Op, Fn, Args,
1323913239
Context.DependentTy, VK_RValue, OpLoc,
13240-
FPFeatures);
13240+
CurFPFeatures);
1324113241
}
1324213242

1324313243
// Always do placeholder-like conversions on the RHS.
@@ -13406,7 +13406,7 @@ ExprResult Sema::CreateOverloadedBinOp(SourceLocation OpLoc,
1340613406

1340713407
CXXOperatorCallExpr *TheCall = CXXOperatorCallExpr::Create(
1340813408
Context, ChosenOp, FnExpr.get(), Args, ResultTy, VK, OpLoc,
13409-
FPFeatures, Best->IsADLCandidate);
13409+
CurFPFeatures, Best->IsADLCandidate);
1341013410

1341113411
if (CheckCallReturnType(FnDecl->getReturnType(), OpLoc, TheCall,
1341213412
FnDecl))
@@ -13674,7 +13674,7 @@ ExprResult Sema::BuildSynthesizedThreeWayComparison(
1367413674
Expr *SyntacticForm = BinaryOperator::Create(
1367513675
Context, OrigLHS, OrigRHS, BO_Cmp, Result.get()->getType(),
1367613676
Result.get()->getValueKind(), Result.get()->getObjectKind(), OpLoc,
13677-
FPFeatures);
13677+
CurFPFeatures);
1367813678
Expr *SemanticForm[] = {LHS, RHS, Result.get()};
1367913679
return PseudoObjectExpr::Create(Context, SyntacticForm, SemanticForm, 2);
1368013680
}
@@ -13705,7 +13705,7 @@ Sema::CreateOverloadedArraySubscriptExpr(SourceLocation LLoc,
1370513705

1370613706
return CXXOperatorCallExpr::Create(Context, OO_Subscript, Fn, Args,
1370713707
Context.DependentTy, VK_RValue, RLoc,
13708-
FPFeatures);
13708+
CurFPFeatures);
1370913709
}
1371013710

1371113711
// Handle placeholders on both operands.
@@ -13780,7 +13780,7 @@ Sema::CreateOverloadedArraySubscriptExpr(SourceLocation LLoc,
1378013780

1378113781
CXXOperatorCallExpr *TheCall =
1378213782
CXXOperatorCallExpr::Create(Context, OO_Subscript, FnExpr.get(),
13783-
Args, ResultTy, VK, RLoc, FPFeatures);
13783+
Args, ResultTy, VK, RLoc, CurFPFeatures);
1378413784
if (CheckCallReturnType(FnDecl->getReturnType(), LLoc, TheCall, FnDecl))
1378513785
return ExprError();
1378613786

@@ -14403,7 +14403,7 @@ Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Obj,
1440314403

1440414404
CXXOperatorCallExpr *TheCall =
1440514405
CXXOperatorCallExpr::Create(Context, OO_Call, NewFn.get(), MethodArgs,
14406-
ResultTy, VK, RParenLoc, FPFeatures);
14406+
ResultTy, VK, RParenLoc, CurFPFeatures);
1440714407

1440814408
if (CheckCallReturnType(Method->getReturnType(), LParenLoc, TheCall, Method))
1440914409
return true;
@@ -14520,7 +14520,7 @@ Sema::BuildOverloadedArrowExpr(Scope *S, Expr *Base, SourceLocation OpLoc,
1452014520
ExprValueKind VK = Expr::getValueKindForType(ResultTy);
1452114521
ResultTy = ResultTy.getNonLValueExprType(Context);
1452214522
CXXOperatorCallExpr *TheCall = CXXOperatorCallExpr::Create(
14523-
Context, OO_Arrow, FnExpr.get(), Base, ResultTy, VK, OpLoc, FPFeatures);
14523+
Context, OO_Arrow, FnExpr.get(), Base, ResultTy, VK, OpLoc, CurFPFeatures);
1452414524

1452514525
if (CheckCallReturnType(Method->getReturnType(), OpLoc, TheCall, Method))
1452614526
return ExprError();

clang/lib/Sema/SemaPseudoObject.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ PseudoOpBuilder::buildAssignmentOperation(Scope *Sc, SourceLocation opcLoc,
450450
result = semanticRHS;
451451
syntactic = BinaryOperator::Create(
452452
S.Context, syntacticLHS, capturedRHS, opcode, capturedRHS->getType(),
453-
capturedRHS->getValueKind(), OK_Ordinary, opcLoc, S.FPFeatures);
453+
capturedRHS->getValueKind(), OK_Ordinary, opcLoc, S.CurFPFeatures);
454454

455455
} else {
456456
ExprResult opLHS = buildGet();
@@ -464,7 +464,7 @@ PseudoOpBuilder::buildAssignmentOperation(Scope *Sc, SourceLocation opcLoc,
464464

465465
syntactic = CompoundAssignOperator::Create(
466466
S.Context, syntacticLHS, capturedRHS, opcode, result.get()->getType(),
467-
result.get()->getValueKind(), OK_Ordinary, opcLoc, S.FPFeatures,
467+
result.get()->getValueKind(), OK_Ordinary, opcLoc, S.CurFPFeatures,
468468
opLHS.get()->getType(), result.get()->getType());
469469
}
470470

@@ -1583,7 +1583,7 @@ ExprResult Sema::checkPseudoObjectAssignment(Scope *S, SourceLocation opcLoc,
15831583
if (LHS->isTypeDependent() || RHS->isTypeDependent())
15841584
return BinaryOperator::Create(Context, LHS, RHS, opcode,
15851585
Context.DependentTy, VK_RValue, OK_Ordinary,
1586-
opcLoc, FPFeatures);
1586+
opcLoc, CurFPFeatures);
15871587

15881588
// Filter out non-overload placeholder types in the RHS.
15891589
if (RHS->getType()->isNonOverloadPlaceholderType()) {
@@ -1646,7 +1646,7 @@ Expr *Sema::recreateSyntacticForm(PseudoObjectExpr *E) {
16461646
return CompoundAssignOperator::Create(
16471647
Context, lhs, rhs, cop->getOpcode(), cop->getType(),
16481648
cop->getValueKind(), cop->getObjectKind(), cop->getOperatorLoc(),
1649-
FPFeatures, cop->getComputationLHSType(),
1649+
CurFPFeatures, cop->getComputationLHSType(),
16501650
cop->getComputationResultType());
16511651

16521652
} else if (BinaryOperator *bop = dyn_cast<BinaryOperator>(syntax)) {
@@ -1655,7 +1655,7 @@ Expr *Sema::recreateSyntacticForm(PseudoObjectExpr *E) {
16551655
return BinaryOperator::Create(Context, lhs, rhs, bop->getOpcode(),
16561656
bop->getType(), bop->getValueKind(),
16571657
bop->getObjectKind(), bop->getOperatorLoc(),
1658-
FPFeatures);
1658+
CurFPFeatures);
16591659

16601660
} else if (isa<CallExpr>(syntax)) {
16611661
return syntax;

clang/lib/Sema/TreeTransform.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10267,7 +10267,7 @@ TreeTransform<Derived>::TransformBinaryOperator(BinaryOperator *E) {
1026710267
return getDerived().RebuildBinaryOperator(
1026810268
E->getOperatorLoc(), E->getOpcode(), LHS.get(), RHS.get());
1026910269
Sema::FPFeaturesStateRAII FPFeaturesState(getSema());
10270-
getSema().FPFeatures = E->getFPFeatures(getSema().getLangOpts());
10270+
getSema().CurFPFeatures = E->getFPFeatures(getSema().getLangOpts());
1027110271

1027210272
return getDerived().RebuildBinaryOperator(E->getOperatorLoc(), E->getOpcode(),
1027310273
LHS.get(), RHS.get());
@@ -10322,7 +10322,7 @@ ExprResult
1032210322
TreeTransform<Derived>::TransformCompoundAssignOperator(
1032310323
CompoundAssignOperator *E) {
1032410324
Sema::FPFeaturesStateRAII FPFeaturesState(getSema());
10325-
getSema().FPFeatures = E->getFPFeatures(getSema().getLangOpts());
10325+
getSema().CurFPFeatures = E->getFPFeatures(getSema().getLangOpts());
1032610326
return getDerived().TransformBinaryOperator(E);
1032710327
}
1032810328

@@ -10797,7 +10797,7 @@ TreeTransform<Derived>::TransformCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
1079710797
return SemaRef.MaybeBindToTemporary(E);
1079810798

1079910799
Sema::FPFeaturesStateRAII FPFeaturesState(getSema());
10800-
getSema().FPFeatures = E->getFPFeatures();
10800+
getSema().CurFPFeatures = E->getFPFeatures();
1080110801

1080210802
return getDerived().RebuildCXXOperatorCallExpr(E->getOperator(),
1080310803
E->getOperatorLoc(),

clang/lib/Serialization/ASTReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7773,7 +7773,7 @@ void ASTReader::InitializeSema(Sema &S) {
77737773
// FIXME: What happens if these are changed by a module import?
77747774
if (!FPPragmaOptions.empty()) {
77757775
assert(FPPragmaOptions.size() == 1 && "Wrong number of FP_PRAGMA_OPTIONS");
7776-
SemaObj->FPFeatures = FPOptions(FPPragmaOptions[0]);
7776+
SemaObj->CurFPFeatures = FPOptions(FPPragmaOptions[0]);
77777777
}
77787778

77797779
SemaObj->OpenCLFeatures.copy(OpenCLExtensions);

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4727,7 +4727,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
47274727
WriteReferencedSelectorsPool(SemaRef);
47284728
WriteLateParsedTemplates(SemaRef);
47294729
WriteIdentifierTable(PP, SemaRef.IdResolver, isModule);
4730-
WriteFPPragmaOptions(SemaRef.getFPOptions());
4730+
WriteFPPragmaOptions(SemaRef.getCurFPFeatures());
47314731
WriteOpenCLExtensions(SemaRef);
47324732
WriteOpenCLExtensionTypes(SemaRef);
47334733
WriteCUDAPragmas(SemaRef);

0 commit comments

Comments
 (0)