Skip to content

Commit 43f9de3

Browse files
committed
merge main into amd-staging
2 parents 53a7009 + e6529dc commit 43f9de3

File tree

197 files changed

+4252
-784
lines changed

Some content is hidden

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

197 files changed

+4252
-784
lines changed

.github/new-prs-labeler.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,12 @@ flang:fir-hlfir:
554554
flang:codegen:
555555
- flang/**/CodeGen/**
556556

557+
llvm:codegen:
558+
- llvm/lib/CodeGen/*
559+
- llvm/lib/CodeGen/MIRParser/*
560+
- llvm/lib/CodeGen/LiveDebugValues/*
561+
- llvm/lib/CodeGen/AsmPrinter/*
562+
557563
llvm:globalisel:
558564
- llvm/**/GlobalISel/**
559565
- llvm/utils/TableGen/GlobalISel*

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,15 @@ Bug Fixes to Compiler Builtins
719719
are ``__builtin_is_cpp_trivially_relocatable``. It is recommended to use
720720
``__builtin_trivially_relocate`` instead.
721721

722+
- ``__reference_binds_to_temporary``, ``__reference_constructs_from_temporary``
723+
and ``__reference_converts_from_temporary`` intrinsics no longer consider
724+
function references can bind to temporary objects. (#GH114344)
725+
726+
- ``__reference_constructs_from_temporary`` and
727+
``__reference_converts_from_temporary`` intrinsics detect reference binding
728+
to prvalue instead of xvalue now if the second operand is an object type, per
729+
`LWG3819 <https://cplusplus.github.io/LWG/issue3819>`_.
730+
722731
Bug Fixes to Attribute Support
723732
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
724733
- Fixed crash when a parameter to the ``clang::annotate`` attribute evaluates to ``void``. See #GH119125

clang/include/clang/Basic/BuiltinsBase.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- BuiltinsBase.td - common structured used by builtins ---*- C++ -*-===//
1+
//===--- BuiltinsBase.td - common structured used by builtins -------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,24 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
300300
return createBinop(loc, lhs, cir::BinOpKind::Or, rhs);
301301
}
302302

303+
mlir::Value createSelect(mlir::Location loc, mlir::Value condition,
304+
mlir::Value trueValue, mlir::Value falseValue) {
305+
assert(trueValue.getType() == falseValue.getType() &&
306+
"trueValue and falseValue should have the same type");
307+
return create<cir::SelectOp>(loc, trueValue.getType(), condition, trueValue,
308+
falseValue);
309+
}
310+
311+
mlir::Value createLogicalAnd(mlir::Location loc, mlir::Value lhs,
312+
mlir::Value rhs) {
313+
return createSelect(loc, lhs, rhs, getBool(false, loc));
314+
}
315+
316+
mlir::Value createLogicalOr(mlir::Location loc, mlir::Value lhs,
317+
mlir::Value rhs) {
318+
return createSelect(loc, lhs, getBool(true, loc), rhs);
319+
}
320+
303321
mlir::Value createMul(mlir::Location loc, mlir::Value lhs, mlir::Value rhs,
304322
OverflowBehavior ob = OverflowBehavior::None) {
305323
auto op =

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ struct MissingFeatures {
208208
static bool deferredDecls() { return false; }
209209
static bool setTargetAttributes() { return false; }
210210
static bool coverageMapping() { return false; }
211+
static bool peepholeProtection() { return false; }
212+
static bool instrumentation() { return false; }
211213

212214
// Missing types
213215
static bool dataMemberType() { return false; }
@@ -232,8 +234,9 @@ struct MissingFeatures {
232234
static bool ptrDiffOp() { return false; }
233235
static bool ptrStrideOp() { return false; }
234236
static bool switchOp() { return false; }
235-
static bool ternaryOp() { return false; }
237+
static bool throwOp() { return false; }
236238
static bool tryOp() { return false; }
239+
static bool vecTernaryOp() { return false; }
237240
static bool zextOp() { return false; }
238241

239242
// Future CIR attributes

clang/include/clang/Lex/Preprocessor.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ enum class EmbedResult {
129129
Empty = 2, // Corresponds to __STDC_EMBED_EMPTY__
130130
};
131131

132+
struct CXXStandardLibraryVersionInfo {
133+
enum Library { Unknown, LibStdCXX };
134+
Library Lib;
135+
std::uint64_t Version;
136+
};
137+
132138
/// Engages in a tight little dance with the lexer to efficiently
133139
/// preprocess tokens.
134140
///
@@ -2706,6 +2712,15 @@ class Preprocessor {
27062712
return IsFileLexer(CurLexer.get(), CurPPLexer);
27072713
}
27082714

2715+
//===--------------------------------------------------------------------===//
2716+
// Standard Library Identification
2717+
std::optional<CXXStandardLibraryVersionInfo> CXXStandardLibraryVersion;
2718+
2719+
public:
2720+
std::optional<std::uint64_t> getStdLibCxxVersion();
2721+
bool NeedsStdLibCxxWorkaroundBefore(std::uint64_t FixedVersion);
2722+
2723+
private:
27092724
//===--------------------------------------------------------------------===//
27102725
// Caching stuff.
27112726
void CachingLex(Token &Result);

clang/include/clang/Parse/Parser.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7074,6 +7074,10 @@ class Parser : public CodeCompletionHandler {
70747074
bool HandlePragmaMSOptimize(StringRef PragmaName,
70757075
SourceLocation PragmaLocation);
70767076

7077+
// #pragma intrinsic("foo")
7078+
bool HandlePragmaMSIntrinsic(StringRef PragmaName,
7079+
SourceLocation PragmaLocation);
7080+
70777081
/// Handle the annotation token produced for
70787082
/// #pragma align...
70797083
void HandlePragmaAlign();

clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ class CheckerContext {
5151
wasInlined(wasInlined) {
5252
assert(Pred->getState() &&
5353
"We should not call the checkers on an empty state.");
54+
assert(loc.getTag() && "The ProgramPoint associated with CheckerContext "
55+
"must be tagged with the active checker.");
5456
}
5557

5658
AnalysisManager &getAnalysisManager() {

clang/lib/AST/ByteCode/Boolean.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,10 @@ class Boolean final {
3030
public:
3131
/// Zero-initializes a boolean.
3232
Boolean() : V(false) {}
33-
Boolean(const llvm::APSInt &I) : V(!I.isZero()) {}
3433
explicit Boolean(bool V) : V(V) {}
3534

3635
bool operator<(Boolean RHS) const { return V < RHS.V; }
3736
bool operator>(Boolean RHS) const { return V > RHS.V; }
38-
bool operator<=(Boolean RHS) const { return V <= RHS.V; }
39-
bool operator>=(Boolean RHS) const { return V >= RHS.V; }
40-
bool operator==(Boolean RHS) const { return V == RHS.V; }
41-
bool operator!=(Boolean RHS) const { return V != RHS.V; }
42-
4337
bool operator>(unsigned RHS) const { return static_cast<unsigned>(V) > RHS; }
4438

4539
Boolean operator-() const { return Boolean(V); }

clang/lib/AST/ByteCode/Floating.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ class Floating final {
8787

8888
bool isSigned() const { return true; }
8989
bool isNegative() const { return F.isNegative(); }
90-
bool isPositive() const { return !F.isNegative(); }
9190
bool isZero() const { return F.isZero(); }
9291
bool isNonZero() const { return F.isNonZero(); }
9392
bool isMin() const { return F.isSmallest(); }

0 commit comments

Comments
 (0)