Skip to content

Commit 9a3a74a

Browse files
authored
Merge pull request #557 from Xilinx/bump_to_8388040f
[AutoBump] Merge with fixes of 8388040 (Jan 23) (19)
2 parents d21dbbb + 19ec244 commit 9a3a74a

File tree

1,218 files changed

+57879
-45481
lines changed

Some content is hidden

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

1,218 files changed

+57879
-45481
lines changed

.github/workflows/libc-fullbuild-tests.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@ on:
1111

1212
jobs:
1313
build:
14-
runs-on: ubuntu-24.04
14+
runs-on: ${{ matrix.os }}
1515
strategy:
1616
fail-fast: false
1717
matrix:
1818
include:
19-
- c_compiler: clang
19+
- os: ubuntu-24.04
20+
ccache-variant: sccache
21+
c_compiler: clang
22+
cpp_compiler: clang++
23+
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
24+
- os: ubuntu-24.04-arm
25+
ccache-variant: ccache
26+
c_compiler: clang
2027
cpp_compiler: clang++
2128
# TODO: add back gcc build when it is fixed
2229
# - c_compiler: gcc
@@ -35,7 +42,7 @@ jobs:
3542
with:
3643
max-size: 1G
3744
key: libc_fullbuild_${{ matrix.c_compiler }}
38-
variant: sccache
45+
variant: ${{ matrix.ccache-variant }}
3946

4047
# Notice:
4148
# - MPFR is required by some of the mathlib tests.
@@ -62,8 +69,8 @@ jobs:
6269
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
6370
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
6471
-DCMAKE_BUILD_TYPE=MinSizeRel
65-
-DCMAKE_C_COMPILER_LAUNCHER=sccache
66-
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
72+
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
73+
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
6774
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }}
6875
-DLLVM_ENABLE_RUNTIMES="libc;compiler-rt"
6976
-DLLVM_LIBC_FULL_BUILD=ON

.github/workflows/libc-overlay-tests.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,28 @@ jobs:
1919
include:
2020
# TODO: add linux gcc when it is fixed
2121
- os: ubuntu-24.04
22+
ccache-variant: sccache
23+
compiler:
24+
c_compiler: clang
25+
cpp_compiler: clang++
26+
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
27+
- os: ubuntu-24.04-arm
28+
ccache-variant: ccache
2229
compiler:
2330
c_compiler: clang
2431
cpp_compiler: clang++
2532
- os: windows-2022
33+
ccache-variant: sccache
34+
compiler:
35+
c_compiler: clang-cl
36+
cpp_compiler: clang-cl
37+
- os: windows-2025
38+
ccache-variant: sccache
2639
compiler:
2740
c_compiler: clang-cl
2841
cpp_compiler: clang-cl
2942
- os: macos-14
43+
ccache-variant: sccache
3044
compiler:
3145
c_compiler: clang
3246
cpp_compiler: clang++
@@ -46,7 +60,7 @@ jobs:
4660
with:
4761
max-size: 1G
4862
key: libc_overlay_build_${{ matrix.os }}_${{ matrix.compiler.c_compiler }}
49-
variant: sccache
63+
variant: ${{ matrix.ccache-variant }}
5064

5165
# MPFR is required by some of the mathlib tests.
5266
- name: Prepare dependencies (Ubuntu)
@@ -82,8 +96,8 @@ jobs:
8296
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }}
8397
-DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }}
8498
-DCMAKE_BUILD_TYPE=MinSizeRel
85-
-DCMAKE_C_COMPILER_LAUNCHER=sccache
86-
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
99+
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
100+
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
87101
-DCMAKE_POLICY_DEFAULT_CMP0141=NEW
88102
-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded
89103
-DLLVM_ENABLE_RUNTIMES=libc

clang-tools-extra/clang-tidy/ClangTidyProfiling.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,25 @@ ClangTidyProfiling::StorageParams::StorageParams(llvm::StringRef ProfilePrefix,
3636
.str();
3737
}
3838

