[clang] 948219d - Replace setter named 'getAsOpaqueInt' with a real getter.
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 16 17:02:04 PDT 2020
Author: Richard Smith
Date: 2020-08-16T16:38:33-07:00
New Revision: 948219d1098736758123c43f995ec784db5d921e
URL: https://github.com/llvm/llvm-project/commit/948219d1098736758123c43f995ec784db5d921e
DIFF: https://github.com/llvm/llvm-project/commit/948219d1098736758123c43f995ec784db5d921e.diff
LOG: Replace setter named 'getAsOpaqueInt' with a real getter.
Clean up a bunch of places where the opaque forms of FPOptions and
FPOptionsOverride were being used inappropriately.
Added:
Modified:
clang/include/clang/Basic/LangOptions.h
clang/include/clang/Sema/Sema.h
clang/include/clang/Serialization/ASTReader.h
clang/lib/Parse/ParseDeclCXX.cpp
clang/lib/Sema/Sema.cpp
clang/lib/Sema/SemaAttr.cpp
clang/lib/Sema/TreeTransform.h
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTReaderStmt.cpp
clang/lib/Serialization/ASTWriter.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h
index f1601aaa9d39..4e277435bf8f 100644
--- a/clang/include/clang/Basic/LangOptions.h
+++ b/clang/include/clang/Basic/LangOptions.h
@@ -402,9 +402,6 @@ class FPOptions {
setRoundingMode(static_cast<RoundingMode>(LangOptions::FPR_ToNearest));
setFPExceptionMode(LangOptions::FPE_Ignore);
}
- // Used for serializing.
- explicit FPOptions(unsigned I) { getFromOpaqueInt(I); }
-
explicit FPOptions(const LangOptions &LO) {
Value = 0;
setFPContractMode(LO.getDefaultFPContractMode());
@@ -447,7 +444,11 @@ class FPOptions {
static FPOptions defaultWithoutTrailingStorage(const LangOptions &LO);
storage_type getAsOpaqueInt() const { return Value; }
- void getFromOpaqueInt(storage_type value) { Value = value; }
+ static FPOptions getFromOpaqueInt(storage_type Value) {
+ FPOptions Opts;
+ Opts.Value = Value;
+ return Opts;
+ }
// We can define most of the accessors automatically:
#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
@@ -475,7 +476,7 @@ class FPOptions {
/// The is implemented as a value of the new FPOptions plus a mask showing which
/// fields are actually set in it.
class FPOptionsOverride {
- FPOptions Options = FPOptions(0);
+ FPOptions Options = FPOptions::getFromOpaqueInt(0);
FPOptions::storage_type OverrideMask = 0;
public:
@@ -493,14 +494,9 @@ class FPOptionsOverride {
(static_cast<storage_type>(1) << FPOptions::StorageBitSize) - 1;
FPOptionsOverride() {}
- FPOptionsOverride(FPOptions::storage_type Value, FPOptions::storage_type Mask)
- : Options(Value), OverrideMask(Mask) {}
FPOptionsOverride(const LangOptions &LO)
: Options(LO), OverrideMask(OverrideMaskBits) {}
- // Used for serializing.
- explicit FPOptionsOverride(storage_type I) { getFromOpaqueInt(I); }
-
bool requiresTrailingStorage() const { return OverrideMask != 0; }
void setAllowFPContractWithinStatement() {
@@ -535,14 +531,17 @@ class FPOptionsOverride {
<< FPOptions::StorageBitSize) |
OverrideMask;
}
- void getFromOpaqueInt(storage_type I) {
- OverrideMask = I & OverrideMaskBits;
- Options.getFromOpaqueInt(I >> FPOptions::StorageBitSize);
+ static FPOptionsOverride getFromOpaqueInt(storage_type I) {
+ FPOptionsOverride Opts;
+ Opts.OverrideMask = I & OverrideMaskBits;
+ Opts.Options = FPOptions::getFromOpaqueInt(I >> FPOptions::StorageBitSize);
+ return Opts;
}
FPOptions applyOverrides(FPOptions Base) {
- FPOptions Result((Base.getAsOpaqueInt() & ~OverrideMask) |
- (Options.getAsOpaqueInt() & OverrideMask));
+ FPOptions Result =
+ FPOptions::getFromOpaqueInt((Base.getAsOpaqueInt() & ~OverrideMask) |
+ (Options.getAsOpaqueInt() & OverrideMask));
return Result;
}
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 558602b76e07..1d12551a8ad2 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -587,13 +587,13 @@ class Sema final {
PragmaStack<StringLiteral *> CodeSegStack;
// This stack tracks the current state of Sema.CurFPFeatures.
- PragmaStack<FPOptionsOverride::storage_type> FpPragmaStack;
+ PragmaStack<FPOptionsOverride> FpPragmaStack;
FPOptionsOverride CurFPFeatureOverrides() {
FPOptionsOverride result;
if (!FpPragmaStack.hasValue()) {
result = FPOptionsOverride();
} else {
- result = FPOptionsOverride(FpPragmaStack.CurrentValue);
+ result = FpPragmaStack.CurrentValue;
}
return result;
}
@@ -1405,12 +1405,12 @@ class Sema final {
S.CurFPFeatures = OldFPFeaturesState;
S.FpPragmaStack.CurrentValue = OldOverrides;
}
- FPOptionsOverride::storage_type getOverrides() { return OldOverrides; }
+ FPOptionsOverride getOverrides() { return OldOverrides; }
private:
Sema& S;
FPOptions OldFPFeaturesState;
- FPOptionsOverride::storage_type OldOverrides;
+ FPOptionsOverride OldOverrides;
};
void addImplicitTypedef(StringRef Name, QualType T);
diff --git a/clang/include/clang/Serialization/ASTReader.h b/clang/include/clang/Serialization/ASTReader.h
index e883eb2f1749..b6892e295ac7 100644
--- a/clang/include/clang/Serialization/ASTReader.h
+++ b/clang/include/clang/Serialization/ASTReader.h
@@ -858,10 +858,10 @@ class ASTReader
SourceLocation PointersToMembersPragmaLocation;
/// The pragma float_control state.
- Optional<FPOptionsOverride::storage_type> FpPragmaCurrentValue;
+ Optional<FPOptionsOverride> FpPragmaCurrentValue;
SourceLocation FpPragmaCurrentLocation;
struct FpPragmaStackEntry {
- FPOptionsOverride::storage_type Value;
+ FPOptionsOverride Value;
SourceLocation Location;
SourceLocation PushLocation;
StringRef SlotLabel;
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index ddcbb5615fee..d2cc089c98eb 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -3379,7 +3379,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
FPOptionsOverride NewOverrides;
Actions.CurFPFeatures = NewOverrides.applyOverrides(getLangOpts());
Actions.FpPragmaStack.Act(Tok.getLocation(), Sema::PSK_Reset, StringRef(),
- 0 /*unused*/);
+ {} /*unused*/);
SourceLocation SavedPrevTokLocation = PrevTokLocation;
ParseLexedPragmas(getCurrentClass());
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 7415d0d0766b..b9d655bab1b0 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -159,8 +159,9 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
LangOpts.getMSPointerToMemberRepresentationMethod()),
VtorDispStack(LangOpts.getVtorDispMode()), PackStack(0),
DataSegStack(nullptr), BSSSegStack(nullptr), ConstSegStack(nullptr),
- CodeSegStack(nullptr), FpPragmaStack(0xffffffff), CurInitSeg(nullptr),
- VisContext(nullptr), PragmaAttributeCurrentTargetDecl(nullptr),
+ CodeSegStack(nullptr), FpPragmaStack(FPOptionsOverride()),
+ CurInitSeg(nullptr), VisContext(nullptr),
+ PragmaAttributeCurrentTargetDecl(nullptr),
IsBuildingRecoveryCallExpr(false), Cleanup{}, LateTemplateParser(nullptr),
LateTemplateParserCleanup(nullptr), OpaqueParser(nullptr), IdResolver(pp),
StdExperimentalNamespaceCache(nullptr), StdInitializerList(nullptr),
diff --git a/clang/lib/Sema/SemaAttr.cpp b/clang/lib/Sema/SemaAttr.cpp
index f9785e4bea5e..e34f7371506d 100644
--- a/clang/lib/Sema/SemaAttr.cpp
+++ b/clang/lib/Sema/SemaAttr.cpp
@@ -415,10 +415,7 @@ void Sema::ActOnPragmaDetectMismatch(SourceLocation Loc, StringRef Name,
void Sema::ActOnPragmaFloatControl(SourceLocation Loc,
PragmaMsStackAction Action,
PragmaFloatControlKind Value) {
- unsigned NewValue = FpPragmaStack.hasValue()
- ? FpPragmaStack.CurrentValue
- : CurFPFeatureOverrides().getAsOpaqueInt();
- FPOptionsOverride NewFPFeatures(NewValue);
+ FPOptionsOverride NewFPFeatures = CurFPFeatureOverrides();
if ((Action == PSK_Push_Set || Action == PSK_Push || Action == PSK_Pop) &&
!(CurContext->isTranslationUnit()) && !CurContext->isNamespace()) {
// Push and pop can only occur at file or namespace scope.
@@ -430,8 +427,7 @@ void Sema::ActOnPragmaFloatControl(SourceLocation Loc,
llvm_unreachable("invalid pragma float_control kind");
case PFC_Precise:
NewFPFeatures.setFPPreciseEnabled(true);
- NewValue = NewFPFeatures.getAsOpaqueInt();
- FpPragmaStack.Act(Loc, Action, StringRef(), NewValue);
+ FpPragmaStack.Act(Loc, Action, StringRef(), NewFPFeatures);
break;
case PFC_NoPrecise:
if (CurFPFeatures.getFPExceptionMode() == LangOptions::FPE_Strict)
@@ -440,25 +436,21 @@ void Sema::ActOnPragmaFloatControl(SourceLocation Loc,
Diag(Loc, diag::err_pragma_fc_noprecise_requires_nofenv);
else
NewFPFeatures.setFPPreciseEnabled(false);
- NewValue = NewFPFeatures.getAsOpaqueInt();
- FpPragmaStack.Act(Loc, Action, StringRef(), NewValue);
+ FpPragmaStack.Act(Loc, Action, StringRef(), NewFPFeatures);
break;
case PFC_Except:
if (!isPreciseFPEnabled())
Diag(Loc, diag::err_pragma_fc_except_requires_precise);
else
NewFPFeatures.setFPExceptionModeOverride(LangOptions::FPE_Strict);
- NewValue = NewFPFeatures.getAsOpaqueInt();
- FpPragmaStack.Act(Loc, Action, StringRef(), NewValue);
+ FpPragmaStack.Act(Loc, Action, StringRef(), NewFPFeatures);
break;
case PFC_NoExcept:
NewFPFeatures.setFPExceptionModeOverride(LangOptions::FPE_Ignore);
- NewValue = NewFPFeatures.getAsOpaqueInt();
- FpPragmaStack.Act(Loc, Action, StringRef(), NewValue);
+ FpPragmaStack.Act(Loc, Action, StringRef(), NewFPFeatures);
break;
case PFC_Push:
- FpPragmaStack.Act(Loc, Sema::PSK_Push_Set, StringRef(),
- NewFPFeatures.getAsOpaqueInt());
+ FpPragmaStack.Act(Loc, Sema::PSK_Push_Set, StringRef(), NewFPFeatures);
break;
case PFC_Pop:
if (FpPragmaStack.Stack.empty()) {
@@ -466,14 +458,11 @@ void Sema::ActOnPragmaFloatControl(SourceLocation Loc,
<< "stack empty";
return;
}
- FpPragmaStack.Act(Loc, Action, StringRef(), NewFPFeatures.getAsOpaqueInt());
- NewValue = FpPragmaStack.CurrentValue;
+ FpPragmaStack.Act(Loc, Action, StringRef(), NewFPFeatures);
+ NewFPFeatures = FpPragmaStack.CurrentValue;
break;
}
- FPOptionsOverride NewOverrides;
- if (NewValue != FpPragmaStack.DefaultValue)
- NewOverrides.getFromOpaqueInt(NewValue);
- CurFPFeatures = NewOverrides.applyOverrides(getLangOpts());
+ CurFPFeatures = NewFPFeatures.applyOverrides(getLangOpts());
}
void Sema::ActOnPragmaMSPointersToMembers(
@@ -966,10 +955,7 @@ void Sema::ActOnPragmaVisibility(const IdentifierInfo* VisType,
void Sema::ActOnPragmaFPContract(SourceLocation Loc,
LangOptions::FPModeKind FPC) {
- unsigned NewValue = FpPragmaStack.hasValue()
- ? FpPragmaStack.CurrentValue
- : CurFPFeatureOverrides().getAsOpaqueInt();
- FPOptionsOverride NewFPFeatures(NewValue);
+ FPOptionsOverride NewFPFeatures = CurFPFeatureOverrides();
switch (FPC) {
case LangOptions::FPM_On:
NewFPFeatures.setAllowFPContractWithinStatement();
@@ -981,53 +967,34 @@ void Sema::ActOnPragmaFPContract(SourceLocation Loc,
NewFPFeatures.setDisallowFPContract();
break;
}
+ FpPragmaStack.Act(Loc, Sema::PSK_Set, StringRef(), NewFPFeatures);
CurFPFeatures = NewFPFeatures.applyOverrides(getLangOpts());
- FpPragmaStack.Act(Loc, Sema::PSK_Set, StringRef(),
- NewFPFeatures.getAsOpaqueInt());
}
void Sema::ActOnPragmaFPReassociate(SourceLocation Loc, bool IsEnabled) {
- unsigned NewValue = FpPragmaStack.hasValue()
- ? FpPragmaStack.CurrentValue
- : CurFPFeatureOverrides().getAsOpaqueInt();
- FPOptionsOverride NewFPFeatures(NewValue);
+ FPOptionsOverride NewFPFeatures = CurFPFeatureOverrides();
NewFPFeatures.setAllowFPReassociateOverride(IsEnabled);
- NewValue = NewFPFeatures.getAsOpaqueInt();
- FpPragmaStack.Act(Loc, PSK_Set, StringRef(), NewValue);
- FPOptionsOverride NewOverrides(NewValue);
- CurFPFeatures = NewOverrides.applyOverrides(getLangOpts());
+ FpPragmaStack.Act(Loc, PSK_Set, StringRef(), NewFPFeatures);
+ CurFPFeatures = NewFPFeatures.applyOverrides(getLangOpts());
}
void Sema::setRoundingMode(SourceLocation Loc, llvm::RoundingMode FPR) {
- unsigned NewValue = FpPragmaStack.hasValue()
- ? FpPragmaStack.CurrentValue
- : CurFPFeatureOverrides().getAsOpaqueInt();
- FPOptionsOverride NewFPFeatures(NewValue);
+ FPOptionsOverride NewFPFeatures = CurFPFeatureOverrides();
NewFPFeatures.setRoundingModeOverride(FPR);
- NewValue = NewFPFeatures.getAsOpaqueInt();
- FpPragmaStack.Act(Loc, PSK_Set, StringRef(), NewValue);
- FPOptionsOverride NewOverrides(NewValue);
- CurFPFeatures = NewOverrides.applyOverrides(getLangOpts());
+ FpPragmaStack.Act(Loc, PSK_Set, StringRef(), NewFPFeatures);
+ CurFPFeatures = NewFPFeatures.applyOverrides(getLangOpts());
}
void Sema::setExceptionMode(SourceLocation Loc,
LangOptions::FPExceptionModeKind FPE) {
- unsigned NewValue = FpPragmaStack.hasValue()
- ? FpPragmaStack.CurrentValue
- : CurFPFeatureOverrides().getAsOpaqueInt();
- FPOptionsOverride NewFPFeatures(NewValue);
+ FPOptionsOverride NewFPFeatures = CurFPFeatureOverrides();
NewFPFeatures.setFPExceptionModeOverride(FPE);
- NewValue = NewFPFeatures.getAsOpaqueInt();
- FpPragmaStack.Act(Loc, PSK_Set, StringRef(), NewValue);
- FPOptionsOverride NewOverrides(NewValue);
- CurFPFeatures = NewOverrides.applyOverrides(getLangOpts());
+ FpPragmaStack.Act(Loc, PSK_Set, StringRef(), NewFPFeatures);
+ CurFPFeatures = NewFPFeatures.applyOverrides(getLangOpts());
}
void Sema::ActOnPragmaFEnvAccess(SourceLocation Loc, bool IsEnabled) {
- unsigned NewValue = FpPragmaStack.hasValue()
- ? FpPragmaStack.CurrentValue
- : CurFPFeatureOverrides().getAsOpaqueInt();
- FPOptionsOverride NewFPFeatures(NewValue);
+ FPOptionsOverride NewFPFeatures = CurFPFeatureOverrides();
if (IsEnabled) {
// Verify Microsoft restriction:
// You can't enable fenv_access unless precise semantics are enabled.
@@ -1038,10 +1005,8 @@ void Sema::ActOnPragmaFEnvAccess(SourceLocation Loc, bool IsEnabled) {
NewFPFeatures.setAllowFEnvAccessOverride(true);
} else
NewFPFeatures.setAllowFEnvAccessOverride(false);
- NewValue = NewFPFeatures.getAsOpaqueInt();
- FpPragmaStack.Act(Loc, PSK_Set, StringRef(), NewValue);
- FPOptionsOverride NewOverrides(NewValue);
- CurFPFeatures = NewOverrides.applyOverrides(getLangOpts());
+ FpPragmaStack.Act(Loc, PSK_Set, StringRef(), NewFPFeatures);
+ CurFPFeatures = NewFPFeatures.applyOverrides(getLangOpts());
}
void Sema::PushNamespaceVisibilityAttr(const VisibilityAttr *Attr,
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index 3a2c6a8930d3..4c8293f3bf4c 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -10495,7 +10495,7 @@ TreeTransform<Derived>::TransformCallExpr(CallExpr *E) {
FPOptionsOverride NewOverrides = E->getFPFeatures();
getSema().CurFPFeatures =
NewOverrides.applyOverrides(getSema().getLangOpts());
- getSema().FpPragmaStack.CurrentValue = NewOverrides.getAsOpaqueInt();
+ getSema().FpPragmaStack.CurrentValue = NewOverrides;
}
return getDerived().RebuildCallExpr(Callee.get(), FakeLParenLoc,
@@ -10612,7 +10612,7 @@ TreeTransform<Derived>::TransformBinaryOperator(BinaryOperator *E) {
FPOptionsOverride NewOverrides(E->getFPFeatures(getSema().getLangOpts()));
getSema().CurFPFeatures =
NewOverrides.applyOverrides(getSema().getLangOpts());
- getSema().FpPragmaStack.CurrentValue = NewOverrides.getAsOpaqueInt();
+ getSema().FpPragmaStack.CurrentValue = NewOverrides;
return getDerived().RebuildBinaryOperator(E->getOperatorLoc(), E->getOpcode(),
LHS.get(), RHS.get());
}
@@ -10669,7 +10669,7 @@ TreeTransform<Derived>::TransformCompoundAssignOperator(
FPOptionsOverride NewOverrides(E->getFPFeatures(getSema().getLangOpts()));
getSema().CurFPFeatures =
NewOverrides.applyOverrides(getSema().getLangOpts());
- getSema().FpPragmaStack.CurrentValue = NewOverrides.getAsOpaqueInt();
+ getSema().FpPragmaStack.CurrentValue = NewOverrides;
return getDerived().TransformBinaryOperator(E);
}
@@ -11147,7 +11147,7 @@ TreeTransform<Derived>::TransformCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
FPOptionsOverride NewOverrides(E->getFPFeatures());
getSema().CurFPFeatures =
NewOverrides.applyOverrides(getSema().getLangOpts());
- getSema().FpPragmaStack.CurrentValue = NewOverrides.getAsOpaqueInt();
+ getSema().FpPragmaStack.CurrentValue = NewOverrides;
return getDerived().RebuildCXXOperatorCallExpr(E->getOperator(),
E->getOperatorLoc(),
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 0b3389c4e082..2b4679b79d11 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -3790,7 +3790,7 @@ ASTReader::ReadASTBlock(ModuleFile &F, unsigned ClientLoadCapabilities) {
Error("invalid pragma pack record");
return Failure;
}
- FpPragmaCurrentValue = Record[0];
+ FpPragmaCurrentValue = FPOptionsOverride::getFromOpaqueInt(Record[0]);
FpPragmaCurrentLocation = ReadSourceLocation(F, Record[1]);
unsigned NumStackEntries = Record[2];
unsigned Idx = 3;
@@ -3798,7 +3798,7 @@ ASTReader::ReadASTBlock(ModuleFile &F, unsigned ClientLoadCapabilities) {
FpPragmaStack.clear();
for (unsigned I = 0; I < NumStackEntries; ++I) {
FpPragmaStackEntry Entry;
- Entry.Value = Record[Idx++];
+ Entry.Value = FPOptionsOverride::getFromOpaqueInt(Record[Idx++]);
Entry.Location = ReadSourceLocation(F, Record[Idx++]);
Entry.PushLocation = ReadSourceLocation(F, Record[Idx++]);
FpPragmaStrings.push_back(ReadString(Record, Idx));
@@ -7842,7 +7842,8 @@ 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");
- FPOptionsOverride NewOverrides(FPPragmaOptions[0]);
+ FPOptionsOverride NewOverrides =
+ FPOptionsOverride::getFromOpaqueInt(FPPragmaOptions[0]);
SemaObj->CurFPFeatures =
NewOverrides.applyOverrides(SemaObj->getLangOpts());
}
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp
index 9c8b3b6af651..e261044f7cb1 100644
--- a/clang/lib/Serialization/ASTReaderStmt.cpp
+++ b/clang/lib/Serialization/ASTReaderStmt.cpp
@@ -712,7 +712,8 @@ void ASTStmtReader::VisitUnaryOperator(UnaryOperator *E) {
E->setOperatorLoc(readSourceLocation());
E->setCanOverflow(Record.readInt());
if (hasFP_Features)
- E->setStoredFPFeatures(FPOptionsOverride(Record.readInt()));
+ E->setStoredFPFeatures(
+ FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
}
void ASTStmtReader::VisitOffsetOfExpr(OffsetOfExpr *E) {
@@ -1003,7 +1004,8 @@ void ASTStmtReader::VisitCallExpr(CallExpr *E) {
E->setArg(I, Record.readSubExpr());
E->setADLCallKind(static_cast<CallExpr::ADLCallKind>(Record.readInt()));
if (HasFPFeatures)
- E->setStoredFPFeatures(FPOptionsOverride(Record.readInt()));
+ E->setStoredFPFeatures(
+ FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
}
void ASTStmtReader::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
@@ -1100,7 +1102,8 @@ void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
E->setRHS(Record.readSubExpr());
E->setOperatorLoc(readSourceLocation());
if (hasFP_Features)
- E->setStoredFPFeatures(FPOptionsOverride(Record.readInt()));
+ E->setStoredFPFeatures(
+ FPOptionsOverride::getFromOpaqueInt(Record.readInt()));
}
void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 8352bae32137..a896df2e8358 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -4178,11 +4178,11 @@ void ASTWriter::WriteFloatControlPragmaOptions(Sema &SemaRef) {
return;
RecordData Record;
- Record.push_back(SemaRef.FpPragmaStack.CurrentValue);
+ Record.push_back(SemaRef.FpPragmaStack.CurrentValue.getAsOpaqueInt());
AddSourceLocation(SemaRef.FpPragmaStack.CurrentPragmaLocation, Record);
Record.push_back(SemaRef.FpPragmaStack.Stack.size());
for (const auto &StackEntry : SemaRef.FpPragmaStack.Stack) {
- Record.push_back(StackEntry.Value);
+ Record.push_back(StackEntry.Value.getAsOpaqueInt());
AddSourceLocation(StackEntry.PragmaLocation, Record);
AddSourceLocation(StackEntry.PragmaPushLocation, Record);
AddString(StackEntry.StackSlotLabel, Record);
More information about the cfe-commits
mailing list