Skip to content

Commit 7490d3e

Browse files
Merge from 'master' to 'sycl-web' (#8)
CONFLICT (content): Merge conflict in clang/include/clang/Driver/Driver.h
2 parents 1b7f832 + 4d5c448 commit 7490d3e

File tree

99 files changed

+927
-1041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+927
-1041
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ New Compiler Flags
104104
simplify access to the many single purpose floating point options. The default
105105
setting is ``precise``.
106106

107-
- The default module cache has moved from /tmp to a per-user cache directory.
108-
By default, this is ~/.cache but on some platforms or installations, this
109-
might be elsewhere. The -fmodules-cache-path=... flag continues to work.
110-
111107
Deprecated Compiler Flags
112108
-------------------------
113109

clang/include/clang/AST/Expr.h

Lines changed: 31 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,21 +2118,21 @@ class ParenExpr : public Expr {
21182118
///
21192119
class UnaryOperator final
21202120
: public Expr,
2121-
private llvm::TrailingObjects<UnaryOperator, FPOptionsOverride> {
2121+
private llvm::TrailingObjects<UnaryOperator, FPOptions> {
21222122
Stmt *Val;
21232123

2124-
size_t numTrailingObjects(OverloadToken<FPOptionsOverride>) const {
2124+
size_t numTrailingObjects(OverloadToken<FPOptions>) const {
21252125
return UnaryOperatorBits.HasFPFeatures ? 1 : 0;
21262126
}
21272127

2128-
FPOptionsOverride &getTrailingFPFeatures() {
2128+
FPOptions &getTrailingFPFeatures() {
21292129
assert(UnaryOperatorBits.HasFPFeatures);
2130-
return *getTrailingObjects<FPOptionsOverride>();
2130+
return *getTrailingObjects<FPOptions>();
21312131
}
21322132

2133-
const FPOptionsOverride &getTrailingFPFeatures() const {
2133+
const FPOptions &getTrailingFPFeatures() const {
21342134
assert(UnaryOperatorBits.HasFPFeatures);
2135-
return *getTrailingObjects<FPOptionsOverride>();
2135+
return *getTrailingObjects<FPOptions>();
21362136
}
21372137

21382138
public:
@@ -2141,7 +2141,7 @@ class UnaryOperator final
21412141
protected:
21422142
UnaryOperator(const ASTContext &Ctx, Expr *input, Opcode opc, QualType type,
21432143
ExprValueKind VK, ExprObjectKind OK, SourceLocation l,
2144-
bool CanOverflow, FPOptionsOverride FPFeatures);
2144+
bool CanOverflow, FPOptions FPFeatures);
21452145

21462146
/// Build an empty unary operator.
21472147
explicit UnaryOperator(bool HasFPFeatures, EmptyShell Empty)
@@ -2156,7 +2156,7 @@ class UnaryOperator final
21562156
static UnaryOperator *Create(const ASTContext &C, Expr *input, Opcode opc,
21572157
QualType type, ExprValueKind VK,
21582158
ExprObjectKind OK, SourceLocation l,
2159-
bool CanOverflow, FPOptionsOverride FPFeatures);
2159+
bool CanOverflow, FPOptions FPFeatures);
21602160

21612161
Opcode getOpcode() const {
21622162
return static_cast<Opcode>(UnaryOperatorBits.Opc);
@@ -2182,13 +2182,13 @@ class UnaryOperator final
21822182
// Get the FP contractability status of this operator. Only meaningful for
21832183
// operations on floating point types.
21842184
bool isFPContractableWithinStatement(const LangOptions &LO) const {
2185-
return getFPFeaturesInEffect(LO).allowFPContractWithinStatement();
2185+
return getFPFeatures(LO).allowFPContractWithinStatement();
21862186
}
21872187

21882188
// Get the FENV_ACCESS status of this operator. Only meaningful for
21892189
// operations on floating point types.
21902190
bool isFEnvAccessOn(const LangOptions &LO) const {
2191-
return getFPFeaturesInEffect(LO).getAllowFEnvAccess();
2191+
return getFPFeatures(LO).allowFEnvAccess();
21922192
}
21932193

21942194
/// isPostfix - Return true if this is a postfix operation, like x++.
@@ -2263,25 +2263,18 @@ class UnaryOperator final
22632263

22642264
protected:
22652265
/// Get FPFeatures from trailing storage
2266-
FPOptionsOverride getStoredFPFeatures() const {
2267-
return getTrailingFPFeatures();
2268-
}
2266+
FPOptions getStoredFPFeatures() const { return getTrailingFPFeatures(); }
22692267

22702268
/// Set FPFeatures in trailing storage, used only by Serialization
2271-
void setStoredFPFeatures(FPOptionsOverride F) { getTrailingFPFeatures() = F; }
2269+
void setStoredFPFeatures(FPOptions F) { getTrailingFPFeatures() = F; }
22722270

22732271
public:
22742272
// Get the FP features status of this operator. Only meaningful for
22752273
// 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 {
22822275
if (UnaryOperatorBits.HasFPFeatures)
22832276
return getStoredFPFeatures();
2284-
return FPOptionsOverride();
2277+
return FPOptions::defaultWithoutTrailingStorage(LO);
22852278
}
22862279

22872280
friend TrailingObjects;
@@ -3640,22 +3633,22 @@ class BinaryOperator : public Expr {
36403633
size_t offsetOfTrailingStorage() const;
36413634

36423635
/// Return a pointer to the trailing FPOptions
3643-
FPOptionsOverride *getTrailingFPFeatures() {
3636+
FPOptions *getTrailingFPFeatures() {
36443637
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());
36473640
}
3648-
const FPOptionsOverride *getTrailingFPFeatures() const {
3641+
const FPOptions *getTrailingFPFeatures() const {
36493642
assert(BinaryOperatorBits.HasFPFeatures);
3650-
return reinterpret_cast<const FPOptionsOverride *>(
3643+
return reinterpret_cast<const FPOptions *>(
36513644
reinterpret_cast<const char *>(this) + offsetOfTrailingStorage());
36523645
}
36533646

36543647
/// Build a binary operator, assuming that appropriate storage has been
36553648
/// allocated for the trailing objects when needed.
36563649
BinaryOperator(const ASTContext &Ctx, Expr *lhs, Expr *rhs, Opcode opc,
36573650
QualType ResTy, ExprValueKind VK, ExprObjectKind OK,
3658-
SourceLocation opLoc, FPOptionsOverride FPFeatures);
3651+
SourceLocation opLoc, FPOptions FPFeatures);
36593652

36603653
/// Construct an empty binary operator.
36613654
explicit BinaryOperator(EmptyShell Empty) : Expr(BinaryOperatorClass, Empty) {
@@ -3668,7 +3661,7 @@ class BinaryOperator : public Expr {
36683661
static BinaryOperator *Create(const ASTContext &C, Expr *lhs, Expr *rhs,
36693662
Opcode opc, QualType ResTy, ExprValueKind VK,
36703663
ExprObjectKind OK, SourceLocation opLoc,
3671-
FPOptionsOverride FPFeatures);
3664+
FPOptions FPFeatures);
36723665
SourceLocation getExprLoc() const { return getOperatorLoc(); }
36733666
SourceLocation getOperatorLoc() const { return BinaryOperatorBits.OpLoc; }
36743667
void setOperatorLoc(SourceLocation L) { BinaryOperatorBits.OpLoc = L; }
@@ -3815,48 +3808,40 @@ class BinaryOperator : public Expr {
38153808
bool hasStoredFPFeatures() const { return BinaryOperatorBits.HasFPFeatures; }
38163809

38173810
/// Get FPFeatures from trailing storage
3818-
FPOptionsOverride getStoredFPFeatures() const {
3811+
FPOptions getStoredFPFeatures() const {
38193812
assert(hasStoredFPFeatures());
38203813
return *getTrailingFPFeatures();
38213814
}
38223815
/// Set FPFeatures in trailing storage, used only by Serialization
3823-
void setStoredFPFeatures(FPOptionsOverride F) {
3816+
void setStoredFPFeatures(FPOptions F) {
38243817
assert(BinaryOperatorBits.HasFPFeatures);
38253818
*getTrailingFPFeatures() = F;
38263819
}
38273820

38283821
// Get the FP features status of this operator. Only meaningful for
38293822
// 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 {
38383824
if (BinaryOperatorBits.HasFPFeatures)
38393825
return getStoredFPFeatures();
3840-
return FPOptionsOverride();
3826+
return FPOptions::defaultWithoutTrailingStorage(LO);
38413827
}
38423828

38433829
// Get the FP contractability status of this operator. Only meaningful for
38443830
// operations on floating point types.
38453831
bool isFPContractableWithinStatement(const LangOptions &LO) const {
3846-
return getFPFeaturesInEffect(LO).allowFPContractWithinStatement();
3832+
return getFPFeatures(LO).allowFPContractWithinStatement();
38473833
}
38483834

38493835
// Get the FENV_ACCESS status of this operator. Only meaningful for
38503836
// operations on floating point types.
38513837
bool isFEnvAccessOn(const LangOptions &LO) const {
3852-
return getFPFeaturesInEffect(LO).getAllowFEnvAccess();
3838+
return getFPFeatures(LO).allowFEnvAccess();
38533839
}
38543840

38553841
protected:
38563842
BinaryOperator(const ASTContext &Ctx, Expr *lhs, Expr *rhs, Opcode opc,
38573843
QualType ResTy, ExprValueKind VK, ExprObjectKind OK,
3858-
SourceLocation opLoc, FPOptionsOverride FPFeatures,
3859-
bool dead2);
3844+
SourceLocation opLoc, FPOptions FPFeatures, bool dead2);
38603845

38613846
/// Construct an empty BinaryOperator, SC is CompoundAssignOperator.
38623847
BinaryOperator(StmtClass SC, EmptyShell Empty) : Expr(SC, Empty) {
@@ -3866,7 +3851,7 @@ class BinaryOperator : public Expr {
38663851
/// Return the size in bytes needed for the trailing objects.
38673852
/// Used to allocate the right amount of storage.
38683853
static unsigned sizeOfTrailingObjects(bool HasFPFeatures) {
3869-
return HasFPFeatures * sizeof(FPOptionsOverride);
3854+
return HasFPFeatures * sizeof(FPOptions);
38703855
}
38713856
};
38723857

@@ -3888,7 +3873,7 @@ class CompoundAssignOperator : public BinaryOperator {
38883873
protected:
38893874
CompoundAssignOperator(const ASTContext &C, Expr *lhs, Expr *rhs, Opcode opc,
38903875
QualType ResType, ExprValueKind VK, ExprObjectKind OK,
3891-
SourceLocation OpLoc, FPOptionsOverride FPFeatures,
3876+
SourceLocation OpLoc, FPOptions FPFeatures,
38923877
QualType CompLHSType, QualType CompResultType)
38933878
: BinaryOperator(C, lhs, rhs, opc, ResType, VK, OK, OpLoc, FPFeatures,
38943879
true),
@@ -3904,7 +3889,7 @@ class CompoundAssignOperator : public BinaryOperator {
39043889
static CompoundAssignOperator *
39053890
Create(const ASTContext &C, Expr *lhs, Expr *rhs, Opcode opc, QualType ResTy,
39063891
ExprValueKind VK, ExprObjectKind OK, SourceLocation opLoc,
3907-
FPOptionsOverride FPFeatures, QualType CompLHSType = QualType(),
3892+
FPOptions FPFeatures, QualType CompLHSType = QualType(),
39083893
QualType CompResultType = QualType());
39093894

39103895
// The two computation types are the type the LHS is converted

clang/include/clang/AST/ExprCXX.h

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ class CXXOperatorCallExpr final : public CallExpr {
8484
friend class ASTStmtWriter;
8585

8686
SourceRange Range;
87-
FPOptionsOverride Overrides;
8887

8988
// CXXOperatorCallExpr has some trailing objects belonging
9089
// to CallExpr. See CallExpr for the details.
@@ -93,7 +92,7 @@ class CXXOperatorCallExpr final : public CallExpr {
9392

9493
CXXOperatorCallExpr(OverloadedOperatorKind OpKind, Expr *Fn,
9594
ArrayRef<Expr *> Args, QualType Ty, ExprValueKind VK,
96-
SourceLocation OperatorLoc, FPOptionsOverride FPFeatures,
95+
SourceLocation OperatorLoc, FPOptions FPFeatures,
9796
ADLCallKind UsesADL);
9897

9998
CXXOperatorCallExpr(unsigned NumArgs, EmptyShell Empty);
@@ -102,7 +101,7 @@ class CXXOperatorCallExpr final : public CallExpr {
102101
static CXXOperatorCallExpr *
103102
Create(const ASTContext &Ctx, OverloadedOperatorKind OpKind, Expr *Fn,
104103
ArrayRef<Expr *> Args, QualType Ty, ExprValueKind VK,
105-
SourceLocation OperatorLoc, FPOptionsOverride FPFeatures,
104+
SourceLocation OperatorLoc, FPOptions FPFeatures,
106105
ADLCallKind UsesADL = NotADL);
107106

108107
static CXXOperatorCallExpr *CreateEmpty(const ASTContext &Ctx,
@@ -165,10 +164,20 @@ class CXXOperatorCallExpr final : public CallExpr {
165164
return T->getStmtClass() == CXXOperatorCallExprClass;
166165
}
167166

168-
// Set the FPFeatures status of this operator. Only meaningful for
167+
// Set the FP contractability status of this operator. Only meaningful for
169168
// operations on floating point types.
170-
void setFPFeatures(FPOptionsOverride F) { Overrides = F; }
171-
FPOptionsOverride getFPFeatures() const { return Overrides; }
169+
void setFPFeatures(FPOptions F) {
170+
CXXOperatorCallExprBits.FPFeatures = F.getAsOpaqueInt();
171+
}
172+
FPOptions getFPFeatures() const {
173+
return FPOptions(CXXOperatorCallExprBits.FPFeatures);
174+
}
175+
176+
// Get the FP contractability status of this operator. Only meaningful for
177+
// operations on floating point types.
178+
bool isFPContractableWithinStatement() const {
179+
return getFPFeatures().allowFPContractWithinStatement();
180+
}
172181
};
173182

174183
/// Represents a call to a member function that

clang/include/clang/AST/Stmt.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,9 @@ class alignas(void *) Stmt {
614614
/// The kind of this overloaded operator. One of the enumerator
615615
/// value of OverloadedOperatorKind.
616616
unsigned OperatorKind : 6;
617+
618+
// Only meaningful for floating point types.
619+
unsigned FPFeatures : 14;
617620
};
618621

619622
class CXXRewrittenBinaryOperatorBitfields {

clang/include/clang/Basic/FPOptions.def

Lines changed: 0 additions & 26 deletions
This file was deleted.

clang/include/clang/Basic/LangOptions.def

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,12 @@ COMPATIBLE_LANGOPT(Deprecated , 1, 0, "__DEPRECATED predefined macro")
193193
COMPATIBLE_LANGOPT(FastMath , 1, 0, "fast FP math optimizations, and __FAST_MATH__ predefined macro")
194194
COMPATIBLE_LANGOPT(FiniteMathOnly , 1, 0, "__FINITE_MATH_ONLY__ predefined macro")
195195
COMPATIBLE_LANGOPT(UnsafeFPMath , 1, 0, "Unsafe Floating Point Math")
196-
BENIGN_LANGOPT(AllowFPReassoc , 1, 0, "Permit Floating Point reassociation")
197-
BENIGN_LANGOPT(NoHonorNaNs , 1, 0, "Permit Floating Point optimization without regard to NaN")
198-
BENIGN_LANGOPT(NoHonorInfs , 1, 0, "Permit Floating Point optimization without regard to infinities")
199-
BENIGN_LANGOPT(NoSignedZero , 1, 0, "Permit Floating Point optimization without regard to signed zeros")
200-
BENIGN_LANGOPT(AllowRecip , 1, 0, "Permit Floating Point reciprocal")
201-
BENIGN_LANGOPT(ApproxFunc , 1, 0, "Permit Floating Point approximation")
196+
COMPATIBLE_LANGOPT(AllowFPReassoc , 1, 0, "Permit Floating Point reassociation")
197+
COMPATIBLE_LANGOPT(NoHonorNaNs , 1, 0, "Permit Floating Point optimization without regard to NaN")
198+
COMPATIBLE_LANGOPT(NoHonorInfs , 1, 0, "Permit Floating Point optimization without regard to infinities")
199+
COMPATIBLE_LANGOPT(NoSignedZero , 1, 0, "Permit Floating Point optimization without regard to signed zeros")
200+
COMPATIBLE_LANGOPT(AllowRecip , 1, 0, "Permit Floating Point reciprocal")
201+
COMPATIBLE_LANGOPT(ApproxFunc , 1, 0, "Permit Floating Point approximation")
202202

203203
BENIGN_LANGOPT(ObjCGCBitmapPrint , 1, 0, "printing of GC's bitmap layout for __weak/__strong ivars")
204204

@@ -277,9 +277,9 @@ BENIGN_LANGOPT(SpellChecking , 1, 1, "spell-checking")
277277
LANGOPT(SinglePrecisionConstants , 1, 0, "treating double-precision floating point constants as single precision constants")
278278
LANGOPT(FastRelaxedMath , 1, 0, "OpenCL fast relaxed math")
279279
/// FP_CONTRACT mode (on/off/fast).
280-
BENIGN_ENUM_LANGOPT(DefaultFPContractMode, FPModeKind, 2, FPM_Off, "FP contraction type")
281-
BENIGN_ENUM_LANGOPT(FPRoundingMode, RoundingMode, 3, RoundingMode::NearestTiesToEven, "FP Rounding Mode type")
282-
BENIGN_ENUM_LANGOPT(FPExceptionMode, FPExceptionModeKind, 2, FPE_Ignore, "FP Exception Behavior Mode type")
280+
ENUM_LANGOPT(DefaultFPContractMode, FPModeKind, 2, FPM_Off, "FP contraction type")
281+
ENUM_LANGOPT(FPRoundingMode, RoundingMode, 3, RoundingMode::NearestTiesToEven, "FP Rounding Mode type")
282+
ENUM_LANGOPT(FPExceptionMode, FPExceptionModeKind, 2, FPE_Ignore, "FP Exception Behavior Mode type")
283283
LANGOPT(NoBitFieldTypeAlign , 1, 0, "bit-field type alignment")
284284
LANGOPT(HexagonQdsp6Compat , 1, 0, "hexagon-qdsp6 backward compatibility")
285285
LANGOPT(ObjCAutoRefCount , 1, 0, "Objective-C automated reference counting")

0 commit comments

Comments
 (0)