[clang] 8812b0c - [NFC] Rename Sema.FPFeatures to CurFPFeatures and accessor to getCurFPFeatures
Melanie Blower via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 16 08:50:57 PDT 2020
Author: Melanie Blower
Date: 2020-04-16T08:50:14-07:00
New Revision: 8812b0cc5cc09f350d8e89bff99f185c5e1a5d4d
URL: https://github.com/llvm/llvm-project/commit/8812b0cc5cc09f350d8e89bff99f185c5e1a5d4d
DIFF: https://github.com/llvm/llvm-project/commit/8812b0cc5cc09f350d8e89bff99f185c5e1a5d4d.diff
LOG: [NFC] Rename Sema.FPFeatures to CurFPFeatures and accessor to getCurFPFeatures
Added:
Modified:
clang/include/clang/Sema/Sema.h
clang/lib/Sema/Sema.cpp
clang/lib/Sema/SemaAttr.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaOverload.cpp
clang/lib/Sema/SemaPseudoObject.cpp
clang/lib/Sema/TreeTransform.h
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTWriter.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 889f4ee9031e..a1a0b854a85b 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -392,7 +392,7 @@ class Sema final {
typedef OpaquePtr<QualType> TypeTy;
OpenCLOptions OpenCLFeatures;
- FPOptions FPFeatures;
+ FPOptions CurFPFeatures;
const LangOptions &LangOpts;
Preprocessor &PP;
@@ -1354,8 +1354,8 @@ class Sema final {
/// statements.
class FPFeaturesStateRAII {
public:
- FPFeaturesStateRAII(Sema &S) : S(S), OldFPFeaturesState(S.FPFeatures) {}
- ~FPFeaturesStateRAII() { S.FPFeatures = OldFPFeaturesState; }
+ FPFeaturesStateRAII(Sema &S) : S(S), OldFPFeaturesState(S.CurFPFeatures) {}
+ ~FPFeaturesStateRAII() { S.CurFPFeatures = OldFPFeaturesState; }
private:
Sema& S;
@@ -1378,7 +1378,7 @@ class Sema final {
const LangOptions &getLangOpts() const { return LangOpts; }
OpenCLOptions &getOpenCLOptions() { return OpenCLFeatures; }
- FPOptions &getFPOptions() { return FPFeatures; }
+ FPOptions &getCurFPFeatures() { return CurFPFeatures; }
DiagnosticsEngine &getDiagnostics() const { return Diags; }
SourceManager &getSourceManager() const { return SourceMgr; }
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 5e5a90ad0143..405b6c33d280 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -150,7 +150,7 @@ const unsigned Sema::MaximumAlignment;
Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
TranslationUnitKind TUKind, CodeCompleteConsumer *CodeCompleter)
: ExternalSource(nullptr), isMultiplexExternalSource(false),
- FPFeatures(pp.getLangOpts()), LangOpts(pp.getLangOpts()), PP(pp),
+ CurFPFeatures(pp.getLangOpts()), LangOpts(pp.getLangOpts()), PP(pp),
Context(ctxt), Consumer(consumer), Diags(PP.getDiagnostics()),
SourceMgr(PP.getSourceManager()), CollectStats(false),
CodeCompleter(CodeCompleter), CurContext(nullptr),
diff --git a/clang/lib/Sema/SemaAttr.cpp b/clang/lib/Sema/SemaAttr.cpp
index 9141a28381ad..8633581b6880 100644
--- a/clang/lib/Sema/SemaAttr.cpp
+++ b/clang/lib/Sema/SemaAttr.cpp
@@ -929,32 +929,32 @@ void Sema::ActOnPragmaVisibility(const IdentifierInfo* VisType,
void Sema::ActOnPragmaFPContract(LangOptions::FPContractModeKind FPC) {
switch (FPC) {
case LangOptions::FPC_On:
- FPFeatures.setAllowFPContractWithinStatement();
+ CurFPFeatures.setAllowFPContractWithinStatement();
break;
case LangOptions::FPC_Fast:
- FPFeatures.setAllowFPContractAcrossStatement();
+ CurFPFeatures.setAllowFPContractAcrossStatement();
break;
case LangOptions::FPC_Off:
- FPFeatures.setDisallowFPContract();
+ CurFPFeatures.setDisallowFPContract();
break;
}
}
void Sema::setRoundingMode(llvm::RoundingMode FPR) {
- FPFeatures.setRoundingMode(FPR);
+ CurFPFeatures.setRoundingMode(FPR);
}
void Sema::setExceptionMode(LangOptions::FPExceptionModeKind FPE) {
- FPFeatures.setExceptionMode(FPE);
+ CurFPFeatures.setExceptionMode(FPE);
}
void Sema::ActOnPragmaFEnvAccess(LangOptions::FEnvAccessModeKind FPC) {
switch (FPC) {
case LangOptions::FEA_On:
- FPFeatures.setAllowFEnvAccess();
+ CurFPFeatures.setAllowFEnvAccess();
break;
case LangOptions::FEA_Off:
- FPFeatures.setDisallowFEnvAccess();
+ CurFPFeatures.setDisallowFEnvAccess();
break;
}
}
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 381db055afae..8f04f5ae5dea 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -13698,7 +13698,7 @@ buildSingleCopyAssignRecursively(Sema &S, SourceLocation Loc, QualType T,
Expr *Comparison = BinaryOperator::Create(
S.Context, IterationVarRefRVal.build(S, Loc),
IntegerLiteral::Create(S.Context, Upper, SizeType, Loc), BO_NE,
- S.Context.BoolTy, VK_RValue, OK_Ordinary, Loc, S.FPFeatures);
+ S.Context.BoolTy, VK_RValue, OK_Ordinary, Loc, S.CurFPFeatures);
// Create the pre-increment of the iteration variable. We can determine
// whether the increment will overflow based on the value of the array
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 141c4b1fea1d..60d99db7ced9 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -13693,9 +13693,9 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
if (CompResultTy.isNull()) {
if (ConvertHalfVec)
return convertHalfVecBinOp(*this, LHS, RHS, Opc, ResultTy, VK, OK, false,
- OpLoc, FPFeatures);
+ OpLoc, CurFPFeatures);
return BinaryOperator::Create(Context, LHS.get(), RHS.get(), Opc, ResultTy,
- VK, OK, OpLoc, FPFeatures);
+ VK, OK, OpLoc, CurFPFeatures);
}
// Handle compound assignments.
@@ -13707,10 +13707,10 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
if (ConvertHalfVec)
return convertHalfVecBinOp(*this, LHS, RHS, Opc, ResultTy, VK, OK, true,
- OpLoc, FPFeatures);
+ OpLoc, CurFPFeatures);
return CompoundAssignOperator::Create(Context, LHS.get(), RHS.get(), Opc,
- ResultTy, VK, OK, OpLoc, FPFeatures,
+ ResultTy, VK, OK, OpLoc, CurFPFeatures,
CompLHSTy, CompResultTy);
}
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 805bf667e861..2594e68a48b2 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -12975,7 +12975,7 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc,
/*ADL*/ true, IsOverloaded(Fns), Fns.begin(), Fns.end());
return CXXOperatorCallExpr::Create(Context, Op, Fn, ArgsArray,
Context.DependentTy, VK_RValue, OpLoc,
- FPFeatures);
+ CurFPFeatures);
}
// Build an empty overload set.
@@ -13048,8 +13048,8 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc,
Args[0] = Input;
CallExpr *TheCall = CXXOperatorCallExpr::Create(
- Context, Op, FnExpr.get(), ArgsArray, ResultTy, VK, OpLoc, FPFeatures,
- Best->IsADLCandidate);
+ Context, Op, FnExpr.get(), ArgsArray, ResultTy, VK, OpLoc,
+ CurFPFeatures, Best->IsADLCandidate);
if (CheckCallReturnType(FnDecl->getReturnType(), OpLoc, TheCall, FnDecl))
return ExprError();
@@ -13220,10 +13220,10 @@ ExprResult Sema::CreateOverloadedBinOp(SourceLocation OpLoc,
if (Opc <= BO_Assign || Opc > BO_OrAssign)
return BinaryOperator::Create(Context, Args[0], Args[1], Opc,
Context.DependentTy, VK_RValue,
- OK_Ordinary, OpLoc, FPFeatures);
+ OK_Ordinary, OpLoc, CurFPFeatures);
return CompoundAssignOperator::Create(
Context, Args[0], Args[1], Opc, Context.DependentTy, VK_LValue,
- OK_Ordinary, OpLoc, FPFeatures, Context.DependentTy,
+ OK_Ordinary, OpLoc, CurFPFeatures, Context.DependentTy,
Context.DependentTy);
}
@@ -13237,7 +13237,7 @@ ExprResult Sema::CreateOverloadedBinOp(SourceLocation OpLoc,
/*ADL*/ PerformADL, IsOverloaded(Fns), Fns.begin(), Fns.end());
return CXXOperatorCallExpr::Create(Context, Op, Fn, Args,
Context.DependentTy, VK_RValue, OpLoc,
- FPFeatures);
+ CurFPFeatures);
}
// Always do placeholder-like conversions on the RHS.
@@ -13406,7 +13406,7 @@ ExprResult Sema::CreateOverloadedBinOp(SourceLocation OpLoc,
CXXOperatorCallExpr *TheCall = CXXOperatorCallExpr::Create(
Context, ChosenOp, FnExpr.get(), Args, ResultTy, VK, OpLoc,
- FPFeatures, Best->IsADLCandidate);
+ CurFPFeatures, Best->IsADLCandidate);
if (CheckCallReturnType(FnDecl->getReturnType(), OpLoc, TheCall,
FnDecl))
@@ -13674,7 +13674,7 @@ ExprResult Sema::BuildSynthesizedThreeWayComparison(
Expr *SyntacticForm = BinaryOperator::Create(
Context, OrigLHS, OrigRHS, BO_Cmp, Result.get()->getType(),
Result.get()->getValueKind(), Result.get()->getObjectKind(), OpLoc,
- FPFeatures);
+ CurFPFeatures);
Expr *SemanticForm[] = {LHS, RHS, Result.get()};
return PseudoObjectExpr::Create(Context, SyntacticForm, SemanticForm, 2);
}
@@ -13705,7 +13705,7 @@ Sema::CreateOverloadedArraySubscriptExpr(SourceLocation LLoc,
return CXXOperatorCallExpr::Create(Context, OO_Subscript, Fn, Args,
Context.DependentTy, VK_RValue, RLoc,
- FPFeatures);
+ CurFPFeatures);
}
// Handle placeholders on both operands.
@@ -13780,7 +13780,7 @@ Sema::CreateOverloadedArraySubscriptExpr(SourceLocation LLoc,
CXXOperatorCallExpr *TheCall =
CXXOperatorCallExpr::Create(Context, OO_Subscript, FnExpr.get(),
- Args, ResultTy, VK, RLoc, FPFeatures);
+ Args, ResultTy, VK, RLoc, CurFPFeatures);
if (CheckCallReturnType(FnDecl->getReturnType(), LLoc, TheCall, FnDecl))
return ExprError();
@@ -14403,7 +14403,7 @@ Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Obj,
CXXOperatorCallExpr *TheCall =
CXXOperatorCallExpr::Create(Context, OO_Call, NewFn.get(), MethodArgs,
- ResultTy, VK, RParenLoc, FPFeatures);
+ ResultTy, VK, RParenLoc, CurFPFeatures);
if (CheckCallReturnType(Method->getReturnType(), LParenLoc, TheCall, Method))
return true;
@@ -14520,7 +14520,7 @@ Sema::BuildOverloadedArrowExpr(Scope *S, Expr *Base, SourceLocation OpLoc,
ExprValueKind VK = Expr::getValueKindForType(ResultTy);
ResultTy = ResultTy.getNonLValueExprType(Context);
CXXOperatorCallExpr *TheCall = CXXOperatorCallExpr::Create(
- Context, OO_Arrow, FnExpr.get(), Base, ResultTy, VK, OpLoc, FPFeatures);
+ Context, OO_Arrow, FnExpr.get(), Base, ResultTy, VK, OpLoc, CurFPFeatures);
if (CheckCallReturnType(Method->getReturnType(), OpLoc, TheCall, Method))
return ExprError();
diff --git a/clang/lib/Sema/SemaPseudoObject.cpp b/clang/lib/Sema/SemaPseudoObject.cpp
index 74077b33f945..4413b24fa958 100644
--- a/clang/lib/Sema/SemaPseudoObject.cpp
+++ b/clang/lib/Sema/SemaPseudoObject.cpp
@@ -450,7 +450,7 @@ PseudoOpBuilder::buildAssignmentOperation(Scope *Sc, SourceLocation opcLoc,
result = semanticRHS;
syntactic = BinaryOperator::Create(
S.Context, syntacticLHS, capturedRHS, opcode, capturedRHS->getType(),
- capturedRHS->getValueKind(), OK_Ordinary, opcLoc, S.FPFeatures);
+ capturedRHS->getValueKind(), OK_Ordinary, opcLoc, S.CurFPFeatures);
} else {
ExprResult opLHS = buildGet();
@@ -464,7 +464,7 @@ PseudoOpBuilder::buildAssignmentOperation(Scope *Sc, SourceLocation opcLoc,
syntactic = CompoundAssignOperator::Create(
S.Context, syntacticLHS, capturedRHS, opcode, result.get()->getType(),
- result.get()->getValueKind(), OK_Ordinary, opcLoc, S.FPFeatures,
+ result.get()->getValueKind(), OK_Ordinary, opcLoc, S.CurFPFeatures,
opLHS.get()->getType(), result.get()->getType());
}
@@ -1583,7 +1583,7 @@ ExprResult Sema::checkPseudoObjectAssignment(Scope *S, SourceLocation opcLoc,
if (LHS->isTypeDependent() || RHS->isTypeDependent())
return BinaryOperator::Create(Context, LHS, RHS, opcode,
Context.DependentTy, VK_RValue, OK_Ordinary,
- opcLoc, FPFeatures);
+ opcLoc, CurFPFeatures);
// Filter out non-overload placeholder types in the RHS.
if (RHS->getType()->isNonOverloadPlaceholderType()) {
@@ -1646,7 +1646,7 @@ Expr *Sema::recreateSyntacticForm(PseudoObjectExpr *E) {
return CompoundAssignOperator::Create(
Context, lhs, rhs, cop->getOpcode(), cop->getType(),
cop->getValueKind(), cop->getObjectKind(), cop->getOperatorLoc(),
- FPFeatures, cop->getComputationLHSType(),
+ CurFPFeatures, cop->getComputationLHSType(),
cop->getComputationResultType());
} else if (BinaryOperator *bop = dyn_cast<BinaryOperator>(syntax)) {
@@ -1655,7 +1655,7 @@ Expr *Sema::recreateSyntacticForm(PseudoObjectExpr *E) {
return BinaryOperator::Create(Context, lhs, rhs, bop->getOpcode(),
bop->getType(), bop->getValueKind(),
bop->getObjectKind(), bop->getOperatorLoc(),
- FPFeatures);
+ CurFPFeatures);
} else if (isa<CallExpr>(syntax)) {
return syntax;
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index e79969e9a87a..87b07897ec28 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -10267,7 +10267,7 @@ TreeTransform<Derived>::TransformBinaryOperator(BinaryOperator *E) {
return getDerived().RebuildBinaryOperator(
E->getOperatorLoc(), E->getOpcode(), LHS.get(), RHS.get());
Sema::FPFeaturesStateRAII FPFeaturesState(getSema());
- getSema().FPFeatures = E->getFPFeatures(getSema().getLangOpts());
+ getSema().CurFPFeatures = E->getFPFeatures(getSema().getLangOpts());
return getDerived().RebuildBinaryOperator(E->getOperatorLoc(), E->getOpcode(),
LHS.get(), RHS.get());
@@ -10322,7 +10322,7 @@ ExprResult
TreeTransform<Derived>::TransformCompoundAssignOperator(
CompoundAssignOperator *E) {
Sema::FPFeaturesStateRAII FPFeaturesState(getSema());
- getSema().FPFeatures = E->getFPFeatures(getSema().getLangOpts());
+ getSema().CurFPFeatures = E->getFPFeatures(getSema().getLangOpts());
return getDerived().TransformBinaryOperator(E);
}
@@ -10797,7 +10797,7 @@ TreeTransform<Derived>::TransformCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
return SemaRef.MaybeBindToTemporary(E);
Sema::FPFeaturesStateRAII FPFeaturesState(getSema());
- getSema().FPFeatures = E->getFPFeatures();
+ getSema().CurFPFeatures = E->getFPFeatures();
return getDerived().RebuildCXXOperatorCallExpr(E->getOperator(),
E->getOperatorLoc(),
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index cc69488c4f64..9f662c6e0d4c 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -7773,7 +7773,7 @@ void ASTReader::InitializeSema(Sema &S) {
// FIXME: What happens if these are changed by a module import?
if (!FPPragmaOptions.empty()) {
assert(FPPragmaOptions.size() == 1 && "Wrong number of FP_PRAGMA_OPTIONS");
- SemaObj->FPFeatures = FPOptions(FPPragmaOptions[0]);
+ SemaObj->CurFPFeatures = FPOptions(FPPragmaOptions[0]);
}
SemaObj->OpenCLFeatures.copy(OpenCLExtensions);
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 05ec8feffb26..a3ceeef99097 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -4727,7 +4727,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
WriteReferencedSelectorsPool(SemaRef);
WriteLateParsedTemplates(SemaRef);
WriteIdentifierTable(PP, SemaRef.IdResolver, isModule);
- WriteFPPragmaOptions(SemaRef.getFPOptions());
+ WriteFPPragmaOptions(SemaRef.getCurFPFeatures());
WriteOpenCLExtensions(SemaRef);
WriteOpenCLExtensionTypes(SemaRef);
WriteCUDAPragmas(SemaRef);
More information about the cfe-commits
mailing list