@@ -2118,21 +2118,21 @@ class ParenExpr : public Expr {
2118
2118
// /
2119
2119
class UnaryOperator final
2120
2120
: public Expr,
2121
- private llvm::TrailingObjects<UnaryOperator, FPOptionsOverride > {
2121
+ private llvm::TrailingObjects<UnaryOperator, FPOptions > {
2122
2122
Stmt *Val;
2123
2123
2124
- size_t numTrailingObjects (OverloadToken<FPOptionsOverride >) const {
2124
+ size_t numTrailingObjects (OverloadToken<FPOptions >) const {
2125
2125
return UnaryOperatorBits.HasFPFeatures ? 1 : 0 ;
2126
2126
}
2127
2127
2128
- FPOptionsOverride &getTrailingFPFeatures () {
2128
+ FPOptions &getTrailingFPFeatures () {
2129
2129
assert (UnaryOperatorBits.HasFPFeatures );
2130
- return *getTrailingObjects<FPOptionsOverride >();
2130
+ return *getTrailingObjects<FPOptions >();
2131
2131
}
2132
2132
2133
- const FPOptionsOverride &getTrailingFPFeatures () const {
2133
+ const FPOptions &getTrailingFPFeatures () const {
2134
2134
assert (UnaryOperatorBits.HasFPFeatures );
2135
- return *getTrailingObjects<FPOptionsOverride >();
2135
+ return *getTrailingObjects<FPOptions >();
2136
2136
}
2137
2137
2138
2138
public:
@@ -2141,7 +2141,7 @@ class UnaryOperator final
2141
2141
protected:
2142
2142
UnaryOperator (const ASTContext &Ctx, Expr *input, Opcode opc, QualType type,
2143
2143
ExprValueKind VK, ExprObjectKind OK, SourceLocation l,
2144
- bool CanOverflow, FPOptionsOverride FPFeatures);
2144
+ bool CanOverflow, FPOptions FPFeatures);
2145
2145
2146
2146
// / Build an empty unary operator.
2147
2147
explicit UnaryOperator (bool HasFPFeatures, EmptyShell Empty)
@@ -2156,7 +2156,7 @@ class UnaryOperator final
2156
2156
static UnaryOperator *Create (const ASTContext &C, Expr *input, Opcode opc,
2157
2157
QualType type, ExprValueKind VK,
2158
2158
ExprObjectKind OK, SourceLocation l,
2159
- bool CanOverflow, FPOptionsOverride FPFeatures);
2159
+ bool CanOverflow, FPOptions FPFeatures);
2160
2160
2161
2161
Opcode getOpcode () const {
2162
2162
return static_cast <Opcode>(UnaryOperatorBits.Opc );
@@ -2182,13 +2182,13 @@ class UnaryOperator final
2182
2182
// Get the FP contractability status of this operator. Only meaningful for
2183
2183
// operations on floating point types.
2184
2184
bool isFPContractableWithinStatement (const LangOptions &LO) const {
2185
- return getFPFeaturesInEffect (LO).allowFPContractWithinStatement ();
2185
+ return getFPFeatures (LO).allowFPContractWithinStatement ();
2186
2186
}
2187
2187
2188
2188
// Get the FENV_ACCESS status of this operator. Only meaningful for
2189
2189
// operations on floating point types.
2190
2190
bool isFEnvAccessOn (const LangOptions &LO) const {
2191
- return getFPFeaturesInEffect (LO).getAllowFEnvAccess ();
2191
+ return getFPFeatures (LO).allowFEnvAccess ();
2192
2192
}
2193
2193
2194
2194
// / isPostfix - Return true if this is a postfix operation, like x++.
@@ -2263,25 +2263,18 @@ class UnaryOperator final
2263
2263
2264
2264
protected:
2265
2265
// / Get FPFeatures from trailing storage
2266
- FPOptionsOverride getStoredFPFeatures () const {
2267
- return getTrailingFPFeatures ();
2268
- }
2266
+ FPOptions getStoredFPFeatures () const { return getTrailingFPFeatures (); }
2269
2267
2270
2268
// / Set FPFeatures in trailing storage, used only by Serialization
2271
- void setStoredFPFeatures (FPOptionsOverride F) { getTrailingFPFeatures () = F; }
2269
+ void setStoredFPFeatures (FPOptions F) { getTrailingFPFeatures () = F; }
2272
2270
2273
2271
public:
2274
2272
// Get the FP features status of this operator. Only meaningful for
2275
2273
// operations on floating point types.
2276
- FPOptions getFPFeaturesInEffect (const LangOptions &LO) const {
2277
- if (UnaryOperatorBits.HasFPFeatures )
2278
- return getStoredFPFeatures ().applyOverrides (LO);
2279
- return FPOptions::defaultWithoutTrailingStorage (LO);
2280
- }
2281
- FPOptionsOverride getFPOptionsOverride () const {
2274
+ FPOptions getFPFeatures (const LangOptions &LO) const {
2282
2275
if (UnaryOperatorBits.HasFPFeatures )
2283
2276
return getStoredFPFeatures ();
2284
- return FPOptionsOverride ( );
2277
+ return FPOptions::defaultWithoutTrailingStorage (LO );
2285
2278
}
2286
2279
2287
2280
friend TrailingObjects;
@@ -3640,22 +3633,22 @@ class BinaryOperator : public Expr {
3640
3633
size_t offsetOfTrailingStorage () const ;
3641
3634
3642
3635
// / Return a pointer to the trailing FPOptions
3643
- FPOptionsOverride *getTrailingFPFeatures () {
3636
+ FPOptions *getTrailingFPFeatures () {
3644
3637
assert (BinaryOperatorBits.HasFPFeatures );
3645
- return reinterpret_cast <FPOptionsOverride *>(
3646
- reinterpret_cast < char *>( this ) + offsetOfTrailingStorage ());
3638
+ return reinterpret_cast <FPOptions *>(reinterpret_cast < char *>( this ) +
3639
+ offsetOfTrailingStorage ());
3647
3640
}
3648
- const FPOptionsOverride *getTrailingFPFeatures () const {
3641
+ const FPOptions *getTrailingFPFeatures () const {
3649
3642
assert (BinaryOperatorBits.HasFPFeatures );
3650
- return reinterpret_cast <const FPOptionsOverride *>(
3643
+ return reinterpret_cast <const FPOptions *>(
3651
3644
reinterpret_cast <const char *>(this ) + offsetOfTrailingStorage ());
3652
3645
}
3653
3646
3654
3647
// / Build a binary operator, assuming that appropriate storage has been
3655
3648
// / allocated for the trailing objects when needed.
3656
3649
BinaryOperator (const ASTContext &Ctx, Expr *lhs, Expr *rhs, Opcode opc,
3657
3650
QualType ResTy, ExprValueKind VK, ExprObjectKind OK,
3658
- SourceLocation opLoc, FPOptionsOverride FPFeatures);
3651
+ SourceLocation opLoc, FPOptions FPFeatures);
3659
3652
3660
3653
// / Construct an empty binary operator.
3661
3654
explicit BinaryOperator (EmptyShell Empty) : Expr(BinaryOperatorClass, Empty) {
@@ -3668,7 +3661,7 @@ class BinaryOperator : public Expr {
3668
3661
static BinaryOperator *Create (const ASTContext &C, Expr *lhs, Expr *rhs,
3669
3662
Opcode opc, QualType ResTy, ExprValueKind VK,
3670
3663
ExprObjectKind OK, SourceLocation opLoc,
3671
- FPOptionsOverride FPFeatures);
3664
+ FPOptions FPFeatures);
3672
3665
SourceLocation getExprLoc () const { return getOperatorLoc (); }
3673
3666
SourceLocation getOperatorLoc () const { return BinaryOperatorBits.OpLoc ; }
3674
3667
void setOperatorLoc (SourceLocation L) { BinaryOperatorBits.OpLoc = L; }
@@ -3815,48 +3808,40 @@ class BinaryOperator : public Expr {
3815
3808
bool hasStoredFPFeatures () const { return BinaryOperatorBits.HasFPFeatures ; }
3816
3809
3817
3810
// / Get FPFeatures from trailing storage
3818
- FPOptionsOverride getStoredFPFeatures () const {
3811
+ FPOptions getStoredFPFeatures () const {
3819
3812
assert (hasStoredFPFeatures ());
3820
3813
return *getTrailingFPFeatures ();
3821
3814
}
3822
3815
// / Set FPFeatures in trailing storage, used only by Serialization
3823
- void setStoredFPFeatures (FPOptionsOverride F) {
3816
+ void setStoredFPFeatures (FPOptions F) {
3824
3817
assert (BinaryOperatorBits.HasFPFeatures );
3825
3818
*getTrailingFPFeatures () = F;
3826
3819
}
3827
3820
3828
3821
// Get the FP features status of this operator. Only meaningful for
3829
3822
// operations on floating point types.
3830
- FPOptions getFPFeaturesInEffect (const LangOptions &LO) const {
3831
- if (BinaryOperatorBits.HasFPFeatures )
3832
- return getStoredFPFeatures ().applyOverrides (LO);
3833
- return FPOptions::defaultWithoutTrailingStorage (LO);
3834
- }
3835
-
3836
- // This is used in ASTImporter
3837
- FPOptionsOverride getFPFeatures (const LangOptions &LO) const {
3823
+ FPOptions getFPFeatures (const LangOptions &LO) const {
3838
3824
if (BinaryOperatorBits.HasFPFeatures )
3839
3825
return getStoredFPFeatures ();
3840
- return FPOptionsOverride ( );
3826
+ return FPOptions::defaultWithoutTrailingStorage (LO );
3841
3827
}
3842
3828
3843
3829
// Get the FP contractability status of this operator. Only meaningful for
3844
3830
// operations on floating point types.
3845
3831
bool isFPContractableWithinStatement (const LangOptions &LO) const {
3846
- return getFPFeaturesInEffect (LO).allowFPContractWithinStatement ();
3832
+ return getFPFeatures (LO).allowFPContractWithinStatement ();
3847
3833
}
3848
3834
3849
3835
// Get the FENV_ACCESS status of this operator. Only meaningful for
3850
3836
// operations on floating point types.
3851
3837
bool isFEnvAccessOn (const LangOptions &LO) const {
3852
- return getFPFeaturesInEffect (LO).getAllowFEnvAccess ();
3838
+ return getFPFeatures (LO).allowFEnvAccess ();
3853
3839
}
3854
3840
3855
3841
protected:
3856
3842
BinaryOperator (const ASTContext &Ctx, Expr *lhs, Expr *rhs, Opcode opc,
3857
3843
QualType ResTy, ExprValueKind VK, ExprObjectKind OK,
3858
- SourceLocation opLoc, FPOptionsOverride FPFeatures,
3859
- bool dead2);
3844
+ SourceLocation opLoc, FPOptions FPFeatures, bool dead2);
3860
3845
3861
3846
// / Construct an empty BinaryOperator, SC is CompoundAssignOperator.
3862
3847
BinaryOperator (StmtClass SC, EmptyShell Empty) : Expr(SC, Empty) {
@@ -3866,7 +3851,7 @@ class BinaryOperator : public Expr {
3866
3851
// / Return the size in bytes needed for the trailing objects.
3867
3852
// / Used to allocate the right amount of storage.
3868
3853
static unsigned sizeOfTrailingObjects (bool HasFPFeatures) {
3869
- return HasFPFeatures * sizeof (FPOptionsOverride );
3854
+ return HasFPFeatures * sizeof (FPOptions );
3870
3855
}
3871
3856
};
3872
3857
@@ -3888,7 +3873,7 @@ class CompoundAssignOperator : public BinaryOperator {
3888
3873
protected:
3889
3874
CompoundAssignOperator (const ASTContext &C, Expr *lhs, Expr *rhs, Opcode opc,
3890
3875
QualType ResType, ExprValueKind VK, ExprObjectKind OK,
3891
- SourceLocation OpLoc, FPOptionsOverride FPFeatures,
3876
+ SourceLocation OpLoc, FPOptions FPFeatures,
3892
3877
QualType CompLHSType, QualType CompResultType)
3893
3878
: BinaryOperator(C, lhs, rhs, opc, ResType, VK, OK, OpLoc, FPFeatures,
3894
3879
true ),
@@ -3904,7 +3889,7 @@ class CompoundAssignOperator : public BinaryOperator {
3904
3889
static CompoundAssignOperator *
3905
3890
Create (const ASTContext &C, Expr *lhs, Expr *rhs, Opcode opc, QualType ResTy,
3906
3891
ExprValueKind VK, ExprObjectKind OK, SourceLocation opLoc,
3907
- FPOptionsOverride FPFeatures, QualType CompLHSType = QualType(),
3892
+ FPOptions FPFeatures, QualType CompLHSType = QualType(),
3908
3893
QualType CompResultType = QualType());
3909
3894
3910
3895
// The two computation types are the type the LHS is converted
0 commit comments