39-
void ClangTidyProfiling::printUserFriendlyTable(llvm::raw_ostream &OS) {
40-
TG->print(OS);
39+
void ClangTidyProfiling::printUserFriendlyTable(llvm::raw_ostream &OS,
40+
llvm::TimerGroup &TG) {
41+
TG.print(OS);
4142
OS.flush();
4243
}
4344

44-
void ClangTidyProfiling::printAsJSON(llvm::raw_ostream &OS) {
45+
void ClangTidyProfiling::printAsJSON(llvm::raw_ostream &OS,
46+
llvm::TimerGroup &TG) {
4547
OS << "{\n";
4648
OS << R"("file": ")" << Storage->SourceFilename << "\",\n";
4749
OS << R"("timestamp": ")" << Storage->Timestamp << "\",\n";
4850
OS << "\"profile\": {\n";
49-
TG->printJSONValues(OS, "");
51+
TG.printJSONValues(OS, "");
5052
OS << "\n}\n";
5153
OS << "}\n";
5254
OS.flush();
5355
}
5456

55-
void ClangTidyProfiling::storeProfileData() {
57+
void ClangTidyProfiling::storeProfileData(llvm::TimerGroup &TG) {
5658
assert(Storage && "We should have a filename.");
5759

5860
llvm::SmallString<256> OutputDirectory(Storage->StoreFilename);
@@ -71,19 +73,18 @@ void ClangTidyProfiling::storeProfileData() {
7173
return;
7274
}
7375

74-
printAsJSON(OS);
76+
printAsJSON(OS, TG);
7577
}
7678

7779
ClangTidyProfiling::ClangTidyProfiling(std::optional<StorageParams> Storage)
7880
: Storage(std::move(Storage)) {}
7981

8082
ClangTidyProfiling::~ClangTidyProfiling() {
81-
TG.emplace("clang-tidy", "clang-tidy checks profiling", Records);
82-
83+
llvm::TimerGroup TG{"clang-tidy", "clang-tidy checks profiling", Records};
8384
if (!Storage)
84-
printUserFriendlyTable(llvm::errs());
85+
printUserFriendlyTable(llvm::errs(), TG);
8586
else
86-
storeProfileData();
87+
storeProfileData(TG);
8788
}
8889

8990
} // namespace clang::tidy

clang-tools-extra/clang-tidy/ClangTidyProfiling.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,11 @@ class ClangTidyProfiling {
3434
};
3535

3636
private:
37-
std::optional<llvm::TimerGroup> TG;
38-
3937
std::optional<StorageParams> Storage;
4038

41-
void printUserFriendlyTable(llvm::raw_ostream &OS);
42-
void printAsJSON(llvm::raw_ostream &OS);
43-
44-
void storeProfileData();
39+
void printUserFriendlyTable(llvm::raw_ostream &OS, llvm::TimerGroup &TG);
40+
void printAsJSON(llvm::raw_ostream &OS, llvm::TimerGroup &TG);
41+
void storeProfileData(llvm::TimerGroup &TG);
4542

4643
public:
4744
llvm::StringMap<llvm::TimeRecord> Records;

clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ UnusedUsingDeclsCheck::UnusedUsingDeclsCheck(StringRef Name,
5151
HeaderFileExtensions(Context->getHeaderFileExtensions()) {}
5252

5353
void UnusedUsingDeclsCheck::registerMatchers(MatchFinder *Finder) {
54+
// We don't emit warnings on unused-using-decls from headers, so bail out if
55+
// the main file is a header.
56+
if (utils::isFileExtension(getCurrentMainFile(), HeaderFileExtensions))
57+
return;
5458
Finder->addMatcher(usingDecl(isExpansionInMainFile()).bind("using"), this);
5559
auto DeclMatcher = hasDeclaration(namedDecl().bind("used"));
5660
Finder->addMatcher(loc(templateSpecializationType(DeclMatcher)), this);
@@ -83,12 +87,6 @@ void UnusedUsingDeclsCheck::registerMatchers(MatchFinder *Finder) {
8387
void UnusedUsingDeclsCheck::check(const MatchFinder::MatchResult &Result) {
8488
if (Result.Context->getDiagnostics().hasUncompilableErrorOccurred())
8589
return;
86-
// We don't emit warnings on unused-using-decls from headers, so bail out if
87-
// the main file is a header.
88-
if (auto MainFile = Result.SourceManager->getFileEntryRefForID(
89-
Result.SourceManager->getMainFileID());
90-
utils::isFileExtension(MainFile->getName(), HeaderFileExtensions))
91-
return;
9290

9391
if (const auto *Using = Result.Nodes.getNodeAs<UsingDecl>("using")) {
9492
// Ignores using-declarations defined in macros.

clang-tools-extra/modularize/CoverageChecker.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,15 @@ CoverageChecker::collectUmbrellaHeaderHeaders(StringRef UmbrellaHeaderName) {
278278
sys::fs::current_path(PathBuf);
279279

280280
// Create the compilation database.
281-
std::unique_ptr<CompilationDatabase> Compilations;
282-
Compilations.reset(new FixedCompilationDatabase(Twine(PathBuf), CommandLine));
281+
FixedCompilationDatabase Compilations(Twine(PathBuf), CommandLine);
283282

284283
std::vector<std::string> HeaderPath;
285284
HeaderPath.push_back(std::string(UmbrellaHeaderName));
286285

287286
// Create the tool and run the compilation.
288-
ClangTool Tool(*Compilations, HeaderPath);
289-
int HadErrors = Tool.run(new CoverageCheckerFrontendActionFactory(*this));
287+
ClangTool Tool(Compilations, HeaderPath);
288+
CoverageCheckerFrontendActionFactory ActionFactory(*this);
289+
int HadErrors = Tool.run(&ActionFactory);
290290

291291
// If we had errors, exit early.
292292
return !HadErrors;

clang/docs/ReleaseNotes.rst

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,6 @@ C++ Language Changes
294294
C++2c Feature Support
295295
^^^^^^^^^^^^^^^^^^^^^
296296

297-
- Add ``__builtin_is_implicit_lifetime`` intrinsic, which supports
298-
`P2647R1 A trait for implicit lifetime types <https://wg21.link/p2674r1>`_
299-
300297
- Add ``__builtin_is_virtual_base_of`` intrinsic, which supports
301298
`P2985R0 A type trait for detecting virtual base classes <https://wg21.link/p2985r0>`_
302299

@@ -318,13 +315,20 @@ C++23 Feature Support
318315

319316
- ``__cpp_explicit_this_parameter`` is now defined. (#GH82780)
320317

318+
- Add ``__builtin_is_implicit_lifetime`` intrinsic, which supports
319+
`P2674R1 A trait for implicit lifetime types <https://wg21.link/p2674r1>`_
320+
321321
- Add support for `P2280R4 Using unknown pointers and references in constant expressions <https://wg21.link/P2280R4>`_. (#GH63139)
322322

323323
C++20 Feature Support
324324
^^^^^^^^^^^^^^^^^^^^^
325325

326326
- Implemented module level lookup for C++20 modules. (#GH90154)
327327

328+
C++17 Feature Support
329+
^^^^^^^^^^^^^^^^^^^^^
330+
- The implementation of the relaxed template template argument matching rules is
331+
more complete and reliable, and should provide more accurate diagnostics.
328332

329333
Resolutions to C++ Defect Reports
330334
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -351,7 +355,8 @@ Resolutions to C++ Defect Reports
351355
(`CWG2351: void{} <https://cplusplus.github.io/CWG/issues/2351.html>`_).
352356

353357
- Clang now has improved resolution to CWG2398, allowing class templates to have
354-
default arguments deduced when partial ordering.
358+
default arguments deduced when partial ordering, and better backwards compatibility
359+
in overload resolution.
355360

356361
- Clang now allows comparing unequal object pointers that have been cast to ``void *``
357362
in constant expressions. These comparisons always worked in non-constant expressions.
@@ -636,6 +641,10 @@ Improvements to Clang's diagnostics
636641

637642
- Clang now diagnoses when the result of a [[nodiscard]] function is discarded after being cast in C. Fixes #GH104391.
638643

644+
- Clang now properly explains the reason a template template argument failed to
645+
match a template template parameter, in terms of the C++17 relaxed matching rules
646+
instead of the old ones.
647+
639648
- Don't emit duplicated dangling diagnostics. (#GH93386).
640649

641650
- Improved diagnostic when trying to befriend a concept. (#GH45182).
@@ -807,6 +816,8 @@ Improvements to Clang's diagnostics
807816

808817
- Clang now emits a ``-Wignored-qualifiers`` diagnostic when a base class includes cv-qualifiers (#GH55474).
809818

819+
- Clang now diagnoses the use of attribute names reserved by the C++ standard (#GH92196).
820+
810821
Improvements to Clang's time-trace
811822
----------------------------------
812823

@@ -885,6 +896,8 @@ Bug Fixes to C++ Support
885896
- Correctly check constraints of explicit instantiations of member functions. (#GH46029)
886897
- When performing partial ordering of function templates, clang now checks that
887898
the deduction was consistent. Fixes (#GH18291).
899+
- Fixes to several issues in partial ordering of template template parameters, which
900+
were documented in the test suite.
888901
- Fixed an assertion failure about a constraint of a friend function template references to a value with greater
889902
template depth than the friend function template. (#GH98258)
890903
- Clang now rebuilds the template parameters of out-of-line declarations and specializations in the context
@@ -975,6 +988,8 @@ Bug Fixes to C++ Support
975988
- Fixed a nested lambda substitution issue for constraint evaluation. (#GH123441)
976989
- Fixed various false diagnostics related to the use of immediate functions. (#GH123472)
977990
- Fix immediate escalation not propagating through inherited constructors. (#GH112677)
991+
- Fixed assertions or false compiler diagnostics in the case of C++ modules for
992+
lambda functions or inline friend functions defined inside templates (#GH122493).
978993

979994
Bug Fixes to AST Handling
980995
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/AttributeCommonInfo.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,18 @@ class AttributeCommonInfo {
6161
};
6262
enum Kind {
6363
#define PARSED_ATTR(NAME) AT_##NAME,
64-
#include "clang/Sema/AttrParsedAttrList.inc"
64+
#include "clang/Basic/AttrParsedAttrList.inc"
6565
#undef PARSED_ATTR
6666
NoSemaHandlerAttribute,
6767
IgnoredAttribute,
6868
UnknownAttribute,
6969
};
7070
enum class Scope { NONE, CLANG, GNU, MSVC, OMP, HLSL, GSL, RISCV };
71+
enum class AttrArgsInfo {
72+
None,
73+
Optional,
74+
Required,
75+
};
7176

7277
private:
7378
const IdentifierInfo *AttrName = nullptr;
@@ -241,6 +246,8 @@ class AttributeCommonInfo {
241246
static Kind getParsedKind(const IdentifierInfo *Name,
242247
const IdentifierInfo *Scope, Syntax SyntaxUsed);
243248

249+
static AttrArgsInfo getCXX11AttrArgsInfo(const IdentifierInfo *Name);
250+
244251
private:
245252
/// Get an index into the attribute spelling list
246253
/// defined in Attr.td. This index is used by an attribute

clang/include/clang/Basic/Attributes.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ int hasAttribute(AttributeCommonInfo::Syntax Syntax,
2323
const IdentifierInfo *Scope, const IdentifierInfo *Attr,
2424
const TargetInfo &Target, const LangOptions &LangOpts);
2525

26+
int hasAttribute(AttributeCommonInfo::Syntax Syntax,
27+
const IdentifierInfo *Scope, const IdentifierInfo *Attr,
28+
const TargetInfo &Target, const LangOptions &LangOpts,
29+
bool CheckPlugins);
30+
2631
} // end namespace clang
2732

2833
#endif // LLVM_CLANG_BASIC_ATTRIBUTES_H

0 commit comments

Comments
 (0)