diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml index a061be3892523..a28bf4d5daf6d 100644 --- a/.github/workflows/libcxx-build-and-test.yaml +++ b/.github/workflows/libcxx-build-and-test.yaml @@ -43,6 +43,7 @@ jobs: fail-fast: false matrix: config: [ + 'frozen-cxx03-headers', 'generic-cxx03', 'generic-cxx26', 'generic-modules' diff --git a/bolt/docs/CommandLineArgumentReference.md b/bolt/docs/CommandLineArgumentReference.md index 91918d614a90f..f3881c9a640a9 100644 --- a/bolt/docs/CommandLineArgumentReference.md +++ b/bolt/docs/CommandLineArgumentReference.md @@ -931,15 +931,6 @@ Remove redundant Address-Size override prefix -### BOLT options in relocation mode: - -- `--align-macro-fusion=` - - Fix instruction alignment for macro-fusion (x86 relocation mode) - - `none`: do not insert alignment no-ops for macro-fusion - - `hot`: only insert alignment no-ops on hot execution paths (default) - - `all`: always align instructions to allow macro-fusion - ### BOLT instrumentation options: `llvm-bolt -instrument [-o outputfile] ` diff --git a/bolt/include/bolt/Core/BinaryData.h b/bolt/include/bolt/Core/BinaryData.h index 6a773c4cb7067..4ab628030ff0d 100644 --- a/bolt/include/bolt/Core/BinaryData.h +++ b/bolt/include/bolt/Core/BinaryData.h @@ -169,6 +169,11 @@ class BinaryData { return Parent && (Parent == BD || Parent->isAncestorOf(BD)); } + void updateSize(uint64_t N) { + if (N > Size) + Size = N; + } + void setIsMoveable(bool Flag) { IsMoveable = Flag; } void setSection(BinarySection &NewSection); void setOutputSection(BinarySection &NewSection) { diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp index f88e34b8e8962..f5e11358daaa3 100644 --- a/bolt/lib/Core/BinaryContext.cpp +++ b/bolt/lib/Core/BinaryContext.cpp @@ -1076,6 +1076,7 @@ MCSymbol *BinaryContext::registerNameAtAddress(StringRef Name, uint64_t Address, BD = GAI->second; if (!BD->hasName(Name)) { GlobalSymbols[Name] = BD; + BD->updateSize(Size); BD->Symbols.push_back(Symbol); } } diff --git a/bolt/lib/Rewrite/LinuxKernelRewriter.cpp b/bolt/lib/Rewrite/LinuxKernelRewriter.cpp index 0532468c237e0..5a5e044184d0b 100644 --- a/bolt/lib/Rewrite/LinuxKernelRewriter.cpp +++ b/bolt/lib/Rewrite/LinuxKernelRewriter.cpp @@ -21,6 +21,8 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Errc.h" +#include "llvm/Support/ErrorOr.h" +#include #define DEBUG_TYPE "bolt-linux" @@ -89,6 +91,34 @@ static cl::opt } // namespace opts +/// Linux kernel version +struct LKVersion { + LKVersion() {} + LKVersion(unsigned Major, unsigned Minor, unsigned Rev) + : Major(Major), Minor(Minor), Rev(Rev) {} + + bool operator<(const LKVersion &Other) const { + return std::make_tuple(Major, Minor, Rev) < + std::make_tuple(Other.Major, Other.Minor, Other.Rev); + } + + bool operator>(const LKVersion &Other) const { return Other < *this; } + + bool operator<=(const LKVersion &Other) const { return !(*this > Other); } + + bool operator>=(const LKVersion &Other) const { return !(*this < Other); } + + bool operator==(const LKVersion &Other) const { + return Major == Other.Major && Minor == Other.Minor && Rev == Other.Rev; + } + + bool operator!=(const LKVersion &Other) const { return !(*this == Other); } + + unsigned Major{0}; + unsigned Minor{0}; + unsigned Rev{0}; +}; + /// Linux Kernel supports stack unwinding using ORC (oops rewind capability). /// ORC state at every IP can be described by the following data structure. struct ORCState { @@ -148,6 +178,8 @@ class AddressExtractor : public DataExtractor { }; class LinuxKernelRewriter final : public MetadataRewriter { + LKVersion LinuxKernelVersion; + /// Information required for updating metadata referencing an instruction. struct InstructionFixup { BinarySection &Section; // Section referencing the instruction. @@ -249,6 +281,8 @@ class LinuxKernelRewriter final : public MetadataRewriter { ErrorOr PCIFixupSection = std::errc::bad_address; static constexpr size_t PCI_FIXUP_ENTRY_SIZE = 16; + Error detectLinuxKernelVersion(); + /// Process linux kernel special sections and their relocations. void processLKSections(); @@ -314,6 +348,9 @@ class LinuxKernelRewriter final : public MetadataRewriter { : MetadataRewriter("linux-kernel-rewriter", BC) {} Error preCFGInitializer() override { + if (Error E = detectLinuxKernelVersion()) + return E; + processLKSections(); if (Error E = processSMPLocks()) @@ -394,6 +431,28 @@ class LinuxKernelRewriter final : public MetadataRewriter { } }; +Error LinuxKernelRewriter::detectLinuxKernelVersion() { + if (BinaryData *BD = BC.getBinaryDataByName("linux_banner")) { + const BinarySection &Section = BD->getSection(); + const std::string S = + Section.getContents().substr(BD->getOffset(), BD->getSize()).str(); + + const std::regex Re(R"---(Linux version ((\d+)\.(\d+)(\.(\d+))?))---"); + std::smatch Match; + if (std::regex_search(S, Match, Re)) { + const unsigned Major = std::stoi(Match[2].str()); + const unsigned Minor = std::stoi(Match[3].str()); + const unsigned Rev = Match[5].matched ? std::stoi(Match[5].str()) : 0; + LinuxKernelVersion = LKVersion(Major, Minor, Rev); + BC.outs() << "BOLT-INFO: Linux kernel version is " << Match[1].str() + << "\n"; + return Error::success(); + } + } + return createStringError(errc::executable_format_error, + "Linux kernel version is unknown"); +} + void LinuxKernelRewriter::processLKSections() { processLKKSymtab(); processLKKSymtab(true); diff --git a/bolt/test/X86/linux-alt-instruction.s b/bolt/test/X86/linux-alt-instruction.s index fe3abbfc2b4c9..83d2cd0634d08 100644 --- a/bolt/test/X86/linux-alt-instruction.s +++ b/bolt/test/X86/linux-alt-instruction.s @@ -142,6 +142,15 @@ _start: .section .orc_unwind_ip .long .L0 + 2 - . +## Linux kernel version + .rodata + .align 16 + .globl linux_banner + .type linux_banner, @object +linux_banner: + .string "Linux version 6.6.61\n" + .size linux_banner, . - linux_banner + ## Fake Linux Kernel sections. .section __ksymtab,"a",@progbits .section __ksymtab_gpl,"a",@progbits diff --git a/bolt/test/X86/linux-bug-table.s b/bolt/test/X86/linux-bug-table.s index 07a4729ade737..2965daab2b265 100644 --- a/bolt/test/X86/linux-bug-table.s +++ b/bolt/test/X86/linux-bug-table.s @@ -56,6 +56,15 @@ _start: .long .L1 - . # instruction .org 2b + 12 +## Linux kernel version + .rodata + .align 16 + .globl linux_banner + .type linux_banner, @object +linux_banner: + .string "Linux version 6.6.61\n" + .size linux_banner, . - linux_banner + ## Fake Linux Kernel sections. .section __ksymtab,"a",@progbits .section __ksymtab_gpl,"a",@progbits diff --git a/bolt/test/X86/linux-exceptions.s b/bolt/test/X86/linux-exceptions.s index 20b8c965f853a..b0e7641af1cd9 100644 --- a/bolt/test/X86/linux-exceptions.s +++ b/bolt/test/X86/linux-exceptions.s @@ -59,6 +59,15 @@ foo: .long .LF0 - . # fixup .long 0 # data +## Linux kernel version + .rodata + .align 16 + .globl linux_banner + .type linux_banner, @object +linux_banner: + .string "Linux version 6.6.61\n" + .size linux_banner, . - linux_banner + ## Fake Linux Kernel sections. .section __ksymtab,"a",@progbits .section __ksymtab_gpl,"a",@progbits diff --git a/bolt/test/X86/linux-orc.s b/bolt/test/X86/linux-orc.s index 1b0e681b1dbf9..133b0df690e62 100644 --- a/bolt/test/X86/linux-orc.s +++ b/bolt/test/X86/linux-orc.s @@ -157,6 +157,15 @@ bar: .section .orc_unwind_ip .long .L4 - . +## Linux kernel version + .rodata + .align 16 + .globl linux_banner + .type linux_banner, @object +linux_banner: + .string "Linux version 6.6.61\n" + .size linux_banner, . - linux_banner + ## Fake Linux Kernel sections. .section __ksymtab,"a",@progbits .section __ksymtab_gpl,"a",@progbits diff --git a/bolt/test/X86/linux-parainstructions.s b/bolt/test/X86/linux-parainstructions.s index 07fca6bbedafa..facfcb168b166 100644 --- a/bolt/test/X86/linux-parainstructions.s +++ b/bolt/test/X86/linux-parainstructions.s @@ -49,6 +49,15 @@ _start: .byte 1 # type .byte 7 # length +## Linux kernel version + .rodata + .align 16 + .globl linux_banner + .type linux_banner, @object +linux_banner: + .string "Linux version 6.6.61\n" + .size linux_banner, . - linux_banner + ## Fake Linux Kernel sections. .section __ksymtab,"a",@progbits .section __ksymtab_gpl,"a",@progbits diff --git a/bolt/test/X86/linux-pci-fixup.s b/bolt/test/X86/linux-pci-fixup.s index 42504c108d339..d8df91a4e9bcd 100644 --- a/bolt/test/X86/linux-pci-fixup.s +++ b/bolt/test/X86/linux-pci-fixup.s @@ -36,6 +36,15 @@ _start: .long 0x0 # class shift .long .L0 - . # fixup +## Linux kernel version + .rodata + .align 16 + .globl linux_banner + .type linux_banner, @object +linux_banner: + .string "Linux version 6.6.61\n" + .size linux_banner, . - linux_banner + ## Fake Linux Kernel sections. .section __ksymtab,"a",@progbits .section __ksymtab_gpl,"a",@progbits diff --git a/bolt/test/X86/linux-smp-locks.s b/bolt/test/X86/linux-smp-locks.s index 50d9e632b1172..2fc136fd78cda 100644 --- a/bolt/test/X86/linux-smp-locks.s +++ b/bolt/test/X86/linux-smp-locks.s @@ -35,6 +35,15 @@ _start: .long .L0 - . .long .L1 - . +## Linux kernel version + .rodata + .align 16 + .globl linux_banner + .type linux_banner, @object +linux_banner: + .string "Linux version 6.6.61\n" + .size linux_banner, . - linux_banner + ## Fake Linux Kernel sections. .section __ksymtab,"a",@progbits .section __ksymtab_gpl,"a",@progbits diff --git a/bolt/test/X86/linux-static-calls.s b/bolt/test/X86/linux-static-calls.s index ce90f4bb79c09..758e1395d8846 100644 --- a/bolt/test/X86/linux-static-calls.s +++ b/bolt/test/X86/linux-static-calls.s @@ -54,6 +54,15 @@ __start_static_call_sites: .type __stop_static_call_sites, %object __stop_static_call_sites: +## Linux kernel version + .rodata + .align 16 + .globl linux_banner + .type linux_banner, @object +linux_banner: + .string "Linux version 6.6.61\n" + .size linux_banner, . - linux_banner + ## Fake Linux Kernel sections. .section __ksymtab,"a",@progbits .section __ksymtab_gpl,"a",@progbits diff --git a/bolt/test/X86/linux-static-keys.s b/bolt/test/X86/linux-static-keys.s index d34dd640ef879..2e4457e4df9fb 100644 --- a/bolt/test/X86/linux-static-keys.s +++ b/bolt/test/X86/linux-static-keys.s @@ -85,6 +85,15 @@ __stop___jump_table: fake_static_key: .quad 0 +## Linux kernel version + .rodata + .align 16 + .globl linux_banner + .type linux_banner, @object +linux_banner: + .string "Linux version 6.6.61\n" + .size linux_banner, . - linux_banner + ## Fake Linux Kernel sections. .section __ksymtab,"a",@progbits .section __ksymtab_gpl,"a",@progbits diff --git a/bolt/test/X86/linux-version.S b/bolt/test/X86/linux-version.S new file mode 100644 index 0000000000000..e680d0d64a21f --- /dev/null +++ b/bolt/test/X86/linux-version.S @@ -0,0 +1,53 @@ +# REQUIRES: system-linux + +## Check that BOLT correctly detects the Linux kernel version + +# RUN: %clang -DA -target x86_64-unknown-unknown \ +# RUN: %cflags -nostdlib %s -o %t.exe \ +# RUN: -Wl,--image-base=0xffffffff80000000,--no-dynamic-linker,--no-eh-frame-hdr +# RUN: llvm-bolt %t.exe -o %t.out 2>&1 | FileCheck --check-prefix=CHECK-A %s + +# RUN: %clang -DB -target x86_64-unknown-unknown \ +# RUN: %cflags -nostdlib %s -o %t.exe \ +# RUN: -Wl,--image-base=0xffffffff80000000,--no-dynamic-linker,--no-eh-frame-hdr +# RUN: llvm-bolt %t.exe -o %t.out 2>&1 | FileCheck --check-prefix=CHECK-B %s + +# RUN: %clang -DC -target x86_64-unknown-unknown \ +# RUN: %cflags -nostdlib %s -o %t.exe \ +# RUN: -Wl,--image-base=0xffffffff80000000,--no-dynamic-linker,--no-eh-frame-hdr +# RUN: llvm-bolt %t.exe -o %t.out 2>&1 | FileCheck --check-prefix=CHECK-C %s + + .text + .globl foo + .type foo, %function +foo: + ret + .size foo, .-foo + +## Linux kernel version + .rodata + .align 16 + .globl linux_banner + .type linux_banner, @object +linux_banner: + +#ifdef A + .string "Linux version 6.6.61\n" +#endif +# CHECK-A: BOLT-INFO: Linux kernel version is 6.6.61 + +#ifdef B + .string "Linux version 6.6.50-rc4\n" +#endif +# CHECK-B: BOLT-INFO: Linux kernel version is 6.6.50 + +#ifdef C + .string "Linux version 6.6\n" +#endif +# CHECK-C: BOLT-INFO: Linux kernel version is 6.6 + + .size linux_banner, . - linux_banner + +## Fake Linux Kernel sections. + .section __ksymtab,"a",@progbits + .section __ksymtab_gpl,"a",@progbits diff --git a/clang-tools-extra/clang-doc/Serialize.cpp b/clang-tools-extra/clang-doc/Serialize.cpp index 93efdd44f4589..f737fc75135a1 100644 --- a/clang-tools-extra/clang-doc/Serialize.cpp +++ b/clang-tools-extra/clang-doc/Serialize.cpp @@ -696,13 +696,11 @@ emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber, // What this is a specialization of. auto SpecOf = CTSD->getSpecializedTemplateOrPartial(); - if (SpecOf.is()) { - Specialization.SpecializationOf = - getUSRForDecl(SpecOf.get()); - } else if (SpecOf.is()) { - Specialization.SpecializationOf = - getUSRForDecl(SpecOf.get()); - } + if (auto *CTD = dyn_cast(SpecOf)) + Specialization.SpecializationOf = getUSRForDecl(CTD); + else if (auto *CTPSD = + dyn_cast(SpecOf)) + Specialization.SpecializationOf = getUSRForDecl(CTPSD); // Parameters to the specilization. For partial specializations, get the // parameters "as written" from the ClassTemplatePartialSpecializationDecl diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp index 9c8c93c5d16c7..959b11777e88d 100644 --- a/clang-tools-extra/clang-tidy/ClangTidy.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp @@ -646,9 +646,9 @@ void exportReplacements(const llvm::StringRef MainFilePath, YAML << TUD; } -NamesAndOptions +ChecksAndOptions getAllChecksAndOptions(bool AllowEnablingAnalyzerAlphaCheckers) { - NamesAndOptions Result; + ChecksAndOptions Result; ClangTidyOptions Opts; Opts.Checks = "*"; clang::tidy::ClangTidyContext Context( @@ -661,7 +661,7 @@ getAllChecksAndOptions(bool AllowEnablingAnalyzerAlphaCheckers) { } for (const auto &Factory : Factories) - Result.Names.insert(Factory.getKey()); + Result.Checks.insert(Factory.getKey()); #if CLANG_TIDY_ENABLE_STATIC_ANALYZER SmallString<64> Buffer(AnalyzerCheckNamePrefix); @@ -670,7 +670,7 @@ getAllChecksAndOptions(bool AllowEnablingAnalyzerAlphaCheckers) { AllowEnablingAnalyzerAlphaCheckers)) { Buffer.truncate(DefSize); Buffer.append(AnalyzerCheck); - Result.Names.insert(Buffer); + Result.Checks.insert(Buffer); } for (std::string OptionName : { #define GET_CHECKER_OPTIONS diff --git a/clang-tools-extra/clang-tidy/ClangTidy.h b/clang-tools-extra/clang-tidy/ClangTidy.h index 51d9e226c7946..4ffd49f6ebf50 100644 --- a/clang-tools-extra/clang-tidy/ClangTidy.h +++ b/clang-tools-extra/clang-tidy/ClangTidy.h @@ -58,12 +58,12 @@ class ClangTidyASTConsumerFactory { std::vector getCheckNames(const ClangTidyOptions &Options, bool AllowEnablingAnalyzerAlphaCheckers); -struct NamesAndOptions { - llvm::StringSet<> Names; +struct ChecksAndOptions { + llvm::StringSet<> Checks; llvm::StringSet<> Options; }; -NamesAndOptions +ChecksAndOptions getAllChecksAndOptions(bool AllowEnablingAnalyzerAlphaCheckers = true); /// Returns the effective check-specific options. diff --git a/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp b/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp index 6028bb2258136..4aa9fe228ee79 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp @@ -7,11 +7,11 @@ //===----------------------------------------------------------------------===// #include "ClangTidyCheck.h" -#include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" -#include "llvm/Support/Error.h" +#include "llvm/ADT/StringSet.h" #include "llvm/Support/YAMLParser.h" #include +#include namespace clang::tidy { @@ -62,16 +62,29 @@ ClangTidyCheck::OptionsView::get(StringRef LocalName) const { return std::nullopt; } +static const llvm::StringSet<> DeprecatedGlobalOptions{ + "StrictMode", + "IgnoreMacros", +}; + static ClangTidyOptions::OptionMap::const_iterator findPriorityOption(const ClangTidyOptions::OptionMap &Options, StringRef NamePrefix, StringRef LocalName, - llvm::StringSet<> *Collector) { + ClangTidyContext *Context) { + llvm::StringSet<> *Collector = Context->getOptionsCollector(); if (Collector) { Collector->insert((NamePrefix + LocalName).str()); Collector->insert(LocalName); } auto IterLocal = Options.find((NamePrefix + LocalName).str()); auto IterGlobal = Options.find(LocalName); + // FIXME: temporary solution for deprecation warnings, should be removed + // after 22.x. Warn configuration deps on deprecation global options. + if (IterLocal == Options.end() && IterGlobal != Options.end() && + DeprecatedGlobalOptions.contains(LocalName)) + Context->configurationDiag( + "global option '%0' is deprecated, please use '%1%0' instead.") + << LocalName << NamePrefix; if (IterLocal == Options.end()) return IterGlobal; if (IterGlobal == Options.end()) @@ -83,8 +96,7 @@ findPriorityOption(const ClangTidyOptions::OptionMap &Options, std::optional ClangTidyCheck::OptionsView::getLocalOrGlobal(StringRef LocalName) const { - auto Iter = findPriorityOption(CheckOptions, NamePrefix, LocalName, - Context->getOptionsCollector()); + auto Iter = findPriorityOption(CheckOptions, NamePrefix, LocalName, Context); if (Iter != CheckOptions.end()) return StringRef(Iter->getValue().Value); return std::nullopt; @@ -117,8 +129,7 @@ ClangTidyCheck::OptionsView::get(StringRef LocalName) const { template <> std::optional ClangTidyCheck::OptionsView::getLocalOrGlobal(StringRef LocalName) const { - auto Iter = findPriorityOption(CheckOptions, NamePrefix, LocalName, - Context->getOptionsCollector()); + auto Iter = findPriorityOption(CheckOptions, NamePrefix, LocalName, Context); if (Iter != CheckOptions.end()) { if (auto Result = getAsBool(Iter->getValue().Value, Iter->getKey())) return Result; @@ -157,10 +168,9 @@ std::optional ClangTidyCheck::OptionsView::getEnumInt( bool IgnoreCase) const { if (!CheckGlobal && Context->getOptionsCollector()) Context->getOptionsCollector()->insert((NamePrefix + LocalName).str()); - auto Iter = CheckGlobal - ? findPriorityOption(CheckOptions, NamePrefix, LocalName, - Context->getOptionsCollector()) - : CheckOptions.find((NamePrefix + LocalName).str()); + auto Iter = CheckGlobal ? findPriorityOption(CheckOptions, NamePrefix, + LocalName, Context) + : CheckOptions.find((NamePrefix + LocalName).str()); if (Iter == CheckOptions.end()) return std::nullopt; diff --git a/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp b/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp index 33ac65e715ce8..b27616f3dcc65 100644 --- a/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp @@ -9,7 +9,6 @@ #include "../ClangTidy.h" #include "../ClangTidyModule.h" #include "../ClangTidyModuleRegistry.h" -#include "../cppcoreguidelines/NarrowingConversionsCheck.h" #include "ArgumentCommentCheck.h" #include "AssertSideEffectCheck.h" #include "AssignmentInIfConditionCheck.h" @@ -47,6 +46,7 @@ #include "MultiLevelImplicitPointerConversionCheck.h" #include "MultipleNewInOneExpressionCheck.h" #include "MultipleStatementMacroCheck.h" +#include "NarrowingConversionsCheck.h" #include "NoEscapeCheck.h" #include "NonZeroEnumToBoolConversionCheck.h" #include "NondeterministicPointerIterationOrderCheck.h" @@ -183,7 +183,7 @@ class BugproneModule : public ClangTidyModule { "bugprone-pointer-arithmetic-on-polymorphic-object"); CheckFactories.registerCheck( "bugprone-redundant-branch-condition"); - CheckFactories.registerCheck( + CheckFactories.registerCheck( "bugprone-narrowing-conversions"); CheckFactories.registerCheck("bugprone-no-escape"); CheckFactories.registerCheck( diff --git a/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt b/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt index 13adad7c3dadb..8bd5646c5fe05 100644 --- a/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt @@ -42,6 +42,7 @@ add_clang_library(clangTidyBugproneModule STATIC MultiLevelImplicitPointerConversionCheck.cpp MultipleNewInOneExpressionCheck.cpp MultipleStatementMacroCheck.cpp + NarrowingConversionsCheck.cpp NoEscapeCheck.cpp NonZeroEnumToBoolConversionCheck.cpp NondeterministicPointerIterationOrderCheck.cpp @@ -95,7 +96,6 @@ add_clang_library(clangTidyBugproneModule STATIC LINK_LIBS clangTidy - clangTidyCppCoreGuidelinesModule clangTidyUtils DEPENDS diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/NarrowingConversionsCheck.cpp similarity index 99% rename from clang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp rename to clang-tools-extra/clang-tidy/bugprone/NarrowingConversionsCheck.cpp index 45fef9471d521..a950704208c73 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/NarrowingConversionsCheck.cpp @@ -22,7 +22,7 @@ using namespace clang::ast_matchers; -namespace clang::tidy::cppcoreguidelines { +namespace clang::tidy::bugprone { namespace { @@ -614,4 +614,4 @@ void NarrowingConversionsCheck::check(const MatchFinder::MatchResult &Result) { return handleImplicitCast(*Result.Context, *Cast); llvm_unreachable("must be binary operator or cast expression"); } -} // namespace clang::tidy::cppcoreguidelines +} // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.h b/clang-tools-extra/clang-tidy/bugprone/NarrowingConversionsCheck.h similarity index 90% rename from clang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.h rename to clang-tools-extra/clang-tidy/bugprone/NarrowingConversionsCheck.h index 1add40b91778a..20403f920b925 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.h +++ b/clang-tools-extra/clang-tidy/bugprone/NarrowingConversionsCheck.h @@ -6,19 +6,19 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_NARROWING_CONVERSIONS_H -#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_NARROWING_CONVERSIONS_H +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_NARROWING_CONVERSIONS_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_NARROWING_CONVERSIONS_H #include "../ClangTidyCheck.h" -namespace clang::tidy::cppcoreguidelines { +namespace clang::tidy::bugprone { /// Checks for narrowing conversions, e.g: /// int i = 0; /// i += 0.1; /// /// For the user-facing documentation see: -/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/narrowing-conversions.html +/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/narrowing-conversions.html class NarrowingConversionsCheck : public ClangTidyCheck { public: NarrowingConversionsCheck(StringRef Name, ClangTidyContext *Context); @@ -104,6 +104,6 @@ class NarrowingConversionsCheck : public ClangTidyCheck { const bool PedanticMode; }; -} // namespace clang::tidy::cppcoreguidelines +} // namespace clang::tidy::bugprone -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_NARROWING_CONVERSIONS_H +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_NARROWING_CONVERSIONS_H diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt b/clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt index 07bb89ec7937a..b023f76a25432 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt @@ -16,7 +16,6 @@ add_clang_library(clangTidyCppCoreGuidelinesModule STATIC MacroUsageCheck.cpp MisleadingCaptureDefaultByValueCheck.cpp MissingStdForwardCheck.cpp - NarrowingConversionsCheck.cpp NoMallocCheck.cpp NoSuspendWithLockCheck.cpp OwningMemoryCheck.cpp @@ -38,6 +37,7 @@ add_clang_library(clangTidyCppCoreGuidelinesModule STATIC LINK_LIBS clangTidy + clangTidyBugproneModule clangTidyMiscModule clangTidyModernizeModule clangTidyPerformanceModule diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp index e9f0201615616..6adef04264347 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp @@ -9,6 +9,7 @@ #include "../ClangTidy.h" #include "../ClangTidyModule.h" #include "../ClangTidyModuleRegistry.h" +#include "../bugprone/NarrowingConversionsCheck.h" #include "../misc/NonPrivateMemberVariablesInClassesCheck.h" #include "../misc/UnconventionalAssignOperatorCheck.h" #include "../modernize/AvoidCArraysCheck.h" @@ -30,7 +31,6 @@ #include "MacroUsageCheck.h" #include "MisleadingCaptureDefaultByValueCheck.h" #include "MissingStdForwardCheck.h" -#include "NarrowingConversionsCheck.h" #include "NoMallocCheck.h" #include "NoSuspendWithLockCheck.h" #include "OwningMemoryCheck.h" @@ -87,7 +87,7 @@ class CppCoreGuidelinesModule : public ClangTidyModule { "cppcoreguidelines-misleading-capture-default-by-value"); CheckFactories.registerCheck( "cppcoreguidelines-missing-std-forward"); - CheckFactories.registerCheck( + CheckFactories.registerCheck( "cppcoreguidelines-narrowing-conversions"); CheckFactories.registerCheck("cppcoreguidelines-no-malloc"); CheckFactories.registerCheck( diff --git a/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp index 24eefdb082eb3..30fcba367db67 100644 --- a/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp @@ -7,9 +7,14 @@ //===----------------------------------------------------------------------===// #include "UseUsingCheck.h" -#include "clang/AST/ASTContext.h" +#include "../utils/LexerUtils.h" #include "clang/AST/DeclGroup.h" +#include "clang/Basic/LangOptions.h" +#include "clang/Basic/SourceLocation.h" +#include "clang/Basic/SourceManager.h" +#include "clang/Basic/TokenKinds.h" #include "clang/Lex/Lexer.h" +#include using namespace clang::ast_matchers; namespace { @@ -83,6 +88,9 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) { if (!ParentDecl) return; + const SourceManager &SM = *Result.SourceManager; + const LangOptions &LO = getLangOpts(); + // Match CXXRecordDecl only to store the range of the last non-implicit full // declaration, to later check whether it's within the typdef itself. const auto *MatchedTagDecl = Result.Nodes.getNodeAs(TagDeclName); @@ -119,14 +127,51 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) { return; } - PrintingPolicy PrintPolicy(getLangOpts()); - PrintPolicy.SuppressScope = true; - PrintPolicy.ConstantArraySizeAsWritten = true; - PrintPolicy.UseVoidForZeroParams = false; - PrintPolicy.PrintInjectedClassNameWithArguments = false; + const TypeLoc TL = MatchedDecl->getTypeSourceInfo()->getTypeLoc(); + + auto [Type, QualifierStr] = [MatchedDecl, this, &TL, &SM, + &LO]() -> std::pair { + SourceRange TypeRange = TL.getSourceRange(); + + // Function pointer case, get the left and right side of the identifier + // without the identifier. + if (TypeRange.fullyContains(MatchedDecl->getLocation())) { + const auto RangeLeftOfIdentifier = CharSourceRange::getCharRange( + TypeRange.getBegin(), MatchedDecl->getLocation()); + const auto RangeRightOfIdentifier = CharSourceRange::getCharRange( + Lexer::getLocForEndOfToken(MatchedDecl->getLocation(), 0, SM, LO), + Lexer::getLocForEndOfToken(TypeRange.getEnd(), 0, SM, LO)); + const std::string VerbatimType = + (Lexer::getSourceText(RangeLeftOfIdentifier, SM, LO) + + Lexer::getSourceText(RangeRightOfIdentifier, SM, LO)) + .str(); + return {VerbatimType, ""}; + } + + StringRef ExtraReference = ""; + if (MainTypeEndLoc.isValid() && TypeRange.fullyContains(MainTypeEndLoc)) { + // Each type introduced in a typedef can specify being a reference or + // pointer type seperately, so we need to sigure out if the new using-decl + // needs to be to a reference or pointer as well. + const SourceLocation Tok = utils::lexer::findPreviousAnyTokenKind( + MatchedDecl->getLocation(), SM, LO, tok::TokenKind::star, + tok::TokenKind::amp, tok::TokenKind::comma, + tok::TokenKind::kw_typedef); + + ExtraReference = Lexer::getSourceText( + CharSourceRange::getCharRange(Tok, Tok.getLocWithOffset(1)), SM, LO); - std::string Type = MatchedDecl->getUnderlyingType().getAsString(PrintPolicy); - std::string Name = MatchedDecl->getNameAsString(); + if (ExtraReference != "*" && ExtraReference != "&") + ExtraReference = ""; + + TypeRange.setEnd(MainTypeEndLoc); + } + return { + Lexer::getSourceText(CharSourceRange::getTokenRange(TypeRange), SM, LO) + .str(), + ExtraReference.str()}; + }(); + StringRef Name = MatchedDecl->getName(); SourceRange ReplaceRange = MatchedDecl->getSourceRange(); // typedefs with multiple comma-separated definitions produce multiple @@ -143,7 +188,8 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) { // This is the first (and possibly the only) TypedefDecl in a typedef. Save // Type and Name in case we find subsequent TypedefDecl's in this typedef. FirstTypedefType = Type; - FirstTypedefName = Name; + FirstTypedefName = Name.str(); + MainTypeEndLoc = TL.getEndLoc(); } else { // This is additional TypedefDecl in a comma-separated typedef declaration. // Start replacement *after* prior replacement and separate with semicolon. @@ -153,10 +199,10 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) { // If this additional TypedefDecl's Type starts with the first TypedefDecl's // type, make this using statement refer back to the first type, e.g. make // "typedef int Foo, *Foo_p;" -> "using Foo = int;\nusing Foo_p = Foo*;" - if (Type.size() > FirstTypedefType.size() && - Type.substr(0, FirstTypedefType.size()) == FirstTypedefType) - Type = FirstTypedefName + Type.substr(FirstTypedefType.size() + 1); + if (Type == FirstTypedefType && !QualifierStr.empty()) + Type = FirstTypedefName; } + if (!ReplaceRange.getEnd().isMacroID()) { const SourceLocation::IntTy Offset = MatchedDecl->getFunctionType() ? 0 : Name.size(); @@ -171,13 +217,12 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) { LastTagDeclRange->second.isValid() && ReplaceRange.fullyContains(LastTagDeclRange->second)) { Type = std::string(Lexer::getSourceText( - CharSourceRange::getTokenRange(LastTagDeclRange->second), - *Result.SourceManager, getLangOpts())); + CharSourceRange::getTokenRange(LastTagDeclRange->second), SM, LO)); if (Type.empty()) return; } - std::string Replacement = Using + Name + " = " + Type; + std::string Replacement = (Using + Name + " = " + Type + QualifierStr).str(); Diag << FixItHint::CreateReplacement(ReplaceRange, Replacement); } } // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.h b/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.h index 7054778d84a0c..1e54bbf23c984 100644 --- a/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.h +++ b/clang-tools-extra/clang-tidy/modernize/UseUsingCheck.h @@ -26,6 +26,7 @@ class UseUsingCheck : public ClangTidyCheck { std::string FirstTypedefType; std::string FirstTypedefName; + SourceLocation MainTypeEndLoc; public: UseUsingCheck(StringRef Name, ClangTidyContext *Context); diff --git a/clang-tools-extra/clang-tidy/tool/CMakeLists.txt b/clang-tools-extra/clang-tidy/tool/CMakeLists.txt index 81fba3bbf12fe..0d4501d1eac06 100644 --- a/clang-tools-extra/clang-tidy/tool/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/tool/CMakeLists.txt @@ -3,6 +3,7 @@ set(LLVM_LINK_COMPONENTS AllTargetsDescs AllTargetsInfos FrontendOpenMP + TargetParser support ) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index d42dafa8ffc36..fa8887e4639b4 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -20,12 +20,14 @@ #include "../GlobList.h" #include "clang/Tooling/CommonOptionsParser.h" #include "llvm/ADT/StringSet.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/InitLLVM.h" #include "llvm/Support/PluginLoader.h" #include "llvm/Support/Process.h" #include "llvm/Support/Signals.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Support/WithColor.h" +#include "llvm/TargetParser/Host.h" #include using namespace clang::tooling; @@ -36,6 +38,11 @@ static cl::desc desc(StringRef description) { return {description.ltrim()}; } static cl::OptionCategory ClangTidyCategory("clang-tidy options"); static cl::extrahelp CommonHelp(CommonOptionsParser::HelpMessage); +static cl::extrahelp ClangTidyParameterFileHelp(R"( +Parameters files: + A large number of options or source files can be passed as parameter files + by use '@parameter-file' in the command line. +)"); static cl::extrahelp ClangTidyHelp(R"( Configuration files: clang-tidy attempts to read configuration for each source file from a @@ -54,12 +61,12 @@ Configuration files: globs can be specified as a list instead of a string. ExcludeHeaderFilterRegex - Same as '--exclude-header-filter'. - ExtraArgs - Same as '--extra-args'. - ExtraArgsBefore - Same as '--extra-args-before'. + ExtraArgs - Same as '--extra-arg'. + ExtraArgsBefore - Same as '--extra-arg-before'. FormatStyle - Same as '--format-style'. HeaderFileExtensions - File extensions to consider to determine if a given diagnostic is located in a header file. - HeaderFilterRegex - Same as '--header-filter-regex'. + HeaderFilterRegex - Same as '--header-filter'. ImplementationFileExtensions - File extensions to consider to determine if a given diagnostic is located in an implementation file. @@ -526,6 +533,24 @@ static bool verifyFileExtensions( return AnyInvalid; } +static bool verifyOptions(const llvm::StringSet<> &ValidOptions, + const ClangTidyOptions::OptionMap &OptionMap, + StringRef Source) { + bool AnyInvalid = false; + for (auto Key : OptionMap.keys()) { + if (ValidOptions.contains(Key)) + continue; + AnyInvalid = true; + auto &Output = llvm::WithColor::warning(llvm::errs(), Source) + << "unknown check option '" << Key << '\''; + llvm::StringRef Closest = closest(Key, ValidOptions); + if (!Closest.empty()) + Output << "; did you mean '" << Closest << '\''; + Output << VerifyConfigWarningEnd; + } + return AnyInvalid; +} + static SmallString<256> makeAbsolute(llvm::StringRef Input) { if (Input.empty()) return {}; @@ -553,6 +578,21 @@ static llvm::IntrusiveRefCntPtr createBaseFS() { int clangTidyMain(int argc, const char **argv) { llvm::InitLLVM X(argc, argv); + SmallVector Args{argv, argv + argc}; + + // expand parameters file to argc and argv. + llvm::BumpPtrAllocator Alloc; + llvm::cl::TokenizerCallback Tokenizer = + llvm::Triple(llvm::sys::getProcessTriple()).isOSWindows() + ? llvm::cl::TokenizeWindowsCommandLine + : llvm::cl::TokenizeGNUCommandLine; + llvm::cl::ExpansionContext ECtx(Alloc, Tokenizer); + if (llvm::Error Err = ECtx.expandResponseFiles(Args)) { + llvm::WithColor::error() << llvm::toString(std::move(Err)) << "\n"; + return 1; + } + argc = static_cast(Args.size()); + argv = Args.data(); // Enable help for -load option, if plugins are enabled. if (cl::Option *LoadOpt = cl::getRegisteredOptions().lookup("load")) @@ -629,29 +669,17 @@ int clangTidyMain(int argc, const char **argv) { if (VerifyConfig) { std::vector RawOptions = OptionsProvider->getRawOptions(FileName); - NamesAndOptions Valid = + ChecksAndOptions Valid = getAllChecksAndOptions(AllowEnablingAnalyzerAlphaCheckers); bool AnyInvalid = false; for (const auto &[Opts, Source] : RawOptions) { if (Opts.Checks) - AnyInvalid |= verifyChecks(Valid.Names, *Opts.Checks, Source); - + AnyInvalid |= verifyChecks(Valid.Checks, *Opts.Checks, Source); if (Opts.HeaderFileExtensions && Opts.ImplementationFileExtensions) AnyInvalid |= verifyFileExtensions(*Opts.HeaderFileExtensions, *Opts.ImplementationFileExtensions, Source); - - for (auto Key : Opts.CheckOptions.keys()) { - if (Valid.Options.contains(Key)) - continue; - AnyInvalid = true; - auto &Output = llvm::WithColor::warning(llvm::errs(), Source) - << "unknown check option '" << Key << '\''; - llvm::StringRef Closest = closest(Key, Valid.Options); - if (!Closest.empty()) - Output << "; did you mean '" << Closest << '\''; - Output << VerifyConfigWarningEnd; - } + AnyInvalid |= verifyOptions(Valid.Options, Opts.CheckOptions, Source); } if (AnyInvalid) return 1; diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp index 2c2d5f0b5ac92..fb39b7b292242 100644 --- a/clang-tools-extra/clangd/CodeComplete.cpp +++ b/clang-tools-extra/clangd/CodeComplete.cpp @@ -807,8 +807,8 @@ SpecifiedScope getQueryScopes(CodeCompletionContext &CCContext, llvm::StringRef SpelledSpecifier = Lexer::getSourceText( CharSourceRange::getCharRange(SemaSpecifier->getRange()), CCSema.SourceMgr, clang::LangOptions()); - if (SpelledSpecifier.consume_front("::")) - Scopes.QueryScopes = {""}; + if (SpelledSpecifier.consume_front("::")) + Scopes.QueryScopes = {""}; Scopes.UnresolvedQualifier = std::string(SpelledSpecifier); // Sema excludes the trailing "::". if (!Scopes.UnresolvedQualifier->empty()) @@ -1604,7 +1604,7 @@ class CodeCompleteFlow { CompletionPrefix HeuristicPrefix; std::optional Filter; // Initialized once Sema runs. Range ReplacedRange; - std::vector QueryScopes; // Initialized once Sema runs. + std::vector QueryScopes; // Initialized once Sema runs. std::vector AccessibleScopes; // Initialized once Sema runs. // Initialized once QueryScopes is initialized, if there are scopes. std::optional ScopeProximity; @@ -1663,7 +1663,9 @@ class CodeCompleteFlow { Inserter.emplace( SemaCCInput.FileName, SemaCCInput.ParseInput.Contents, Style, SemaCCInput.ParseInput.CompileCommand.Directory, - &Recorder->CCSema->getPreprocessor().getHeaderSearchInfo()); + &Recorder->CCSema->getPreprocessor().getHeaderSearchInfo(), + Config::current().Style.QuotedHeaders, + Config::current().Style.AngledHeaders); for (const auto &Inc : Includes.MainFileIncludes) Inserter->addExisting(Inc); @@ -1746,7 +1748,9 @@ class CodeCompleteFlow { auto Style = getFormatStyleForFile(FileName, Content, TFS, false); // This will only insert verbatim headers. Inserter.emplace(FileName, Content, Style, - /*BuildDir=*/"", /*HeaderSearchInfo=*/nullptr); + /*BuildDir=*/"", /*HeaderSearchInfo=*/nullptr, + Config::current().Style.QuotedHeaders, + Config::current().Style.AngledHeaders); auto Identifiers = collectIdentifiers(Content, Style); std::vector IdentifierResults; diff --git a/clang-tools-extra/clangd/Config.h b/clang-tools-extra/clangd/Config.h index e174f7fabe344..586d031d58481 100644 --- a/clang-tools-extra/clangd/Config.h +++ b/clang-tools-extra/clangd/Config.h @@ -124,6 +124,10 @@ struct Config { // declarations, always spell out the whole name (with or without leading // ::). All nested namespaces are affected as well. std::vector FullyQualifiedNamespaces; + + // List of matcher functions for inserting certain headers with <> or "". + std::vector> QuotedHeaders; + std::vector> AngledHeaders; } Style; /// controls the completion options for argument lists. diff --git a/clang-tools-extra/clangd/ConfigCompile.cpp b/clang-tools-extra/clangd/ConfigCompile.cpp index fb7692998d05c..aa2561e081047 100644 --- a/clang-tools-extra/clangd/ConfigCompile.cpp +++ b/clang-tools-extra/clangd/ConfigCompile.cpp @@ -482,6 +482,55 @@ struct FragmentCompiler { FullyQualifiedNamespaces.begin(), FullyQualifiedNamespaces.end()); }); } + auto QuotedFilter = compileHeaderRegexes(F.QuotedHeaders); + if (QuotedFilter.has_value()) { + Out.Apply.push_back( + [QuotedFilter = *QuotedFilter](const Params &, Config &C) { + C.Style.QuotedHeaders.emplace_back(QuotedFilter); + }); + } + auto AngledFilter = compileHeaderRegexes(F.AngledHeaders); + if (AngledFilter.has_value()) { + Out.Apply.push_back( + [AngledFilter = *AngledFilter](const Params &, Config &C) { + C.Style.AngledHeaders.emplace_back(AngledFilter); + }); + } + } + + auto compileHeaderRegexes(llvm::ArrayRef> HeaderPatterns) + -> std::optional> { + // TODO: Share this code with Diagnostics.Includes.IgnoreHeader +#ifdef CLANGD_PATH_CASE_INSENSITIVE + static llvm::Regex::RegexFlags Flags = llvm::Regex::IgnoreCase; +#else + static llvm::Regex::RegexFlags Flags = llvm::Regex::NoFlags; +#endif + auto Filters = std::make_shared>(); + for (auto &HeaderPattern : HeaderPatterns) { + // Anchor on the right. + std::string AnchoredPattern = "(" + *HeaderPattern + ")$"; + llvm::Regex CompiledRegex(AnchoredPattern, Flags); + std::string RegexError; + if (!CompiledRegex.isValid(RegexError)) { + diag(Warning, + llvm::formatv("Invalid regular expression '{0}': {1}", + *HeaderPattern, RegexError) + .str(), + HeaderPattern.Range); + continue; + } + Filters->push_back(std::move(CompiledRegex)); + } + if (Filters->empty()) + return std::nullopt; + auto Filter = [Filters](llvm::StringRef Path) { + for (auto &Regex : *Filters) + if (Regex.match(Path)) + return true; + return false; + }; + return Filter; } void appendTidyCheckSpec(std::string &CurSpec, diff --git a/clang-tools-extra/clangd/ConfigFragment.h b/clang-tools-extra/clangd/ConfigFragment.h index 36f7d04231c41..9535b20253b13 100644 --- a/clang-tools-extra/clangd/ConfigFragment.h +++ b/clang-tools-extra/clangd/ConfigFragment.h @@ -301,6 +301,23 @@ struct Fragment { // ::). All nested namespaces are affected as well. // Affects availability of the AddUsing tweak. std::vector> FullyQualifiedNamespaces; + + /// List of regexes for headers that should always be included with a + /// ""-style include. By default, and in case of a conflict with + /// AngledHeaders (i.e. a header matches a regex in both QuotedHeaders and + /// AngledHeaders), system headers use <> and non-system headers use "". + /// These can match any suffix of the header file in question. + /// Matching is performed against the header text, not its absolute path + /// within the project. + std::vector> QuotedHeaders; + /// List of regexes for headers that should always be included with a + /// <>-style include. By default, and in case of a conflict with + /// AngledHeaders (i.e. a header matches a regex in both QuotedHeaders and + /// AngledHeaders), system headers use <> and non-system headers use "". + /// These can match any suffix of the header file in question. + /// Matching is performed against the header text, not its absolute path + /// within the project. + std::vector> AngledHeaders; }; StyleBlock Style; diff --git a/clang-tools-extra/clangd/ConfigYAML.cpp b/clang-tools-extra/clangd/ConfigYAML.cpp index 32e028981d424..95cc5c1f9f1cf 100644 --- a/clang-tools-extra/clangd/ConfigYAML.cpp +++ b/clang-tools-extra/clangd/ConfigYAML.cpp @@ -116,6 +116,14 @@ class Parser { if (auto Values = scalarValues(N)) F.FullyQualifiedNamespaces = std::move(*Values); }); + Dict.handle("QuotedHeaders", [&](Node &N) { + if (auto Values = scalarValues(N)) + F.QuotedHeaders = std::move(*Values); + }); + Dict.handle("AngledHeaders", [&](Node &N) { + if (auto Values = scalarValues(N)) + F.AngledHeaders = std::move(*Values); + }); Dict.parse(N); } diff --git a/clang-tools-extra/clangd/Headers.cpp b/clang-tools-extra/clangd/Headers.cpp index b537417bd1056..0ffd9ee4d2751 100644 --- a/clang-tools-extra/clangd/Headers.cpp +++ b/clang-tools-extra/clangd/Headers.cpp @@ -9,6 +9,7 @@ #include "Headers.h" #include "Preamble.h" #include "SourceCode.h" +#include "support/Logger.h" #include "clang/Basic/SourceLocation.h" #include "clang/Basic/SourceManager.h" #include "clang/Frontend/CompilerInstance.h" @@ -30,8 +31,7 @@ namespace clangd { class IncludeStructure::RecordHeaders : public PPCallbacks { public: RecordHeaders(const CompilerInstance &CI, IncludeStructure *Out) - : SM(CI.getSourceManager()), - Out(Out) {} + : SM(CI.getSourceManager()), Out(Out) {} // Record existing #includes - both written and resolved paths. Only #includes // in the main file are collected. @@ -287,11 +287,11 @@ IncludeInserter::calculateIncludePath(const HeaderFile &InsertedHeader, assert(InsertedHeader.valid()); if (InsertedHeader.Verbatim) return InsertedHeader.File; - bool IsAngled = false; + bool IsAngledByDefault = false; std::string Suggested; if (HeaderSearchInfo) { Suggested = HeaderSearchInfo->suggestPathToFileForDiagnostics( - InsertedHeader.File, BuildDir, IncludingFile, &IsAngled); + InsertedHeader.File, BuildDir, IncludingFile, &IsAngledByDefault); } else { // Calculate include relative to including file only. StringRef IncludingDir = llvm::sys::path::parent_path(IncludingFile); @@ -304,9 +304,33 @@ IncludeInserter::calculateIncludePath(const HeaderFile &InsertedHeader, // FIXME: should we allow (some limited number of) "../header.h"? if (llvm::sys::path::is_absolute(Suggested)) return std::nullopt; + bool IsAngled = false; + for (auto Filter : AngledHeaders) { + if (Filter(Suggested)) { + IsAngled = true; + break; + } + } + bool IsQuoted = false; + for (auto Filter : QuotedHeaders) { + if (Filter(Suggested)) { + IsQuoted = true; + break; + } + } + // No filters apply, or both filters apply (a bug), use system default. + if (IsAngled == IsQuoted) { + // Probably a bug in the config regex. + if (IsAngled && IsQuoted) { + elog("Header '{0}' matches both quoted and angled regexes, default will " + "be used.", + Suggested); + } + IsAngled = IsAngledByDefault; + } if (IsAngled) Suggested = "<" + Suggested + ">"; - else + else // if (IsQuoted) Suggested = "\"" + Suggested + "\""; return Suggested; } diff --git a/clang-tools-extra/clangd/Headers.h b/clang-tools-extra/clangd/Headers.h index 41cf3de6bba35..b91179da253e9 100644 --- a/clang-tools-extra/clangd/Headers.h +++ b/clang-tools-extra/clangd/Headers.h @@ -33,6 +33,8 @@ namespace clang { namespace clangd { +using HeaderFilter = llvm::ArrayRef>; + /// Returns true if \p Include is literal include like "path" or . bool isLiteralInclude(llvm::StringRef Include); @@ -211,10 +213,12 @@ class IncludeInserter { // include path of non-verbatim header will not be shortened. IncludeInserter(StringRef FileName, StringRef Code, const format::FormatStyle &Style, StringRef BuildDir, - HeaderSearch *HeaderSearchInfo) + HeaderSearch *HeaderSearchInfo, HeaderFilter QuotedHeaders, + HeaderFilter AngledHeaders) : FileName(FileName), Code(Code), BuildDir(BuildDir), HeaderSearchInfo(HeaderSearchInfo), - Inserter(FileName, Code, Style.IncludeStyle) {} + Inserter(FileName, Code, Style.IncludeStyle), + QuotedHeaders(QuotedHeaders), AngledHeaders(AngledHeaders) {} void addExisting(const Inclusion &Inc); @@ -258,6 +262,8 @@ class IncludeInserter { HeaderSearch *HeaderSearchInfo = nullptr; llvm::StringSet<> IncludedHeaders; // Both written and resolved. tooling::HeaderIncludes Inserter; // Computers insertion replacement. + HeaderFilter QuotedHeaders; + HeaderFilter AngledHeaders; }; } // namespace clangd diff --git a/clang-tools-extra/clangd/IncludeCleaner.h b/clang-tools-extra/clangd/IncludeCleaner.h index a01146d14e3c1..3f6e3b2fd45b6 100644 --- a/clang-tools-extra/clangd/IncludeCleaner.h +++ b/clang-tools-extra/clangd/IncludeCleaner.h @@ -57,7 +57,6 @@ IncludeCleanerFindings computeIncludeCleanerFindings(ParsedAST &AST, bool AnalyzeAngledIncludes = false); -using HeaderFilter = llvm::ArrayRef>; std::vector issueIncludeCleanerDiagnostics(ParsedAST &AST, llvm::StringRef Code, const IncludeCleanerFindings &Findings, diff --git a/clang-tools-extra/clangd/ParsedAST.cpp b/clang-tools-extra/clangd/ParsedAST.cpp index 045d32afbc938..725cbeb154cb8 100644 --- a/clang-tools-extra/clangd/ParsedAST.cpp +++ b/clang-tools-extra/clangd/ParsedAST.cpp @@ -639,7 +639,8 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs, getFormatStyleForFile(Filename, Inputs.Contents, *Inputs.TFS, false); auto Inserter = std::make_shared( Filename, Inputs.Contents, Style, BuildDir.get(), - &Clang->getPreprocessor().getHeaderSearchInfo()); + &Clang->getPreprocessor().getHeaderSearchInfo(), + Cfg.Style.QuotedHeaders, Cfg.Style.AngledHeaders); ArrayRef MainFileIncludes; if (Preamble) { MainFileIncludes = Preamble->Includes.MainFileIncludes; diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp b/clang-tools-extra/clangd/tool/ClangdMain.cpp index 80a0653f8f740..714891703b6f3 100644 --- a/clang-tools-extra/clangd/tool/ClangdMain.cpp +++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp @@ -242,13 +242,13 @@ opt FallbackStyle{ init(clang::format::DefaultFallbackStyle), }; -opt EnableFunctionArgSnippets{ +opt EnableFunctionArgSnippets{ "function-arg-placeholders", cat(Features), desc("When disabled (0), completions contain only parentheses for " "function calls. When enabled (1), completions also contain " "placeholders for method parameters"), - init(-1), + init("-1"), }; opt HeaderInsertion{ @@ -636,6 +636,22 @@ loadExternalIndex(const Config::ExternalIndexSpec &External, llvm_unreachable("Invalid ExternalIndexKind."); } +std::optional shouldEnableFunctionArgSnippets() { + std::string Val = EnableFunctionArgSnippets; + // Accept the same values that a bool option parser would, but also accept + // -1 to indicate "unspecified", in which case the ArgumentListsPolicy + // config option will be respected. + if (Val == "1" || Val == "true" || Val == "True" || Val == "TRUE") + return true; + if (Val == "0" || Val == "false" || Val == "False" || Val == "FALSE") + return false; + if (Val != "-1") + elog("Value specified by --function-arg-placeholders is invalid. Provide a " + "boolean value or leave unspecified to use ArgumentListsPolicy from " + "config instead."); + return std::nullopt; +} + class FlagsConfigProvider : public config::Provider { private: config::CompiledFragment Frag; @@ -696,10 +712,9 @@ class FlagsConfigProvider : public config::Provider { BGPolicy = Config::BackgroundPolicy::Skip; } - if (EnableFunctionArgSnippets >= 0) { - ArgumentLists = EnableFunctionArgSnippets - ? Config::ArgumentListsPolicy::FullPlaceholders - : Config::ArgumentListsPolicy::Delimiters; + if (std::optional Enable = shouldEnableFunctionArgSnippets()) { + ArgumentLists = *Enable ? Config::ArgumentListsPolicy::FullPlaceholders + : Config::ArgumentListsPolicy::Delimiters; } Frag = [=](const config::Params &, Config &C) { diff --git a/clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp b/clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp index 3acacf496e77f..9d48a6e09fc77 100644 --- a/clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp +++ b/clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp @@ -920,6 +920,41 @@ TEST(CompletionTest, NoIncludeInsertionWhenDeclFoundInFile) { AllOf(named("Y"), Not(insertInclude())))); } +TEST(CompletionTest, IncludeInsertionRespectsQuotedAngledConfig) { + TestTU TU; + TU.ExtraArgs.push_back("-I" + testPath("sub")); + TU.AdditionalFiles["sub/bar.h"] = ""; + auto BarURI = URI::create(testPath("sub/bar.h")).toString(); + + Symbol Sym = cls("ns::X"); + Sym.CanonicalDeclaration.FileURI = BarURI.c_str(); + Sym.IncludeHeaders.emplace_back(BarURI, 1, Symbol::Include); + Annotations Test("int main() { ns::^ }"); + TU.Code = Test.code().str(); + auto Results = completions(TU, Test.point(), {Sym}); + // Default for a local path is quoted include + EXPECT_THAT(Results.Completions, + ElementsAre(AllOf(named("X"), insertInclude("\"bar.h\"")))); + { + Config C; + C.Style.AngledHeaders.push_back( + [](auto header) { return header == "bar.h"; }); + WithContextValue WithCfg(Config::Key, std::move(C)); + Results = completions(TU, Test.point(), {Sym}); + EXPECT_THAT(Results.Completions, + ElementsAre(AllOf(named("X"), insertInclude("")))); + } + { + Config C; + C.Style.QuotedHeaders.push_back( + [](auto header) { return header == "bar.h"; }); + WithContextValue WithCfg(Config::Key, std::move(C)); + Results = completions(TU, Test.point(), {Sym}); + EXPECT_THAT(Results.Completions, + ElementsAre(AllOf(named("X"), insertInclude("\"bar.h\"")))); + } +} + TEST(CompletionTest, IndexSuppressesPreambleCompletions) { Annotations Test(R"cpp( #include "bar.h" @@ -1138,8 +1173,8 @@ TEST(CodeCompleteTest, NoColonColonAtTheEnd) { } TEST(CompletionTests, EmptySnippetDoesNotCrash) { - // See https://github.com/clangd/clangd/issues/1216 - auto Results = completions(R"cpp( + // See https://github.com/clangd/clangd/issues/1216 + auto Results = completions(R"cpp( int main() { auto w = [&](auto &&f) { return f(f); }; auto f = w([&](auto &&f) { @@ -1155,18 +1190,18 @@ TEST(CompletionTests, EmptySnippetDoesNotCrash) { } TEST(CompletionTest, Issue1427Crash) { - // Need to provide main file signals to ensure that the branch in - // SymbolRelevanceSignals::computeASTSignals() that tries to - // compute a symbol ID is taken. - ASTSignals MainFileSignals; - CodeCompleteOptions Opts; - Opts.MainFileSignals = &MainFileSignals; - completions(R"cpp( + // Need to provide main file signals to ensure that the branch in + // SymbolRelevanceSignals::computeASTSignals() that tries to + // compute a symbol ID is taken. + ASTSignals MainFileSignals; + CodeCompleteOptions Opts; + Opts.MainFileSignals = &MainFileSignals; + completions(R"cpp( auto f = []() { 1.0_^ }; )cpp", - {}, Opts); + {}, Opts); } TEST(CompletionTest, BacktrackCrashes) { diff --git a/clang-tools-extra/clangd/unittests/ConfigCompileTests.cpp b/clang-tools-extra/clangd/unittests/ConfigCompileTests.cpp index 4ecfdf0184ab4..179960a02cade 100644 --- a/clang-tools-extra/clangd/unittests/ConfigCompileTests.cpp +++ b/clang-tools-extra/clangd/unittests/ConfigCompileTests.cpp @@ -545,6 +545,44 @@ TEST_F(ConfigCompileTests, Style) { Frag.Style.FullyQualifiedNamespaces.push_back(std::string("bar")); EXPECT_TRUE(compileAndApply()); EXPECT_THAT(Conf.Style.FullyQualifiedNamespaces, ElementsAre("foo", "bar")); + + { + Frag = {}; + EXPECT_TRUE(Conf.Style.QuotedHeaders.empty()) + << Conf.Style.QuotedHeaders.size(); + Frag.Style.QuotedHeaders.push_back(Located("foo.h")); + Frag.Style.QuotedHeaders.push_back(Located(".*inc")); + EXPECT_TRUE(compileAndApply()); + auto HeaderFilter = [this](llvm::StringRef Path) { + for (auto &Filter : Conf.Style.QuotedHeaders) { + if (Filter(Path)) + return true; + } + return false; + }; + EXPECT_TRUE(HeaderFilter("foo.h")); + EXPECT_TRUE(HeaderFilter("prefix/foo.h")); + EXPECT_FALSE(HeaderFilter("bar.h")); + EXPECT_FALSE(HeaderFilter("foo.h/bar.h")); + } + + { + Frag = {}; + EXPECT_TRUE(Conf.Style.AngledHeaders.empty()) + << Conf.Style.AngledHeaders.size(); + Frag.Style.AngledHeaders.push_back(Located("foo.h")); + Frag.Style.AngledHeaders.push_back(Located(".*inc")); + EXPECT_TRUE(compileAndApply()); + auto HeaderFilter = [this](llvm::StringRef Path) { + for (auto &Filter : Conf.Style.AngledHeaders) { + if (Filter(Path)) + return true; + } + return false; + }; + EXPECT_TRUE(HeaderFilter("foo.h")); + EXPECT_FALSE(HeaderFilter("bar.h")); + } } } // namespace } // namespace config diff --git a/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp b/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp index 10d67dead342c..979d725461fd0 100644 --- a/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp +++ b/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp @@ -297,13 +297,19 @@ TEST(ParseYAML, Style) { CapturedDiags Diags; Annotations YAML(R"yaml( Style: - FullyQualifiedNamespaces: [foo, bar])yaml"); + FullyQualifiedNamespaces: [foo, bar] + AngledHeaders: ["foo", "bar"] + QuotedHeaders: ["baz", "baar"])yaml"); auto Results = Fragment::parseYAML(YAML.code(), "config.yaml", Diags.callback()); ASSERT_THAT(Diags.Diagnostics, IsEmpty()); ASSERT_EQ(Results.size(), 1u); EXPECT_THAT(Results[0].Style.FullyQualifiedNamespaces, ElementsAre(val("foo"), val("bar"))); + EXPECT_THAT(Results[0].Style.AngledHeaders, + ElementsAre(val("foo"), val("bar"))); + EXPECT_THAT(Results[0].Style.QuotedHeaders, + ElementsAre(val("baz"), val("baar"))); } } // namespace } // namespace config diff --git a/clang-tools-extra/clangd/unittests/HeadersTests.cpp b/clang-tools-extra/clangd/unittests/HeadersTests.cpp index dc6adaee11257..751383e3b4650 100644 --- a/clang-tools-extra/clangd/unittests/HeadersTests.cpp +++ b/clang-tools-extra/clangd/unittests/HeadersTests.cpp @@ -107,7 +107,8 @@ class HeadersTest : public ::testing::Test { IncludeInserter Inserter(MainFile, /*Code=*/"", format::getLLVMStyle(), CDB.getCompileCommand(MainFile)->Directory, - &Clang->getPreprocessor().getHeaderSearchInfo()); + &Clang->getPreprocessor().getHeaderSearchInfo(), + QuotedHeaders, AngledHeaders); for (const auto &Inc : Inclusions) Inserter.addExisting(Inc); auto Inserted = ToHeaderFile(Preferred); @@ -127,7 +128,8 @@ class HeadersTest : public ::testing::Test { IncludeInserter Inserter(MainFile, /*Code=*/"", format::getLLVMStyle(), CDB.getCompileCommand(MainFile)->Directory, - &Clang->getPreprocessor().getHeaderSearchInfo()); + &Clang->getPreprocessor().getHeaderSearchInfo(), + QuotedHeaders, AngledHeaders); auto Edit = Inserter.insert(VerbatimHeader, Directive); Action.EndSourceFile(); return Edit; @@ -139,6 +141,8 @@ class HeadersTest : public ::testing::Test { std::string Subdir = testPath("sub"); std::string SearchDirArg = (llvm::Twine("-I") + Subdir).str(); IgnoringDiagConsumer IgnoreDiags; + std::vector> QuotedHeaders; + std::vector> AngledHeaders; std::unique_ptr Clang; }; @@ -304,6 +308,9 @@ TEST_F(HeadersTest, InsertInclude) { std::string Path = testPath("sub/bar.h"); FS.Files[Path] = ""; EXPECT_EQ(calculate(Path), "\"bar.h\""); + + AngledHeaders.push_back([](auto Path) { return true; }); + EXPECT_EQ(calculate(Path), ""); } TEST_F(HeadersTest, DoNotInsertIfInSameFile) { @@ -326,6 +333,17 @@ TEST_F(HeadersTest, ShortenIncludesInSearchPath) { EXPECT_EQ(calculate(BarHeader), "\"sub/bar.h\""); } +TEST_F(HeadersTest, ShortenIncludesInSearchPathBracketed) { + AngledHeaders.push_back([](auto Path) { return true; }); + std::string BarHeader = testPath("sub/bar.h"); + EXPECT_EQ(calculate(BarHeader), ""); + + SearchDirArg = (llvm::Twine("-I") + Subdir + "/..").str(); + CDB.ExtraClangFlags = {SearchDirArg.c_str()}; + BarHeader = testPath("sub/bar.h"); + EXPECT_EQ(calculate(BarHeader), ""); +} + TEST_F(HeadersTest, ShortenedIncludeNotInSearchPath) { std::string BarHeader = llvm::sys::path::convert_to_slash(testPath("sub-2/bar.h")); @@ -338,6 +356,10 @@ TEST_F(HeadersTest, PreferredHeader) { std::string BazHeader = testPath("sub/baz.h"); EXPECT_EQ(calculate(BarHeader, BazHeader), "\"baz.h\""); + + AngledHeaders.push_back([](auto Path) { return true; }); + std::string BiffHeader = testPath("sub/biff.h"); + EXPECT_EQ(calculate(BarHeader, BiffHeader), ""); } TEST_F(HeadersTest, DontInsertDuplicatePreferred) { @@ -370,7 +392,8 @@ TEST_F(HeadersTest, PreferInserted) { TEST(Headers, NoHeaderSearchInfo) { std::string MainFile = testPath("main.cpp"); IncludeInserter Inserter(MainFile, /*Code=*/"", format::getLLVMStyle(), - /*BuildDir=*/"", /*HeaderSearchInfo=*/nullptr); + /*BuildDir=*/"", /*HeaderSearchInfo=*/nullptr, + /*QuotedHeaders=*/{}, /*AngledHeaders=*/{}); auto HeaderPath = testPath("sub/bar.h"); auto Inserting = HeaderFile{HeaderPath, /*Verbatim=*/false}; diff --git a/clang-tools-extra/clangd/unittests/Matchers.h b/clang-tools-extra/clangd/unittests/Matchers.h index 0fbd93b2e6882..17d18dd9b85b6 100644 --- a/clang-tools-extra/clangd/unittests/Matchers.h +++ b/clang-tools-extra/clangd/unittests/Matchers.h @@ -127,74 +127,6 @@ PolySubsequenceMatcher HasSubsequence(Args &&... M) { llvm::consumeError(ComputedValue.takeError()); \ } while (false) -// Implements the HasValue(m) matcher for matching an Optional whose -// value matches matcher m. -template class OptionalMatcher { -public: - explicit OptionalMatcher(const InnerMatcher &matcher) : matcher_(matcher) {} - OptionalMatcher(const OptionalMatcher&) = default; - OptionalMatcher &operator=(const OptionalMatcher&) = delete; - - // This type conversion operator template allows Optional(m) to be - // used as a matcher for any Optional type whose value type is - // compatible with the inner matcher. - // - // The reason we do this instead of relying on - // MakePolymorphicMatcher() is that the latter is not flexible - // enough for implementing the DescribeTo() method of Optional(). - template operator Matcher() const { - return MakeMatcher(new Impl(matcher_)); - } - -private: - // The monomorphic implementation that works for a particular optional type. - template - class Impl : public ::testing::MatcherInterface { - public: - using Value = typename std::remove_const< - typename std::remove_reference::type>::type::value_type; - - explicit Impl(const InnerMatcher &matcher) - : matcher_(::testing::MatcherCast(matcher)) {} - - Impl(const Impl&) = default; - Impl &operator=(const Impl&) = delete; - - virtual void DescribeTo(::std::ostream *os) const { - *os << "has a value that "; - matcher_.DescribeTo(os); - } - - virtual void DescribeNegationTo(::std::ostream *os) const { - *os << "does not have a value that "; - matcher_.DescribeTo(os); - } - - virtual bool - MatchAndExplain(Optional optional, - ::testing::MatchResultListener *listener) const { - if (!optional) - return false; - - *listener << "which has a value "; - return MatchPrintAndExplain(*optional, matcher_, listener); - } - - private: - const Matcher matcher_; - }; - - const InnerMatcher matcher_; -}; - -// Creates a matcher that matches an Optional that has a value -// that matches inner_matcher. -template -inline OptionalMatcher -HasValue(const InnerMatcher &inner_matcher) { - return OptionalMatcher(inner_matcher); -} - } // namespace clangd } // namespace clang #endif diff --git a/clang-tools-extra/clangd/unittests/TypeHierarchyTests.cpp b/clang-tools-extra/clangd/unittests/TypeHierarchyTests.cpp index 15158d8a45ca8..406a842f5a008 100644 --- a/clang-tools-extra/clangd/unittests/TypeHierarchyTests.cpp +++ b/clang-tools-extra/clangd/unittests/TypeHierarchyTests.cpp @@ -28,6 +28,7 @@ using ::testing::ElementsAre; using ::testing::Field; using ::testing::IsEmpty; using ::testing::Matcher; +using ::testing::Optional; using ::testing::SizeIs; using ::testing::UnorderedElementsAre; @@ -38,12 +39,12 @@ MATCHER_P(selectionRangeIs, R, "") { return arg.selectionRange == R; } template ::testing::Matcher parents(ParentMatchers... ParentsM) { return Field(&TypeHierarchyItem::parents, - HasValue(UnorderedElementsAre(ParentsM...))); + Optional(UnorderedElementsAre(ParentsM...))); } template ::testing::Matcher children(ChildMatchers... ChildrenM) { return Field(&TypeHierarchyItem::children, - HasValue(UnorderedElementsAre(ChildrenM...))); + Optional(UnorderedElementsAre(ChildrenM...))); } // Note: "not resolved" is different from "resolved but empty"! MATCHER(parentsNotResolved, "") { return !arg.parents; } @@ -790,7 +791,7 @@ struct Child : Parent1, Parent2 {}; Children, UnorderedElementsAre( AllOf(withName("Child"), - withResolveParents(HasValue(UnorderedElementsAre(withResolveID( + withResolveParents(Optional(UnorderedElementsAre(withResolveID( getSymbolID(&findDecl(AST, "Parent1")).str()))))))); } @@ -810,9 +811,9 @@ struct Chil^d : Parent {}; ASSERT_THAT(Result, SizeIs(1)); auto Parents = superTypes(Result.front(), Index.get()); - EXPECT_THAT(Parents, HasValue(UnorderedElementsAre( + EXPECT_THAT(Parents, Optional(UnorderedElementsAre( AllOf(withName("Parent"), - withResolveParents(HasValue(IsEmpty())))))); + withResolveParents(Optional(IsEmpty())))))); } } // namespace } // namespace clangd diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 3fd7a4f9da18a..1fd9b6077be5f 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -115,9 +115,12 @@ Improvements to clang-tidy - Improved :program:`run-clang-tidy.py` script. Fixed minor shutdown noise happening on certain platforms when interrupting the script. +- Improved :program:`clang-tidy` by accepting parameters file in command line. + - Removed :program:`clang-tidy`'s global options for most of checks. All options are changed to local options except `IncludeStyle`, `StrictMode` and - `IgnoreMacros`. + `IgnoreMacros`. Global scoped `StrictMode` and `IgnoreMacros` are deprecated + and will be removed in further releases. .. csv-table:: :header: "Check", "Options removed from global option" @@ -317,6 +320,9 @@ Changes in existing checks member function calls too and to only expand macros starting with ``PRI`` and ``__PRI`` from ```` in the format string. +- Improved :doc:`modernize-use-using + ` check by not expanding macros. + - Improved :doc:`performance-avoid-endl ` check to use ``std::endl`` as placeholder when lexer cannot get source text. @@ -356,6 +362,13 @@ Removed checks Miscellaneous ^^^^^^^^^^^^^ +- The :doc:`bugprone-narrowing-conversions ` + check is no longer an alias of :doc:`cppcoreguidelines-narrowing-conversions + `. Instead, + :doc:`cppcoreguidelines-narrowing-conversions + ` is now an alias + of :doc:`bugprone-narrowing-conversions `. + Improvements to include-fixer ----------------------------- diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/narrowing-conversions.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/narrowing-conversions.rst index f4bb40b341bcd..1a1217ed5a21c 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/narrowing-conversions.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/narrowing-conversions.rst @@ -1,10 +1,126 @@ .. title:: clang-tidy - bugprone-narrowing-conversions -.. meta:: - :http-equiv=refresh: 5;URL=../cppcoreguidelines/narrowing-conversions.html bugprone-narrowing-conversions ============================== -The bugprone-narrowing-conversions check is an alias, please see -:doc:`cppcoreguidelines-narrowing-conversions <../cppcoreguidelines/narrowing-conversions>` -for more information. +`cppcoreguidelines-narrowing-conversions` redirects here as an alias for this check. + +Checks for silent narrowing conversions, e.g: ``int i = 0; i += 0.1;``. While +the issue is obvious in this former example, it might not be so in the +following: ``void MyClass::f(double d) { int_member_ += d; }``. + +We flag narrowing conversions from: + - an integer to a narrower integer (e.g. ``char`` to ``unsigned char``) + if WarnOnIntegerNarrowingConversion Option is set, + - an integer to a narrower floating-point (e.g. ``uint64_t`` to ``float``) + if WarnOnIntegerToFloatingPointNarrowingConversion Option is set, + - a floating-point to an integer (e.g. ``double`` to ``int``), + - a floating-point to a narrower floating-point (e.g. ``double`` to ``float``) + if WarnOnFloatingPointNarrowingConversion Option is set. + +This check will flag: + - All narrowing conversions that are not marked by an explicit cast (c-style or + ``static_cast``). For example: ``int i = 0; i += 0.1;``, + ``void f(int); f(0.1);``, + - All applications of binary operators with a narrowing conversions. + For example: ``int i; i+= 0.1;``. + +Arithmetic with smaller integer types than ``int`` trigger implicit conversions, +as explained under `"Integral Promotion" on cppreference.com +`_. +This check diagnoses more instances of narrowing than the compiler warning +`-Wconversion` does. The example below demonstrates this behavior. + +.. code-block:: c++ + + // The following function definition demonstrates usage of arithmetic with + // integer types smaller than `int` and how the narrowing conversion happens + // implicitly. + void computation(short argument1, short argument2) { + // Arithmetic written by humans: + short result = argument1 + argument2; + // Arithmetic actually performed by C++: + short result = static_cast(static_cast(argument1) + static_cast(argument2)); + } + + void recommended_resolution(short argument1, short argument2) { + short result = argument1 + argument2; + // ^ warning: narrowing conversion from 'int' to signed type 'short' is implementation-defined + + // The cppcoreguidelines recommend to resolve this issue by using the GSL + // in one of two ways. Either by a cast that throws if a loss of precision + // would occur. + short result = gsl::narrow(argument1 + argument2); + // Or it can be resolved without checking the result risking invalid results. + short result = gsl::narrow_cast(argument1 + argument2); + + // A classical `static_cast` will silence the warning as well if the GSL + // is not available. + short result = static_cast(argument1 + argument2); + } + +Options +------- + +.. option:: WarnOnIntegerNarrowingConversion + + When `true`, the check will warn on narrowing integer conversion + (e.g. ``int`` to ``size_t``). `true` by default. + +.. option:: WarnOnIntegerToFloatingPointNarrowingConversion + + When `true`, the check will warn on narrowing integer to floating-point + conversion (e.g. ``size_t`` to ``double``). `true` by default. + +.. option:: WarnOnFloatingPointNarrowingConversion + + When `true`, the check will warn on narrowing floating point conversion + (e.g. ``double`` to ``float``). `true` by default. + +.. option:: WarnWithinTemplateInstantiation + + When `true`, the check will warn on narrowing conversions within template + instantiations. `false` by default. + +.. option:: WarnOnEquivalentBitWidth + + When `true`, the check will warn on narrowing conversions that arise from + casting between types of equivalent bit width. (e.g. + `int n = uint(0);` or `long long n = double(0);`) `true` by default. + +.. option:: IgnoreConversionFromTypes + + Narrowing conversions from any type in this semicolon-separated list will be + ignored. This may be useful to weed out commonly occurring, but less commonly + problematic assignments such as `int n = std::vector().size();` or + `int n = std::difference(it1, it2);`. The default list is empty, but one + suggested list for a legacy codebase would be + `size_t;ptrdiff_t;size_type;difference_type`. + +.. option:: PedanticMode + + When `true`, the check will warn on assigning a floating point constant + to an integer value even if the floating point value is exactly + representable in the destination type (e.g. ``int i = 1.0;``). + `false` by default. + +FAQ +--- + + - What does "narrowing conversion from 'int' to 'float'" mean? + +An IEEE754 Floating Point number can represent all integer values in the range +[-2^PrecisionBits, 2^PrecisionBits] where PrecisionBits is the number of bits in +the mantissa. + +For ``float`` this would be [-2^23, 2^23], where ``int`` can represent values in +the range [-2^31, 2^31-1]. + + - What does "implementation-defined" mean? + +You may have encountered messages like "narrowing conversion from 'unsigned int' +to signed type 'int' is implementation-defined". +The C/C++ standard does not mandate two's complement for signed integers, and so +the compiler is free to define what the semantics are for converting an unsigned +integer to signed integer. Clang's implementation uses the two's complement +format. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/unhandled-self-assignment.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/unhandled-self-assignment.rst index dee139861c8cf..d3cdd5a12fdca 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/unhandled-self-assignment.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/unhandled-self-assignment.rst @@ -120,5 +120,7 @@ temporary object into ``this`` (needs a move assignment operator): .. option:: WarnOnlyIfThisHasSuspiciousField - When `true`, the check will warn only if the container class of the copy assignment operator - has any suspicious fields (pointer or C array). This option is set to `true` by default. + When `true`, the check will warn only if the container class of the copy + assignment operator has any suspicious fields (pointer, C array and C++ smart + pointer). + This option is set to `true` by default. diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/narrowing-conversions.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/narrowing-conversions.rst index 7cc0b2809b458..ea24e870d32d4 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/narrowing-conversions.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/narrowing-conversions.rst @@ -1,129 +1,14 @@ .. title:: clang-tidy - cppcoreguidelines-narrowing-conversions +.. meta:: + :http-equiv=refresh: 5;URL=../bugprone/narrowing-conversions.html cppcoreguidelines-narrowing-conversions ======================================= -Checks for silent narrowing conversions, e.g: ``int i = 0; i += 0.1;``. While -the issue is obvious in this former example, it might not be so in the -following: ``void MyClass::f(double d) { int_member_ += d; }``. - -This check implements `ES.46 +This check implements part of `ES.46 `_ from the C++ Core Guidelines. -We enforce only part of the guideline, more specifically, we flag narrowing conversions from: - - an integer to a narrower integer (e.g. ``char`` to ``unsigned char``) - if WarnOnIntegerNarrowingConversion Option is set, - - an integer to a narrower floating-point (e.g. ``uint64_t`` to ``float``) - if WarnOnIntegerToFloatingPointNarrowingConversion Option is set, - - a floating-point to an integer (e.g. ``double`` to ``int``), - - a floating-point to a narrower floating-point (e.g. ``double`` to ``float``) - if WarnOnFloatingPointNarrowingConversion Option is set. - -This check will flag: - - All narrowing conversions that are not marked by an explicit cast (c-style or - ``static_cast``). For example: ``int i = 0; i += 0.1;``, - ``void f(int); f(0.1);``, - - All applications of binary operators with a narrowing conversions. - For example: ``int i; i+= 0.1;``. - -Arithmetic with smaller integer types than ``int`` trigger implicit conversions, -as explained under `"Integral Promotion" on cppreference.com -`_. -This check diagnoses more instances of narrowing than the compiler warning -`-Wconversion` does. The example below demonstrates this behavior. - -.. code-block:: c++ - - // The following function definition demonstrates usage of arithmetic with - // integer types smaller than `int` and how the narrowing conversion happens - // implicitly. - void computation(short argument1, short argument2) { - // Arithmetic written by humans: - short result = argument1 + argument2; - // Arithmetic actually performed by C++: - short result = static_cast(static_cast(argument1) + static_cast(argument2)); - } - - void recommended_resolution(short argument1, short argument2) { - short result = argument1 + argument2; - // ^ warning: narrowing conversion from 'int' to signed type 'short' is implementation-defined - - // The cppcoreguidelines recommend to resolve this issue by using the GSL - // in one of two ways. Either by a cast that throws if a loss of precision - // would occur. - short result = gsl::narrow(argument1 + argument2); - // Or it can be resolved without checking the result risking invalid results. - short result = gsl::narrow_cast(argument1 + argument2); - - // A classical `static_cast` will silence the warning as well if the GSL - // is not available. - short result = static_cast(argument1 + argument2); - } - - -Options -------- - -.. option:: WarnOnIntegerNarrowingConversion - - When `true`, the check will warn on narrowing integer conversion - (e.g. ``int`` to ``size_t``). `true` by default. - -.. option:: WarnOnIntegerToFloatingPointNarrowingConversion - - When `true`, the check will warn on narrowing integer to floating-point - conversion (e.g. ``size_t`` to ``double``). `true` by default. - -.. option:: WarnOnFloatingPointNarrowingConversion - - When `true`, the check will warn on narrowing floating point conversion - (e.g. ``double`` to ``float``). `true` by default. - -.. option:: WarnWithinTemplateInstantiation - - When `true`, the check will warn on narrowing conversions within template - instantiations. `false` by default. - -.. option:: WarnOnEquivalentBitWidth - - When `true`, the check will warn on narrowing conversions that arise from - casting between types of equivalent bit width. (e.g. - `int n = uint(0);` or `long long n = double(0);`) `true` by default. - -.. option:: IgnoreConversionFromTypes - - Narrowing conversions from any type in this semicolon-separated list will be - ignored. This may be useful to weed out commonly occurring, but less commonly - problematic assignments such as `int n = std::vector().size();` or - `int n = std::difference(it1, it2);`. The default list is empty, but one - suggested list for a legacy codebase would be - `size_t;ptrdiff_t;size_type;difference_type`. - -.. option:: PedanticMode - - When `true`, the check will warn on assigning a floating point constant - to an integer value even if the floating point value is exactly - representable in the destination type (e.g. ``int i = 1.0;``). - `false` by default. - -FAQ ---- - - - What does "narrowing conversion from 'int' to 'float'" mean? - -An IEEE754 Floating Point number can represent all integer values in the range -[-2^PrecisionBits, 2^PrecisionBits] where PrecisionBits is the number of bits in -the mantissa. - -For ``float`` this would be [-2^23, 2^23], where ``int`` can represent values in -the range [-2^31, 2^31-1]. - - - What does "implementation-defined" mean? - -You may have encountered messages like "narrowing conversion from 'unsigned int' -to signed type 'int' is implementation-defined". -The C/C++ standard does not mandate two's complement for signed integers, and so -the compiler is free to define what the semantics are for converting an unsigned -integer to signed integer. Clang's implementation uses the two's complement -format. +The cppcoreguidelines-narrowing-conversions check is an alias, please see +:doc:`bugprone-narrowing-conversions <../bugprone/narrowing-conversions>` +for more information. diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst index 4d8853a0f6d86..e8f9b4e829634 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/list.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst @@ -114,6 +114,7 @@ Clang-Tidy Checks :doc:`bugprone-multi-level-implicit-pointer-conversion `, :doc:`bugprone-multiple-new-in-one-expression `, :doc:`bugprone-multiple-statement-macro `, + :doc:`bugprone-narrowing-conversions `, :doc:`bugprone-no-escape `, :doc:`bugprone-non-zero-enum-to-bool-conversion `, :doc:`bugprone-nondeterministic-pointer-iteration-order `, @@ -190,7 +191,6 @@ Clang-Tidy Checks :doc:`cppcoreguidelines-macro-usage `, :doc:`cppcoreguidelines-misleading-capture-default-by-value `, "Yes" :doc:`cppcoreguidelines-missing-std-forward `, - :doc:`cppcoreguidelines-narrowing-conversions `, :doc:`cppcoreguidelines-no-malloc `, :doc:`cppcoreguidelines-no-suspend-with-lock `, :doc:`cppcoreguidelines-owning-memory `, @@ -411,7 +411,6 @@ Check aliases .. csv-table:: :header: "Name", "Redirect", "Offers fixes" - :doc:`bugprone-narrowing-conversions `, :doc:`cppcoreguidelines-narrowing-conversions `, :doc:`cert-arr39-c `, :doc:`bugprone-sizeof-expression `, :doc:`cert-con36-c `, :doc:`bugprone-spuriously-wake-up-functions `, :doc:`cert-con54-cpp `, :doc:`bugprone-spuriously-wake-up-functions `, @@ -541,6 +540,7 @@ Check aliases :doc:`cppcoreguidelines-c-copy-assignment-signature `, :doc:`misc-unconventional-assign-operator `, :doc:`cppcoreguidelines-explicit-virtual-functions `, :doc:`modernize-use-override `, "Yes" :doc:`cppcoreguidelines-macro-to-enum `, :doc:`modernize-macro-to-enum `, "Yes" + :doc:`cppcoreguidelines-narrowing-conversions `, :doc:`bugprone-narrowing-conversions `, :doc:`cppcoreguidelines-noexcept-destructor `, :doc:`performance-noexcept-destructor `, "Yes" :doc:`cppcoreguidelines-noexcept-move-operations `, :doc:`performance-noexcept-move-constructor `, "Yes" :doc:`cppcoreguidelines-noexcept-swap `, :doc:`performance-noexcept-swap `, "Yes" diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-ranges.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-ranges.rst index 1ce866ca1f66a..912b42b33f919 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-ranges.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-ranges.rst @@ -104,6 +104,9 @@ Calls to the following std library algorithms are checked: ``std::unique``, ``std::upper_bound``. +Note: some range algorithms for ``vector`` require C++23 because it uses +proxy iterators. + Reverse Iteration ----------------- diff --git a/clang-tools-extra/docs/clang-tidy/index.rst b/clang-tools-extra/docs/clang-tidy/index.rst index f053e57e8d4c8..b7a366e874130 100644 --- a/clang-tools-extra/docs/clang-tidy/index.rst +++ b/clang-tools-extra/docs/clang-tidy/index.rst @@ -33,6 +33,14 @@ compilation options on the command line after ``--``: $ clang-tidy test.cpp -- -Imy_project/include -DMY_DEFINES ... +If there are too many options or source files to specify on the command line, +you can store them in a parameter file, and use :program:`clang-tidy` with that +parameters file: + +.. code-block:: console + + $ clang-tidy @parameters_file + :program:`clang-tidy` has its own checks and can also run Clang Static Analyzer checks. Each check has a name and the checks to run can be chosen using the ``-checks=`` option, which specifies a comma-separated list of positive and @@ -264,6 +272,9 @@ An overview of all the command-line options: automatically removed, but the rest of a relative path must be a suffix of a path in the compile command database. + Parameters files: + A large number of options or source files can be passed as parameter files + by use '@parameter-file' in the command line. Configuration files: clang-tidy attempts to read configuration for each source file from a @@ -282,8 +293,8 @@ An overview of all the command-line options: globs can be specified as a list instead of a string. ExcludeHeaderFilterRegex - Same as '--exclude-header-filter'. - ExtraArgs - Same as '--extra-args'. - ExtraArgsBefore - Same as '--extra-args-before'. + ExtraArgs - Same as '--extra-arg'. + ExtraArgsBefore - Same as '--extra-arg-before'. FormatStyle - Same as '--format-style'. HeaderFileExtensions - File extensions to consider to determine if a given diagnostic is located in a header file. diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone/branch-clone-2.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/branch-clone-2.cpp new file mode 100644 index 0000000000000..b91ac6a550c5a --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/branch-clone-2.cpp @@ -0,0 +1,768 @@ +// RUN: %check_clang_tidy %s bugprone-branch-clone %t -- + +/* Only one expected warning per function allowed at the very end. */ + +int func(void) +{ + return 0; +} + +int func2(void) +{ + return 0; +} + +int funcParam(int a) +{ + return 0; +} + +/* '!=' operator*/ + + +/* '!=' with int pointer */ + +int checkNotEqualIntPointerLiteralCompare1(void) { + int* p = 0; + return (p != 0); // no warning +} + +int checkNotEqualIntPointerLiteralCompare2(void) { + return (6 != 7); // no warning +} + +int checkNotEqualIntPointerDeclCompare1(void) { + int k = 3; + int* f = &k; + int* g = &k; + return (f != g); // no warning +} + +int checkNotEqualCastIntPointerDeclCompare11(void) { + int k = 7; + int* f = &k; + return ((int*)f != (int*)f); +} +int checkNotEqualCastIntPointerDeclCompare12(void) { + int k = 7; + int* f = &k; + return ((int*)((char*)f) != (int*)f); // no warning +} +int checkNotEqualBinaryOpIntPointerCompare1(void) { + int k = 7; + int res; + int* f= &k; + res = (f + 4 != f + 4); + return (0); +} +int checkNotEqualBinaryOpIntPointerCompare2(void) { + int k = 7; + int* f = &k; + int* g = &k; + return (f + 4 != g + 4); // no warning +} + + +int checkNotEqualBinaryOpIntPointerCompare3(void) { + int k = 7; + int res; + int* f= &k; + res = ((int*)f + 4 != (int*)f + 4); + return (0); +} +int checkNotEqualBinaryOpIntPointerCompare4(void) { + int k = 7; + int res; + int* f= &k; + res = ((int*)f + 4 != (int*)((char*)f) + 4); // no warning + return (0); +} + +int checkNotEqualNestedBinaryOpIntPointerCompare1(void) { + int res; + int k = 7; + int t= 1; + int* u= &k+2; + int* f= &k+3; + res = ((f + (3)*t) != (f + (3)*t)); + return (0); +} + +int checkNotEqualNestedBinaryOpIntPointerCompare2(void) { + int res; + int k = 7; + int t= 1; + int* u= &k+2; + int* f= &k+3; + res = (((3)*t + f) != (f + (3)*t)); // no warning + return (0); +} +/* end '!=' int* */ + +/* '!=' with function*/ + +int checkNotEqualSameFunction() { + unsigned a = 0; + unsigned b = 1; + int res = (a+func() != a+func()); // no warning + return (0); +} + +int checkNotEqualDifferentFunction() { + unsigned a = 0; + unsigned b = 1; + int res = (a+func() != a+func2()); // no warning + return (0); +} + +int checkNotEqualSameFunctionSameParam() { + unsigned a = 0; + unsigned b = 1; + int res = (a+funcParam(a) != a+funcParam(a)); // no warning + return (0); +} + +int checkNotEqualSameFunctionDifferentParam() { + unsigned a = 0; + unsigned b = 1; + int res = (a+funcParam(a) != a+funcParam(b)); // no warning + return (0); +} + +/* end '!=' with function*/ + +/* end '!=' */ + + +/* Checking use of identical expressions in conditional operator*/ + +unsigned test_unsigned(unsigned a) { + unsigned b = 1; + a = a > 5 ? b : b; +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] + return a; +} + +void test_signed() { + int a = 0; + a = a > 5 ? a : a; +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +void test_bool(bool a) { + a = a > 0 ? a : a; +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +void test_float() { + float a = 0; + float b = 0; + a = a > 5 ? a : a; +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +const char *test_string() { + float a = 0; + return a > 5 ? "abc" : "abc"; +// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +void test_unsigned_expr() { + unsigned a = 0; + unsigned b = 0; + a = a > 5 ? a+b : a+b; +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +void test_signed_expr() { + int a = 0; + int b = 1; + a = a > 5 ? a+b : a+b; +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +void test_bool_expr(bool a) { + bool b = 0; + a = a > 0 ? a&&b : a&&b; +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +void test_unsigned_expr_negative() { + unsigned a = 0; + unsigned b = 0; + a = a > 5 ? a+b : b+a; // no warning +} + +void test_signed_expr_negative() { + int a = 0; + int b = 1; + a = a > 5 ? b+a : a+b; // no warning +} + +void test_bool_expr_negative(bool a) { + bool b = 0; + a = a > 0 ? a&&b : b&&a; // no warning +} + +void test_float_expr_positive() { + float a = 0; + float b = 0; + a = a > 5 ? a+b : a+b; +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +void test_expr_positive_func() { + unsigned a = 0; + unsigned b = 1; + a = a > 5 ? a+func() : a+func(); +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +void test_expr_negative_func() { + unsigned a = 0; + unsigned b = 1; + a = a > 5 ? a+func() : a+func2(); // no warning +} + +void test_expr_positive_funcParam() { + unsigned a = 0; + unsigned b = 1; + a = a > 5 ? a+funcParam(b) : a+funcParam(b); +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +void test_expr_negative_funcParam() { + unsigned a = 0; + unsigned b = 1; + a = a > 5 ? a+funcParam(a) : a+funcParam(b); // no warning +} + +void test_expr_positive_inc() { + unsigned a = 0; + unsigned b = 1; + a = a > 5 ? a++ : a++; +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +void test_expr_negative_inc() { + unsigned a = 0; + unsigned b = 1; + a = a > 5 ? a++ : b++; // no warning +} + +void test_expr_positive_assign() { + unsigned a = 0; + unsigned b = 1; + a = a > 5 ? a=1 : a=1; +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +void test_expr_negative_assign() { + unsigned a = 0; + unsigned b = 1; + a = a > 5 ? a=1 : a=2; // no warning +} + +void test_signed_nested_expr() { + int a = 0; + int b = 1; + int c = 3; + a = a > 5 ? a+b+(c+a)*(a + b*(c+a)) : a+b+(c+a)*(a + b*(c+a)); +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +void test_signed_nested_expr_negative() { + int a = 0; + int b = 1; + int c = 3; + a = a > 5 ? a+b+(c+a)*(a + b*(c+a)) : a+b+(c+a)*(a + b*(a+c)); // no warning +} + +void test_signed_nested_cond_expr_negative() { + int a = 0; + int b = 1; + int c = 3; + a = a > 5 ? (b > 5 ? 1 : 4) : (b > 5 ? 2 : 4); // no warning +} + +void test_signed_nested_cond_expr() { + int a = 0; + int b = 1; + int c = 3; + a = a > 5 ? (b > 5 ? 1 : 4) : (b > 5 ? 4 : 4); +// CHECK-MESSAGES: :[[@LINE-1]]:40: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} + +void test_identical_branches1(bool b) { + int i = 0; + if (b) { +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] + ++i; + } else { +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here + ++i; + } +} + +void test_identical_branches2(bool b) { + int i = 0; + if (b) { +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] + ++i; + } else +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here + ++i; +} + +void test_identical_branches3(bool b) { + int i = 0; + if (b) { // no warning + ++i; + } else { + i++; + } +} + +void test_identical_branches4(bool b) { + int i = 0; + if (b) { +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] + } else { +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here + } +} + +void test_identical_branches_break(bool b) { + while (true) { + if (b) +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: if with identical then and else branches [bugprone-branch-clone] + break; + else +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here + break; + } +} + +void test_identical_branches_continue(bool b) { + while (true) { + if (b) +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: if with identical then and else branches [bugprone-branch-clone] + continue; + else +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here + continue; + } +} + +void test_identical_branches_func(bool b) { + if (b) +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] + func(); + else +// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here + func(); +} + +void test_identical_branches_func_arguments(bool b) { + if (b) // no-warning + funcParam(1); + else + funcParam(2); +} + +void test_identical_branches_cast1(bool b) { + long v = -7; + if (b) // no-warning + v = (signed int) v; + else + v = (unsigned int) v; +} + +void test_identical_branches_cast2(bool b) { + long v = -7; + if (b) +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] + v = (signed int) v; + else +// CHECK-MESSAGES: :[[@LINE-1]]:3: note: else branch starts here + v = (signed int) v; +} + +int test_identical_branches_return_int(bool b) { + int i = 0; + if (b) { +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] + i++; + return i; + } else { +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here + i++; + return i; + } +} + +int test_identical_branches_return_func(bool b) { + if (b) { +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] + return func(); + } else { +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here + return func(); + } +} + +void test_identical_branches_for(bool b) { + int i; + int j; + if (b) { +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] + for (i = 0, j = 0; i < 10; i++) + j += 4; + } else { +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here + for (i = 0, j = 0; i < 10; i++) + j += 4; + } +} + +void test_identical_branches_while(bool b) { + int i = 10; + if (b) { +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] + while (func()) + i--; + } else { +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here + while (func()) + i--; + } +} + +void test_identical_branches_while_2(bool b) { + int i = 10; + if (b) { // no-warning + while (func()) + i--; + } else { + while (func()) + i++; + } +} + +void test_identical_branches_do_while(bool b) { + int i = 10; + if (b) { +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] + do { + i--; + } while (func()); + } else { +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here + do { + i--; + } while (func()); + } +} + +void test_identical_branches_if(bool b, int i) { + if (b) { +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] + if (i < 5) + i += 10; + } else { +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: else branch starts here + if (i < 5) + i += 10; + } +} + +void test_identical_bitwise1() { + int a = 5 | 5; // no-warning +} + +void test_identical_bitwise2() { + int a = 5; + int b = a | a; // no-warning +} + +void test_identical_bitwise3() { + int a = 5; + int b = (a | a); // no-warning +} + +void test_identical_bitwise4() { + int a = 4; + int b = a | 4; // no-warning +} + +void test_identical_bitwise5() { + int a = 4; + int b = 4; + int c = a | b; // no-warning +} + +void test_identical_bitwise6() { + int a = 5; + int b = a | 4 | a; +} + +void test_identical_bitwise7() { + int a = 5; + int b = func() | func(); +} + +void test_identical_logical1(int a) { + if (a == 4 && a == 4) + ; +} + +void test_identical_logical2(int a) { + if (a == 4 || a == 5 || a == 4) + ; +} + +void test_identical_logical3(int a) { + if (a == 4 || a == 5 || a == 6) // no-warning + ; +} + +void test_identical_logical4(int a) { + if (a == func() || a == func()) // no-warning + ; +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wlogical-op-parentheses" +void test_identical_logical5(int x, int y) { + if (x == 4 && y == 5 || x == 4 && y == 6) // no-warning + ; +} + +void test_identical_logical6(int x, int y) { + if (x == 4 && y == 5 || x == 4 && y == 5) + ; +} + +void test_identical_logical7(int x, int y) { + // FIXME: We should warn here + if (x == 4 && y == 5 || x == 4) + ; +} + +void test_identical_logical8(int x, int y) { + // FIXME: We should warn here + if (x == 4 || y == 5 && x == 4) + ; +} + +void test_identical_logical9(int x, int y) { + // FIXME: We should warn here + if (x == 4 || x == 4 && y == 5) + ; +} +#pragma clang diagnostic pop + +void test_warn_chained_if_stmts_1(int x) { + if (x == 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] +// CHECK-MESSAGES: :[[@LINE-2]]:6: note: end of the original + else if (x == 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 1 starts here +} + +void test_warn_chained_if_stmts_2(int x) { + if (x == 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] +// CHECK-MESSAGES: :[[@LINE-2]]:6: note: end of the original + else if (x == 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 1 starts here + else if (x == 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 2 starts here +} + +void test_warn_chained_if_stmts_3(int x) { + if (x == 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] +// CHECK-MESSAGES: :[[@LINE-2]]:6: note: end of the original + else if (x == 2) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 1 starts here + else if (x == 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 2 starts here +} + +void test_warn_chained_if_stmts_4(int x) { + if (x == 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] +// CHECK-MESSAGES: :[[@LINE-2]]:6: note: end of the original + else if (func()) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 1 starts here + else if (x == 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 2 starts here +} + +void test_warn_chained_if_stmts_5(int x) { + if (x & 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] +// CHECK-MESSAGES: :[[@LINE-2]]:6: note: end of the original + else if (x & 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 1 starts here +} + +void test_warn_chained_if_stmts_6(int x) { + if (x == 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] +// CHECK-MESSAGES: :[[@LINE-2]]:6: note: end of the original + else if (x == 2) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 1 starts here + else if (x == 2) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 2 starts here + else if (x == 3) + ; +} + +void test_warn_chained_if_stmts_7(int x) { + if (x == 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] +// CHECK-MESSAGES: :[[@LINE-2]]:6: note: end of the original + else if (x == 2) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 1 starts here + else if (x == 3) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 2 starts here + else if (x == 2) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 3 starts here + else if (x == 5) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 4 starts here +} + +void test_warn_chained_if_stmts_8(int x) { + if (x == 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] +// CHECK-MESSAGES: :[[@LINE-2]]:6: note: end of the original + else if (x == 2) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 1 starts here + else if (x == 3) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 2 starts here + else if (x == 2) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 3 starts here + else if (x == 5) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 4 starts here + else if (x == 3) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 5 starts here + else if (x == 7) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 6 starts here +} + +void test_nowarn_chained_if_stmts_1(int x) { + if (func()) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] +// CHECK-MESSAGES: :[[@LINE-2]]:6: note: end of the original + else if (func()) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 1 starts here +} + +void test_nowarn_chained_if_stmts_2(int x) { + if (func()) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] +// CHECK-MESSAGES: :[[@LINE-2]]:6: note: end of the original + else if (x == 1) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 1 starts here + else if (func()) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 2 starts here +} + +void test_nowarn_chained_if_stmts_3(int x) { + if (x++) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] +// CHECK-MESSAGES: :[[@LINE-2]]:6: note: end of the original + else if (x++) + ; +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: clone 1 starts here +} + +void test_warn_wchar() { + const wchar_t * a = 0 ? L"Warning" : L"Warning"; +// CHECK-MESSAGES: :[[@LINE-1]]:25: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] +} +void test_nowarn_wchar() { + const wchar_t * a = 0 ? L"No" : L"Warning"; +} + +void test_nowarn_long() { + int a = 0, b = 0; + long c; + if (0) { + b -= a; + c = 0; + } else { + b -= a; + c = 0LL; + } +} + +// Identical inner conditions + +void test_warn_inner_if_1(int x) { + if (x == 1) { +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: if with identical inner if statement [bugprone-branch-clone] + if (x == 1) +// CHECK-MESSAGES: :[[@LINE-1]]:5: note: inner if starts here + ; + } + + // FIXME: Should warn here. The warning is currently not emitted because there + // is code between the conditions. + if (x == 1) { + int y = x; + if (x == 1) + ; + } +} + +void test_nowarn_inner_if_1(int x) { + // Don't warn when condition has side effects. + if (x++ == 1) { + if (x++ == 1) + ; + } + + // Don't warn when x is changed before inner condition. + if (x < 10) { + x++; + if (x < 10) + ; + } +} diff --git a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-bitfields.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-bitfields.cpp similarity index 97% rename from clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-bitfields.cpp rename to clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-bitfields.cpp index 36fde38202efc..a7bb3c8d0c0c7 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-bitfields.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-bitfields.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-narrowing-conversions %t \ +// RUN: %check_clang_tidy %s bugprone-narrowing-conversions %t \ // RUN: -std=c++17 -- -target x86_64-unknown-linux #define CHAR_BITS 8 @@ -31,7 +31,7 @@ struct CompleteBitfield { }; int example_warning(unsigned x) { - // CHECK-MESSAGES: :[[@LINE+1]]:10: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE+1]]:10: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] return x; } diff --git a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-equivalentbitwidth-option.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-equivalentbitwidth-option.cpp similarity index 66% rename from clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-equivalentbitwidth-option.cpp rename to clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-equivalentbitwidth-option.cpp index fb5c7e36eeb0d..0deb006711367 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-equivalentbitwidth-option.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-equivalentbitwidth-option.cpp @@ -1,35 +1,35 @@ // RUN: %check_clang_tidy -check-suffix=DEFAULT %s \ -// RUN: cppcoreguidelines-narrowing-conversions %t -- +// RUN: bugprone-narrowing-conversions %t -- // RUN: %check_clang_tidy -check-suffix=DISABLED %s \ -// RUN: cppcoreguidelines-narrowing-conversions %t -- \ +// RUN: bugprone-narrowing-conversions %t -- \ // RUN: -config='{CheckOptions: { \ -// RUN: cppcoreguidelines-narrowing-conversions.WarnOnEquivalentBitWidth: 0}}' +// RUN: bugprone-narrowing-conversions.WarnOnEquivalentBitWidth: 0}}' void narrowing_equivalent_bitwidth() { int i; unsigned int ui; i = ui; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] // DISABLED: Warning disabled with WarnOnEquivalentBitWidth=0. float f; i = f; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to 'int' [bugprone-narrowing-conversions] // DISABLED: Warning disabled with WarnOnEquivalentBitWidth=0. f = i; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'int' to 'float' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'int' to 'float' [bugprone-narrowing-conversions] // DISABLED: Warning disabled with WarnOnEquivalentBitWidth=0. long long ll; double d; ll = d; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: narrowing conversion from 'double' to 'long long' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: narrowing conversion from 'double' to 'long long' [bugprone-narrowing-conversions] // DISABLED: Warning disabled with WarnOnEquivalentBitWidth=0. d = ll; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to 'double' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to 'double' [bugprone-narrowing-conversions] // DISABLED: Warning disabled with WarnOnEquivalentBitWidth=0. } @@ -37,6 +37,6 @@ void most_narrowing_is_not_ok() { int i; long long ui; i = ui; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] - // CHECK-MESSAGES-DISABLED: :[[@LINE-2]]:7: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] + // CHECK-MESSAGES-DISABLED: :[[@LINE-2]]:7: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] } diff --git a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-ignoreconversionfromtypes-option.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-ignoreconversionfromtypes-option.cpp similarity index 75% rename from clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-ignoreconversionfromtypes-option.cpp rename to clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-ignoreconversionfromtypes-option.cpp index 91e908f535a0d..6d93f5d642b5e 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-ignoreconversionfromtypes-option.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-ignoreconversionfromtypes-option.cpp @@ -1,10 +1,10 @@ // RUN: %check_clang_tidy -check-suffix=DEFAULT %s \ -// RUN: cppcoreguidelines-narrowing-conversions %t -- +// RUN: bugprone-narrowing-conversions %t -- // RUN: %check_clang_tidy -check-suffix=IGNORED %s \ -// RUN: cppcoreguidelines-narrowing-conversions %t -- \ +// RUN: bugprone-narrowing-conversions %t -- \ // RUN: -config='{CheckOptions: { \ -// RUN: cppcoreguidelines-narrowing-conversions.IgnoreConversionFromTypes: "global_size_t;nested_size_type;long" \ +// RUN: bugprone-narrowing-conversions.IgnoreConversionFromTypes: "global_size_t;nested_size_type;long" \ // RUN: }}' // We use global_size_t instead of 'size_t' because windows predefines size_t. @@ -20,7 +20,7 @@ void narrowing_global_size_t() { int i; global_size_t j; i = j; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'global_size_t' (aka 'long long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'global_size_t' (aka 'long long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] // IGNORED: Warning is disabled with IgnoreConversionFromTypes=global_size_t. } @@ -28,7 +28,7 @@ void narrowing_size_type() { int i; vector::nested_size_type j; i = j; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'vector::nested_size_type' (aka 'long long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'vector::nested_size_type' (aka 'long long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] // IGNORED: Warning is disabled with IgnoreConversionFromTypes=nested_size_type. } @@ -36,11 +36,11 @@ void narrowing_size_method() { vector v; int i, j; i = v.size(); - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'global_size_t' (aka 'long long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'global_size_t' (aka 'long long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] // IGNORED: Warning is disabled with IgnoreConversionFromTypes=global_size_t. i = j + v.size(); - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'global_size_t' (aka 'long long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'global_size_t' (aka 'long long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] // IGNORED: Warning is disabled with IgnoreConversionFromTypes=global_size_t. } @@ -49,7 +49,7 @@ void narrowing_size_method_binary_expr() { int j; vector v; i = j + v.size(); - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'global_size_t' (aka 'long long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'global_size_t' (aka 'long long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] // IGNORED: Warning is disabled with IgnoreConversionFromTypes=global_size_t. } @@ -57,11 +57,11 @@ void narrowing_size_method_binary_op() { int i, j; vector v; i += v.size(); - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: narrowing conversion from 'global_size_t' (aka 'long long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: narrowing conversion from 'global_size_t' (aka 'long long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] // IGNORED: Warning is disabled with IgnoreConversionFromTypes=global_size_t. i += j + v.size(); - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: narrowing conversion from 'global_size_t' (aka 'long long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: narrowing conversion from 'global_size_t' (aka 'long long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] // IGNORED: Warning is disabled with IgnoreConversionFromTypes=global_size_t. } @@ -69,13 +69,13 @@ void most_narrowing_is_not_ok() { int i; long long j; i = j; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] - // CHECK-MESSAGES-IGNORED: :[[@LINE-2]]:7: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] + // CHECK-MESSAGES-IGNORED: :[[@LINE-2]]:7: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] } void test_ignore_builtin_type_pr58809() { long x = 123; short y = x; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:13: warning: narrowing conversion from 'long' to signed type 'short' is implementation-defined [cppcoreguidelines-narrowing-conversions] - // CHECK-MESSAGES-NOT-IGNORED: :[[@LINE-2]]:13: warning: narrowing conversion from 'long' to signed type 'short' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:13: warning: narrowing conversion from 'long' to signed type 'short' is implementation-defined [bugprone-narrowing-conversions] + // CHECK-MESSAGES-NOT-IGNORED: :[[@LINE-2]]:13: warning: narrowing conversion from 'long' to signed type 'short' is implementation-defined [bugprone-narrowing-conversions] } diff --git a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-intemplates-option.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-intemplates-option.cpp similarity index 73% rename from clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-intemplates-option.cpp rename to clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-intemplates-option.cpp index cb19ed78cce8a..625dc45abcbec 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-intemplates-option.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-intemplates-option.cpp @@ -1,10 +1,10 @@ // RUN: %check_clang_tidy -check-suffix=DEFAULT %s \ -// RUN: cppcoreguidelines-narrowing-conversions %t -- +// RUN: bugprone-narrowing-conversions %t -- // RUN: %check_clang_tidy -check-suffix=WARN %s \ -// RUN: cppcoreguidelines-narrowing-conversions %t -- \ +// RUN: bugprone-narrowing-conversions %t -- \ // RUN: -config='{CheckOptions: { \ -// RUN: cppcoreguidelines-narrowing-conversions.WarnWithinTemplateInstantiation: 1 \ +// RUN: bugprone-narrowing-conversions.WarnWithinTemplateInstantiation: 1 \ // RUN: }}' template @@ -12,7 +12,7 @@ void assign_in_template(OrigType jj) { int ii; ii = jj; // DEFAULT: Warning disabled because WarnWithinTemplateInstantiation=0. - // CHECK-MESSAGES-WARN: :[[@LINE-2]]:8: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-WARN: :[[@LINE-2]]:8: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] } void narrow_inside_template_not_ok() { @@ -23,8 +23,8 @@ void narrow_inside_template_not_ok() { void assign_outside_template(long long jj) { int ii; ii = jj; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] - // CHECK-MESSAGES-WARN: :[[@LINE-2]]:8: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] + // CHECK-MESSAGES-WARN: :[[@LINE-2]]:8: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] } void narrow_outside_template_not_ok() { diff --git a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-long-is-32bits.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-long-is-32bits.cpp similarity index 84% rename from clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-long-is-32bits.cpp rename to clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-long-is-32bits.cpp index dcf1848a30f66..8e801a0eeea37 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-long-is-32bits.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-long-is-32bits.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-narrowing-conversions %t \ +// RUN: %check_clang_tidy %s bugprone-narrowing-conversions %t \ // RUN: -- -- -target x86_64-unknown-linux -m32 static_assert(sizeof(int) * 8 == 32, "int is 32-bits"); @@ -16,8 +16,8 @@ void narrow_integer_to_signed_integer_is_not_ok() { i = l; // int and long are the same type. i = ll; // int64_t does not fit in an int32_t - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] ll = ul; // uint32_t fits into int64_t ll = ull; // uint64_t does not fit in an int64_t - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned long long' to signed type 'long long' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned long long' to signed type 'long long' is implementation-defined [bugprone-narrowing-conversions] } diff --git a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-narrowingfloatingpoint-option.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-narrowingfloatingpoint-option.cpp similarity index 70% rename from clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-narrowingfloatingpoint-option.cpp rename to clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-narrowingfloatingpoint-option.cpp index 6cad3204c18e4..9ded2f0923f4e 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-narrowingfloatingpoint-option.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-narrowingfloatingpoint-option.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-narrowing-conversions %t \ +// RUN: %check_clang_tidy %s bugprone-narrowing-conversions %t \ // RUN: -- -- -target x86_64-unknown-linux -fsigned-char namespace floats { @@ -6,15 +6,15 @@ namespace floats { void narrow_constant_floating_point_to_int_not_ok(double d) { int i = 0; i += 0.5; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'double' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'double' to 'int' [bugprone-narrowing-conversions] i += 0.5f; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'float' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'float' to 'int' [bugprone-narrowing-conversions] i *= 0.5f; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'float' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'float' to 'int' [bugprone-narrowing-conversions] i /= 0.5f; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'float' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'float' to 'int' [bugprone-narrowing-conversions] i += (double)0.5f; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'double' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'double' to 'int' [bugprone-narrowing-conversions] i += 2.0; i += 2.0f; } @@ -28,11 +28,11 @@ float narrow_double_to_float_return() { void narrow_double_to_float_not_ok(double d) { float f; f = d; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'double' to 'float' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'double' to 'float' [bugprone-narrowing-conversions] f = 15_double; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'double' to 'float' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'double' to 'float' [bugprone-narrowing-conversions] f += d; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'double' to 'float' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'double' to 'float' [bugprone-narrowing-conversions] f = narrow_double_to_float_return(); } @@ -46,11 +46,11 @@ void narrow_fp_constants() { f = __builtin_nanf("0"); // float NaN is not narrowing. f = __builtin_huge_val(); // max double is not within-range of float. - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from constant 'double' to 'float' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from constant 'double' to 'float' [bugprone-narrowing-conversions] f = -__builtin_huge_val(); // -max double is not within-range of float. - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from constant 'double' to 'float' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from constant 'double' to 'float' [bugprone-narrowing-conversions] f = __builtin_inf(); // double infinity is not within-range of float. - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from constant 'double' to 'float' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from constant 'double' to 'float' [bugprone-narrowing-conversions] f = __builtin_nan("0"); // double NaN is not narrowing. } diff --git a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-narrowinginteger-option.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-narrowinginteger-option.cpp similarity index 59% rename from clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-narrowinginteger-option.cpp rename to clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-narrowinginteger-option.cpp index f58de65f04232..fce90ecf0881d 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-narrowinginteger-option.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-narrowinginteger-option.cpp @@ -1,23 +1,23 @@ // RUN: %check_clang_tidy -check-suffix=DEFAULT %s \ -// RUN: cppcoreguidelines-narrowing-conversions %t -- \ -// RUN: -config='{CheckOptions: {cppcoreguidelines-narrowing-conversions.WarnOnIntegerNarrowingConversion: true}}' +// RUN: bugprone-narrowing-conversions %t -- \ +// RUN: -config='{CheckOptions: {bugprone-narrowing-conversions.WarnOnIntegerNarrowingConversion: true}}' // RUN: %check_clang_tidy -check-suffix=DISABLED %s \ -// RUN: cppcoreguidelines-narrowing-conversions %t -- \ -// RUN: -config='{CheckOptions: {cppcoreguidelines-narrowing-conversions.WarnOnIntegerNarrowingConversion: false}}' +// RUN: bugprone-narrowing-conversions %t -- \ +// RUN: -config='{CheckOptions: {bugprone-narrowing-conversions.WarnOnIntegerNarrowingConversion: false}}' void foo(unsigned long long value) { int a = value; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:11: warning: narrowing conversion from 'unsigned long long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:11: warning: narrowing conversion from 'unsigned long long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] // DISABLED: No warning for integer narrowing conversions when WarnOnIntegerNarrowingConversion = false. long long b = value; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:17: warning: narrowing conversion from 'unsigned long long' to signed type 'long long' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:17: warning: narrowing conversion from 'unsigned long long' to signed type 'long long' is implementation-defined [bugprone-narrowing-conversions] // DISABLED: No warning for integer narrowing conversions when WarnOnIntegerNarrowingConversion = false. } void casting_float_to_bool_is_still_operational_when_integer_narrowing_is_disabled(float f) { if (f) { - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to 'bool' [cppcoreguidelines-narrowing-conversions] - // CHECK-MESSAGES-DISABLED: :[[@LINE-2]]:7: warning: narrowing conversion from 'float' to 'bool' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to 'bool' [bugprone-narrowing-conversions] + // CHECK-MESSAGES-DISABLED: :[[@LINE-2]]:7: warning: narrowing conversion from 'float' to 'bool' [bugprone-narrowing-conversions] } } diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-narrowingintegertofloatingpoint-option.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-narrowingintegertofloatingpoint-option.cpp new file mode 100644 index 0000000000000..704d24dbb973d --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-narrowingintegertofloatingpoint-option.cpp @@ -0,0 +1,19 @@ +// RUN: %check_clang_tidy -check-suffix=DEFAULT %s \ +// RUN: bugprone-narrowing-conversions %t -- \ +// RUN: -config='{CheckOptions: {bugprone-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion: true}}' + +// RUN: %check_clang_tidy -check-suffix=DISABLED %s \ +// RUN: bugprone-narrowing-conversions %t -- \ +// RUN: -config='{CheckOptions: {bugprone-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion: false}}' + +void foo(unsigned long long value) { + double a = value; + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:14: warning: narrowing conversion from 'unsigned long long' to 'double' [bugprone-narrowing-conversions] + // DISABLED: No warning for integer to floating-point narrowing conversions when WarnOnIntegerToFloatingPointNarrowingConversion = false. +} + +void floating_point_to_integer_is_still_not_ok(double f) { + int a = f; + // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:11: warning: narrowing conversion from 'double' to 'int' [bugprone-narrowing-conversions] + // CHECK-MESSAGES-DISABLED: :[[@LINE-2]]:11: warning: narrowing conversion from 'double' to 'int' [bugprone-narrowing-conversions] +} diff --git a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-pedanticmode-option.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-pedanticmode-option.cpp similarity index 52% rename from clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-pedanticmode-option.cpp rename to clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-pedanticmode-option.cpp index eb1a5a67ee118..d2e2eada96c4b 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-pedanticmode-option.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-pedanticmode-option.cpp @@ -1,22 +1,22 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-narrowing-conversions %t \ +// RUN: %check_clang_tidy %s bugprone-narrowing-conversions %t \ // RUN: -config="{CheckOptions: { \ -// RUN: cppcoreguidelines-narrowing-conversions.PedanticMode: true}}" \ +// RUN: bugprone-narrowing-conversions.PedanticMode: true}}" \ // RUN: -- -target x86_64-unknown-linux -fsigned-char namespace floats { void triggers_wrong_constant_type_warning(double d) { int i = 0.0; - // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: constant value should be of type of type 'int' instead of 'double' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: constant value should be of type of type 'int' instead of 'double' [bugprone-narrowing-conversions] i += 2.0; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: constant value should be of type of type 'int' instead of 'double' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: constant value should be of type of type 'int' instead of 'double' [bugprone-narrowing-conversions] i += 2.0f; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: constant value should be of type of type 'int' instead of 'float' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: constant value should be of type of type 'int' instead of 'float' [bugprone-narrowing-conversions] } void triggers_narrowing_warning_when_overflowing() { unsigned short us = 65537.0; - // CHECK-MESSAGES: :[[@LINE-1]]:23: warning: narrowing conversion from constant 'double' to 'unsigned short' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:23: warning: narrowing conversion from constant 'double' to 'unsigned short' [bugprone-narrowing-conversions] } } // namespace floats diff --git a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-unsigned-char.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-unsigned-char.cpp similarity index 80% rename from clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-unsigned-char.cpp rename to clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-unsigned-char.cpp index 6bd437f98d44c..6a544b46b65d0 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-unsigned-char.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions-unsigned-char.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-narrowing-conversions %t \ +// RUN: %check_clang_tidy %s bugprone-narrowing-conversions %t \ // RUN: -- -- -target x86_64-unknown-linux -funsigned-char void narrow_integer_to_unsigned_integer_is_ok() { @@ -42,24 +42,24 @@ void narrow_integer_to_signed_integer_is_not_ok() { sc = sc; sc = s; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'short' to signed type 'signed char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'short' to signed type 'signed char' is implementation-defined [bugprone-narrowing-conversions] sc = i; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'int' to signed type 'signed char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'int' to signed type 'signed char' is implementation-defined [bugprone-narrowing-conversions] sc = l; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'long' to signed type 'signed char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'long' to signed type 'signed char' is implementation-defined [bugprone-narrowing-conversions] sc = ll; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'long long' to signed type 'signed char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'long long' to signed type 'signed char' is implementation-defined [bugprone-narrowing-conversions] sc = c; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'char' to signed type 'signed char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'char' to signed type 'signed char' is implementation-defined [bugprone-narrowing-conversions] sc = us; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned short' to signed type 'signed char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned short' to signed type 'signed char' is implementation-defined [bugprone-narrowing-conversions] sc = ui; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned int' to signed type 'signed char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned int' to signed type 'signed char' is implementation-defined [bugprone-narrowing-conversions] sc = ul; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned long' to signed type 'signed char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned long' to signed type 'signed char' is implementation-defined [bugprone-narrowing-conversions] sc = ull; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned long long' to signed type 'signed char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned long long' to signed type 'signed char' is implementation-defined [bugprone-narrowing-conversions] } void narrow_constant_to_unsigned_integer_is_ok() { @@ -72,7 +72,7 @@ void narrow_constant_to_unsigned_integer_is_ok() { unsigned char uc3 = -1; // unsigned dst type is well defined. unsigned char uc4 = 256; // unsigned dst type is well defined. signed char sc = 128; - // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: narrowing conversion from constant value 128 (0x00000080) of type 'int' to signed type 'signed char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: narrowing conversion from constant value 128 (0x00000080) of type 'int' to signed type 'signed char' is implementation-defined [bugprone-narrowing-conversions] } void narrow_conditional_operator_contant_to_unsigned_is_ok(bool b) { diff --git a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions.cpp similarity index 77% rename from clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions.cpp rename to clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions.cpp index 29b38e74e1a22..39875264bd1e6 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/narrowing-conversions.cpp @@ -1,6 +1,6 @@ -// RUN: %check_clang_tidy %s cppcoreguidelines-narrowing-conversions %t \ +// RUN: %check_clang_tidy %s bugprone-narrowing-conversions %t \ // RUN: -config="{CheckOptions: { \ -// RUN: cppcoreguidelines-narrowing-conversions.WarnOnFloatingPointNarrowingConversion: false}}" \ +// RUN: bugprone-narrowing-conversions.WarnOnFloatingPointNarrowingConversion: false}}" \ // RUN: -- -target x86_64-unknown-linux -fsigned-char float ceil(float); @@ -20,27 +20,27 @@ float operator"" _float(unsigned long long); void narrow_fp_to_int_not_ok(double d) { int i = 0; i = d; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'double' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'double' to 'int' [bugprone-narrowing-conversions] i = 0.5f; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from constant 'float' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from constant 'float' to 'int' [bugprone-narrowing-conversions] i = static_cast(d); - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to 'int' [bugprone-narrowing-conversions] i = ConvertsToFloat(); - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to 'int' [bugprone-narrowing-conversions] i = 15_float; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to 'int' [bugprone-narrowing-conversions] i += d; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'double' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'double' to 'int' [bugprone-narrowing-conversions] i += 0.5; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'double' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'double' to 'int' [bugprone-narrowing-conversions] i += 0.5f; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'float' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'float' to 'int' [bugprone-narrowing-conversions] i *= 0.5f; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'float' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'float' to 'int' [bugprone-narrowing-conversions] i /= 0.5f; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'float' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'float' to 'int' [bugprone-narrowing-conversions] i += (double)0.5f; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'double' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from constant 'double' to 'int' [bugprone-narrowing-conversions] i += 2.0; i += 2.0f; } @@ -84,29 +84,29 @@ void narrow_double_to_float_not_ok_binary_ops(double d) { void narrow_fp_constant_to_bool_not_ok() { bool b1 = 1.0; - // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: narrowing conversion from constant 'double' to 'bool' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: narrowing conversion from constant 'double' to 'bool' [bugprone-narrowing-conversions] bool b2 = 1.0f; - // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: narrowing conversion from constant 'float' to 'bool' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: narrowing conversion from constant 'float' to 'bool' [bugprone-narrowing-conversions] } void narrow_integer_to_floating() { { long long ll; // 64 bits float f = ll; // doesn't fit in 24 bits - // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: narrowing conversion from 'long long' to 'float' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: narrowing conversion from 'long long' to 'float' [bugprone-narrowing-conversions] double d = ll; // doesn't fit in 53 bits. - // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: narrowing conversion from 'long long' to 'double' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: narrowing conversion from 'long long' to 'double' [bugprone-narrowing-conversions] } { int i; // 32 bits float f = i; // doesn't fit in 24 bits - // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: narrowing conversion from 'int' to 'float' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: narrowing conversion from 'int' to 'float' [bugprone-narrowing-conversions] double d = i; // fits in 53 bits. } { short n1, n2; float f = n1 + n2; // 'n1 + n2' is of type 'int' because of integer rules - // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: narrowing conversion from 'int' to 'float' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: narrowing conversion from 'int' to 'float' [bugprone-narrowing-conversions] } { short s; // 16 bits @@ -156,41 +156,41 @@ void narrow_integer_to_signed_integer_is_not_ok() { c = c; c = s; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'short' to signed type 'char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'short' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions] c = i; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'int' to signed type 'char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'int' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions] c = l; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'long' to signed type 'char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'long' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions] c = ll; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to signed type 'char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions] c = uc; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned char' to signed type 'char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned char' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions] c = us; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned short' to signed type 'char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned short' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions] c = ui; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned int' to signed type 'char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned int' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions] c = ul; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned long' to signed type 'char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned long' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions] c = ull; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned long long' to signed type 'char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned long long' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions] i = c; i = s; i = i; i = l; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] i = ll; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] i = uc; i = us; i = ui; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] i = ul; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] i = ull; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned long long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'unsigned long long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] ll = c; ll = s; @@ -202,9 +202,9 @@ void narrow_integer_to_signed_integer_is_not_ok() { ll = us; ll = ui; ll = ul; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned long' to signed type 'long long' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned long' to signed type 'long long' is implementation-defined [bugprone-narrowing-conversions] ll = ull; - // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned long long' to signed type 'long long' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: narrowing conversion from 'unsigned long long' to signed type 'long long' is implementation-defined [bugprone-narrowing-conversions] } void narrow_constant_to_unsigned_integer_is_ok() { @@ -222,16 +222,16 @@ void narrow_constant_to_signed_integer_is_not_ok() { char c1 = -128; char c2 = 127; char c3 = -129; - // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: narrowing conversion from constant value -129 (0xFFFFFF7F) of type 'int' to signed type 'char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: narrowing conversion from constant value -129 (0xFFFFFF7F) of type 'int' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions] char c4 = 128; - // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: narrowing conversion from constant value 128 (0x00000080) of type 'int' to signed type 'char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: narrowing conversion from constant value 128 (0x00000080) of type 'int' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions] short s1 = -32768; short s2 = 32767; short s3 = -32769; - // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: narrowing conversion from constant value -32769 (0xFFFF7FFF) of type 'int' to signed type 'short' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: narrowing conversion from constant value -32769 (0xFFFF7FFF) of type 'int' to signed type 'short' is implementation-defined [bugprone-narrowing-conversions] short s4 = 32768; - // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: narrowing conversion from constant value 32768 (0x00008000) of type 'int' to signed type 'short' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: narrowing conversion from constant value 32768 (0x00008000) of type 'int' to signed type 'short' is implementation-defined [bugprone-narrowing-conversions] } void narrow_conditional_operator_contant_to_unsigned_is_ok(bool b) { @@ -244,22 +244,22 @@ void narrow_conditional_operator_contant_to_unsigned_is_ok(bool b) { void narrow_conditional_operator_contant_to_signed_is_not_ok(bool b) { char uc1 = b ? 1 : 0; char uc2 = b ? 1 : 128; - // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: narrowing conversion from constant value 128 (0x00000080) of type 'int' to signed type 'char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: narrowing conversion from constant value 128 (0x00000080) of type 'int' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions] char uc3 = b ? -129 : 0; - // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: narrowing conversion from constant value -129 (0xFFFFFF7F) of type 'int' to signed type 'char' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: narrowing conversion from constant value -129 (0xFFFFFF7F) of type 'int' to signed type 'char' is implementation-defined [bugprone-narrowing-conversions] unsigned long long ysize; long long mirror = b ? -1 : ysize - 1; - // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: narrowing conversion from constant value 18446744073709551615 (0xFFFFFFFFFFFFFFFF) of type 'unsigned long long' to signed type 'long long' is implementation-defined [cppcoreguidelines-narrowing-conversions] - // CHECK-MESSAGES: :[[@LINE-2]]:37: warning: narrowing conversion from 'unsigned long long' to signed type 'long long' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: narrowing conversion from constant value 18446744073709551615 (0xFFFFFFFFFFFFFFFF) of type 'unsigned long long' to signed type 'long long' is implementation-defined [bugprone-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-2]]:37: warning: narrowing conversion from 'unsigned long long' to signed type 'long long' is implementation-defined [bugprone-narrowing-conversions] } void narrow_constant_to_floating_point() { float f_ok = 1ULL << 24; // fits in 24 bits mantissa. float f_not_ok = (1ULL << 24) + 1ULL; // doesn't fit in 24 bits mantissa. - // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: narrowing conversion from constant value 16777217 of type 'unsigned long long' to 'float' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: narrowing conversion from constant value 16777217 of type 'unsigned long long' to 'float' [bugprone-narrowing-conversions] double d_ok = 1ULL << 53; // fits in 53 bits mantissa. double d_not_ok = (1ULL << 53) + 1ULL; // doesn't fit in 53 bits mantissa. - // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: narrowing conversion from constant value 9007199254740993 of type 'unsigned long long' to 'double' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: narrowing conversion from constant value 9007199254740993 of type 'unsigned long long' to 'double' [bugprone-narrowing-conversions] } void casting_integer_to_bool_is_ok() { @@ -275,13 +275,13 @@ void casting_integer_to_bool_is_ok() { void casting_float_to_bool_is_not_ok() { float f; while (f) { - // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: narrowing conversion from 'float' to 'bool' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: narrowing conversion from 'float' to 'bool' [bugprone-narrowing-conversions] } for (; f;) { - // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: narrowing conversion from 'float' to 'bool' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: narrowing conversion from 'float' to 'bool' [bugprone-narrowing-conversions] } if (f) { - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to 'bool' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to 'bool' [bugprone-narrowing-conversions] } } @@ -352,7 +352,7 @@ void typedef_context() { i64 = i; // Okay, no narrowing. i = i64; - // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'myint64_t' (aka 'long long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: narrowing conversion from 'myint64_t' (aka 'long long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] } } // namespace floats diff --git a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-narrowingintegertofloatingpoint-option.cpp b/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-narrowingintegertofloatingpoint-option.cpp deleted file mode 100644 index 35ca61b6a9a8c..0000000000000 --- a/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-narrowingintegertofloatingpoint-option.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// RUN: %check_clang_tidy -check-suffix=DEFAULT %s \ -// RUN: cppcoreguidelines-narrowing-conversions %t -- \ -// RUN: -config='{CheckOptions: {cppcoreguidelines-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion: true}}' - -// RUN: %check_clang_tidy -check-suffix=DISABLED %s \ -// RUN: cppcoreguidelines-narrowing-conversions %t -- \ -// RUN: -config='{CheckOptions: {cppcoreguidelines-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion: false}}' - -void foo(unsigned long long value) { - double a = value; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:14: warning: narrowing conversion from 'unsigned long long' to 'double' [cppcoreguidelines-narrowing-conversions] - // DISABLED: No warning for integer to floating-point narrowing conversions when WarnOnIntegerToFloatingPointNarrowingConversion = false. -} - -void floating_point_to_integer_is_still_not_ok(double f) { - int a = f; - // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:11: warning: narrowing conversion from 'double' to 'int' [cppcoreguidelines-narrowing-conversions] - // CHECK-MESSAGES-DISABLED: :[[@LINE-2]]:11: warning: narrowing conversion from 'double' to 'int' [cppcoreguidelines-narrowing-conversions] -} diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone/alpha-core-identicalexpr.cpp b/clang-tools-extra/test/clang-tidy/checkers/misc/redundant-expression-2.cpp similarity index 67% rename from clang-tools-extra/test/clang-tidy/checkers/bugprone/alpha-core-identicalexpr.cpp rename to clang-tools-extra/test/clang-tidy/checkers/misc/redundant-expression-2.cpp index 8eff3ebc948de..8dcef30a4e754 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/bugprone/alpha-core-identicalexpr.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/misc/redundant-expression-2.cpp @@ -1,5 +1,4 @@ -// RUN: clang-tidy %s -checks="-*,misc-redundant-expression" -- 2>&1 | FileCheck %s --check-prefix=CHECK-MESSAGES-IDENTEXPR -// RUN: clang-tidy %s -checks="-*,bugprone-branch-clone" -- 2>&1 | FileCheck %s --check-prefix=CHECK-MESSAGES-BUGPRONEBRANCH +// RUN: %check_clang_tidy %s misc-redundant-expression -check-suffix=IDENTEXPR %t /* Only one expected warning per function allowed at the very end. */ @@ -77,6 +76,7 @@ int checkNotEqualBinaryOpFloatCompare1(void) { int res; float f= 3.14F; res = (f + 3.14F != f + 3.14F); // no warning +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:20: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } int checkNotEqualBinaryOpFloatCompare2(void) { @@ -88,6 +88,7 @@ int checkNotEqualBinaryOpFloatCompare3(void) { int res; float f= 3.14F; res = ((int)f + 3.14F != (int)f + 3.14F); // no warning +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:25: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } int checkNotEqualBinaryOpFloatCompare4(void) { @@ -103,6 +104,7 @@ int checkNotEqualNestedBinaryOpFloatCompare1(void) { int u= 2; float f= 3.14F; res = (((int)f + (3.14F - u)*t) != ((int)f + (3.14F - u)*t)); // no warning +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:35: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } @@ -121,12 +123,11 @@ int checkNotEqualNestedBinaryOpFloatCompare3(void) { int u= 2; float f= 3.14F; res = (((int)f + (u - 3.14F)*t) != ((int)f + (3.14F - u)*(f + t != f + t))); // no warning +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:67: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } - - /* end '!=' with float*/ /* '!=' with int*/ @@ -238,8 +239,6 @@ int checkNotEqualNestedBinaryOpIntCompare3(void) { /* end '!=' int */ - - /* '!=' with int pointer */ int checkNotEqualIntPointerLiteralCompare1(void) { @@ -329,6 +328,7 @@ int checkNotEqualSameFunction() { unsigned a = 0; unsigned b = 1; int res = (a+func() != a+func()); // no warning +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:23: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } @@ -343,6 +343,7 @@ int checkNotEqualSameFunctionSameParam() { unsigned a = 0; unsigned b = 1; int res = (a+funcParam(a) != a+funcParam(a)); // no warning +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:29: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } @@ -434,7 +435,8 @@ int checkEqualCastFloatDeclCompare12(void) { int checkEqualBinaryOpFloatCompare1(void) { int res; float f= 3.14F; - res = (f + 3.14F == f + 3.14F); // no warning + res = (f + 3.14F == f + 3.14F); +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:20: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } int checkEqualBinaryOpFloatCompare2(void) { @@ -445,7 +447,8 @@ int checkEqualBinaryOpFloatCompare2(void) { int checkEqualBinaryOpFloatCompare3(void) { int res; float f= 3.14F; - res = ((int)f + 3.14F == (int)f + 3.14F); // no warning + res = ((int)f + 3.14F == (int)f + 3.14F); +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:25: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } int checkEqualBinaryOpFloatCompare4(void) { @@ -460,7 +463,8 @@ int checkEqualNestedBinaryOpFloatCompare1(void) { int t= 1; int u= 2; float f= 3.14F; - res = (((int)f + (3.14F - u)*t) == ((int)f + (3.14F - u)*t)); // no warning + res = (((int)f + (3.14F - u)*t) == ((int)f + (3.14F - u)*t)); +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:35: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } @@ -478,14 +482,11 @@ int checkEqualNestedBinaryOpFloatCompare3(void) { int t= 1; int u= 2; float f= 3.14F; - res = (((int)f + (u - 3.14F)*t) == ((int)f + (3.14F - u)*(f + t == f + t))); // no warning + res = (((int)f + (u - 3.14F)*t) == ((int)f + (3.14F - u)*(f + t == f + t))); +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:67: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } - - - - /* Equal with int*/ int checkEqualIntLiteralCompare1(void) { @@ -600,7 +601,8 @@ int checkEqualNestedBinaryOpIntCompare3(void) { int checkEqualSameFunction() { unsigned a = 0; unsigned b = 1; - int res = (a+func() == a+func()); // no warning + int res = (a+func() == a+func()); +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:23: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } @@ -614,7 +616,8 @@ int checkEqualDifferentFunction() { int checkEqualSameFunctionSameParam() { unsigned a = 0; unsigned b = 1; - int res = (a+funcParam(a) == a+funcParam(a)); // no warning + int res = (a+funcParam(a) == a+funcParam(a)); +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:29: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } @@ -692,7 +695,8 @@ int checkLessThanCastFloatDeclCompare12(void) { int checkLessThanBinaryOpFloatCompare1(void) { int res; float f= 3.14F; - res = (f + 3.14F < f + 3.14F); // no warning + res = (f + 3.14F < f + 3.14F); +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:20: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } int checkLessThanBinaryOpFloatCompare2(void) { @@ -703,7 +707,8 @@ int checkLessThanBinaryOpFloatCompare2(void) { int checkLessThanBinaryOpFloatCompare3(void) { int res; float f= 3.14F; - res = ((int)f + 3.14F < (int)f + 3.14F); // no warning + res = ((int)f + 3.14F < (int)f + 3.14F); +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:25: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } int checkLessThanBinaryOpFloatCompare4(void) { @@ -718,7 +723,8 @@ int checkLessThanNestedBinaryOpFloatCompare1(void) { int t= 1; int u= 2; float f= 3.14F; - res = (((int)f + (3.14F - u)*t) < ((int)f + (3.14F - u)*t)); // no warning + res = (((int)f + (3.14F - u)*t) < ((int)f + (3.14F - u)*t)); +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:35: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } @@ -736,7 +742,8 @@ int checkLessThanNestedBinaryOpFloatCompare3(void) { int t= 1; int u= 2; float f= 3.14F; - res = (((int)f + (u - 3.14F)*t) < ((int)f + (3.14F - u)*(f + t < f + t))); // no warning + res = (((int)f + (u - 3.14F)*t) < ((int)f + (3.14F - u)*(f + t < f + t))); +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:66: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } @@ -912,7 +919,8 @@ int checkGreaterThanCastFloatDeclCompare12(void) { int checkGreaterThanBinaryOpFloatCompare1(void) { int res; float f= 3.14F; - res = (f + 3.14F > f + 3.14F); // no warning + res = (f + 3.14F > f + 3.14F); +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:20: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } int checkGreaterThanBinaryOpFloatCompare2(void) { @@ -923,7 +931,8 @@ int checkGreaterThanBinaryOpFloatCompare2(void) { int checkGreaterThanBinaryOpFloatCompare3(void) { int res; float f= 3.14F; - res = ((int)f + 3.14F > (int)f + 3.14F); // no warning + res = ((int)f + 3.14F > (int)f + 3.14F); +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:25: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } int checkGreaterThanBinaryOpFloatCompare4(void) { @@ -938,7 +947,8 @@ int checkGreaterThanNestedBinaryOpFloatCompare1(void) { int t= 1; int u= 2; float f= 3.14F; - res = (((int)f + (3.14F - u)*t) > ((int)f + (3.14F - u)*t)); // no warning + res = (((int)f + (3.14F - u)*t) > ((int)f + (3.14F - u)*t)); +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:35: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } @@ -957,6 +967,7 @@ int checkGreaterThanNestedBinaryOpFloatCompare3(void) { int u= 2; float f= 3.14F; res = (((int)f + (u - 3.14F)*t) > ((int)f + (3.14F - u)*(f + t > f + t))); // no warning +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:66: warning: both sides of operator are equivalent [misc-redundant-expression] return (0); } @@ -1066,7 +1077,6 @@ unsigned test_unsigned(unsigned a) { unsigned b = 1; a = a > 5 ? b : b; // CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:17: warning: 'true' and 'false' expressions are equivalent [misc-redundant-expression] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] return a; } @@ -1074,13 +1084,11 @@ void test_signed() { int a = 0; a = a > 5 ? a : a; // CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:17: warning: 'true' and 'false' expressions are equivalent [misc-redundant-expression] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] } void test_bool(bool a) { a = a > 0 ? a : a; // CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:17: warning: 'true' and 'false' expressions are equivalent [misc-redundant-expression] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] } void test_float() { @@ -1088,14 +1096,12 @@ void test_float() { float b = 0; a = a > 5 ? a : a; // CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:17: warning: 'true' and 'false' expressions are equivalent [misc-redundant-expression] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] } const char *test_string() { float a = 0; return a > 5 ? "abc" : "abc"; // CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:24: warning: 'true' and 'false' expressions are equivalent [misc-redundant-expression] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:16: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] } void test_unsigned_expr() { @@ -1103,7 +1109,6 @@ void test_unsigned_expr() { unsigned b = 0; a = a > 5 ? a+b : a+b; // CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:19: warning: 'true' and 'false' expressions are equivalent [misc-redundant-expression] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] } void test_signed_expr() { @@ -1111,14 +1116,12 @@ void test_signed_expr() { int b = 1; a = a > 5 ? a+b : a+b; // CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:19: warning: 'true' and 'false' expressions are equivalent [misc-redundant-expression] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] } void test_bool_expr(bool a) { bool b = 0; a = a > 0 ? a&&b : a&&b; // CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:20: warning: 'true' and 'false' expressions are equivalent [misc-redundant-expression] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] } void test_unsigned_expr_negative() { @@ -1143,7 +1146,6 @@ void test_float_expr_positive() { float b = 0; a = a > 5 ? a+b : a+b; // CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:19: warning: 'true' and 'false' expressions are equivalent [misc-redundant-expression] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] } void test_expr_positive_func() { @@ -1151,7 +1153,6 @@ void test_expr_positive_func() { unsigned b = 1; a = a > 5 ? a+func() : a+func(); // CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:24: warning: 'true' and 'false' expressions are equivalent [misc-redundant-expression] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] } void test_expr_negative_func() { @@ -1165,7 +1166,6 @@ void test_expr_positive_funcParam() { unsigned b = 1; a = a > 5 ? a+funcParam(b) : a+funcParam(b); // CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:30: warning: 'true' and 'false' expressions are equivalent [misc-redundant-expression] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] } void test_expr_negative_funcParam() { @@ -1174,26 +1174,12 @@ void test_expr_negative_funcParam() { a = a > 5 ? a+funcParam(a) : a+funcParam(b); // no warning } -void test_expr_positive_inc() { - unsigned a = 0; - unsigned b = 1; - a = a > 5 ? a++ : a++; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] -} - void test_expr_negative_inc() { unsigned a = 0; unsigned b = 1; a = a > 5 ? a++ : b++; // no warning } -void test_expr_positive_assign() { - unsigned a = 0; - unsigned b = 1; - a = a > 5 ? a=1 : a=1; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] -} - void test_expr_negative_assign() { unsigned a = 0; unsigned b = 1; @@ -1206,7 +1192,6 @@ void test_signed_nested_expr() { int c = 3; a = a > 5 ? a+b+(c+a)*(a + b*(c+a)) : a+b+(c+a)*(a + b*(c+a)); // CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:39: warning: 'true' and 'false' expressions are equivalent [misc-redundant-expression] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:13: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] } void test_signed_nested_expr_negative() { @@ -1229,190 +1214,6 @@ void test_signed_nested_cond_expr() { int c = 3; a = a > 5 ? (b > 5 ? 1 : 4) : (b > 5 ? 4 : 4); // CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:44: warning: 'true' and 'false' expressions are equivalent [misc-redundant-expression] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:40: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] -} - -void test_identical_branches1(bool b) { - int i = 0; - if (b) { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] - ++i; - } else { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: else branch starts here - ++i; - } -} - -void test_identical_branches2(bool b) { - int i = 0; - if (b) { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] - ++i; - } else -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: else branch starts here - ++i; -} - -void test_identical_branches3(bool b) { - int i = 0; - if (b) { // no warning - ++i; - } else { - i++; - } -} - -void test_identical_branches4(bool b) { - int i = 0; - if (b) { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] - } else { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: else branch starts here - } -} - -void test_identical_branches_break(bool b) { - while (true) { - if (b) -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: warning: if with identical then and else branches [bugprone-branch-clone] - break; - else -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: else branch starts here - break; - } -} - -void test_identical_branches_continue(bool b) { - while (true) { - if (b) -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: warning: if with identical then and else branches [bugprone-branch-clone] - continue; - else -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: else branch starts here - continue; - } -} - -void test_identical_branches_func(bool b) { - if (b) -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] - func(); - else -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: note: else branch starts here - func(); -} - -void test_identical_branches_func_arguments(bool b) { - if (b) // no-warning - funcParam(1); - else - funcParam(2); -} - -void test_identical_branches_cast1(bool b) { - long v = -7; - if (b) // no-warning - v = (signed int) v; - else - v = (unsigned int) v; -} - -void test_identical_branches_cast2(bool b) { - long v = -7; - if (b) -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] - v = (signed int) v; - else -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: note: else branch starts here - v = (signed int) v; -} - -int test_identical_branches_return_int(bool b) { - int i = 0; - if (b) { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] - i++; - return i; - } else { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: else branch starts here - i++; - return i; - } -} - -int test_identical_branches_return_func(bool b) { - if (b) { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] - return func(); - } else { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: else branch starts here - return func(); - } -} - -void test_identical_branches_for(bool b) { - int i; - int j; - if (b) { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] - for (i = 0, j = 0; i < 10; i++) - j += 4; - } else { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: else branch starts here - for (i = 0, j = 0; i < 10; i++) - j += 4; - } -} - -void test_identical_branches_while(bool b) { - int i = 10; - if (b) { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] - while (func()) - i--; - } else { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: else branch starts here - while (func()) - i--; - } -} - -void test_identical_branches_while_2(bool b) { - int i = 10; - if (b) { // no-warning - while (func()) - i--; - } else { - while (func()) - i++; - } -} - -void test_identical_branches_do_while(bool b) { - int i = 10; - if (b) { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] - do { - i--; - } while (func()); - } else { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: else branch starts here - do { - i--; - } while (func()); - } -} - -void test_identical_branches_if(bool b, int i) { - if (b) { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: warning: if with identical then and else branches [bugprone-branch-clone] - if (i < 5) - i += 10; - } else { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: else branch starts here - if (i < 5) - i += 10; - } } void test_identical_bitwise1() { @@ -1473,7 +1274,8 @@ void test_identical_logical3(int a) { } void test_identical_logical4(int a) { - if (a == func() || a == func()) // no-warning + if (a == func() || a == func()) +// CHECK-MESSAGES-IDENTEXPR: :[[@LINE-1]]:19: warning: both sides of operator are equivalent [misc-redundant-expression] ; } @@ -1508,208 +1310,3 @@ void test_identical_logical9(int x, int y) { ; } #pragma clang diagnostic pop - -void test_warn_chained_if_stmts_1(int x) { - if (x == 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:6: note: end of the original - else if (x == 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 1 starts here -} - -void test_warn_chained_if_stmts_2(int x) { - if (x == 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:6: note: end of the original - else if (x == 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 1 starts here - else if (x == 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 2 starts here -} - -void test_warn_chained_if_stmts_3(int x) { - if (x == 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:6: note: end of the original - else if (x == 2) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 1 starts here - else if (x == 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 2 starts here -} - -void test_warn_chained_if_stmts_4(int x) { - if (x == 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:6: note: end of the original - else if (func()) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 1 starts here - else if (x == 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 2 starts here -} - -void test_warn_chained_if_stmts_5(int x) { - if (x & 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:6: note: end of the original - else if (x & 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 1 starts here -} - -void test_warn_chained_if_stmts_6(int x) { - if (x == 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:6: note: end of the original - else if (x == 2) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 1 starts here - else if (x == 2) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 2 starts here - else if (x == 3) - ; -} - -void test_warn_chained_if_stmts_7(int x) { - if (x == 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:6: note: end of the original - else if (x == 2) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 1 starts here - else if (x == 3) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 2 starts here - else if (x == 2) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 3 starts here - else if (x == 5) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 4 starts here -} - -void test_warn_chained_if_stmts_8(int x) { - if (x == 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:6: note: end of the original - else if (x == 2) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 1 starts here - else if (x == 3) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 2 starts here - else if (x == 2) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 3 starts here - else if (x == 5) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 4 starts here - else if (x == 3) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 5 starts here - else if (x == 7) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 6 starts here -} - -void test_nowarn_chained_if_stmts_1(int x) { - if (func()) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:6: note: end of the original - else if (func()) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 1 starts here -} - -void test_nowarn_chained_if_stmts_2(int x) { - if (func()) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:6: note: end of the original - else if (x == 1) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 1 starts here - else if (func()) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 2 starts here -} - -void test_nowarn_chained_if_stmts_3(int x) { - if (x++) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: warning: repeated branch body in conditional chain [bugprone-branch-clone] -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-2]]:6: note: end of the original - else if (x++) - ; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: clone 1 starts here -} - -void test_warn_wchar() { - const wchar_t * a = 0 ? L"Warning" : L"Warning"; -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:25: warning: conditional operator with identical true and false expressions [bugprone-branch-clone] -} -void test_nowarn_wchar() { - const wchar_t * a = 0 ? L"No" : L"Warning"; -} - -void test_nowarn_long() { - int a = 0, b = 0; - long c; - if (0) { - b -= a; - c = 0; - } else { - b -= a; - c = 0LL; - } -} - -// Identical inner conditions - -void test_warn_inner_if_1(int x) { - if (x == 1) { -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:3: warning: if with identical inner if statement [bugprone-branch-clone] - if (x == 1) -// CHECK-MESSAGES-BUGPRONEBRANCH: :[[@LINE-1]]:5: note: inner if starts here - ; - } - - // FIXME: Should warn here. The warning is currently not emitted because there - // is code between the conditions. - if (x == 1) { - int y = x; - if (x == 1) - ; - } -} - -void test_nowarn_inner_if_1(int x) { - // Don't warn when condition has side effects. - if (x++ == 1) { - if (x++ == 1) - ; - } - - // Don't warn when x is changed before inner condition. - if (x < 10) { - x++; - if (x < 10) - ; - } -} diff --git a/clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format-fmt.cpp b/clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format-fmt.cpp index 1eaf18ac11996..71c8af190467c 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format-fmt.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format-fmt.cpp @@ -1,6 +1,6 @@ // RUN: %check_clang_tidy %s modernize-use-std-format %t -- \ // RUN: -config="{CheckOptions: { \ -// RUN: StrictMode: true, \ +// RUN: modernize-use-std-format.StrictMode: true, \ // RUN: modernize-use-std-format.StrFormatLikeFunctions: 'fmt::sprintf', \ // RUN: modernize-use-std-format.ReplacementFormatFunction: 'fmt::format', \ // RUN: modernize-use-std-format.FormatHeader: '' \ diff --git a/clang-tools-extra/test/clang-tidy/checkers/modernize/use-using.cpp b/clang-tools-extra/test/clang-tidy/checkers/modernize/use-using.cpp index 925e5f9c1ca54..214a66f3dcc88 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/modernize/use-using.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/modernize/use-using.cpp @@ -80,7 +80,7 @@ typedef Test another; typedef int* PInt; // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' -// CHECK-FIXES: using PInt = int *; +// CHECK-FIXES: using PInt = int*; typedef int bla1, bla2, bla3; // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' @@ -112,7 +112,7 @@ TYPEDEF Foo Bak; typedef FOO Bam; // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' // CHECK-FIXES: #define FOO Foo -// CHECK-FIXES: using Bam = Foo; +// CHECK-FIXES: using Bam = FOO; typedef struct Foo Bap; // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' @@ -247,7 +247,7 @@ typedef Q Q3_t; typedef TwoArgTemplate >, S<(0 < 0), Q > > Nested_t; // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' -// CHECK-FIXES: using Nested_t = TwoArgTemplate>, S<(0 < 0), Q>>; +// CHECK-FIXES: using Nested_t = TwoArgTemplate >, S<(0 < 0), Q > >; template class TemplateKeyword { @@ -265,12 +265,12 @@ class Variadic {}; typedef Variadic >, S<(0 < 0), Variadic > > > Variadic_t; // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' -// CHECK-FIXES: using Variadic_t = Variadic>, S<(0 < 0), Variadic>>> +// CHECK-FIXES: using Variadic_t = Variadic >, S<(0 < 0), Variadic > > > typedef Variadic >, S<(0 < 0), Variadic > > > Variadic_t, *Variadic_p; // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' // CHECK-MESSAGES: :[[@LINE-2]]:103: warning: use 'using' instead of 'typedef' -// CHECK-FIXES: using Variadic_t = Variadic>, S<(0 < 0), Variadic>>>; +// CHECK-FIXES: using Variadic_t = Variadic >, S<(0 < 0), Variadic > > >; // CHECK-FIXES-NEXT: using Variadic_p = Variadic_t*; typedef struct { int a; } R_t, *R_p; @@ -383,3 +383,57 @@ namespace ISSUE_72179 // CHECK-MESSAGES: :[[@LINE-1]]:31: warning: use 'using' instead of 'typedef' [modernize-use-using] // CHECK-FIXES: const auto foo4 = [](int a){using d = int;}; } + + +typedef int* int_ptr, *int_ptr_ptr; +// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' [modernize-use-using] +// CHECK-MESSAGES: :[[@LINE-2]]:21: warning: use 'using' instead of 'typedef' [modernize-use-using] +// CHECK-FIXES: using int_ptr = int*; +// CHECK-FIXES-NEXT: using int_ptr_ptr = int_ptr*; + +#ifndef SpecialMode +#define SomeMacro(x) x +#else +#define SomeMacro(x) SpecialType +#endif + +class SomeMacro(GH33760) { }; + +typedef void(SomeMacro(GH33760)::* FunctionType)(float, int); +// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' [modernize-use-using] +// CHECK-FIXES: using FunctionType = void(SomeMacro(GH33760)::* )(float, int); + +#define CDECL __attribute((cdecl)) + +// GH37846 & GH41685 +typedef void (CDECL *GH37846)(int); +// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' [modernize-use-using] +// CHECK-FIXES: using GH37846 = void (CDECL *)(int); + +typedef void (__attribute((cdecl)) *GH41685)(int); +// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' [modernize-use-using] +// CHECK-FIXES: using GH41685 = void (__attribute((cdecl)) *)(int); + +namespace GH83568 { + typedef int(*name)(int arg1, int arg2); +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use 'using' instead of 'typedef' [modernize-use-using] +// CHECK-FIXES: using name = int(*)(int arg1, int arg2); +} + +#ifdef FOO +#define GH95716 float +#else +#define GH95716 double +#endif + +typedef GH95716 foo; +// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' [modernize-use-using] +// CHECK-FIXES: using foo = GH95716; + +namespace GH97009 { + typedef double PointType[3]; +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use 'using' instead of 'typedef' [modernize-use-using] + typedef bool (*Function)(PointType, PointType); +// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use 'using' instead of 'typedef' [modernize-use-using] +// CHECK-FIXES: using Function = bool (*)(PointType, PointType); +} diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/Inputs/param/parameters.txt b/clang-tools-extra/test/clang-tidy/infrastructure/Inputs/param/parameters.txt new file mode 100644 index 0000000000000..a6d8fa7ee299f --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/infrastructure/Inputs/param/parameters.txt @@ -0,0 +1,2 @@ +-checks='-*,llvm-namespace-comment' +--warnings-as-errors=llvm-namespace-comment diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/deprecation-global-option.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/deprecation-global-option.cpp new file mode 100644 index 0000000000000..4c9854d221832 --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/infrastructure/deprecation-global-option.cpp @@ -0,0 +1,3 @@ +// RUN: clang-tidy %s --config="{CheckOptions:{StrictMode: true}}" -checks="-*,modernize-use-std-format" | FileCheck %s + +// CHECK: warning: global option 'StrictMode' is deprecated, please use 'modernize-use-std-format.StrictMode' instead. [clang-tidy-config] diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/read-parameters-from-file-error.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/read-parameters-from-file-error.cpp new file mode 100644 index 0000000000000..183f44365137c --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/infrastructure/read-parameters-from-file-error.cpp @@ -0,0 +1,3 @@ +// RUN: echo @%t.param > %t.param && not clang-tidy %s @%t.param -- 2>&1 | FileCheck %s + +// CHECK: recursive expansion of diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/read-parameters-from-file.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/read-parameters-from-file.cpp new file mode 100644 index 0000000000000..9d8c40a2e7d41 --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/infrastructure/read-parameters-from-file.cpp @@ -0,0 +1,5 @@ +// RUN: not clang-tidy %s @%S/Inputs/param/parameters.txt -- | FileCheck %s + +namespace i { +} +// CHECK: error: namespace 'i' not terminated with a closing comment [llvm-namespace-comment,-warnings-as-errors] diff --git a/clang/docs/ClangFormat.rst b/clang/docs/ClangFormat.rst index c8f1d7f5a7758..e1f677178c00a 100644 --- a/clang/docs/ClangFormat.rst +++ b/clang/docs/ClangFormat.rst @@ -150,6 +150,7 @@ names. It has the following format: * Patterns follow the rules specified in `POSIX 2.13.1, 2.13.2, and Rule 1 of 2.13.3 `_. +* Bash globstar (``**``) is supported. * A pattern is negated if it starts with a bang (``!``). To match all files in a directory, use e.g. ``foo/bar/*``. To match all files in diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst index 4be448171699c..d9b3f666df03c 100644 --- a/clang/docs/ClangFormatStyleOptions.rst +++ b/clang/docs/ClangFormatStyleOptions.rst @@ -2088,6 +2088,11 @@ the configuration (without a prefix: ``Auto``). If ``true``, ``while (true) continue;`` can be put on a single line. +.. _AllowShortNamespacesOnASingleLine: + +**AllowShortNamespacesOnASingleLine** (``Boolean``) :versionbadge:`clang-format 20` :ref:`¶ ` + If ``true``, ``namespace a { class b; }`` can be put on a single line. + .. _AlwaysBreakAfterDefinitionReturnType: **AlwaysBreakAfterDefinitionReturnType** (``DefinitionReturnTypeBreakingStyle``) :versionbadge:`clang-format 3.7` :ref:`¶ ` @@ -6793,6 +6798,15 @@ the configuration (without a prefix: ``Auto``). +.. _VariableTemplates: + +**VariableTemplates** (``List of Strings``) :versionbadge:`clang-format 20` :ref:`¶ ` + A vector of non-keyword identifiers that should be interpreted as variable + template names. + + A ``)`` after a variable template instantiation is **not** annotated as + the closing parenthesis of C-style cast operator. + .. _VerilogBreakBetweenInstancePorts: **VerilogBreakBetweenInstancePorts** (``Boolean``) :versionbadge:`clang-format 17` :ref:`¶ ` diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst index 3d4f68b818bce..cc5f1d4ddf447 100644 --- a/clang/docs/LanguageExtensions.rst +++ b/clang/docs/LanguageExtensions.rst @@ -736,9 +736,10 @@ at the end to the next power of 2. These reductions support both fixed-sized and scalable vector types. -The integer reduction intrinsics, including ``__builtin_reduce_add``, -``__builtin_reduce_mul``, ``__builtin_reduce_and``, ``__builtin_reduce_or``, -and ``__builtin_reduce_xor``, can be called in a ``constexpr`` context. +The integer reduction intrinsics, including ``__builtin_reduce_max``, +``__builtin_reduce_min``, ``__builtin_reduce_add``, ``__builtin_reduce_mul``, +``__builtin_reduce_and``, ``__builtin_reduce_or``, and ``__builtin_reduce_xor``, +can be called in a ``constexpr`` context. Example: diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index f18e9cf134169..8564f2650d205 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -1842,6 +1842,12 @@

Node Matchers

if (x) {} +Matcher<Stmt>dependentScopeDeclRefExprMatcher<DependentScopeDeclRefExpr>... +
Matches expressions that refer to dependent scope declarations.
+
+Example matches T::v
+   template  class X : T { void f() { T::v; } };
+
Matcher<Stmt>declStmtMatcher<DeclStmt>...
Matches declaration statements.
@@ -2530,6 +2536,15 @@ 

Node Matchers

matches "decltype(i + j)"
+Matcher<Type>dependentNameTypeMatcher<DependentNameType>... +
Matches a dependent name type.
+
+Example matches T::type
+
+  template  struct declToImport {
+    typedef typename T::type dependent_name;
+  };
+
Matcher<Type>deducedTemplateSpecializationTypeMatcher<DeducedTemplateSpecializationType>...
Matches C++17 deduced template specialization types, e.g. deduced class
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index a85ef60b7b58b..e0aef1af2135c 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -421,7 +421,8 @@ Non-comprehensive list of changes in this release
   ``__builtin_reduce_mul``, ``__builtin_reduce_and``, ``__builtin_reduce_or``,
   ``__builtin_reduce_xor``, ``__builtin_elementwise_popcount``,
   ``__builtin_elementwise_bitreverse``, ``__builtin_elementwise_add_sat``,
-  ``__builtin_elementwise_sub_sat``.
+  ``__builtin_elementwise_sub_sat``, ``__builtin_reduce_min`` (For integral element type),
+  ``__builtin_reduce_max`` (For integral element type).
 
 - Clang now rejects ``_BitInt`` matrix element types if the bit width is less than ``CHAR_WIDTH`` or
   not a power of two, matching preexisting behaviour for vector types.
@@ -445,9 +446,8 @@ New Compiler Flags
 - The ``-Warray-compare-cxx26`` warning has been added to warn about array comparison
   starting from C++26, this warning is enabled as an error by default.
 
-- '-fsanitize-merge' (default) and '-fno-sanitize-merge' have been added for
-  fine-grained control of which UBSan checks are allowed to be merged by the
-  backend (for example, -fno-sanitize-merge=bool,enum).
+- clang-cl and clang-dxc now support ``-fdiagnostics-color=[auto|never|always]``
+  in addition to ``-f[no-]color-diagnostics``.
 
 Deprecated Compiler Flags
 -------------------------
@@ -488,8 +488,6 @@ Removed Compiler Flags
   derivatives) is now removed, since it's no longer possible to suppress the
   diagnostic (see above). Users can expect an `unknown warning` diagnostic if
   it's still in use.
-- The experimental flag '-ubsan-unique-traps' has been removed. It is
-  superseded by '-fno-sanitize-merge'.
 
 Attribute Changes in Clang
 --------------------------
@@ -708,6 +706,34 @@ Improvements to Clang's diagnostics
 
 - Fix -Wdangling false positives on conditional operators (#120206).
 
+- Fixed a bug where Clang hung on an unsupported optional scope specifier ``::`` when parsing
+  Objective-C. Clang now emits a diagnostic message instead of hanging.
+
+- The :doc:`ThreadSafetyAnalysis` now supports passing scoped capabilities into functions:
+  an attribute on the scoped capability parameter indicates both the expected associated capabilities and,
+  like in the case of attributes on the function declaration itself, their state before and after the call.
+
+  .. code-block:: c++
+
+    #include "mutex.h"
+
+    Mutex mu1, mu2;
+    int a GUARDED_BY(mu1);
+
+    void require(MutexLocker& scope REQUIRES(mu1)) {
+      scope.Unlock();
+      a = 0; // Warning!  Requires mu1.
+      scope.Lock();
+    }
+
+    void testParameter() {
+      MutexLocker scope(&mu1), scope2(&mu2);
+      require(scope2); // Warning! Mutex managed by 'scope2' is 'mu2' instead of 'mu1'
+      require(scope); // OK.
+      scope.Unlock();
+      require(scope); // Warning!  Requires mu1.
+    }
+
 Improvements to Clang's time-trace
 ----------------------------------
 
@@ -859,6 +885,8 @@ Bug Fixes to C++ Support
 - Fixed recognition of ``std::initializer_list`` when it's surrounded with ``extern "C++"`` and exported
   out of a module (which is the case e.g. in MSVC's implementation of ``std`` module). (#GH118218)
 - Fixed a pack expansion issue in checking unexpanded parameter sizes. (#GH17042)
+- Fixed a bug where captured structured bindings were modifiable inside non-mutable lambda (#GH95081)
+- Fixed an issue while resolving type of expression indexing into a pack of values of non-dependent type (#GH121242)
 
 Bug Fixes to AST Handling
 ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -979,6 +1007,12 @@ Arm and AArch64 Support
   in leaf functions after enabling ``-fno-omit-frame-pointer``, you can do so by adding
   the ``-momit-leaf-frame-pointer`` option.
 
+- Support has been added for the following processors (-mcpu identifiers in parenthesis):
+
+  For AArch64:
+
+  * FUJITSU-MONAKA (fujitsu-monaka)
+
 Android Support
 ^^^^^^^^^^^^^^^
 
@@ -1075,6 +1109,10 @@ AST Matchers
 
 - Ensure ``pointee`` matches Objective-C pointer types.
 
+- Add ``dependentScopeDeclRefExpr`` matcher to match expressions that refer to dependent scope declarations.
+
+- Add ``dependentNameType`` matcher to match a dependent name type.
+
 clang-format
 ------------
 
@@ -1086,6 +1124,9 @@ clang-format
   ``Never``, and ``true`` to ``Always``.
 - Adds ``RemoveEmptyLinesInUnwrappedLines`` option.
 - Adds ``KeepFormFeed`` option and set it to ``true`` for ``GNU`` style.
+- Adds ``AllowShortNamespacesOnASingleLine`` option.
+- Adds ``VariableTemplates`` option.
+- Adds support for bash globstar in ``.clang-format-ignore``.
 
 libclang
 --------
@@ -1210,6 +1251,11 @@ Sanitizers
 
 - Implemented ``-f[no-]sanitize-trap=local-bounds``, and ``-f[no-]sanitize-recover=local-bounds``.
 
+- ``-fsanitize-merge`` (default) and ``-fno-sanitize-merge`` have been added for
+  fine-grained, unified control of which UBSan checks can potentially be merged
+  by the compiler (for example,
+  ``-fno-sanitize-merge=bool,enum,array-bounds,local-bounds``).
+
 Python Binding Changes
 ----------------------
 - Fixed an issue that led to crashes when calling ``Type.get_exception_specification_kind``.
@@ -1219,6 +1265,9 @@ OpenMP Support
 - Added support for 'omp assume' directive.
 - Added support for 'omp scope' directive.
 - Added support for allocator-modifier in 'allocate' clause.
+- Changed the OpenMP DeviceRTL to use 'generic' IR. The
+  ``LIBOMPTARGET_DEVICE_ARCHITECTURES`` CMake argument is now unused and will
+  always build support for AMDGPU and NVPTX targets.
 
 Improvements
 ^^^^^^^^^^^^
diff --git a/clang/docs/ThreadSafetyAnalysis.rst b/clang/docs/ThreadSafetyAnalysis.rst
index f6517afc3bfc2..9c1c32e46989b 100644
--- a/clang/docs/ThreadSafetyAnalysis.rst
+++ b/clang/docs/ThreadSafetyAnalysis.rst
@@ -187,10 +187,13 @@ REQUIRES(...), REQUIRES_SHARED(...)
 
 *Previously*: ``EXCLUSIVE_LOCKS_REQUIRED``, ``SHARED_LOCKS_REQUIRED``
 
-``REQUIRES`` is an attribute on functions or methods, which
+``REQUIRES`` is an attribute on functions, methods or function parameters of
+reference to :ref:`scoped_capability`-annotated type, which
 declares that the calling thread must have exclusive access to the given
 capabilities.  More than one capability may be specified.  The capabilities
 must be held on entry to the function, *and must still be held on exit*.
+Additionally, if the attribute is on a function parameter, it declares that
+the scoped capability manages the specified capabilities in the given order.
 
 ``REQUIRES_SHARED`` is similar, but requires only shared access.
 
@@ -211,6 +214,20 @@ must be held on entry to the function, *and must still be held on exit*.
     mu1.Unlock();
   }
 
+  void require(MutexLocker& scope REQUIRES(mu1)) {
+    scope.Unlock();
+    a = 0; // Warning!  Requires mu1.
+    scope.Lock();
+  }
+
+  void testParameter() {
+    MutexLocker scope(&mu1), scope2(&mu2);
+    require(scope2); // Warning! Mutex managed by 'scope2' is 'mu2' instead of 'mu1'
+    require(scope); // OK.
+    scope.Unlock();
+    require(scope); // Warning!  Requires mu1.
+  }
+
 
 ACQUIRE(...), ACQUIRE_SHARED(...), RELEASE(...), RELEASE_SHARED(...), RELEASE_GENERIC(...)
 ------------------------------------------------------------------------------------------
@@ -218,10 +235,13 @@ ACQUIRE(...), ACQUIRE_SHARED(...), RELEASE(...), RELEASE_SHARED(...), RELEASE_GE
 *Previously*: ``EXCLUSIVE_LOCK_FUNCTION``, ``SHARED_LOCK_FUNCTION``,
 ``UNLOCK_FUNCTION``
 
-``ACQUIRE`` and ``ACQUIRE_SHARED`` are attributes on functions or methods
-declaring that the function acquires a capability, but does not release it.
+``ACQUIRE`` and ``ACQUIRE_SHARED`` are attributes on functions, methods
+or function parameters of reference to :ref:`scoped_capability`-annotated type,
+which declare that the function acquires a capability, but does not release it.
 The given capability must not be held on entry, and will be held on exit
 (exclusively for ``ACQUIRE``, shared for ``ACQUIRE_SHARED``).
+Additionally, if the attribute is on a function parameter, it declares that
+the scoped capability manages the specified capabilities in the given order.
 
 ``RELEASE``, ``RELEASE_SHARED``, and ``RELEASE_GENERIC`` declare that the
 function releases the given capability.  The capability must be held on entry
@@ -249,6 +269,14 @@ shared for ``RELEASE_GENERIC``), and will no longer be held on exit.
     myObject.doSomething();  // Warning, mu is not locked.
   }
 
+  void release(MutexLocker& scope RELEASE(mu)) {
+  }                          // Warning!  Need to unlock mu.
+
+  void testParameter() {
+    MutexLocker scope(&mu);
+    release(scope);
+  }
+
 If no argument is passed to ``ACQUIRE`` or ``RELEASE``, then the argument is
 assumed to be ``this``, and the analysis will not check the body of the
 function.  This pattern is intended for use by classes which hide locking
@@ -283,10 +311,13 @@ EXCLUDES(...)
 
 *Previously*: ``LOCKS_EXCLUDED``
 
-``EXCLUDES`` is an attribute on functions or methods, which declares that
+``EXCLUDES`` is an attribute on functions, methods or function parameters
+of reference to :ref:`scoped_capability`-annotated type, which declares that
 the caller must *not* hold the given capabilities.  This annotation is
 used to prevent deadlock.  Many mutex implementations are not re-entrant, so
 deadlock can occur if the function acquires the mutex a second time.
+Additionally, if the attribute is on a function parameter, it declares that
+the scoped capability manages the specified capabilities in the given order.
 
 .. code-block:: c++
 
@@ -305,6 +336,16 @@ deadlock can occur if the function acquires the mutex a second time.
     mu.Unlock();
   }
 
+  void exclude(MutexLocker& scope LOCKS_EXCLUDED(mu)) {
+    scope.Unlock(); // Warning! mu is not locked.
+    scope.Lock();
+  } // Warning! mu still held at the end of function.
+
+  void testParameter() {
+    MutexLocker scope(&mu);
+    exclude(scope); // Warning, mu is held.
+  }
+
 Unlike ``REQUIRES``, ``EXCLUDES`` is optional.  The analysis will not issue a
 warning if the attribute is missing, which can lead to false negatives in some
 cases.  This issue is discussed further in :ref:`negative`.
@@ -393,6 +434,7 @@ class can be used as a capability.  The string argument specifies the kind of
 capability in error messages, e.g. ``"mutex"``.  See the ``Container`` example
 given above, or the ``Mutex`` class in :ref:`mutexheader`.
 
+.. _scoped_capability:
 
 SCOPED_CAPABILITY
 -----------------
diff --git a/clang/docs/UndefinedBehaviorSanitizer.rst b/clang/docs/UndefinedBehaviorSanitizer.rst
index 671db7f9f3671..b9ee4484fb9ae 100644
--- a/clang/docs/UndefinedBehaviorSanitizer.rst
+++ b/clang/docs/UndefinedBehaviorSanitizer.rst
@@ -276,8 +276,8 @@ Stack traces and report symbolization
 If you want UBSan to print symbolized stack trace for each error report, you
 will need to:
 
-#. Compile with ``-g`` and ``-fno-omit-frame-pointer`` to get proper debug
-   information in your binary.
+#. Compile with ``-g``, ``-fno-sanitize-merge`` and ``-fno-omit-frame-pointer``
+   to get proper debug information in your binary.
 #. Run your program with environment variable
    ``UBSAN_OPTIONS=print_stacktrace=1``.
 #. Make sure ``llvm-symbolizer`` binary is in ``PATH``.
diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h
index 07cb63956aed0..405c6166adb15 100644
--- a/clang/include/clang/AST/Stmt.h
+++ b/clang/include/clang/AST/Stmt.h
@@ -109,17 +109,7 @@ class alignas(void *) Stmt {
 
   //===--- Statement bitfields classes ---===//
 
-  enum { NumStmtBits = 9 };
-
-#define STMT(CLASS, PARENT)
-#define STMT_RANGE(BASE, FIRST, LAST)
-#define LAST_STMT_RANGE(BASE, FIRST, LAST)                                     \
-  static_assert(                                                               \
-      llvm::isInt(StmtClass::LAST##Class),                        \
-      "The number of 'StmtClass'es is strictly bounded under two to "          \
-      "the power of 'NumStmtBits'");
-#define ABSTRACT_STMT(STMT)
-#include "clang/AST/StmtNodes.inc"
+  #define NumStmtBits 9
 
   class StmtBitfields {
     friend class ASTStmtReader;
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h
index 897aa25dc95cc..9a046714068a5 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -2125,6 +2125,16 @@ extern const internal::VariadicDynCastAllOfMatcher expr;
 extern const internal::VariadicDynCastAllOfMatcher
     declRefExpr;
 
+/// Matches expressions that refer to dependent scope declarations.
+///
+/// example matches T::v;
+/// \code
+///  template  class X : T { void f() { T::v; } };
+/// \endcode
+extern const internal::VariadicDynCastAllOfMatcher
+    dependentScopeDeclRefExpr;
+
 /// Matches a reference to an ObjCIvar.
 ///
 /// Example: matches "a" in "init" method:
@@ -7701,6 +7711,16 @@ AST_MATCHER_P(DecayedType, hasDecayedType, internal::Matcher,
   return InnerType.matches(Node.getDecayedType(), Finder, Builder);
 }
 
+/// Matches a dependent name type
+///
+/// Example matches  T::type
+/// \code
+///  template  struct declToImport {
+///    typedef typename T::type dependent_name;
+///  };
+/// \endcode
+extern const AstTypeMatcher dependentNameType;
+
 /// Matches declarations whose declaration context, interpreted as a
 /// Decl, matches \c InnerMatcher.
 ///
diff --git a/clang/include/clang/Analysis/Analyses/ThreadSafety.h b/clang/include/clang/Analysis/Analyses/ThreadSafety.h
index 0866b09bab299..0fcf5bed1285a 100644
--- a/clang/include/clang/Analysis/Analyses/ThreadSafety.h
+++ b/clang/include/clang/Analysis/Analyses/ThreadSafety.h
@@ -223,6 +223,42 @@ class ThreadSafetyHandler {
   virtual void handleFunExcludesLock(StringRef Kind, Name FunName,
                                      Name LockName, SourceLocation Loc) {}
 
+  /// Warn when an actual underlying mutex of a scoped lockable does not match
+  /// the expected.
+  /// \param Loc -- The location of the call expression.
+  /// \param DLoc -- The location of the function declaration.
+  /// \param ScopeName -- The name of the scope passed to the function.
+  /// \param Kind -- The kind of the expected mutex.
+  /// \param Expected -- The name of the expected mutex.
+  /// \param Actual -- The name of the actual mutex.
+  virtual void handleUnmatchedUnderlyingMutexes(SourceLocation Loc,
+                                                SourceLocation DLoc,
+                                                Name ScopeName, StringRef Kind,
+                                                Name Expected, Name Actual) {}
+
+  /// Warn when we get fewer underlying mutexes than expected.
+  /// \param Loc -- The location of the call expression.
+  /// \param DLoc -- The location of the function declaration.
+  /// \param ScopeName -- The name of the scope passed to the function.
+  /// \param Kind -- The kind of the expected mutex.
+  /// \param Expected -- The name of the expected mutex.
+  virtual void handleExpectMoreUnderlyingMutexes(SourceLocation Loc,
+                                                 SourceLocation DLoc,
+                                                 Name ScopeName, StringRef Kind,
+                                                 Name Expected) {}
+
+  /// Warn when we get more underlying mutexes than expected.
+  /// \param Loc -- The location of the call expression.
+  /// \param DLoc -- The location of the function declaration.
+  /// \param ScopeName -- The name of the scope passed to the function.
+  /// \param Kind -- The kind of the actual mutex.
+  /// \param Actual -- The name of the actual mutex.
+  virtual void handleExpectFewerUnderlyingMutexes(SourceLocation Loc,
+                                                  SourceLocation DLoc,
+                                                  Name ScopeName,
+                                                  StringRef Kind, Name Actual) {
+  }
+
   /// Warn that L1 cannot be acquired before L2.
   virtual void handleLockAcquiredBefore(StringRef Kind, Name L1Name,
                                         Name L2Name, SourceLocation Loc) {}
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index 90d2a2056fe1b..52ad72eb608c3 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -3763,7 +3763,7 @@ def AcquireCapability : InheritableAttr {
                    Clang<"acquire_shared_capability", 0>,
                    GNU<"exclusive_lock_function">,
                    GNU<"shared_lock_function">];
-  let Subjects = SubjectList<[Function]>;
+  let Subjects = SubjectList<[Function, ParmVar]>;
   let LateParsed = LateAttrParseStandard;
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
@@ -3795,7 +3795,7 @@ def ReleaseCapability : InheritableAttr {
                    Clang<"release_shared_capability", 0>,
                    Clang<"release_generic_capability", 0>,
                    Clang<"unlock_function", 0>];
-  let Subjects = SubjectList<[Function]>;
+  let Subjects = SubjectList<[Function, ParmVar]>;
   let LateParsed = LateAttrParseStandard;
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
@@ -3819,7 +3819,7 @@ def RequiresCapability : InheritableAttr {
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
   let InheritEvenIfAlreadyPresent = 1;
-  let Subjects = SubjectList<[Function]>;
+  let Subjects = SubjectList<[Function, ParmVar]>;
   let Accessors = [Accessor<"isShared", [Clang<"requires_shared_capability", 0>,
                                          Clang<"shared_locks_required", 0>]>];
   let Documentation = [Undocumented];
@@ -3941,7 +3941,7 @@ def LocksExcluded : InheritableAttr {
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
   let InheritEvenIfAlreadyPresent = 1;
-  let Subjects = SubjectList<[Function]>;
+  let Subjects = SubjectList<[Function, ParmVar]>;
   let Documentation = [Undocumented];
 }
 
diff --git a/clang/include/clang/Basic/Builtins.td b/clang/include/clang/Basic/Builtins.td
index d64a66fc9d9cf..b5b47ae274601 100644
--- a/clang/include/clang/Basic/Builtins.td
+++ b/clang/include/clang/Basic/Builtins.td
@@ -1462,13 +1462,13 @@ def ElementwiseSubSat : Builtin {
 
 def ReduceMax : Builtin {
   let Spellings = ["__builtin_reduce_max"];
-  let Attributes = [NoThrow, Const, CustomTypeChecking];
+  let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr];
   let Prototype = "void(...)";
 }
 
 def ReduceMin : Builtin {
   let Spellings = ["__builtin_reduce_min"];
-  let Attributes = [NoThrow, Const, CustomTypeChecking];
+  let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr];
   let Prototype = "void(...)";
 }
 
diff --git a/clang/include/clang/Basic/BuiltinsHexagon.def b/clang/include/clang/Basic/BuiltinsHexagon.def
index 0dc0f4567dd41..adff9f884c049 100644
--- a/clang/include/clang/Basic/BuiltinsHexagon.def
+++ b/clang/include/clang/Basic/BuiltinsHexagon.def
@@ -17,8 +17,12 @@
 #   define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS)
 #endif
 
+#pragma push_macro("V79")
+#define V79 "v79"
+#pragma push_macro("V75")
+#define V75 "v75|" V79
 #pragma push_macro("V73")
-#define V73 "v73"
+#define V73 "v73|" V75
 #pragma push_macro("V71")
 #define V71 "v71|" V73
 #pragma push_macro("V69")
@@ -40,8 +44,12 @@
 #pragma push_macro("V5")
 #define V5 "v5|" V55
 
+#pragma push_macro("HVXV79")
+#define HVXV79 "hvxv79"
+#pragma push_macro("HVXV75")
+#define HVXV75 "hvxv75|" HVXV79
 #pragma push_macro("HVXV73")
-#define HVXV73 "hvxv73"
+#define HVXV73 "hvxv73|" HVXV75
 #pragma push_macro("HVXV71")
 #define HVXV71 "hvxv71|" HVXV73
 #pragma push_macro("HVXV69")
@@ -143,6 +151,8 @@ TARGET_BUILTIN(__builtin_HEXAGON_V6_vrmpyub_rtt_acc_128B,"V64iV64iV32iLLi","", "
 #pragma pop_macro("HVXV69")
 #pragma pop_macro("HVXV71")
 #pragma pop_macro("HVXV73")
+#pragma pop_macro("HVXV75")
+#pragma pop_macro("HVXV79")
 
 #pragma pop_macro("V5")
 #pragma pop_macro("V55")
@@ -155,6 +165,8 @@ TARGET_BUILTIN(__builtin_HEXAGON_V6_vrmpyub_rtt_acc_128B,"V64iV64iV32iLLi","", "
 #pragma pop_macro("V69")
 #pragma pop_macro("V71")
 #pragma pop_macro("V73")
+#pragma pop_macro("V75")
+#pragma pop_macro("V79")
 
 #undef BUILTIN
 #undef TARGET_BUILTIN
diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index 5155b23d151c0..42c39ac6606c7 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -67,7 +67,7 @@ def err_drv_no_cuda_libdevice : Error<
   "libdevice">;
 
 def err_drv_no_rocm_device_lib : Error<
-  "cannot find ROCm device library%select{| for %1|for ABI version %1}0; provide its path via "
+  "cannot find ROCm device library%select{| for %1| for ABI version %1}0; provide its path via "
   "'--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build "
   "without ROCm device library">;
 def err_drv_no_hip_runtime : Error<
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 491bc83c1e129..330ae045616ab 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -3999,6 +3999,10 @@ def warn_thread_attribute_decl_not_lockable : Warning<
 def warn_thread_attribute_decl_not_pointer : Warning<
   "%0 only applies to pointer types; type here is %1">,
   InGroup, DefaultIgnore;
+def warn_thread_attribute_not_on_scoped_lockable_param : Warning<
+  "%0 attribute applies to function parameters only if their type is a "
+  "reference to a 'scoped_lockable'-annotated type">,
+  InGroup, DefaultIgnore;
 def err_attribute_argument_out_of_bounds_extra_info : Error<
   "%0 attribute parameter %1 is out of bounds: "
   "%plural{0:no parameters to index into|"
@@ -4054,6 +4058,17 @@ def warn_acquired_before : Warning<
 def warn_acquired_before_after_cycle : Warning<
   "cycle in acquired_before/after dependencies, starting with '%0'">,
   InGroup, DefaultIgnore;
+def warn_unmatched_underlying_mutexes : Warning<
+  "%0 managed by '%1' is '%3' instead of '%2'">,
+  InGroup, DefaultIgnore;
+def warn_expect_more_underlying_mutexes : Warning<
+  "%0 '%2' not managed by '%1'">,
+  InGroup, DefaultIgnore;
+def warn_expect_fewer_underlying_mutexes : Warning<
+  "did not expect %0 '%2' to be managed by '%1'">,
+  InGroup, DefaultIgnore;
+def note_managed_mismatch_here_for_param : Note<
+  "see attribute on parameter here">;
 
 
 // Thread safety warnings negative capabilities
diff --git a/clang/include/clang/Basic/TargetInfo.h b/clang/include/clang/Basic/TargetInfo.h
index 82bd537b242c1..f2905f30a7c34 100644
--- a/clang/include/clang/Basic/TargetInfo.h
+++ b/clang/include/clang/Basic/TargetInfo.h
@@ -358,7 +358,14 @@ class TargetInfo : public TransferrableTargetInfo,
     //    void *__saved_reg_area_end_pointer;
     //    void *__overflow_area_pointer;
     //} va_list;
-    HexagonBuiltinVaList
+    HexagonBuiltinVaList,
+
+    // typedef struct __va_list_tag {
+    //    int* __va_stk;
+    //    int* __va_reg;
+    //    int __va_ndx;
+    //} va_list;
+    XtensaABIBuiltinVaList
   };
 
 protected:
diff --git a/clang/include/clang/Basic/arm_immcheck_incl.td b/clang/include/clang/Basic/arm_immcheck_incl.td
index 9d7f74a35aaa8..6892b8299771b 100644
--- a/clang/include/clang/Basic/arm_immcheck_incl.td
+++ b/clang/include/clang/Basic/arm_immcheck_incl.td
@@ -2,7 +2,9 @@ class ImmCheckType {
   int Value = val;
 }
 
-// These must be kept in sync with the flags in include/clang/Basic/TargetBuiltins.h
+
+// For SVE, container_size refers to the width of a vector segment (128b).
+// For NEON, container_size refers to the vector width (64b or 128b).
 def ImmCheck0_31                : ImmCheckType<0>;  // 0..31 (used for e.g. predicate patterns)
 def ImmCheck1_16                : ImmCheckType<1>;  // 1..16
 def ImmCheckExtract             : ImmCheckType<2>;  // 0..(2048/sizeinbits(elt) - 1)
@@ -10,10 +12,10 @@ def ImmCheckShiftRight          : ImmCheckType<3>;  // 1..sizeinbits(elt)
 def ImmCheckShiftRightNarrow    : ImmCheckType<4>;  // 1..sizeinbits(elt)/2
 def ImmCheckShiftLeft           : ImmCheckType<5>;  // 0..(sizeinbits(elt) - 1)
 def ImmCheck0_7                 : ImmCheckType<6>;  // 0..7
-def ImmCheckLaneIndex           : ImmCheckType<7>;  // 0..(sizeinbits(vec)/(sizeinbits(elt)) - 1)
+def ImmCheckLaneIndex           : ImmCheckType<7>;  // 0..(container_size/(sizeinbits(elt)) - 1)
 def ImmCheckCvt                 : ImmCheckType<8>;  // 1..sizeinbits(elt) (same as ShiftRight)
-def ImmCheckLaneIndexCompRotate : ImmCheckType<9>;  // 0..(sizeinbits(vec)/(2*sizeinbits(elt)) - 1)
-def ImmCheckLaneIndexDot        : ImmCheckType<10>; // 0..(sizeinbits(vec)/(4*sizeinbits(elt)) - 1)
+def ImmCheckLaneIndexCompRotate : ImmCheckType<9>;  // 0..(container_size/(2*sizeinbits(elt)) - 1)
+def ImmCheckLaneIndexDot        : ImmCheckType<10>; // 0..(container_size/(4*sizeinbits(elt)) - 1)
 def ImmCheckComplexRot90_270    : ImmCheckType<11>; // [90,270]
 def ImmCheckComplexRotAll90     : ImmCheckType<12>; // [0, 90, 180,270]
 def ImmCheck0_13                : ImmCheckType<13>; // 0..13
diff --git a/clang/include/clang/CIR/CMakeLists.txt b/clang/include/clang/CIR/CMakeLists.txt
index f8d6f407a03d0..e20c896171c92 100644
--- a/clang/include/clang/CIR/CMakeLists.txt
+++ b/clang/include/clang/CIR/CMakeLists.txt
@@ -4,3 +4,4 @@ include_directories(${MLIR_INCLUDE_DIR})
 include_directories(${MLIR_TABLEGEN_OUTPUT_DIR})
 
 add_subdirectory(Dialect)
+add_subdirectory(Interfaces)
diff --git a/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h b/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
index 75ae74e926fbc..b4a961de224aa 100644
--- a/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
+++ b/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
@@ -9,7 +9,11 @@
 #ifndef LLVM_CLANG_CIR_DIALECT_BUILDER_CIRBASEBUILDER_H
 #define LLVM_CLANG_CIR_DIALECT_BUILDER_CIRBASEBUILDER_H
 
+#include "clang/CIR/Dialect/IR/CIRAttrs.h"
+
 #include "mlir/IR/Builders.h"
+#include "mlir/IR/BuiltinTypes.h"
+#include "mlir/IR/Types.h"
 
 namespace cir {
 
@@ -18,6 +22,21 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
 public:
   CIRBaseBuilderTy(mlir::MLIRContext &mlirContext)
       : mlir::OpBuilder(&mlirContext) {}
+
+  cir::PointerType getPointerTo(mlir::Type ty) {
+    return cir::PointerType::get(getContext(), ty);
+  }
+
+  cir::PointerType getVoidPtrTy() {
+    return getPointerTo(cir::VoidType::get(getContext()));
+  }
+
+  mlir::TypedAttr getConstPtrAttr(mlir::Type type, int64_t value) {
+    auto valueAttr = mlir::IntegerAttr::get(
+        mlir::IntegerType::get(type.getContext(), 64), value);
+    return cir::ConstPtrAttr::get(
+        getContext(), mlir::cast(type), valueAttr);
+  }
 };
 
 } // namespace cir
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h
new file mode 100644
index 0000000000000..438fb7d09608d
--- /dev/null
+++ b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file declares the attributes in the CIR dialect.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_H
+#define LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_H
+
+#include "clang/CIR/Dialect/IR/CIRTypes.h"
+
+#include "mlir/IR/Attributes.h"
+#include "mlir/IR/BuiltinAttributeInterfaces.h"
+
+#include "llvm/ADT/SmallVector.h"
+
+//===----------------------------------------------------------------------===//
+// CIR Dialect Attrs
+//===----------------------------------------------------------------------===//
+
+namespace clang {
+class FunctionDecl;
+class VarDecl;
+class RecordDecl;
+} // namespace clang
+
+#define GET_ATTRDEF_CLASSES
+#include "clang/CIR/Dialect/IR/CIROpsAttributes.h.inc"
+
+#endif // LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_H
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
new file mode 100644
index 0000000000000..bd1665e1ac1a0
--- /dev/null
+++ b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
@@ -0,0 +1,142 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file declares the CIR dialect attributes.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_TD
+#define LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_TD
+
+include "mlir/IR/BuiltinAttributeInterfaces.td"
+include "mlir/IR/EnumAttr.td"
+
+include "clang/CIR/Dialect/IR/CIRDialect.td"
+
+//===----------------------------------------------------------------------===//
+// CIR Attrs
+//===----------------------------------------------------------------------===//
+
+class CIR_Attr traits = []>
+    : AttrDef {
+  let mnemonic = attrMnemonic;
+}
+
+class CIRUnitAttr traits = []>
+    : CIR_Attr {
+  let returnType = "bool";
+  let defaultValue = "false";
+  let valueType = NoneType;
+  let isOptional = 1;
+}
+
+//===----------------------------------------------------------------------===//
+// IntegerAttr
+//===----------------------------------------------------------------------===//
+
+def IntAttr : CIR_Attr<"Int", "int", [TypedAttrInterface]> {
+  let summary = "An attribute containing an integer value";
+  let description = [{
+    An integer attribute is a literal attribute that represents an integral
+    value of the specified integer type.
+  }];
+  let parameters = (ins AttributeSelfTypeParameter<"">:$type,
+                        "llvm::APInt":$value);
+  let builders = [
+    AttrBuilderWithInferredContext<(ins "mlir::Type":$type,
+                                        "const llvm::APInt &":$value), [{
+      return $_get(type.getContext(), type, value);
+    }]>,
+    AttrBuilderWithInferredContext<(ins "mlir::Type":$type,
+                                        "int64_t":$value), [{
+      IntType intType = mlir::cast(type);
+      mlir::APInt apValue(intType.getWidth(), value, intType.isSigned());
+      return $_get(intType.getContext(), intType, apValue);
+    }]>,
+  ];
+  let extraClassDeclaration = [{
+    int64_t getSInt() const { return getValue().getSExtValue(); }
+    uint64_t getUInt() const { return getValue().getZExtValue(); }
+    bool isNullValue() const { return getValue() == 0; }
+    uint64_t getBitWidth() const {
+      return mlir::cast(getType()).getWidth();
+    }
+  }];
+  let genVerifyDecl = 1;
+  let hasCustomAssemblyFormat = 1;
+}
+
+//===----------------------------------------------------------------------===//
+// FPAttr
+//===----------------------------------------------------------------------===//
+
+def FPAttr : CIR_Attr<"FP", "fp", [TypedAttrInterface]> {
+  let summary = "An attribute containing a floating-point value";
+  let description = [{
+    An fp attribute is a literal attribute that represents a floating-point
+    value of the specified floating-point type. Supporting only CIR FP types.
+  }];
+  let parameters = (ins
+    AttributeSelfTypeParameter<"", "::cir::CIRFPTypeInterface">:$type,
+    APFloatParameter<"">:$value
+  );
+  let builders = [
+    AttrBuilderWithInferredContext<(ins "mlir::Type":$type,
+                                        "const llvm::APFloat &":$value), [{
+      return $_get(type.getContext(), mlir::cast(type),
+                   value);
+    }]>,
+    AttrBuilder<(ins "mlir::Type":$type,
+                     "const llvm::APFloat &":$value), [{
+      return $_get($_ctxt, mlir::cast(type), value);
+    }]>,
+  ];
+  let extraClassDeclaration = [{
+    static FPAttr getZero(mlir::Type type);
+  }];
+  let genVerifyDecl = 1;
+
+  let assemblyFormat = [{
+    `<` custom($value, ref($type)) `>`
+  }];
+}
+
+//===----------------------------------------------------------------------===//
+// ConstPtrAttr
+//===----------------------------------------------------------------------===//
+
+def ConstPtrAttr : CIR_Attr<"ConstPtr", "ptr", [TypedAttrInterface]> {
+  let summary = "Holds a constant pointer value";
+  let parameters = (ins
+    AttributeSelfTypeParameter<"", "::cir::PointerType">:$type,
+    "mlir::IntegerAttr":$value);
+  let description = [{
+    A pointer attribute is a literal attribute that represents an integral
+    value of a pointer type.
+  }];
+  let builders = [
+    AttrBuilderWithInferredContext<(ins "mlir::Type":$type,
+                                        "mlir::IntegerAttr":$value), [{
+      return $_get(type.getContext(), mlir::cast(type),
+                   value);
+    }]>,
+    AttrBuilder<(ins "mlir::Type":$type,
+                     "mlir::IntegerAttr":$value), [{
+      return $_get($_ctxt, mlir::cast(type), value);
+    }]>,
+  ];
+  let extraClassDeclaration = [{
+    bool isNullValue() const { return getValue().getInt() == 0; }
+  }];
+
+  let assemblyFormat = [{
+    `<` custom($value) `>`
+  }];
+}
+
+#endif // LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_TD
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRDialect.h b/clang/include/clang/CIR/Dialect/IR/CIRDialect.h
index 0b71bdad29a3a..683176b139ca4 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIRDialect.h
+++ b/clang/include/clang/CIR/Dialect/IR/CIRDialect.h
@@ -26,6 +26,7 @@
 #include "mlir/Interfaces/MemorySlotInterfaces.h"
 #include "mlir/Interfaces/SideEffectInterfaces.h"
 
+#include "clang/CIR/Dialect/IR/CIRAttrs.h"
 #include "clang/CIR/Dialect/IR/CIROpsDialect.h.inc"
 
 // TableGen'erated files for MLIR dialects require that a macro be defined when
diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index 0d6c65ecf4102..b15e0415360ea 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -16,6 +16,7 @@
 
 include "clang/CIR/Dialect/IR/CIRDialect.td"
 include "clang/CIR/Dialect/IR/CIRTypes.td"
+include "clang/CIR/Dialect/IR/CIRAttrs.td"
 
 include "mlir/IR/BuiltinAttributeInterfaces.td"
 include "mlir/IR/EnumAttr.td"
@@ -75,6 +76,45 @@ class LLVMLoweringInfo {
 class CIR_Op traits = []> :
     Op, LLVMLoweringInfo;
 
+//===----------------------------------------------------------------------===//
+// ConstantOp
+//===----------------------------------------------------------------------===//
+
+def ConstantOp : CIR_Op<"const",
+                        [ConstantLike, Pure, AllTypesMatch<["value", "res"]>]> {
+  let summary = "Defines a CIR constant";
+  let description = [{
+    The `cir.const` operation turns a literal into an SSA value. The data is
+    attached to the operation as an attribute.
+
+    ```mlir
+      %0 = cir.const 42 : i32
+      %1 = cir.const 4.2 : f32
+      %2 = cir.const nullptr : !cir.ptr
+    ```
+  }];
+
+  // The constant operation takes an attribute as the only input.
+  let arguments = (ins TypedAttrInterface:$value);
+
+  // The constant operation returns a single value of CIR_AnyType.
+  let results = (outs CIR_AnyType:$res);
+
+  let assemblyFormat = "attr-dict $value";
+
+  let hasVerifier = 1;
+
+  let extraClassDeclaration = [{
+    bool isNullPtr() {
+      if (const auto ptrAttr = mlir::dyn_cast(getValue()))
+        return ptrAttr.isNullValue();
+      return false;
+    }
+  }];
+
+  let hasFolder = 1;
+}
+
 //===----------------------------------------------------------------------===//
 // GlobalOp
 //===----------------------------------------------------------------------===//
@@ -92,9 +132,19 @@ def GlobalOp : CIR_Op<"global"> {
     described by the type of the variable.
   }];
 
-  let arguments = (ins SymbolNameAttr:$sym_name, TypeAttr:$sym_type);
+  let arguments = (ins SymbolNameAttr:$sym_name, TypeAttr:$sym_type,
+                       OptionalAttr:$initial_value);
+
+  let assemblyFormat = [{
+    $sym_name
+    custom($sym_type, $initial_value)
+    attr-dict
+  }];
 
-  let assemblyFormat = [{ $sym_name `:` $sym_type attr-dict }];
+  let extraClassDeclaration = [{
+    bool isDeclaration() { return !getInitialValue(); }
+    bool hasInitializer() { return !isDeclaration(); }
+  }];
 
   let skipDefaultBuilders = 1;
 
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRTypes.h b/clang/include/clang/CIR/Dialect/IR/CIRTypes.h
index 2bc7d77b2bc8a..5d1eb17e146d0 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIRTypes.h
+++ b/clang/include/clang/CIR/Dialect/IR/CIRTypes.h
@@ -16,6 +16,13 @@
 #include "mlir/IR/BuiltinAttributes.h"
 #include "mlir/IR/Types.h"
 #include "mlir/Interfaces/DataLayoutInterfaces.h"
+#include "clang/CIR/Interfaces/CIRFPTypeInterface.h"
+
+namespace cir {
+
+bool isAnyFloatingPointType(mlir::Type t);
+
+} // namespace cir
 
 //===----------------------------------------------------------------------===//
 // CIR Dialect Tablegen'd Types
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRTypes.td b/clang/include/clang/CIR/Dialect/IR/CIRTypes.td
index ce0b6ba1d68c5..a32fb3c801114 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIRTypes.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIRTypes.td
@@ -14,6 +14,7 @@
 #define MLIR_CIR_DIALECT_CIR_TYPES
 
 include "clang/CIR/Dialect/IR/CIRDialect.td"
+include "clang/CIR/Interfaces/CIRFPTypeInterface.td"
 include "mlir/Interfaces/DataLayoutInterfaces.td"
 include "mlir/IR/AttrTypeBase.td"
 
@@ -129,4 +130,232 @@ def PrimitiveInt
     : AnyTypeOf<[UInt8, UInt16, UInt32, UInt64, SInt8, SInt16, SInt32, SInt64],
                 "primitive int", "::cir::IntType">;
 
+//===----------------------------------------------------------------------===//
+// FloatType
+//===----------------------------------------------------------------------===//
+
+class CIR_FloatType
+    : CIR_Type,
+            DeclareTypeInterfaceMethods,
+          ]> {}
+
+def CIR_Single : CIR_FloatType<"Single", "float"> {
+  let summary = "CIR single-precision 32-bit float type";
+  let description = [{
+    A 32-bit floating-point type whose format is IEEE-754 `binary32`.  It
+    represents the types `float`, `_Float32`, and `std::float32_t` in C and C++.
+  }];
+}
+
+def CIR_Double : CIR_FloatType<"Double", "double"> {
+  let summary = "CIR double-precision 64-bit float type";
+  let description = [{
+    A 64-bit floating-point type whose format is IEEE-754 `binary64`. It
+    represents the types `double', '_Float64`, `std::float64_t`, and `_Float32x`
+    in C and C++.  This is the underlying type for `long double` on some
+    platforms, including Windows.
+  }];
+}
+
+def CIR_FP16 : CIR_FloatType<"FP16", "f16"> {
+  let summary = "CIR half-precision 16-bit float type";
+  let description = [{
+    A 16-bit floating-point type whose format is IEEE-754 `binary16`. It
+    represents the types '_Float16` and `std::float16_t` in C and C++.
+  }];
+}
+
+def CIR_BFloat16 : CIR_FloatType<"BF16", "bf16"> {
+  let summary = "CIR bfloat16 16-bit float type";
+  let description = [{
+    A 16-bit floating-point type in the bfloat16 format, which is the same as
+    IEEE `binary32` except that the lower 16 bits of the mantissa are missing.
+    It represents the type `std::bfloat16_t` in C++, also spelled `__bf16` in
+    some implementations.
+  }];
+}
+
+def CIR_FP80 : CIR_FloatType<"FP80", "f80"> {
+  let summary = "CIR x87 80-bit float type";
+  let description = [{
+    An 80-bit floating-point type in the x87 extended precision format.  The
+    size and alignment of the type are both 128 bits, even though only 80 of
+    those bits are used.  This is the underlying type for `long double` on Linux
+    x86 platforms, and it is available as an extension in some implementations.
+  }];
+}
+
+def CIR_FP128 : CIR_FloatType<"FP128", "f128"> {
+  let summary = "CIR quad-precision 128-bit float type";
+  let description = [{
+    A 128-bit floating-point type whose format is IEEE-754 `binary128`. It
+    represents the types `_Float128` and `std::float128_t` in C and C++, and the
+    extension `__float128` in some implementations.  This is the underlying type
+    for `long double` on some platforms including Linux Arm.
+  }];
+}
+
+def CIR_LongDouble : CIR_FloatType<"LongDouble", "long_double"> {
+  let summary = "CIR float type for `long double`";
+  let description = [{
+    A floating-point type that represents the `long double` type in C and C++.
+
+    The underlying floating-point format of a `long double` value depends on the
+    target platform and the implementation. The `underlying` parameter specifies
+    the CIR floating-point type that corresponds to this format. Underlying
+    types of IEEE 64-bit, IEEE 128-bit, x87 80-bit, and IBM's double-double
+    format are all in use.
+  }];
+
+  let parameters = (ins "mlir::Type":$underlying);
+
+  let assemblyFormat = [{
+    `<` $underlying `>`
+  }];
+
+  let genVerifyDecl = 1;
+}
+
+// Constraints
+
+def CIR_AnyFloat: AnyTypeOf<[CIR_Single, CIR_Double, CIR_FP80, CIR_FP128,
+                             CIR_LongDouble, CIR_FP16, CIR_BFloat16]>;
+def CIR_AnyIntOrFloat: AnyTypeOf<[CIR_AnyFloat, CIR_IntType]>;
+
+//===----------------------------------------------------------------------===//
+// PointerType
+//===----------------------------------------------------------------------===//
+
+def CIR_PointerType : CIR_Type<"Pointer", "ptr",
+    [DeclareTypeInterfaceMethods]> {
+
+  let summary = "CIR pointer type";
+  let description = [{
+    The `cir.ptr` type represents C and C++ pointer types and C++ reference
+    types, other than pointers-to-members.  The `pointee` type is the type
+    pointed to.
+
+    TODO(CIR): The address space attribute is not yet implemented.
+  }];
+
+  let parameters = (ins "mlir::Type":$pointee);
+
+  let builders = [
+    TypeBuilderWithInferredContext<(ins "mlir::Type":$pointee), [{
+      return $_get(pointee.getContext(), pointee);
+    }]>,
+    TypeBuilder<(ins "mlir::Type":$pointee), [{
+      return $_get($_ctxt, pointee);
+    }]>
+  ];
+
+  let assemblyFormat = [{
+    `<` $pointee  `>`
+  }];
+
+  let genVerifyDecl = 1;
+
+  let skipDefaultBuilders = 1;
+
+  let extraClassDeclaration = [{
+    bool isVoidPtr() const {
+      return mlir::isa(getPointee());
+    }
+  }];
+}
+
+//===----------------------------------------------------------------------===//
+// FuncType
+//===----------------------------------------------------------------------===//
+
+def CIR_FuncType : CIR_Type<"Func", "func"> {
+  let summary = "CIR function type";
+  let description = [{
+    The `!cir.func` is a function type. It consists of a single return type, a
+    list of parameter types and can optionally be variadic.
+
+    Example:
+
+    ```mlir
+    !cir.func
+    !cir.func
+    !cir.func
+    ```
+  }];
+
+  let parameters = (ins ArrayRefParameter<"mlir::Type">:$inputs,
+                        "mlir::Type":$returnType, "bool":$varArg);
+  let assemblyFormat = [{
+    `<` $returnType ` ` `(` custom($inputs, $varArg) `>`
+  }];
+
+  let builders = [
+    TypeBuilderWithInferredContext<(ins
+      "llvm::ArrayRef":$inputs, "mlir::Type":$returnType,
+      CArg<"bool", "false">:$isVarArg), [{
+      return $_get(returnType.getContext(), inputs, returnType, isVarArg);
+    }]>
+  ];
+
+  let extraClassDeclaration = [{
+    /// Returns whether the function is variadic.
+    bool isVarArg() const { return getVarArg(); }
+
+    /// Returns the `i`th input operand type. Asserts if out of bounds.
+    mlir::Type getInput(unsigned i) const { return getInputs()[i]; }
+
+    /// Returns the number of arguments to the function.
+    unsigned getNumInputs() const { return getInputs().size(); }
+
+    /// Returns the result type of the function as an ArrayRef, enabling better
+    /// integration with generic MLIR utilities.
+    llvm::ArrayRef getReturnTypes() const;
+
+    /// Returns whether the function is returns void.
+    bool isVoid() const;
+
+    /// Returns a clone of this function type with the given argument
+    /// and result types.
+    FuncType clone(mlir::TypeRange inputs, mlir::TypeRange results) const;
+  }];
+}
+
+//===----------------------------------------------------------------------===//
+// Void type
+//===----------------------------------------------------------------------===//
+
+def CIR_VoidType : CIR_Type<"Void", "void"> {
+  let summary = "CIR void type";
+  let description = [{
+    The `!cir.void` type represents the C and C++ `void` type.
+  }];
+  let extraClassDeclaration = [{
+    std::string getAlias() const { return "void"; };
+  }];
+}
+
+// Constraints
+
+// Pointer to void
+def VoidPtr : Type<
+    And<[
+      CPred<"::mlir::isa<::cir::PointerType>($_self)">,
+      CPred<"::mlir::isa<::cir::VoidType>("
+            "::mlir::cast<::cir::PointerType>($_self).getPointee())">,
+    ]>, "void*">,
+    BuildableType<
+      "cir::PointerType::get($_builder.getContext(),"
+      "cir::VoidType::get($_builder.getContext()))"> {
+}
+
+//===----------------------------------------------------------------------===//
+// Global type constraints
+//===----------------------------------------------------------------------===//
+
+def CIR_AnyType : AnyTypeOf<[
+  CIR_VoidType, CIR_IntType, CIR_AnyFloat, CIR_PointerType, CIR_FuncType
+]>;
+
 #endif // MLIR_CIR_DIALECT_CIR_TYPES
diff --git a/clang/include/clang/CIR/Dialect/IR/CMakeLists.txt b/clang/include/clang/CIR/Dialect/IR/CMakeLists.txt
index 28ae30dab8dfb..1fdbc24ba6b4a 100644
--- a/clang/include/clang/CIR/Dialect/IR/CMakeLists.txt
+++ b/clang/include/clang/CIR/Dialect/IR/CMakeLists.txt
@@ -14,3 +14,6 @@ mlir_tablegen(CIROpsDialect.cpp.inc -gen-dialect-defs)
 add_public_tablegen_target(MLIRCIROpsIncGen)
 add_dependencies(mlir-headers MLIRCIROpsIncGen)
 
+mlir_tablegen(CIROpsAttributes.h.inc -gen-attrdef-decls)
+mlir_tablegen(CIROpsAttributes.cpp.inc -gen-attrdef-defs)
+add_public_tablegen_target(MLIRCIRAttrsEnumsGen)
diff --git a/clang/include/clang/CIR/Interfaces/CIRFPTypeInterface.h b/clang/include/clang/CIR/Interfaces/CIRFPTypeInterface.h
new file mode 100644
index 0000000000000..40b85ef6cfb62
--- /dev/null
+++ b/clang/include/clang/CIR/Interfaces/CIRFPTypeInterface.h
@@ -0,0 +1,22 @@
+//===---------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+//
+// Defines the interface to generically handle CIR floating-point types.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_INCLUDE_CLANG_CIR_INTERFACES_CIRFPTYPEINTERFACE_H
+#define LLVM_CLANG_INCLUDE_CLANG_CIR_INTERFACES_CIRFPTYPEINTERFACE_H
+
+#include "mlir/IR/Types.h"
+#include "llvm/ADT/APFloat.h"
+
+/// Include the tablegen'd interface declarations.
+#include "clang/CIR/Interfaces/CIRFPTypeInterface.h.inc"
+
+#endif // LLVM_CLANG_INCLUDE_CLANG_CIR_INTERFACES_CIRFPTYPEINTERFACE_H
diff --git a/clang/include/clang/CIR/Interfaces/CIRFPTypeInterface.td b/clang/include/clang/CIR/Interfaces/CIRFPTypeInterface.td
new file mode 100644
index 0000000000000..973851b61444f
--- /dev/null
+++ b/clang/include/clang/CIR/Interfaces/CIRFPTypeInterface.td
@@ -0,0 +1,56 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Defines the interface to generically handle CIR floating-point types.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_INCLUDE_CLANG_CIR_INTERFACES_CIRFPTYPEINTERFACE_TD
+#define LLVM_CLANG_INCLUDE_CLANG_CIR_INTERFACES_CIRFPTYPEINTERFACE_TD
+
+include "mlir/IR/OpBase.td"
+
+def CIRFPTypeInterface : TypeInterface<"CIRFPTypeInterface"> {
+  let description = [{
+    Contains helper functions to query properties about a floating-point type.
+  }];
+  let cppNamespace = "::cir";
+
+  let methods = [
+    InterfaceMethod<[{
+        Returns the bit width of this floating-point type.
+      }],
+      /*retTy=*/"unsigned",
+      /*methodName=*/"getWidth",
+      /*args=*/(ins),
+      /*methodBody=*/"",
+      /*defaultImplementation=*/[{
+          return llvm::APFloat::semanticsSizeInBits($_type.getFloatSemantics());
+        }]
+    >,
+    InterfaceMethod<[{
+        Return the mantissa width.
+      }],
+      /*retTy=*/"unsigned",
+      /*methodName=*/"getFPMantissaWidth",
+      /*args=*/(ins),
+      /*methodBody=*/"",
+      /*defaultImplementation=*/[{
+          return llvm::APFloat::semanticsPrecision($_type.getFloatSemantics());
+        }]
+    >,
+    InterfaceMethod<[{
+        Return the float semantics of this floating-point type.
+      }],
+      /*retTy=*/"const llvm::fltSemantics &",
+      /*methodName=*/"getFloatSemantics"
+    >,
+  ];
+}
+
+#endif // LLVM_CLANG_INCLUDE_CLANG_CIR_INTERFACES_CIRFPTYPEINTERFACE_TD
diff --git a/clang/include/clang/CIR/Interfaces/CMakeLists.txt b/clang/include/clang/CIR/Interfaces/CMakeLists.txt
new file mode 100644
index 0000000000000..1c90b6b5a23cb
--- /dev/null
+++ b/clang/include/clang/CIR/Interfaces/CMakeLists.txt
@@ -0,0 +1,14 @@
+# This replicates part of the add_mlir_interface cmake function from MLIR that
+# cannot be used here. This happens because it expects to be run inside MLIR
+# directory which is not the case for CIR (and also FIR, both have similar
+# workarounds).
+
+function(add_clang_mlir_type_interface interface)
+  set(LLVM_TARGET_DEFINITIONS ${interface}.td)
+  mlir_tablegen(${interface}.h.inc -gen-type-interface-decls)
+  mlir_tablegen(${interface}.cpp.inc -gen-type-interface-defs)
+  add_public_tablegen_target(MLIR${interface}IncGen)
+  add_dependencies(mlir-generic-headers MLIR${interface}IncGen)
+endfunction()
+
+add_clang_mlir_type_interface(CIRFPTypeInterface)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 638f8c52053ec..d922709db1778 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1990,7 +1990,7 @@ def : Flag<["-"], "fno-diagnostics-color">, Group,
   Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
   Alias;
 def fdiagnostics_color_EQ : Joined<["-"], "fdiagnostics-color=">, Group,
-  Visibility<[ClangOption, FlangOption]>,
+  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
   Values<"auto,always,never">,
   HelpText<"When to use colors in diagnostics">;
 def fansi_escape_codes : Flag<["-"], "fansi-escape-codes">, Group,
@@ -6224,6 +6224,10 @@ def mv71t : Flag<["-"], "mv71t">, Group,
   Alias, AliasArgs<["hexagonv71t"]>;
 def mv73 : Flag<["-"], "mv73">, Group,
   Alias, AliasArgs<["hexagonv73"]>;
+def mv75 : Flag<["-"], "mv75">, Group,
+  Alias, AliasArgs<["hexagonv75"]>;
+def mv79 : Flag<["-"], "mv79">, Group,
+  Alias, AliasArgs<["hexagonv79"]>;
 def mhexagon_hvx : Flag<["-"], "mhvx">, Group,
   HelpText<"Enable Hexagon Vector eXtensions">;
 def mhexagon_hvx_EQ : Joined<["-"], "mhvx=">,
diff --git a/clang/include/clang/Driver/SanitizerArgs.h b/clang/include/clang/Driver/SanitizerArgs.h
index 7410ad4303011..3b275092bbbe8 100644
--- a/clang/include/clang/Driver/SanitizerArgs.h
+++ b/clang/include/clang/Driver/SanitizerArgs.h
@@ -99,6 +99,7 @@ class SanitizerArgs {
   }
   bool needsFuzzerInterceptors() const;
   bool needsUbsanRt() const;
+  bool needsUbsanCXXRt() const;
   bool requiresMinimalRuntime() const { return MinimalRuntime; }
   bool needsDfsanRt() const { return Sanitizers.has(SanitizerKind::DataFlow); }
   bool needsSafeStackRt() const { return SafeStackRuntime; }
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index 6383934afa2c4..bb34f2d33ac15 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -988,6 +988,10 @@ struct FormatStyle {
   /// \version 3.7
   bool AllowShortLoopsOnASingleLine;
 
+  /// If ``true``, ``namespace a { class b; }`` can be put on a single line.
+  /// \version 20
+  bool AllowShortNamespacesOnASingleLine;
+
   /// Different ways to break after the function definition return type.
   /// This option is **deprecated** and is retained for backwards compatibility.
   enum DefinitionReturnTypeBreakingStyle : int8_t {
@@ -5099,6 +5103,15 @@ struct FormatStyle {
   /// \version 3.7
   UseTabStyle UseTab;
 
+  /// A vector of non-keyword identifiers that should be interpreted as variable
+  /// template names.
+  ///
+  /// A ``)`` after a variable template instantiation is **not** annotated as
+  /// the closing parenthesis of C-style cast operator.
+  ///
+  /// \version 20
+  std::vector VariableTemplates;
+
   /// For Verilog, put each port on its own line in module instantiations.
   /// \code
   ///    true:
@@ -5168,6 +5181,8 @@ struct FormatStyle {
                R.AllowShortIfStatementsOnASingleLine &&
            AllowShortLambdasOnASingleLine == R.AllowShortLambdasOnASingleLine &&
            AllowShortLoopsOnASingleLine == R.AllowShortLoopsOnASingleLine &&
+           AllowShortNamespacesOnASingleLine ==
+               R.AllowShortNamespacesOnASingleLine &&
            AlwaysBreakBeforeMultilineStrings ==
                R.AlwaysBreakBeforeMultilineStrings &&
            AttributeMacros == R.AttributeMacros &&
@@ -5308,7 +5323,7 @@ struct FormatStyle {
            TableGenBreakInsideDAGArg == R.TableGenBreakInsideDAGArg &&
            TabWidth == R.TabWidth && TemplateNames == R.TemplateNames &&
            TypeNames == R.TypeNames && TypenameMacros == R.TypenameMacros &&
-           UseTab == R.UseTab &&
+           UseTab == R.UseTab && VariableTemplates == R.VariableTemplates &&
            VerilogBreakBetweenInstancePorts ==
                R.VerilogBreakBetweenInstancePorts &&
            WhitespaceSensitiveMacros == R.WhitespaceSensitiveMacros;
diff --git a/clang/include/clang/Frontend/Utils.h b/clang/include/clang/Frontend/Utils.h
index 604e42067a3f1..8ed17179c9824 100644
--- a/clang/include/clang/Frontend/Utils.h
+++ b/clang/include/clang/Frontend/Utils.h
@@ -120,6 +120,7 @@ class DependencyFileGenerator : public DependencyCollector {
 private:
   void outputDependencyFile(DiagnosticsEngine &Diags);
 
+  llvm::IntrusiveRefCntPtr FS;
   std::string OutputFile;
   std::vector Targets;
   bool IncludeSystemHeaders;
diff --git a/clang/include/clang/Sema/SemaConcept.h b/clang/include/clang/Sema/SemaConcept.h
index fa5309a597b3a..5c599a70532f6 100644
--- a/clang/include/clang/Sema/SemaConcept.h
+++ b/clang/include/clang/Sema/SemaConcept.h
@@ -135,31 +135,20 @@ struct NormalizedConstraint {
     return *this;
   }
 
-  bool isAtomic() const { return Constraint.is(); }
+  bool isAtomic() const { return llvm::isa(Constraint); }
   bool isFoldExpanded() const {
-    return Constraint.is();
+    return llvm::isa(Constraint);
   }
-  bool isCompound() const { return Constraint.is(); }
+  bool isCompound() const { return llvm::isa(Constraint); }
 
-  CompoundConstraintKind getCompoundKind() const {
-    assert(isCompound() && "getCompoundKind on a non-compound constraint..");
-    return Constraint.get().getInt();
-  }
+  CompoundConstraintKind getCompoundKind() const;
 
   NormalizedConstraint &getLHS() const;
   NormalizedConstraint &getRHS() const;
 
-  AtomicConstraint *getAtomicConstraint() const {
-    assert(isAtomic() &&
-           "getAtomicConstraint called on non-atomic constraint.");
-    return Constraint.get();
-  }
+  AtomicConstraint *getAtomicConstraint() const;
 
-  FoldExpandedConstraint *getFoldExpandedConstraint() const {
-    assert(isFoldExpanded() &&
-           "getFoldExpandedConstraint called on non-fold-expanded constraint.");
-    return Constraint.get();
-  }
+  FoldExpandedConstraint *getFoldExpandedConstraint() const;
 
 private:
   static std::optional
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 6ec927e13a755..8b4ae58e8427a 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -9751,6 +9751,43 @@ static TypedefDecl *CreateHexagonBuiltinVaListDecl(const ASTContext *Context) {
   return Context->buildImplicitTypedef(VaListTagArrayType, "__builtin_va_list");
 }
 
+static TypedefDecl *
+CreateXtensaABIBuiltinVaListDecl(const ASTContext *Context) {
+  // typedef struct __va_list_tag {
+  RecordDecl *VaListTagDecl = Context->buildImplicitRecord("__va_list_tag");
+
+  VaListTagDecl->startDefinition();
+
+  // int* __va_stk;
+  // int* __va_reg;
+  // int __va_ndx;
+  constexpr size_t NumFields = 3;
+  QualType FieldTypes[NumFields] = {Context->getPointerType(Context->IntTy),
+                                    Context->getPointerType(Context->IntTy),
+                                    Context->IntTy};
+  const char *FieldNames[NumFields] = {"__va_stk", "__va_reg", "__va_ndx"};
+
+  // Create fields
+  for (unsigned i = 0; i < NumFields; ++i) {
+    FieldDecl *Field = FieldDecl::Create(
+        *Context, VaListTagDecl, SourceLocation(), SourceLocation(),
+        &Context->Idents.get(FieldNames[i]), FieldTypes[i], /*TInfo=*/nullptr,
+        /*BitWidth=*/nullptr,
+        /*Mutable=*/false, ICIS_NoInit);
+    Field->setAccess(AS_public);
+    VaListTagDecl->addDecl(Field);
+  }
+  VaListTagDecl->completeDefinition();
+  Context->VaListTagDecl = VaListTagDecl;
+  QualType VaListTagType = Context->getRecordType(VaListTagDecl);
+
+  // } __va_list_tag;
+  TypedefDecl *VaListTagTypedefDecl =
+      Context->buildImplicitTypedef(VaListTagType, "__builtin_va_list");
+
+  return VaListTagTypedefDecl;
+}
+
 static TypedefDecl *CreateVaListDecl(const ASTContext *Context,
                                      TargetInfo::BuiltinVaListKind Kind) {
   switch (Kind) {
@@ -9772,6 +9809,8 @@ static TypedefDecl *CreateVaListDecl(const ASTContext *Context,
     return CreateSystemZBuiltinVaListDecl(Context);
   case TargetInfo::HexagonBuiltinVaList:
     return CreateHexagonBuiltinVaListDecl(Context);
+  case TargetInfo::XtensaABIBuiltinVaList:
+    return CreateXtensaABIBuiltinVaListDecl(Context);
   }
 
   llvm_unreachable("Unhandled __builtin_va_list type kind");
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 59c77f0ce78d2..036f9608bf3ca 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -3426,6 +3426,38 @@ bool Compiler::VisitBlockExpr(const BlockExpr *E) {
   return this->emitGetFnPtr(Func, E);
 }
 
+template 
+bool Compiler::VisitCXXTypeidExpr(const CXXTypeidExpr *E) {
+  const Type *TypeInfoType = E->getType().getTypePtr();
+
+  if (!E->isPotentiallyEvaluated()) {
+    if (DiscardResult)
+      return true;
+
+    if (E->isTypeOperand())
+      return this->emitGetTypeid(
+          E->getTypeOperand(Ctx.getASTContext()).getTypePtr(), TypeInfoType, E);
+    return this->emitGetTypeid(E->getExprOperand()->getType().getTypePtr(),
+                               TypeInfoType, E);
+  }
+
+  // Otherwise, we need to evaluate the expression operand.
+  assert(E->getExprOperand());
+  assert(E->getExprOperand()->isLValue());
+
+  if (!Ctx.getLangOpts().CPlusPlus20 && !this->emitDiagTypeid(E))
+    return false;
+
+  if (!this->visit(E->getExprOperand()))
+    return false;
+
+  if (!this->emitGetTypeidPtr(TypeInfoType, E))
+    return false;
+  if (DiscardResult)
+    return this->emitPopPtr(E);
+  return true;
+}
+
 template 
 bool Compiler::VisitExpressionTraitExpr(const ExpressionTraitExpr *E) {
   assert(Ctx.getLangOpts().CPlusPlus);
@@ -4974,20 +5006,35 @@ template  bool Compiler::visitIfStmt(const IfStmt *IS) {
     LabelTy LabelEnd = this->getLabel();
     if (!this->jumpFalse(LabelElse))
       return false;
-    if (!visitStmt(IS->getThen()))
-      return false;
+    {
+      LocalScope ThenScope(this);
+      if (!visitStmt(IS->getThen()))
+        return false;
+      if (!ThenScope.destroyLocals())
+        return false;
+    }
     if (!this->jump(LabelEnd))
       return false;
     this->emitLabel(LabelElse);
-    if (!visitStmt(Else))
-      return false;
+    {
+      LocalScope ElseScope(this);
+      if (!visitStmt(Else))
+        return false;
+      if (!ElseScope.destroyLocals())
+        return false;
+    }
     this->emitLabel(LabelEnd);
   } else {
     LabelTy LabelEnd = this->getLabel();
     if (!this->jumpFalse(LabelEnd))
       return false;
-    if (!visitStmt(IS->getThen()))
-      return false;
+    {
+      LocalScope ThenScope(this);
+      if (!visitStmt(IS->getThen()))
+        return false;
+      if (!ThenScope.destroyLocals())
+        return false;
+    }
     this->emitLabel(LabelEnd);
   }
 
diff --git a/clang/lib/AST/ByteCode/Compiler.h b/clang/lib/AST/ByteCode/Compiler.h
index 2a94f5ec76b6c..71765b18cb1a9 100644
--- a/clang/lib/AST/ByteCode/Compiler.h
+++ b/clang/lib/AST/ByteCode/Compiler.h
@@ -205,6 +205,7 @@ class Compiler : public ConstStmtVisitor, bool>,
   bool VisitCXXNewExpr(const CXXNewExpr *E);
   bool VisitCXXDeleteExpr(const CXXDeleteExpr *E);
   bool VisitBlockExpr(const BlockExpr *E);
+  bool VisitCXXTypeidExpr(const CXXTypeidExpr *E);
 
   // Statements.
   bool visitCompoundStmt(const CompoundStmt *S);
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index 7c7752080746e..cb0ce886f6680 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -1154,6 +1154,53 @@ bool CheckLiteralType(InterpState &S, CodePtr OpPC, const Type *T) {
   return false;
 }
 
+static bool getField(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
+                     uint32_t Off) {
+  if (S.getLangOpts().CPlusPlus && S.inConstantContext() &&
+      !CheckNull(S, OpPC, Ptr, CSK_Field))
+    return false;
+
+  if (!CheckExtern(S, OpPC, Ptr))
+    return false;
+  if (!CheckRange(S, OpPC, Ptr, CSK_Field))
+    return false;
+  if (!CheckArray(S, OpPC, Ptr))
+    return false;
+  if (!CheckSubobject(S, OpPC, Ptr, CSK_Field))
+    return false;
+
+  if (Ptr.isIntegralPointer()) {
+    S.Stk.push(Ptr.asIntPointer().atOffset(S.getASTContext(), Off));
+    return true;
+  }
+
+  if (!Ptr.isBlockPointer()) {
+    // FIXME: The only time we (seem to) get here is when trying to access a
+    // field of a typeid pointer. In that case, we're supposed to diagnose e.g.
+    // `typeid(int).name`, but we currently diagnose `&typeid(int)`.
+    S.FFDiag(S.Current->getSource(OpPC),
+             diag::note_constexpr_access_unreadable_object)
+        << AK_Read << Ptr.toDiagnosticString(S.getASTContext());
+    return false;
+  }
+
+  if (Off > Ptr.block()->getSize())
+    return false;
+
+  S.Stk.push(Ptr.atField(Off));
+  return true;
+}
+
+bool GetPtrField(InterpState &S, CodePtr OpPC, uint32_t Off) {
+  const auto &Ptr = S.Stk.peek();
+  return getField(S, OpPC, Ptr, Off);
+}
+
+bool GetPtrFieldPop(InterpState &S, CodePtr OpPC, uint32_t Off) {
+  const auto &Ptr = S.Stk.pop();
+  return getField(S, OpPC, Ptr, Off);
+}
+
 static bool checkConstructor(InterpState &S, CodePtr OpPC, const Function *Func,
                              const Pointer &ThisPtr) {
   assert(Func->isConstructor());
@@ -1595,6 +1642,41 @@ bool CheckBitCast(InterpState &S, CodePtr OpPC, bool HasIndeterminateBits,
   return false;
 }
 
+bool GetTypeid(InterpState &S, CodePtr OpPC, const Type *TypePtr,
+               const Type *TypeInfoType) {
+  S.Stk.push(TypePtr, TypeInfoType);
+  return true;
+}
+
+bool GetTypeidPtr(InterpState &S, CodePtr OpPC, const Type *TypeInfoType) {
+  const auto &P = S.Stk.pop();
+
+  if (!P.isBlockPointer())
+    return false;
+
+  if (P.isDummy()) {
+    QualType StarThisType =
+        S.getASTContext().getLValueReferenceType(P.getType());
+    S.FFDiag(S.Current->getSource(OpPC),
+             diag::note_constexpr_polymorphic_unknown_dynamic_type)
+        << AK_TypeId
+        << P.toAPValue(S.getASTContext())
+               .getAsString(S.getASTContext(), StarThisType);
+    return false;
+  }
+
+  S.Stk.push(P.getType().getTypePtr(), TypeInfoType);
+  return true;
+}
+
+bool DiagTypeid(InterpState &S, CodePtr OpPC) {
+  const auto *E = cast(S.Current->getExpr(OpPC));
+  S.CCEDiag(E, diag::note_constexpr_typeid_polymorphic)
+      << E->getExprOperand()->getType()
+      << E->getExprOperand()->getSourceRange();
+  return false;
+}
+
 // https://github.com/llvm/llvm-project/issues/102513
 #if defined(_MSC_VER) && !defined(__clang__) && !defined(NDEBUG)
 #pragma optimize("", off)
diff --git a/clang/lib/AST/ByteCode/Interp.h b/clang/lib/AST/ByteCode/Interp.h
index 8461d1e98f977..d2aec69072e04 100644
--- a/clang/lib/AST/ByteCode/Interp.h
+++ b/clang/lib/AST/ByteCode/Interp.h
@@ -1526,61 +1526,8 @@ inline bool GetPtrGlobal(InterpState &S, CodePtr OpPC, uint32_t I) {
 
 /// 1) Peeks a Pointer
 /// 2) Pushes Pointer.atField(Off) on the stack
-inline bool GetPtrField(InterpState &S, CodePtr OpPC, uint32_t Off) {
-  const Pointer &Ptr = S.Stk.peek();
-
-  if (S.getLangOpts().CPlusPlus && S.inConstantContext() &&
-      !CheckNull(S, OpPC, Ptr, CSK_Field))
-    return false;
-
-  if (!CheckExtern(S, OpPC, Ptr))
-    return false;
-  if (!CheckRange(S, OpPC, Ptr, CSK_Field))
-    return false;
-  if (!CheckArray(S, OpPC, Ptr))
-    return false;
-  if (!CheckSubobject(S, OpPC, Ptr, CSK_Field))
-    return false;
-
-  if (Ptr.isBlockPointer() && Off > Ptr.block()->getSize())
-    return false;
-
-  if (Ptr.isIntegralPointer()) {
-    S.Stk.push(Ptr.asIntPointer().atOffset(S.getASTContext(), Off));
-    return true;
-  }
-
-  S.Stk.push(Ptr.atField(Off));
-  return true;
-}
-
-inline bool GetPtrFieldPop(InterpState &S, CodePtr OpPC, uint32_t Off) {
-  const Pointer &Ptr = S.Stk.pop();
-
-  if (S.getLangOpts().CPlusPlus && S.inConstantContext() &&
-      !CheckNull(S, OpPC, Ptr, CSK_Field))
-    return false;
-
-  if (!CheckExtern(S, OpPC, Ptr))
-    return false;
-  if (!CheckRange(S, OpPC, Ptr, CSK_Field))
-    return false;
-  if (!CheckArray(S, OpPC, Ptr))
-    return false;
-  if (!CheckSubobject(S, OpPC, Ptr, CSK_Field))
-    return false;
-
-  if (Ptr.isBlockPointer() && Off > Ptr.block()->getSize())
-    return false;
-
-  if (Ptr.isIntegralPointer()) {
-    S.Stk.push(Ptr.asIntPointer().atOffset(S.getASTContext(), Off));
-    return true;
-  }
-
-  S.Stk.push(Ptr.atField(Off));
-  return true;
-}
+bool GetPtrField(InterpState &S, CodePtr OpPC, uint32_t Off);
+bool GetPtrFieldPop(InterpState &S, CodePtr OpPC, uint32_t Off);
 
 inline bool GetPtrThisField(InterpState &S, CodePtr OpPC, uint32_t Off) {
   if (S.checkingPotentialConstantExpression())
@@ -3087,6 +3034,12 @@ inline bool BitCast(InterpState &S, CodePtr OpPC) {
   return true;
 }
 
+/// Typeid support.
+bool GetTypeid(InterpState &S, CodePtr OpPC, const Type *TypePtr,
+               const Type *TypeInfoType);
+bool GetTypeidPtr(InterpState &S, CodePtr OpPC, const Type *TypeInfoType);
+bool DiagTypeid(InterpState &S, CodePtr OpPC);
+
 //===----------------------------------------------------------------------===//
 // Read opcode arguments
 //===----------------------------------------------------------------------===//
diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index 2ae91feb2d9e8..731c9290993f1 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -17,6 +17,7 @@
 #include "clang/Basic/Builtins.h"
 #include "clang/Basic/TargetBuiltins.h"
 #include "clang/Basic/TargetInfo.h"
+#include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/SipHash.h"
 
 namespace clang {
@@ -1543,9 +1544,10 @@ static bool interp__builtin_constant_p(InterpState &S, CodePtr OpPC,
     if (Res.isInvalid()) {
       C.cleanup();
       Stk.clear();
+      return returnInt(false);
     }
 
-    if (!Res.isInvalid() && !Res.empty()) {
+    if (!Res.empty()) {
       const APValue &LV = Res.toAPValue();
       if (LV.isLValue()) {
         APValue::LValueBase Base = LV.getLValueBase();
@@ -1837,6 +1839,7 @@ static bool interp__builtin_memcpy(InterpState &S, CodePtr OpPC,
   assert(Call->getNumArgs() == 3);
   unsigned ID = Func->getBuiltinID();
   Pointer DestPtr = getParam(Frame, 0);
+  const ASTContext &ASTCtx = S.getASTContext();
   const Pointer &SrcPtr = getParam(Frame, 1);
   const APSInt &Size =
       peekToAPSInt(S.Stk, *S.getContext().classify(Call->getArg(2)));
@@ -1857,34 +1860,63 @@ static bool interp__builtin_memcpy(InterpState &S, CodePtr OpPC,
     Pointer DiagPtr = (SrcPtr.isZero() ? SrcPtr : DestPtr);
     S.FFDiag(S.Current->getSource(OpPC), diag::note_constexpr_memcpy_null)
         << /*IsMove=*/Move << /*IsWchar=*/false << !SrcPtr.isZero()
-        << DiagPtr.toDiagnosticString(S.getASTContext());
+        << DiagPtr.toDiagnosticString(ASTCtx);
     return false;
   }
 
-  QualType ElemType;
-  if (DestPtr.getFieldDesc()->isArray())
-    ElemType = DestPtr.getFieldDesc()->getElemQualType();
-  else
-    ElemType = DestPtr.getType();
+  // Can't read from dummy pointers.
+  if (DestPtr.isDummy() || SrcPtr.isDummy())
+    return false;
 
-  unsigned ElemSize =
-      S.getASTContext().getTypeSizeInChars(ElemType).getQuantity();
-  if (Size.urem(ElemSize) != 0) {
+  QualType DestElemType;
+  size_t RemainingDestElems;
+  if (DestPtr.getFieldDesc()->isArray()) {
+    DestElemType = DestPtr.getFieldDesc()->getElemQualType();
+    RemainingDestElems = DestPtr.isUnknownSizeArray()
+                             ? 0
+                             : (DestPtr.getNumElems() - DestPtr.getIndex());
+  } else {
+    DestElemType = DestPtr.getType();
+    RemainingDestElems = 1;
+  }
+  unsigned DestElemSize = ASTCtx.getTypeSizeInChars(DestElemType).getQuantity();
+
+  if (Size.urem(DestElemSize) != 0) {
     S.FFDiag(S.Current->getSource(OpPC),
              diag::note_constexpr_memcpy_unsupported)
-        << Move << /*IsWchar=*/false << 0 << ElemType << Size << ElemSize;
+        << Move << /*IsWchar=*/false << 0 << DestElemType << Size
+        << DestElemSize;
     return false;
   }
 
   QualType SrcElemType;
-  if (SrcPtr.getFieldDesc()->isArray())
+  size_t RemainingSrcElems;
+  if (SrcPtr.getFieldDesc()->isArray()) {
     SrcElemType = SrcPtr.getFieldDesc()->getElemQualType();
-  else
+    RemainingSrcElems = SrcPtr.isUnknownSizeArray()
+                            ? 0
+                            : (SrcPtr.getNumElems() - SrcPtr.getIndex());
+  } else {
     SrcElemType = SrcPtr.getType();
+    RemainingSrcElems = 1;
+  }
+  unsigned SrcElemSize = ASTCtx.getTypeSizeInChars(SrcElemType).getQuantity();
 
-  if (!S.getASTContext().hasSameUnqualifiedType(ElemType, SrcElemType)) {
+  if (!ASTCtx.hasSameUnqualifiedType(DestElemType, SrcElemType)) {
     S.FFDiag(S.Current->getSource(OpPC), diag::note_constexpr_memcpy_type_pun)
-        << Move << SrcElemType << ElemType;
+        << Move << SrcElemType << DestElemType;
+    return false;
+  }
+
+  // Check if we have enough elements to read from and write to/
+  size_t RemainingDestBytes = RemainingDestElems * DestElemSize;
+  size_t RemainingSrcBytes = RemainingSrcElems * SrcElemSize;
+  if (Size.ugt(RemainingDestBytes) || Size.ugt(RemainingSrcBytes)) {
+    APInt N = Size.udiv(DestElemSize);
+    S.FFDiag(S.Current->getSource(OpPC),
+             diag::note_constexpr_memcpy_unsupported)
+        << Move << /*IsWChar*/ false << (Size.ugt(RemainingSrcBytes) ? 1 : 2)
+        << DestElemType << toString(N, 10, /*Signed=*/false);
     return false;
   }
 
@@ -1902,10 +1934,7 @@ static bool interp__builtin_memcpy(InterpState &S, CodePtr OpPC,
     }
   }
 
-  // As a last resort, reject dummy pointers.
-  if (DestPtr.isDummy() || SrcPtr.isDummy())
-    return false;
-  assert(Size.getZExtValue() % ElemSize == 0);
+  assert(Size.getZExtValue() % DestElemSize == 0);
   if (!DoMemcpy(S, OpPC, SrcPtr, DestPtr, Bytes(Size.getZExtValue()).toBits()))
     return false;
 
diff --git a/clang/lib/AST/ByteCode/InterpBuiltinBitCast.cpp b/clang/lib/AST/ByteCode/InterpBuiltinBitCast.cpp
index 0fc94e1694822..57c1fab5d6ab4 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltinBitCast.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltinBitCast.cpp
@@ -110,7 +110,7 @@ static bool enumerateData(const Pointer &P, const Context &Ctx, Bits Offset,
   if (FieldDesc->isCompositeArray()) {
     QualType ElemType = FieldDesc->getElemQualType();
     Bits ElemSize = Bits(Ctx.getASTContext().getTypeSize(ElemType));
-    for (unsigned I = 0; I != FieldDesc->getNumElems(); ++I) {
+    for (unsigned I = P.getIndex(); I != FieldDesc->getNumElems(); ++I) {
       enumerateData(P.atIndex(I).narrow(), Ctx, Offset, BitsToRead, F);
       Offset += ElemSize;
       if (Offset >= BitsToRead)
diff --git a/clang/lib/AST/ByteCode/Opcodes.td b/clang/lib/AST/ByteCode/Opcodes.td
index 123c21fa43ece..4b0c902ab2926 100644
--- a/clang/lib/AST/ByteCode/Opcodes.td
+++ b/clang/lib/AST/ByteCode/Opcodes.td
@@ -850,3 +850,7 @@ def BitCastPrim : Opcode {
 }
 
 def BitCast : Opcode;
+
+def GetTypeid : Opcode { let Args = [ArgTypePtr, ArgTypePtr]; }
+def GetTypeidPtr : Opcode { let Args = [ArgTypePtr]; }
+def DiagTypeid : Opcode;
diff --git a/clang/lib/AST/ByteCode/Pointer.cpp b/clang/lib/AST/ByteCode/Pointer.cpp
index 54484853fcdae..ec4756fe4f87d 100644
--- a/clang/lib/AST/ByteCode/Pointer.cpp
+++ b/clang/lib/AST/ByteCode/Pointer.cpp
@@ -96,6 +96,8 @@ void Pointer::operator=(const Pointer &P) {
     PointeeStorage.Int = P.PointeeStorage.Int;
   } else if (P.isFunctionPointer()) {
     PointeeStorage.Fn = P.PointeeStorage.Fn;
+  } else if (P.isTypeidPointer()) {
+    PointeeStorage.Typeid = P.PointeeStorage.Typeid;
   } else {
     assert(false && "Unhandled storage kind");
   }
@@ -132,6 +134,8 @@ void Pointer::operator=(Pointer &&P) {
     PointeeStorage.Int = P.PointeeStorage.Int;
   } else if (P.isFunctionPointer()) {
     PointeeStorage.Fn = P.PointeeStorage.Fn;
+  } else if (P.isTypeidPointer()) {
+    PointeeStorage.Typeid = P.PointeeStorage.Typeid;
   } else {
     assert(false && "Unhandled storage kind");
   }
@@ -151,6 +155,14 @@ APValue Pointer::toAPValue(const ASTContext &ASTCtx) const {
   if (isFunctionPointer())
     return asFunctionPointer().toAPValue(ASTCtx);
 
+  if (isTypeidPointer()) {
+    TypeInfoLValue TypeInfo(PointeeStorage.Typeid.TypePtr);
+    return APValue(
+        APValue::LValueBase::getTypeInfo(
+            TypeInfo, QualType(PointeeStorage.Typeid.TypeInfoType, 0)),
+        CharUnits::Zero(), APValue::NoLValuePath{});
+  }
+
   // Build the lvalue base from the block.
   const Descriptor *Desc = getDeclDesc();
   APValue::LValueBase Base;
@@ -304,6 +316,9 @@ void Pointer::print(llvm::raw_ostream &OS) const {
   case Storage::Fn:
     OS << "(Fn) { " << asFunctionPointer().getFunction() << " + " << Offset
        << " }";
+    break;
+  case Storage::Typeid:
+    OS << "(Typeid)";
   }
 }
 
@@ -450,6 +465,8 @@ bool Pointer::hasSameBase(const Pointer &A, const Pointer &B) {
     return true;
   if (A.isFunctionPointer() && B.isFunctionPointer())
     return true;
+  if (A.isTypeidPointer() && B.isTypeidPointer())
+    return true;
 
   if (A.isIntegralPointer() || B.isIntegralPointer())
     return A.getSource() == B.getSource();
@@ -476,10 +493,10 @@ bool Pointer::pointsToLiteral() const {
   if (isZero() || !isBlockPointer())
     return false;
 
-  const Expr *E = block()->getDescriptor()->asExpr();
   if (block()->isDynamic())
     return false;
 
+  const Expr *E = block()->getDescriptor()->asExpr();
   return E && !isa(E);
 }
 
diff --git a/clang/lib/AST/ByteCode/Pointer.h b/clang/lib/AST/ByteCode/Pointer.h
index 0d467c2abf083..ef03c12e86c10 100644
--- a/clang/lib/AST/ByteCode/Pointer.h
+++ b/clang/lib/AST/ByteCode/Pointer.h
@@ -49,7 +49,12 @@ struct IntPointer {
   IntPointer baseCast(const ASTContext &ASTCtx, unsigned BaseOffset) const;
 };
 
-enum class Storage { Block, Int, Fn };
+struct TypeidPointer {
+  const Type *TypePtr;
+  const Type *TypeInfoType;
+};
+
+enum class Storage { Block, Int, Fn, Typeid };
 
 /// A pointer to a memory block, live or dead.
 ///
@@ -107,6 +112,11 @@ class Pointer {
       : Offset(Offset), StorageKind(Storage::Fn) {
     PointeeStorage.Fn = FunctionPointer(F);
   }
+  Pointer(const Type *TypePtr, const Type *TypeInfoType, uint64_t Offset = 0)
+      : Offset(Offset), StorageKind(Storage::Typeid) {
+    PointeeStorage.Typeid.TypePtr = TypePtr;
+    PointeeStorage.Typeid.TypeInfoType = TypeInfoType;
+  }
   Pointer(Block *Pointee, unsigned Base, uint64_t Offset);
   ~Pointer();
 
@@ -263,6 +273,8 @@ class Pointer {
       return asBlockPointer().Pointee == nullptr;
     if (isFunctionPointer())
       return asFunctionPointer().isZero();
+    if (isTypeidPointer())
+      return false;
     assert(isIntegralPointer());
     return asIntPointer().Value == 0 && Offset == 0;
   }
@@ -284,7 +296,7 @@ class Pointer {
   const Descriptor *getDeclDesc() const {
     if (isIntegralPointer())
       return asIntPointer().Desc;
-    if (isFunctionPointer())
+    if (isFunctionPointer() || isTypeidPointer())
       return nullptr;
 
     assert(isBlockPointer());
@@ -337,6 +349,9 @@ class Pointer {
 
   /// Returns the type of the innermost field.
   QualType getType() const {
+    if (isTypeidPointer())
+      return QualType(PointeeStorage.Typeid.TypeInfoType, 0);
+
     if (inPrimitiveArray() && Offset != asBlockPointer().Base) {
       // Unfortunately, complex and vector types are not array types in clang,
       // but they are for us.
@@ -437,7 +452,7 @@ class Pointer {
   }
   /// Pointer points directly to a block.
   bool isRoot() const {
-    if (isZero() || isIntegralPointer())
+    if (isZero() || !isBlockPointer())
       return true;
     return (asBlockPointer().Base ==
                 asBlockPointer().Pointee->getDescriptor()->getMetadataSize() ||
@@ -467,6 +482,7 @@ class Pointer {
   bool isBlockPointer() const { return StorageKind == Storage::Block; }
   bool isIntegralPointer() const { return StorageKind == Storage::Int; }
   bool isFunctionPointer() const { return StorageKind == Storage::Fn; }
+  bool isTypeidPointer() const { return StorageKind == Storage::Typeid; }
 
   /// Returns the record descriptor of a class.
   const Record *getRecord() const { return getFieldDesc()->ElemRecord; }
@@ -605,7 +621,7 @@ class Pointer {
 
   /// Checks if the index is one past end.
   bool isOnePastEnd() const {
-    if (isIntegralPointer() || isFunctionPointer())
+    if (!isBlockPointer())
       return false;
 
     if (!asBlockPointer().Pointee)
@@ -746,6 +762,7 @@ class Pointer {
     BlockPointer BS;
     IntPointer Int;
     FunctionPointer Fn;
+    TypeidPointer Typeid;
   } PointeeStorage;
   Storage StorageKind = Storage::Int;
 };
diff --git a/clang/lib/AST/ExprCXX.cpp b/clang/lib/AST/ExprCXX.cpp
index fc09d24fc30cb..5bf5d6adf525a 100644
--- a/clang/lib/AST/ExprCXX.cpp
+++ b/clang/lib/AST/ExprCXX.cpp
@@ -1722,7 +1722,7 @@ PackIndexingExpr *PackIndexingExpr::Create(
   if (Index && FullySubstituted && !SubstitutedExprs.empty())
     Type = SubstitutedExprs[*Index]->getType();
   else
-    Type = Context.DependentTy;
+    Type = PackIdExpr->getType();
 
   void *Storage =
       Context.Allocate(totalSizeToAlloc(SubstitutedExprs.size()));
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 89c515e639276..dd75dca647540 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -13604,7 +13604,9 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
   case Builtin::BI__builtin_reduce_mul:
   case Builtin::BI__builtin_reduce_and:
   case Builtin::BI__builtin_reduce_or:
-  case Builtin::BI__builtin_reduce_xor: {
+  case Builtin::BI__builtin_reduce_xor:
+  case Builtin::BI__builtin_reduce_min:
+  case Builtin::BI__builtin_reduce_max: {
     APValue Source;
     if (!EvaluateAsRValue(Info, E->getArg(0), Source))
       return false;
@@ -13641,6 +13643,14 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
         Reduced ^= Source.getVectorElt(EltNum).getInt();
         break;
       }
+      case Builtin::BI__builtin_reduce_min: {
+        Reduced = std::min(Reduced, Source.getVectorElt(EltNum).getInt());
+        break;
+      }
+      case Builtin::BI__builtin_reduce_max: {
+        Reduced = std::max(Reduced, Source.getVectorElt(EltNum).getInt());
+        break;
+      }
       }
     }
 
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp
index 1e527ed0b2a2e..d6a351a78c7ba 100644
--- a/clang/lib/AST/Stmt.cpp
+++ b/clang/lib/AST/Stmt.cpp
@@ -47,6 +47,15 @@
 
 using namespace clang;
 
+#define STMT(CLASS, PARENT)
+#define STMT_RANGE(BASE, FIRST, LAST)
+#define LAST_STMT_RANGE(BASE, FIRST, LAST)                                     \
+  static_assert(llvm::isUInt(Stmt::StmtClass::LAST##Class),             \
+                "The number of 'StmtClass'es is strictly bound "               \
+                "by a bitfield of width NumStmtBits");
+#define ABSTRACT_STMT(STMT)
+#include "clang/AST/StmtNodes.inc"
+
 static struct StmtClassNameTable {
   const char *Name;
   unsigned Counter;
diff --git a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
index bf9dc5f2373f9..a47633bf4bae2 100644
--- a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
+++ b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
@@ -924,6 +924,8 @@ const internal::VariadicDynCastAllOfMatcher
 const internal::VariadicDynCastAllOfMatcher cxxFoldExpr;
 const internal::VariadicDynCastAllOfMatcher expr;
 const internal::VariadicDynCastAllOfMatcher declRefExpr;
+const internal::VariadicDynCastAllOfMatcher
+    dependentScopeDeclRefExpr;
 const internal::VariadicDynCastAllOfMatcher objcIvarRefExpr;
 const internal::VariadicDynCastAllOfMatcher blockExpr;
 const internal::VariadicDynCastAllOfMatcher ifStmt;
@@ -1106,6 +1108,7 @@ const AstTypeMatcher substTemplateTypeParmType;
 const AstTypeMatcher templateTypeParmType;
 const AstTypeMatcher injectedClassNameType;
 const AstTypeMatcher decayedType;
+const AstTypeMatcher dependentNameType;
 AST_TYPELOC_TRAVERSE_MATCHER_DEF(hasElementType,
                                  AST_POLYMORPHIC_SUPPORTED_TYPES(ArrayType,
                                                                  ComplexType));
diff --git a/clang/lib/ASTMatchers/Dynamic/Registry.cpp b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
index 837633fb2f060..bfdee412c5328 100644
--- a/clang/lib/ASTMatchers/Dynamic/Registry.cpp
+++ b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
@@ -222,6 +222,8 @@ RegistryMaps::RegistryMaps() {
   REGISTER_MATCHER(decompositionDecl);
   REGISTER_MATCHER(declCountIs);
   REGISTER_MATCHER(declRefExpr);
+  REGISTER_MATCHER(dependentNameType);
+  REGISTER_MATCHER(dependentScopeDeclRefExpr);
   REGISTER_MATCHER(declStmt);
   REGISTER_MATCHER(declaratorDecl);
   REGISTER_MATCHER(decltypeType);
diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp
index 5577f45aa5217..bfaf1a0e7c7ff 100644
--- a/clang/lib/Analysis/ThreadSafety.cpp
+++ b/clang/lib/Analysis/ThreadSafety.cpp
@@ -103,6 +103,8 @@ class FactSet;
 /// FIXME: this analysis does not currently support re-entrant locking.
 class FactEntry : public CapabilityExpr {
 public:
+  enum FactEntryKind { Lockable, ScopedLockable };
+
   /// Where a fact comes from.
   enum SourceKind {
     Acquired, ///< The fact has been directly acquired.
@@ -112,6 +114,8 @@ class FactEntry : public CapabilityExpr {
   };
 
 private:
+  const FactEntryKind Kind : 8;
+
   /// Exclusive or shared.
   LockKind LKind : 8;
 
@@ -122,13 +126,14 @@ class FactEntry : public CapabilityExpr {
   SourceLocation AcquireLoc;
 
 public:
-  FactEntry(const CapabilityExpr &CE, LockKind LK, SourceLocation Loc,
-            SourceKind Src)
-      : CapabilityExpr(CE), LKind(LK), Source(Src), AcquireLoc(Loc) {}
+  FactEntry(FactEntryKind FK, const CapabilityExpr &CE, LockKind LK,
+            SourceLocation Loc, SourceKind Src)
+      : CapabilityExpr(CE), Kind(FK), LKind(LK), Source(Src), AcquireLoc(Loc) {}
   virtual ~FactEntry() = default;
 
   LockKind kind() const { return LKind;      }
   SourceLocation loc() const { return AcquireLoc; }
+  FactEntryKind getFactEntryKind() const { return Kind; }
 
   bool asserted() const { return Source == Asserted; }
   bool declared() const { return Source == Declared; }
@@ -857,7 +862,7 @@ class LockableFactEntry : public FactEntry {
 public:
   LockableFactEntry(const CapabilityExpr &CE, LockKind LK, SourceLocation Loc,
                     SourceKind Src = Acquired)
-      : FactEntry(CE, LK, Loc, Src) {}
+      : FactEntry(Lockable, CE, LK, Loc, Src) {}
 
   void
   handleRemovalFromIntersection(const FactSet &FSet, FactManager &FactMan,
@@ -885,6 +890,10 @@ class LockableFactEntry : public FactEntry {
                                 !Cp, LK_Exclusive, UnlockLoc));
     }
   }
+
+  static bool classof(const FactEntry *A) {
+    return A->getFactEntryKind() == Lockable;
+  }
 };
 
 class ScopedLockableFactEntry : public FactEntry {
@@ -903,8 +912,16 @@ class ScopedLockableFactEntry : public FactEntry {
   SmallVector UnderlyingMutexes;
 
 public:
-  ScopedLockableFactEntry(const CapabilityExpr &CE, SourceLocation Loc)
-      : FactEntry(CE, LK_Exclusive, Loc, Acquired) {}
+  ScopedLockableFactEntry(const CapabilityExpr &CE, SourceLocation Loc,
+                          SourceKind Src)
+      : FactEntry(ScopedLockable, CE, LK_Exclusive, Loc, Src) {}
+
+  CapExprSet getUnderlyingMutexes() const {
+    CapExprSet UnderlyingMutexesSet;
+    for (const UnderlyingCapability &UnderlyingMutex : UnderlyingMutexes)
+      UnderlyingMutexesSet.push_back(UnderlyingMutex.Cap);
+    return UnderlyingMutexesSet;
+  }
 
   void addLock(const CapabilityExpr &M) {
     UnderlyingMutexes.push_back(UnderlyingCapability{M, UCK_Acquired});
@@ -971,6 +988,10 @@ class ScopedLockableFactEntry : public FactEntry {
       FSet.removeLock(FactMan, Cp);
   }
 
+  static bool classof(const FactEntry *A) {
+    return A->getFactEntryKind() == ScopedLockable;
+  }
+
 private:
   void lock(FactSet &FSet, FactManager &FactMan, const CapabilityExpr &Cp,
             LockKind kind, SourceLocation loc,
@@ -1806,7 +1827,7 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D,
   if (Exp) {
     assert(!Self);
     const auto *TagT = Exp->getType()->getAs();
-    if (TagT && Exp->isPRValue()) {
+    if (D->hasAttrs() && TagT && Exp->isPRValue()) {
       std::pair Placeholder =
           Analyzer->SxBuilder.createThisPlaceholder(Exp);
       [[maybe_unused]] auto inserted =
@@ -1915,6 +1936,101 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D,
     }
   }
 
+  std::optional Args;
+  if (Exp) {
+    if (const auto *CE = dyn_cast(Exp))
+      Args = CE->arguments();
+    else if (const auto *CE = dyn_cast(Exp))
+      Args = CE->arguments();
+    else
+      llvm_unreachable("Unknown call kind");
+  }
+  const auto *CalledFunction = dyn_cast(D);
+  if (CalledFunction && Args.has_value()) {
+    for (auto [Param, Arg] : zip(CalledFunction->parameters(), *Args)) {
+      CapExprSet DeclaredLocks;
+      for (const Attr *At : Param->attrs()) {
+        switch (At->getKind()) {
+        case attr::AcquireCapability: {
+          const auto *A = cast(At);
+          Analyzer->getMutexIDs(A->isShared() ? SharedLocksToAdd
+                                              : ExclusiveLocksToAdd,
+                                A, Exp, D, Self);
+          Analyzer->getMutexIDs(DeclaredLocks, A, Exp, D, Self);
+          break;
+        }
+
+        case attr::ReleaseCapability: {
+          const auto *A = cast(At);
+          if (A->isGeneric())
+            Analyzer->getMutexIDs(GenericLocksToRemove, A, Exp, D, Self);
+          else if (A->isShared())
+            Analyzer->getMutexIDs(SharedLocksToRemove, A, Exp, D, Self);
+          else
+            Analyzer->getMutexIDs(ExclusiveLocksToRemove, A, Exp, D, Self);
+          Analyzer->getMutexIDs(DeclaredLocks, A, Exp, D, Self);
+          break;
+        }
+
+        case attr::RequiresCapability: {
+          const auto *A = cast(At);
+          for (auto *Arg : A->args())
+            Analyzer->warnIfMutexNotHeld(FSet, D, Exp,
+                                         A->isShared() ? AK_Read : AK_Written,
+                                         Arg, POK_FunctionCall, Self, Loc);
+          Analyzer->getMutexIDs(DeclaredLocks, A, Exp, D, Self);
+          break;
+        }
+
+        case attr::LocksExcluded: {
+          const auto *A = cast(At);
+          for (auto *Arg : A->args())
+            Analyzer->warnIfMutexHeld(FSet, D, Exp, Arg, Self, Loc);
+          Analyzer->getMutexIDs(DeclaredLocks, A, Exp, D, Self);
+          break;
+        }
+
+        default:
+          break;
+        }
+      }
+      if (DeclaredLocks.empty())
+        continue;
+      CapabilityExpr Cp(Analyzer->SxBuilder.translate(Arg, nullptr),
+                        StringRef("mutex"), false);
+      if (const auto *CBTE = dyn_cast(Arg->IgnoreCasts());
+          Cp.isInvalid() && CBTE) {
+        if (auto Object = Analyzer->ConstructedObjects.find(CBTE->getSubExpr());
+            Object != Analyzer->ConstructedObjects.end())
+          Cp = CapabilityExpr(Object->second, StringRef("mutex"), false);
+      }
+      const FactEntry *Fact = FSet.findLock(Analyzer->FactMan, Cp);
+      if (!Fact) {
+        Analyzer->Handler.handleMutexNotHeld(Cp.getKind(), D, POK_FunctionCall,
+                                             Cp.toString(), LK_Exclusive,
+                                             Exp->getExprLoc());
+        continue;
+      }
+      const auto *Scope = cast(Fact);
+      for (const auto &[a, b] :
+           zip_longest(DeclaredLocks, Scope->getUnderlyingMutexes())) {
+        if (!a.has_value()) {
+          Analyzer->Handler.handleExpectFewerUnderlyingMutexes(
+              Exp->getExprLoc(), D->getLocation(), Scope->toString(),
+              b.value().getKind(), b.value().toString());
+        } else if (!b.has_value()) {
+          Analyzer->Handler.handleExpectMoreUnderlyingMutexes(
+              Exp->getExprLoc(), D->getLocation(), Scope->toString(),
+              a.value().getKind(), a.value().toString());
+        } else if (!a.value().equals(b.value())) {
+          Analyzer->Handler.handleUnmatchedUnderlyingMutexes(
+              Exp->getExprLoc(), D->getLocation(), Scope->toString(),
+              a.value().getKind(), a.value().toString(), b.value().toString());
+          break;
+        }
+      }
+    }
+  }
   // Remove locks first to allow lock upgrading/downgrading.
   // FIXME -- should only fully remove if the attribute refers to 'this'.
   bool Dtor = isa(D);
@@ -1937,7 +2053,8 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D,
 
   if (!Scp.shouldIgnore()) {
     // Add the managing object as a dummy mutex, mapped to the underlying mutex.
-    auto ScopedEntry = std::make_unique(Scp, Loc);
+    auto ScopedEntry = std::make_unique(
+        Scp, Loc, FactEntry::Acquired);
     for (const auto &M : ExclusiveLocksToAdd)
       ScopedEntry->addLock(M);
     for (const auto &M : SharedLocksToAdd)
@@ -2084,7 +2201,7 @@ void BuildLockset::VisitCallExpr(const CallExpr *Exp) {
   }
 
   auto *D = dyn_cast_or_null(Exp->getCalleeDecl());
-  if(!D || !D->hasAttrs())
+  if (!D)
     return;
   handleCall(Exp, D);
 }
@@ -2324,7 +2441,7 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) {
   // Add locks from exclusive_locks_required and shared_locks_required
   // to initial lockset. Also turn off checking for lock and unlock functions.
   // FIXME: is there a more intelligent way to check lock/unlock functions?
-  if (!SortedGraph->empty() && D->hasAttrs()) {
+  if (!SortedGraph->empty()) {
     assert(*SortedGraph->begin() == &CFGraph->getEntry());
     FactSet &InitialLockset = Initial.EntrySet;
 
@@ -2362,6 +2479,44 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) {
         return;
       }
     }
+    ArrayRef Params;
+    if (CurrentFunction)
+      Params = CurrentFunction->getCanonicalDecl()->parameters();
+    else if (auto CurrentMethod = dyn_cast(D))
+      Params = CurrentMethod->getCanonicalDecl()->parameters();
+    else
+      llvm_unreachable("Unknown function kind");
+    for (const ParmVarDecl *Param : Params) {
+      CapExprSet UnderlyingLocks;
+      for (const auto *Attr : Param->attrs()) {
+        Loc = Attr->getLocation();
+        if (const auto *A = dyn_cast(Attr)) {
+          getMutexIDs(A->isShared() ? SharedLocksToAdd : ExclusiveLocksToAdd, A,
+                      nullptr, Param);
+          getMutexIDs(LocksReleased, A, nullptr, Param);
+          getMutexIDs(UnderlyingLocks, A, nullptr, Param);
+        } else if (const auto *A = dyn_cast(Attr)) {
+          getMutexIDs(A->isShared() ? SharedLocksToAdd : ExclusiveLocksToAdd, A,
+                      nullptr, Param);
+          getMutexIDs(UnderlyingLocks, A, nullptr, Param);
+        } else if (const auto *A = dyn_cast(Attr)) {
+          getMutexIDs(A->isShared() ? SharedLocksAcquired
+                                    : ExclusiveLocksAcquired,
+                      A, nullptr, Param);
+          getMutexIDs(UnderlyingLocks, A, nullptr, Param);
+        } else if (const auto *A = dyn_cast(Attr)) {
+          getMutexIDs(UnderlyingLocks, A, nullptr, Param);
+        }
+      }
+      if (UnderlyingLocks.empty())
+        continue;
+      CapabilityExpr Cp(SxBuilder.createVariable(Param), StringRef(), false);
+      auto ScopedEntry = std::make_unique(
+          Cp, Param->getLocation(), FactEntry::Declared);
+      for (const CapabilityExpr &M : UnderlyingLocks)
+        ScopedEntry->addLock(M);
+      addLock(InitialLockset, std::move(ScopedEntry), true);
+    }
 
     // FIXME -- Loc can be wrong here.
     for (const auto &Mu : ExclusiveLocksToAdd) {
diff --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt
index e11e1ac4a6fa6..331dfbb3f4b67 100644
--- a/clang/lib/Basic/CMakeLists.txt
+++ b/clang/lib/Basic/CMakeLists.txt
@@ -120,6 +120,7 @@ add_clang_library(clangBasic
   Targets/WebAssembly.cpp
   Targets/X86.cpp
   Targets/XCore.cpp
+  Targets/Xtensa.cpp
   TokenKinds.cpp
   TypeTraits.cpp
   Version.cpp
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 706a391023b3a..be5dedbe8044e 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -40,6 +40,7 @@
 #include "Targets/WebAssembly.h"
 #include "Targets/X86.h"
 #include "Targets/XCore.h"
+#include "Targets/Xtensa.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/DiagnosticFrontend.h"
 #include "llvm/ADT/StringExtras.h"
@@ -297,6 +298,14 @@ std::unique_ptr AllocateTarget(const llvm::Triple &Triple,
     case llvm::Triple::NaCl:
       return std::make_unique>(Triple,
                                                                     Opts);
+    case llvm::Triple::Win32:
+      switch (Triple.getEnvironment()) {
+      case llvm::Triple::GNU:
+        return std::make_unique(Triple, Opts);
+      case llvm::Triple::MSVC:
+      default: // Assume MSVC for unknown environments
+        return std::make_unique(Triple, Opts);
+      }
     default:
       return std::make_unique(Triple, Opts);
     }
@@ -743,6 +752,9 @@ std::unique_ptr AllocateTarget(const llvm::Triple &Triple,
     default:
         return std::make_unique(Triple, Opts);
     }
+
+  case llvm::Triple::xtensa:
+    return std::make_unique(Triple, Opts);
   }
 }
 } // namespace targets
diff --git a/clang/lib/Basic/Targets/Hexagon.cpp b/clang/lib/Basic/Targets/Hexagon.cpp
index 0282ac812c306..b5e06b679ece7 100644
--- a/clang/lib/Basic/Targets/Hexagon.cpp
+++ b/clang/lib/Basic/Targets/Hexagon.cpp
@@ -78,6 +78,12 @@ void HexagonTargetInfo::getTargetDefines(const LangOptions &Opts,
   } else if (CPU == "hexagonv73") {
     Builder.defineMacro("__HEXAGON_V73__");
     Builder.defineMacro("__HEXAGON_ARCH__", "73");
+  } else if (CPU == "hexagonv75") {
+    Builder.defineMacro("__HEXAGON_V75__");
+    Builder.defineMacro("__HEXAGON_ARCH__", "75");
+  } else if (CPU == "hexagonv79") {
+    Builder.defineMacro("__HEXAGON_V79__");
+    Builder.defineMacro("__HEXAGON_ARCH__", "79");
   }
 
   if (hasFeature("hvx-length64b")) {
@@ -229,13 +235,14 @@ struct CPUSuffix {
 };
 
 static constexpr CPUSuffix Suffixes[] = {
-    {{"hexagonv5"},  {"5"}},  {{"hexagonv55"},  {"55"}},
-    {{"hexagonv60"}, {"60"}}, {{"hexagonv62"},  {"62"}},
-    {{"hexagonv65"}, {"65"}}, {{"hexagonv66"},  {"66"}},
+    {{"hexagonv5"}, {"5"}},   {{"hexagonv55"}, {"55"}},
+    {{"hexagonv60"}, {"60"}}, {{"hexagonv62"}, {"62"}},
+    {{"hexagonv65"}, {"65"}}, {{"hexagonv66"}, {"66"}},
     {{"hexagonv67"}, {"67"}}, {{"hexagonv67t"}, {"67t"}},
-    {{"hexagonv68"}, {"68"}}, {{"hexagonv69"},  {"69"}},
-    {{"hexagonv71"}, {"71"}}, {{"hexagonv71t"},  {"71t"}},
-    {{"hexagonv73"}, {"73"}},
+    {{"hexagonv68"}, {"68"}}, {{"hexagonv69"}, {"69"}},
+    {{"hexagonv71"}, {"71"}}, {{"hexagonv71t"}, {"71t"}},
+    {{"hexagonv73"}, {"73"}}, {{"hexagonv75"}, {"75"}},
+    {{"hexagonv79"}, {"79"}},
 };
 
 std::optional HexagonTargetInfo::getHexagonCPURev(StringRef Name) {
diff --git a/clang/lib/Basic/Targets/Mips.cpp b/clang/lib/Basic/Targets/Mips.cpp
index 174bc9d2ab996..d56995e3ccc48 100644
--- a/clang/lib/Basic/Targets/Mips.cpp
+++ b/clang/lib/Basic/Targets/Mips.cpp
@@ -304,3 +304,62 @@ bool MipsTargetInfo::validateTarget(DiagnosticsEngine &Diags) const {
 
   return true;
 }
+
+WindowsMipsTargetInfo::WindowsMipsTargetInfo(const llvm::Triple &Triple,
+                                             const TargetOptions &Opts)
+    : WindowsTargetInfo(Triple, Opts), Triple(Triple) {}
+
+void WindowsMipsTargetInfo::getVisualStudioDefines(
+    const LangOptions &Opts, MacroBuilder &Builder) const {
+  Builder.defineMacro("_M_MRX000", "4000");
+}
+
+TargetInfo::BuiltinVaListKind
+WindowsMipsTargetInfo::getBuiltinVaListKind() const {
+  return TargetInfo::CharPtrBuiltinVaList;
+}
+
+TargetInfo::CallingConvCheckResult
+WindowsMipsTargetInfo::checkCallingConvention(CallingConv CC) const {
+  switch (CC) {
+  case CC_X86StdCall:
+  case CC_X86ThisCall:
+  case CC_X86FastCall:
+  case CC_X86VectorCall:
+    return CCCR_Ignore;
+  case CC_C:
+  case CC_OpenCLKernel:
+  case CC_PreserveMost:
+  case CC_PreserveAll:
+  case CC_Swift:
+  case CC_SwiftAsync:
+    return CCCR_OK;
+  default:
+    return CCCR_Warning;
+  }
+}
+
+// Windows MIPS, MS (C++) ABI
+MicrosoftMipsTargetInfo::MicrosoftMipsTargetInfo(const llvm::Triple &Triple,
+                                                 const TargetOptions &Opts)
+    : WindowsMipsTargetInfo(Triple, Opts) {
+  TheCXXABI.set(TargetCXXABI::Microsoft);
+}
+
+void MicrosoftMipsTargetInfo::getTargetDefines(const LangOptions &Opts,
+                                               MacroBuilder &Builder) const {
+  WindowsMipsTargetInfo::getTargetDefines(Opts, Builder);
+  WindowsMipsTargetInfo::getVisualStudioDefines(Opts, Builder);
+}
+
+MinGWMipsTargetInfo::MinGWMipsTargetInfo(const llvm::Triple &Triple,
+                                         const TargetOptions &Opts)
+    : WindowsMipsTargetInfo(Triple, Opts) {
+  TheCXXABI.set(TargetCXXABI::GenericMIPS);
+}
+
+void MinGWMipsTargetInfo::getTargetDefines(const LangOptions &Opts,
+                                           MacroBuilder &Builder) const {
+  WindowsMipsTargetInfo::getTargetDefines(Opts, Builder);
+  Builder.defineMacro("_MIPS_");
+}
diff --git a/clang/lib/Basic/Targets/Mips.h b/clang/lib/Basic/Targets/Mips.h
index 8acaf56523b21..7ddcd57053cb2 100644
--- a/clang/lib/Basic/Targets/Mips.h
+++ b/clang/lib/Basic/Targets/Mips.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_MIPS_H
 #define LLVM_CLANG_LIB_BASIC_TARGETS_MIPS_H
 
+#include "OSTargets.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Basic/TargetOptions.h"
 #include "llvm/Support/Compiler.h"
@@ -450,6 +451,42 @@ class LLVM_LIBRARY_VISIBILITY MipsTargetInfo : public TargetInfo {
     return std::make_pair(32, 32);
   }
 };
+
+class LLVM_LIBRARY_VISIBILITY WindowsMipsTargetInfo
+    : public WindowsTargetInfo {
+  const llvm::Triple Triple;
+
+public:
+  WindowsMipsTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts);
+
+  void getVisualStudioDefines(const LangOptions &Opts,
+                              MacroBuilder &Builder) const;
+
+  BuiltinVaListKind getBuiltinVaListKind() const override;
+
+  CallingConvCheckResult checkCallingConvention(CallingConv CC) const override;
+};
+
+// Windows MIPS, MS (C++) ABI
+class LLVM_LIBRARY_VISIBILITY MicrosoftMipsTargetInfo
+    : public WindowsMipsTargetInfo {
+public:
+  MicrosoftMipsTargetInfo(const llvm::Triple &Triple,
+                          const TargetOptions &Opts);
+
+  void getTargetDefines(const LangOptions &Opts,
+                        MacroBuilder &Builder) const override;
+};
+
+// MIPS MinGW target
+class LLVM_LIBRARY_VISIBILITY MinGWMipsTargetInfo
+    : public WindowsMipsTargetInfo {
+public:
+  MinGWMipsTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts);
+
+  void getTargetDefines(const LangOptions &Opts,
+                        MacroBuilder &Builder) const override;
+};
 } // namespace targets
 } // namespace clang
 
diff --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Targets/OSTargets.h
index cd9b3760ca587..53dd23c312963 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -790,7 +790,9 @@ template 
 class LLVM_LIBRARY_VISIBILITY UEFITargetInfo : public OSTargetInfo {
 protected:
   void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
-                    MacroBuilder &Builder) const override {}
+                    MacroBuilder &Builder) const override {
+    Builder.defineMacro("__UEFI__");
+  }
 
 public:
   UEFITargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
diff --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h
index 3ed36c8fa724b..553c452d4ba3c 100644
--- a/clang/lib/Basic/Targets/X86.h
+++ b/clang/lib/Basic/Targets/X86.h
@@ -832,11 +832,6 @@ class LLVM_LIBRARY_VISIBILITY UEFIX86_64TargetInfo
                           "i64:64-i128:128-f80:128-n8:16:32:64-S128");
   }
 
-  void getTargetDefines(const LangOptions &Opts,
-                        MacroBuilder &Builder) const override {
-    getOSDefines(Opts, X86TargetInfo::getTriple(), Builder);
-  }
-
   BuiltinVaListKind getBuiltinVaListKind() const override {
     return TargetInfo::CharPtrBuiltinVaList;
   }
diff --git a/clang/lib/Basic/Targets/Xtensa.cpp b/clang/lib/Basic/Targets/Xtensa.cpp
new file mode 100644
index 0000000000000..f3216f4ba4e80
--- /dev/null
+++ b/clang/lib/Basic/Targets/Xtensa.cpp
@@ -0,0 +1,35 @@
+//===--- Xtensa.cpp - Implement Xtensa target feature support -------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements Xtensa TargetInfo objects.
+//
+//===----------------------------------------------------------------------===//
+
+#include "Xtensa.h"
+#include "clang/Basic/Builtins.h"
+#include "clang/Basic/MacroBuilder.h"
+#include "clang/Basic/TargetBuiltins.h"
+
+using namespace clang;
+using namespace clang::targets;
+
+void XtensaTargetInfo::getTargetDefines(const LangOptions &Opts,
+                                        MacroBuilder &Builder) const {
+  Builder.defineMacro("__xtensa__");
+  Builder.defineMacro("__XTENSA__");
+  if (BigEndian)
+    Builder.defineMacro("__XTENSA_EB__");
+  else
+    Builder.defineMacro("__XTENSA_EL__");
+  Builder.defineMacro("__XCHAL_HAVE_BE", BigEndian ? "1" : "0");
+  Builder.defineMacro("__XCHAL_HAVE_ABS");  // core arch
+  Builder.defineMacro("__XCHAL_HAVE_ADDX"); // core arch
+  Builder.defineMacro("__XCHAL_HAVE_L32R"); // core arch
+}
diff --git a/clang/lib/Basic/Targets/Xtensa.h b/clang/lib/Basic/Targets/Xtensa.h
new file mode 100644
index 0000000000000..a440ba8aa3c6d
--- /dev/null
+++ b/clang/lib/Basic/Targets/Xtensa.h
@@ -0,0 +1,111 @@
+//===--- Xtensa.h - Declare Xtensa target feature support -------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file declares Xtensa TargetInfo objects.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_XTENSA_H
+#define LLVM_CLANG_LIB_BASIC_TARGETS_XTENSA_H
+
+#include "clang/Basic/TargetInfo.h"
+#include "clang/Basic/TargetOptions.h"
+#include "llvm/ADT/StringSwitch.h"
+#include "llvm/Support/Compiler.h"
+#include "llvm/TargetParser/Triple.h"
+
+#include "clang/Basic/Builtins.h"
+#include "clang/Basic/MacroBuilder.h"
+#include "clang/Basic/TargetBuiltins.h"
+
+namespace clang {
+namespace targets {
+
+class LLVM_LIBRARY_VISIBILITY XtensaTargetInfo : public TargetInfo {
+  static const Builtin::Info BuiltinInfo[];
+
+protected:
+  std::string CPU;
+
+public:
+  XtensaTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
+      : TargetInfo(Triple) {
+    // no big-endianess support yet
+    BigEndian = false;
+    NoAsmVariants = true;
+    LongLongAlign = 64;
+    SuitableAlign = 32;
+    DoubleAlign = LongDoubleAlign = 64;
+    SizeType = UnsignedInt;
+    PtrDiffType = SignedInt;
+    IntPtrType = SignedInt;
+    WCharType = SignedInt;
+    WIntType = UnsignedInt;
+    UseZeroLengthBitfieldAlignment = true;
+    MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32;
+    resetDataLayout("e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32");
+  }
+
+  void getTargetDefines(const LangOptions &Opts,
+                        MacroBuilder &Builder) const override;
+
+  ArrayRef getTargetBuiltins() const override {
+    return std::nullopt;
+  }
+
+  BuiltinVaListKind getBuiltinVaListKind() const override {
+    return TargetInfo::XtensaABIBuiltinVaList;
+  }
+
+  std::string_view getClobbers() const override { return ""; }
+
+  ArrayRef getGCCRegNames() const override {
+    static const char *const GCCRegNames[] = {
+        // General register name
+        "a0", "sp", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10",
+        "a11", "a12", "a13", "a14", "a15",
+        // Special register name
+        "sar"};
+    return llvm::ArrayRef(GCCRegNames);
+  }
+
+  ArrayRef getGCCRegAliases() const override {
+    return std::nullopt;
+  }
+
+  bool validateAsmConstraint(const char *&Name,
+                             TargetInfo::ConstraintInfo &Info) const override {
+    switch (*Name) {
+    default:
+      return false;
+    case 'a':
+      Info.setAllowsRegister();
+      return true;
+    }
+    return false;
+  }
+
+  int getEHDataRegisterNumber(unsigned RegNo) const override {
+    return (RegNo < 2) ? RegNo : -1;
+  }
+
+  bool isValidCPUName(StringRef Name) const override {
+    return llvm::StringSwitch(Name).Case("generic", true).Default(false);
+  }
+
+  bool setCPU(const std::string &Name) override {
+    CPU = Name;
+    return isValidCPUName(Name);
+  }
+};
+
+} // namespace targets
+} // namespace clang
+#endif // LLVM_CLANG_LIB_BASIC_TARGETS_XTENSA_H
diff --git a/clang/lib/CIR/CMakeLists.txt b/clang/lib/CIR/CMakeLists.txt
index 11cca734808df..f3ef8525e15c2 100644
--- a/clang/lib/CIR/CMakeLists.txt
+++ b/clang/lib/CIR/CMakeLists.txt
@@ -4,3 +4,4 @@ include_directories(${CMAKE_BINARY_DIR}/tools/mlir/include)
 add_subdirectory(Dialect)
 add_subdirectory(CodeGen)
 add_subdirectory(FrontendAction)
+add_subdirectory(Interfaces)
diff --git a/clang/lib/CIR/CodeGen/CIRGenBuilder.h b/clang/lib/CIR/CodeGen/CIRGenBuilder.h
index 92115778518d4..01d56963883cc 100644
--- a/clang/lib/CIR/CodeGen/CIRGenBuilder.h
+++ b/clang/lib/CIR/CodeGen/CIRGenBuilder.h
@@ -21,6 +21,18 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
 public:
   CIRGenBuilderTy(mlir::MLIRContext &mlirContext, const CIRGenTypeCache &tc)
       : CIRBaseBuilderTy(mlirContext), typeCache(tc) {}
+
+  cir::LongDoubleType getLongDoubleTy(const llvm::fltSemantics &format) const {
+    if (&format == &llvm::APFloat::IEEEdouble())
+      return cir::LongDoubleType::get(getContext(), typeCache.DoubleTy);
+    if (&format == &llvm::APFloat::x87DoubleExtended())
+      return cir::LongDoubleType::get(getContext(), typeCache.FP80Ty);
+    if (&format == &llvm::APFloat::IEEEquad())
+      return cir::LongDoubleType::get(getContext(), typeCache.FP128Ty);
+    if (&format == &llvm::APFloat::PPCDoubleDouble())
+      llvm_unreachable("NYI: PPC double-double format for long double");
+    llvm_unreachable("Unsupported format for long double");
+  }
 };
 
 } // namespace clang::CIRGen
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
index 0db24c3b41d18..2615ae382cb8b 100644
--- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
@@ -35,6 +35,7 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext,
       diags(diags), target(astContext.getTargetInfo()), genTypes(*this) {
 
   // Initialize cached types
+  VoidTy = cir::VoidType::get(&getMLIRContext());
   SInt8Ty = cir::IntType::get(&getMLIRContext(), 8, /*isSigned=*/true);
   SInt16Ty = cir::IntType::get(&getMLIRContext(), 16, /*isSigned=*/true);
   SInt32Ty = cir::IntType::get(&getMLIRContext(), 32, /*isSigned=*/true);
@@ -45,6 +46,12 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext,
   UInt32Ty = cir::IntType::get(&getMLIRContext(), 32, /*isSigned=*/false);
   UInt64Ty = cir::IntType::get(&getMLIRContext(), 64, /*isSigned=*/false);
   UInt128Ty = cir::IntType::get(&getMLIRContext(), 128, /*isSigned=*/false);
+  FP16Ty = cir::FP16Type::get(&getMLIRContext());
+  BFloat16Ty = cir::BF16Type::get(&getMLIRContext());
+  FloatTy = cir::SingleType::get(&getMLIRContext());
+  DoubleTy = cir::DoubleType::get(&getMLIRContext());
+  FP80Ty = cir::FP80Type::get(&getMLIRContext());
+  FP128Ty = cir::FP128Type::get(&getMLIRContext());
 }
 
 mlir::Location CIRGenModule::getLoc(SourceLocation cLoc) {
@@ -108,6 +115,48 @@ void CIRGenModule::emitGlobalVarDefinition(const clang::VarDecl *vd,
   if (clang::IdentifierInfo *identifier = vd->getIdentifier()) {
     auto varOp = builder.create(getLoc(vd->getSourceRange()),
                                                identifier->getName(), type);
+    // TODO(CIR): This code for processing initial values is a placeholder
+    // until class ConstantEmitter is upstreamed and the code for processing
+    // constant expressions is filled out.  Only the most basic handling of
+    // certain constant expressions is implemented for now.
+    const VarDecl *initDecl;
+    const Expr *initExpr = vd->getAnyInitializer(initDecl);
+    if (initExpr) {
+      mlir::Attribute initializer;
+      if (APValue *value = initDecl->evaluateValue()) {
+        switch (value->getKind()) {
+        case APValue::Int: {
+          initializer = builder.getAttr(type, value->getInt());
+          break;
+        }
+        case APValue::Float: {
+          initializer = builder.getAttr(type, value->getFloat());
+          break;
+        }
+        case APValue::LValue: {
+          if (value->getLValueBase()) {
+            errorNYI(initExpr->getSourceRange(),
+                     "non-null pointer initialization");
+          } else {
+            if (auto ptrType = mlir::dyn_cast(type)) {
+              initializer = builder.getConstPtrAttr(
+                  ptrType, value->getLValueOffset().getQuantity());
+            } else {
+              llvm_unreachable(
+                  "non-pointer variable initialized with a pointer");
+            }
+          }
+          break;
+        }
+        default:
+          errorNYI(initExpr->getSourceRange(), "unsupported initializer kind");
+          break;
+        }
+      } else {
+        errorNYI(initExpr->getSourceRange(), "non-constant initializer");
+      }
+      varOp.setInitialValueAttr(initializer);
+    }
     theModule.push_back(varOp);
   } else {
     errorNYI(vd->getSourceRange().getBegin(),
diff --git a/clang/lib/CIR/CodeGen/CIRGenTypeCache.h b/clang/lib/CIR/CodeGen/CIRGenTypeCache.h
index a357663c33e0f..99c0123c64b28 100644
--- a/clang/lib/CIR/CodeGen/CIRGenTypeCache.h
+++ b/clang/lib/CIR/CodeGen/CIRGenTypeCache.h
@@ -23,6 +23,9 @@ namespace clang::CIRGen {
 struct CIRGenTypeCache {
   CIRGenTypeCache() = default;
 
+  // ClangIR void type
+  cir::VoidType VoidTy;
+
   // ClangIR signed integral types of common sizes
   cir::IntType SInt8Ty;
   cir::IntType SInt16Ty;
@@ -36,6 +39,14 @@ struct CIRGenTypeCache {
   cir::IntType UInt32Ty;
   cir::IntType UInt64Ty;
   cir::IntType UInt128Ty;
+
+  // ClangIR floating-point types with fixed formats
+  cir::FP16Type FP16Ty;
+  cir::BF16Type BFloat16Ty;
+  cir::SingleType FloatTy;
+  cir::DoubleType DoubleTy;
+  cir::FP80Type FP80Ty;
+  cir::FP128Type FP128Ty;
 };
 
 } // namespace clang::CIRGen
diff --git a/clang/lib/CIR/CodeGen/CIRGenTypes.cpp b/clang/lib/CIR/CodeGen/CIRGenTypes.cpp
index 181af1898baff..8519854556b1c 100644
--- a/clang/lib/CIR/CodeGen/CIRGenTypes.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenTypes.cpp
@@ -4,6 +4,9 @@
 
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Type.h"
+#include "clang/Basic/TargetInfo.h"
+
+#include 
 
 using namespace clang;
 using namespace clang::CIRGen;
@@ -18,6 +21,70 @@ mlir::MLIRContext &CIRGenTypes::getMLIRContext() const {
   return *builder.getContext();
 }
 
+/// Return true if the specified type in a function parameter or result position
+/// can be converted to a CIR type at this point. This boils down to being
+/// whether it is complete, as well as whether we've temporarily deferred
+/// expanding the type because we're in a recursive context.
+bool CIRGenTypes::isFuncParamTypeConvertible(clang::QualType type) {
+  // Some ABIs cannot have their member pointers represented in LLVM IR unless
+  // certain circumstances have been reached.
+  assert(!type->getAs() && "NYI");
+
+  // If this isn't a tag type, we can convert it.
+  const TagType *tagType = type->getAs();
+  if (!tagType)
+    return true;
+
+  // Function types involving incomplete class types are problematic in MLIR.
+  return !tagType->isIncompleteType();
+}
+
+/// Code to verify a given function type is complete, i.e. the return type and
+/// all of the parameter types are complete. Also check to see if we are in a
+/// RS_StructPointer context, and if so whether any struct types have been
+/// pended. If so, we don't want to ask the ABI lowering code to handle a type
+/// that cannot be converted to a CIR type.
+bool CIRGenTypes::isFuncTypeConvertible(const FunctionType *ft) {
+  if (!isFuncParamTypeConvertible(ft->getReturnType()))
+    return false;
+
+  if (const auto *fpt = dyn_cast(ft))
+    for (unsigned i = 0, e = fpt->getNumParams(); i != e; i++)
+      if (!isFuncParamTypeConvertible(fpt->getParamType(i)))
+        return false;
+
+  return true;
+}
+
+mlir::Type CIRGenTypes::ConvertFunctionTypeInternal(QualType qft) {
+  assert(qft.isCanonical());
+  const FunctionType *ft = cast(qft.getTypePtr());
+  // First, check whether we can build the full fucntion type. If the function
+  // type depends on an incomplete type (e.g. a struct or enum), we cannot lower
+  // the function type.
+  if (!isFuncTypeConvertible(ft)) {
+    cgm.errorNYI(SourceLocation(), "function type involving an incomplete type",
+                 qft);
+    return cir::FuncType::get(SmallVector{}, cgm.VoidTy);
+  }
+
+  // TODO(CIR): This is a stub of what the final code will be.  See the
+  // implementation of this function and the implementation of class
+  // CIRGenFunction in the ClangIR incubator project.
+
+  if (const auto *fpt = dyn_cast(ft)) {
+    SmallVector mlirParamTypes;
+    for (unsigned i = 0; i < fpt->getNumParams(); ++i) {
+      mlirParamTypes.push_back(convertType(fpt->getParamType(i)));
+    }
+    return cir::FuncType::get(
+        mlirParamTypes, convertType(fpt->getReturnType().getUnqualifiedType()),
+        fpt->isVariadic());
+  }
+  cgm.errorNYI(SourceLocation(), "non-prototype function type", qft);
+  return cir::FuncType::get(SmallVector{}, cgm.VoidTy);
+}
+
 mlir::Type CIRGenTypes::convertType(QualType type) {
   type = astContext.getCanonicalType(type);
   const Type *ty = type.getTypePtr();
@@ -34,6 +101,12 @@ mlir::Type CIRGenTypes::convertType(QualType type) {
   switch (ty->getTypeClass()) {
   case Type::Builtin: {
     switch (cast(ty)->getKind()) {
+
+    // void
+    case BuiltinType::Void:
+      resultType = cgm.VoidTy;
+      break;
+
     // Signed integral types.
     case BuiltinType::Char_S:
     case BuiltinType::Int:
@@ -63,6 +136,47 @@ mlir::Type CIRGenTypes::convertType(QualType type) {
           cir::IntType::get(&getMLIRContext(), astContext.getTypeSize(ty),
                             /*isSigned=*/false);
       break;
+
+    // Floating-point types
+    case BuiltinType::Float16:
+      resultType = cgm.FP16Ty;
+      break;
+    case BuiltinType::Half:
+      if (astContext.getLangOpts().NativeHalfType ||
+          !astContext.getTargetInfo().useFP16ConversionIntrinsics()) {
+        resultType = cgm.FP16Ty;
+      } else {
+        cgm.errorNYI(SourceLocation(), "processing of built-in type", type);
+        resultType = cgm.SInt32Ty;
+      }
+      break;
+    case BuiltinType::BFloat16:
+      resultType = cgm.BFloat16Ty;
+      break;
+    case BuiltinType::Float:
+      assert(&astContext.getFloatTypeSemantics(type) ==
+                 &llvm::APFloat::IEEEsingle() &&
+             "ClangIR NYI: 'float' in a format other than IEEE 32-bit");
+      resultType = cgm.FloatTy;
+      break;
+    case BuiltinType::Double:
+      assert(&astContext.getFloatTypeSemantics(type) ==
+                 &llvm::APFloat::IEEEdouble() &&
+             "ClangIR NYI: 'double' in a format other than IEEE 64-bit");
+      resultType = cgm.DoubleTy;
+      break;
+    case BuiltinType::LongDouble:
+      resultType =
+          builder.getLongDoubleTy(astContext.getFloatTypeSemantics(type));
+      break;
+    case BuiltinType::Float128:
+      resultType = cgm.FP128Ty;
+      break;
+    case BuiltinType::Ibm128:
+      cgm.errorNYI(SourceLocation(), "processing of built-in type", type);
+      resultType = cgm.SInt32Ty;
+      break;
+
     default:
       cgm.errorNYI(SourceLocation(), "processing of built-in type", type);
       resultType = cgm.SInt32Ty;
@@ -70,6 +184,23 @@ mlir::Type CIRGenTypes::convertType(QualType type) {
     }
     break;
   }
+
+  case Type::Pointer: {
+    const PointerType *ptrTy = cast(ty);
+    QualType elemTy = ptrTy->getPointeeType();
+    assert(!elemTy->isConstantMatrixType() && "not implemented");
+
+    mlir::Type pointeeType = convertType(elemTy);
+
+    resultType = builder.getPointerTo(pointeeType);
+    break;
+  }
+
+  case Type::FunctionNoProto:
+  case Type::FunctionProto:
+    resultType = ConvertFunctionTypeInternal(type);
+    break;
+
   case Type::BitInt: {
     const auto *bitIntTy = cast(type);
     if (bitIntTy->getNumBits() > cir::IntType::maxBitwidth()) {
@@ -81,6 +212,7 @@ mlir::Type CIRGenTypes::convertType(QualType type) {
     }
     break;
   }
+
   default:
     cgm.errorNYI(SourceLocation(), "processing of type", type);
     resultType = cgm.SInt32Ty;
diff --git a/clang/lib/CIR/CodeGen/CIRGenTypes.h b/clang/lib/CIR/CodeGen/CIRGenTypes.h
index 563d7759831fa..71427e1200027 100644
--- a/clang/lib/CIR/CodeGen/CIRGenTypes.h
+++ b/clang/lib/CIR/CodeGen/CIRGenTypes.h
@@ -19,6 +19,7 @@
 
 namespace clang {
 class ASTContext;
+class FunctionType;
 class QualType;
 class Type;
 } // namespace clang
@@ -39,10 +40,18 @@ class CIRGenTypes {
   clang::ASTContext &astContext;
   CIRGenBuilderTy &builder;
 
+  /// Heper for ConvertType.
+  mlir::Type ConvertFunctionTypeInternal(clang::QualType ft);
+
 public:
   CIRGenTypes(CIRGenModule &cgm);
   ~CIRGenTypes();
 
+  /// Utility to check whether a function type can be converted to a CIR type
+  /// (i.e. doesn't depend on an incomplete tag type).
+  bool isFuncTypeConvertible(const clang::FunctionType *ft);
+  bool isFuncParamTypeConvertible(clang::QualType type);
+
   /// This map of clang::Type to mlir::Type (which includes CIR type) is a
   /// cache of types that have already been processed.
   using TypeCacheTy = llvm::DenseMap;
diff --git a/clang/lib/CIR/CodeGen/CMakeLists.txt b/clang/lib/CIR/CodeGen/CMakeLists.txt
index 9ada31c11de95..782b814d75daa 100644
--- a/clang/lib/CIR/CodeGen/CMakeLists.txt
+++ b/clang/lib/CIR/CodeGen/CMakeLists.txt
@@ -21,4 +21,5 @@ add_clang_library(clangCIR
   clangLex
   ${dialect_libs}
   MLIRCIR
+  MLIRCIRInterfaces
 )
diff --git a/clang/lib/CIR/Dialect/IR/CIRAttrs.cpp b/clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
index 7d42da1ab20d7..8e8f7d5b7d7cb 100644
--- a/clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
+++ b/clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
@@ -12,6 +12,24 @@
 
 #include "clang/CIR/Dialect/IR/CIRDialect.h"
 
+#include "mlir/IR/DialectImplementation.h"
+#include "llvm/ADT/TypeSwitch.h"
+
+static void printFloatLiteral(mlir::AsmPrinter &p, llvm::APFloat value,
+                              mlir::Type ty);
+static mlir::ParseResult
+parseFloatLiteral(mlir::AsmParser &parser,
+                  mlir::FailureOr &value,
+                  cir::CIRFPTypeInterface fpType);
+
+static mlir::ParseResult parseConstPtr(mlir::AsmParser &parser,
+                                       mlir::IntegerAttr &value);
+
+static void printConstPtr(mlir::AsmPrinter &p, mlir::IntegerAttr value);
+
+#define GET_ATTRDEF_CLASSES
+#include "clang/CIR/Dialect/IR/CIROpsAttributes.cpp.inc"
+
 using namespace mlir;
 using namespace cir;
 
@@ -21,12 +39,155 @@ using namespace cir;
 
 Attribute CIRDialect::parseAttribute(DialectAsmParser &parser,
                                      Type type) const {
-  // No attributes yet to parse
-  return Attribute{};
+  llvm::SMLoc typeLoc = parser.getCurrentLocation();
+  llvm::StringRef mnemonic;
+  Attribute genAttr;
+  OptionalParseResult parseResult =
+      generatedAttributeParser(parser, &mnemonic, type, genAttr);
+  if (parseResult.has_value())
+    return genAttr;
+  parser.emitError(typeLoc, "unknown attribute in CIR dialect");
+  return Attribute();
 }
 
 void CIRDialect::printAttribute(Attribute attr, DialectAsmPrinter &os) const {
-  // No attributes yet to print
+  if (failed(generatedAttributePrinter(attr, os)))
+    llvm_unreachable("unexpected CIR type kind");
+}
+
+//===----------------------------------------------------------------------===//
+// ConstPtrAttr definitions
+//===----------------------------------------------------------------------===//
+
+// TODO(CIR): Consider encoding the null value differently and use conditional
+// assembly format instead of custom parsing/printing.
+static ParseResult parseConstPtr(AsmParser &parser, mlir::IntegerAttr &value) {
+
+  if (parser.parseOptionalKeyword("null").succeeded()) {
+    value = mlir::IntegerAttr::get(
+        mlir::IntegerType::get(parser.getContext(), 64), 0);
+    return success();
+  }
+
+  return parser.parseAttribute(value);
+}
+
+static void printConstPtr(AsmPrinter &p, mlir::IntegerAttr value) {
+  if (!value.getInt())
+    p << "null";
+  else
+    p << value;
+}
+
+//===----------------------------------------------------------------------===//
+// IntAttr definitions
+//===----------------------------------------------------------------------===//
+
+Attribute IntAttr::parse(AsmParser &parser, Type odsType) {
+  mlir::APInt apValue;
+
+  if (!mlir::isa(odsType))
+    return {};
+  auto type = mlir::cast(odsType);
+
+  // Consume the '<' symbol.
+  if (parser.parseLess())
+    return {};
+
+  // Fetch arbitrary precision integer value.
+  if (type.isSigned()) {
+    int64_t value = 0;
+    if (parser.parseInteger(value)) {
+      parser.emitError(parser.getCurrentLocation(), "expected integer value");
+    } else {
+      apValue = mlir::APInt(type.getWidth(), value, type.isSigned(),
+                            /*implicitTrunc=*/true);
+      if (apValue.getSExtValue() != value)
+        parser.emitError(parser.getCurrentLocation(),
+                         "integer value too large for the given type");
+    }
+  } else {
+    uint64_t value = 0;
+    if (parser.parseInteger(value)) {
+      parser.emitError(parser.getCurrentLocation(), "expected integer value");
+    } else {
+      apValue = mlir::APInt(type.getWidth(), value, type.isSigned(),
+                            /*implicitTrunc=*/true);
+      if (apValue.getZExtValue() != value)
+        parser.emitError(parser.getCurrentLocation(),
+                         "integer value too large for the given type");
+    }
+  }
+
+  // Consume the '>' symbol.
+  if (parser.parseGreater())
+    return {};
+
+  return IntAttr::get(type, apValue);
+}
+
+void IntAttr::print(AsmPrinter &printer) const {
+  auto type = mlir::cast(getType());
+  printer << '<';
+  if (type.isSigned())
+    printer << getSInt();
+  else
+    printer << getUInt();
+  printer << '>';
+}
+
+LogicalResult IntAttr::verify(function_ref emitError,
+                              Type type, APInt value) {
+  if (!mlir::isa(type)) {
+    emitError() << "expected 'simple.int' type";
+    return failure();
+  }
+
+  auto intType = mlir::cast(type);
+  if (value.getBitWidth() != intType.getWidth()) {
+    emitError() << "type and value bitwidth mismatch: " << intType.getWidth()
+                << " != " << value.getBitWidth();
+    return failure();
+  }
+
+  return success();
+}
+
+//===----------------------------------------------------------------------===//
+// FPAttr definitions
+//===----------------------------------------------------------------------===//
+
+static void printFloatLiteral(AsmPrinter &p, APFloat value, Type ty) {
+  p << value;
+}
+
+static ParseResult parseFloatLiteral(AsmParser &parser,
+                                     FailureOr &value,
+                                     CIRFPTypeInterface fpType) {
+
+  APFloat parsedValue(0.0);
+  if (parser.parseFloat(fpType.getFloatSemantics(), parsedValue))
+    return failure();
+
+  value.emplace(parsedValue);
+  return success();
+}
+
+FPAttr FPAttr::getZero(Type type) {
+  return get(type,
+             APFloat::getZero(
+                 mlir::cast(type).getFloatSemantics()));
+}
+
+LogicalResult FPAttr::verify(function_ref emitError,
+                             CIRFPTypeInterface fpType, APFloat value) {
+  if (APFloat::SemanticsToEnum(fpType.getFloatSemantics()) !=
+      APFloat::SemanticsToEnum(value.getSemantics())) {
+    emitError() << "floating-point semantics mismatch";
+    return failure();
+  }
+
+  return success();
 }
 
 //===----------------------------------------------------------------------===//
@@ -34,5 +195,8 @@ void CIRDialect::printAttribute(Attribute attr, DialectAsmPrinter &os) const {
 //===----------------------------------------------------------------------===//
 
 void CIRDialect::registerAttributes() {
-  // No attributes yet to register
+  addAttributes<
+#define GET_ATTRDEF_LIST
+#include "clang/CIR/Dialect/IR/CIROpsAttributes.cpp.inc"
+      >();
 }
diff --git a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp
index dbdca1f840166..f98d8b60f6ff8 100644
--- a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+++ b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp
@@ -12,6 +12,8 @@
 
 #include "clang/CIR/Dialect/IR/CIRDialect.h"
 
+#include "clang/CIR/Dialect/IR/CIRTypes.h"
+
 #include "mlir/Support/LogicalResult.h"
 
 #include "clang/CIR/Dialect/IR/CIROpsDialect.cpp.inc"
@@ -32,13 +34,73 @@ void cir::CIRDialect::initialize() {
       >();
 }
 
+//===----------------------------------------------------------------------===//
+// ConstantOp
+//===----------------------------------------------------------------------===//
+
+static LogicalResult checkConstantTypes(mlir::Operation *op, mlir::Type opType,
+                                        mlir::Attribute attrType) {
+  if (isa(attrType)) {
+    if (!mlir::isa(opType))
+      return op->emitOpError(
+          "pointer constant initializing a non-pointer type");
+    return success();
+  }
+
+  if (mlir::isa(attrType)) {
+    auto at = cast(attrType);
+    if (at.getType() != opType) {
+      return op->emitOpError("result type (")
+             << opType << ") does not match value type (" << at.getType()
+             << ")";
+    }
+    return success();
+  }
+
+  assert(isa(attrType) && "What else could we be looking at here?");
+  return op->emitOpError("global with type ")
+         << cast(attrType).getType() << " not yet supported";
+}
+
+LogicalResult cir::ConstantOp::verify() {
+  // ODS already generates checks to make sure the result type is valid. We just
+  // need to additionally check that the value's attribute type is consistent
+  // with the result type.
+  return checkConstantTypes(getOperation(), getType(), getValue());
+}
+
+OpFoldResult cir::ConstantOp::fold(FoldAdaptor /*adaptor*/) {
+  return getValue();
+}
+
 //===----------------------------------------------------------------------===//
 // GlobalOp
 //===----------------------------------------------------------------------===//
 
-// TODO(CIR): The properties of global variables that require verification
-// haven't been implemented yet.
-mlir::LogicalResult cir::GlobalOp::verify() { return success(); }
+static ParseResult parseConstantValue(OpAsmParser &parser,
+                                      mlir::Attribute &valueAttr) {
+  NamedAttrList attr;
+  return parser.parseAttribute(valueAttr, "value", attr);
+}
+
+static void printConstant(OpAsmPrinter &p, Attribute value) {
+  p.printAttribute(value);
+}
+
+mlir::LogicalResult cir::GlobalOp::verify() {
+  // Verify that the initial value, if present, is either a unit attribute or
+  // an attribute CIR supports.
+  if (getInitialValue().has_value()) {
+    if (checkConstantTypes(getOperation(), getSymType(), *getInitialValue())
+            .failed())
+      return failure();
+  }
+
+  // TODO(CIR): Many other checks for properties that haven't been upstreamed
+  // yet.
+
+  return success();
+}
 
 void cir::GlobalOp::build(OpBuilder &odsBuilder, OperationState &odsState,
                           llvm::StringRef sym_name, mlir::Type sym_type) {
@@ -48,6 +110,45 @@ void cir::GlobalOp::build(OpBuilder &odsBuilder, OperationState &odsState,
                         mlir::TypeAttr::get(sym_type));
 }
 
+static void printGlobalOpTypeAndInitialValue(OpAsmPrinter &p, cir::GlobalOp op,
+                                             TypeAttr type,
+                                             Attribute initAttr) {
+  if (!op.isDeclaration()) {
+    p << "= ";
+    // This also prints the type...
+    if (initAttr)
+      printConstant(p, initAttr);
+  } else {
+    p << ": " << type;
+  }
+}
+
+static ParseResult
+parseGlobalOpTypeAndInitialValue(OpAsmParser &parser, TypeAttr &typeAttr,
+                                 Attribute &initialValueAttr) {
+  mlir::Type opTy;
+  if (parser.parseOptionalEqual().failed()) {
+    // Absence of equal means a declaration, so we need to parse the type.
+    //  cir.global @a : !cir.int
+    if (parser.parseColonType(opTy))
+      return failure();
+  } else {
+    // Parse constant with initializer, examples:
+    //  cir.global @y = #cir.fp<1.250000e+00> : !cir.double
+    //  cir.global @rgb = #cir.const_array<[...] : !cir.array>
+    if (parseConstantValue(parser, initialValueAttr).failed())
+      return failure();
+
+    assert(mlir::isa(initialValueAttr) &&
+           "Non-typed attrs shouldn't appear here.");
+    auto typedAttr = mlir::cast(initialValueAttr);
+    opTy = typedAttr.getType();
+  }
+
+  typeAttr = TypeAttr::get(opTy);
+  return success();
+}
+
 //===----------------------------------------------------------------------===//
 // FuncOp
 //===----------------------------------------------------------------------===//
diff --git a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
index de38337057d3d..48be11ba4e243 100644
--- a/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
+++ b/clang/lib/CIR/Dialect/IR/CIRTypes.cpp
@@ -16,6 +16,16 @@
 #include "clang/CIR/Dialect/IR/CIRDialect.h"
 #include "llvm/ADT/TypeSwitch.h"
 
+//===----------------------------------------------------------------------===//
+// CIR Custom Parser/Printer Signatures
+//===----------------------------------------------------------------------===//
+
+static mlir::ParseResult
+parseFuncTypeArgs(mlir::AsmParser &p, llvm::SmallVector ¶ms,
+                  bool &isVarArg);
+static void printFuncTypeArgs(mlir::AsmPrinter &p,
+                              mlir::ArrayRef params, bool isVarArg);
+
 //===----------------------------------------------------------------------===//
 // Get autogenerated stuff
 //===----------------------------------------------------------------------===//
@@ -133,6 +143,276 @@ IntType::verify(llvm::function_ref emitError,
   return mlir::success();
 }
 
+//===----------------------------------------------------------------------===//
+// Floating-point type definitions
+//===----------------------------------------------------------------------===//
+
+const llvm::fltSemantics &SingleType::getFloatSemantics() const {
+  return llvm::APFloat::IEEEsingle();
+}
+
+llvm::TypeSize
+SingleType::getTypeSizeInBits(const mlir::DataLayout &dataLayout,
+                              mlir::DataLayoutEntryListRef params) const {
+  return llvm::TypeSize::getFixed(getWidth());
+}
+
+uint64_t
+SingleType::getABIAlignment(const mlir::DataLayout &dataLayout,
+                            mlir::DataLayoutEntryListRef params) const {
+  return (uint64_t)(getWidth() / 8);
+}
+
+uint64_t
+SingleType::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
+                                  ::mlir::DataLayoutEntryListRef params) const {
+  return (uint64_t)(getWidth() / 8);
+}
+
+const llvm::fltSemantics &DoubleType::getFloatSemantics() const {
+  return llvm::APFloat::IEEEdouble();
+}
+
+llvm::TypeSize
+DoubleType::getTypeSizeInBits(const mlir::DataLayout &dataLayout,
+                              mlir::DataLayoutEntryListRef params) const {
+  return llvm::TypeSize::getFixed(getWidth());
+}
+
+uint64_t
+DoubleType::getABIAlignment(const mlir::DataLayout &dataLayout,
+                            mlir::DataLayoutEntryListRef params) const {
+  return (uint64_t)(getWidth() / 8);
+}
+
+uint64_t
+DoubleType::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
+                                  ::mlir::DataLayoutEntryListRef params) const {
+  return (uint64_t)(getWidth() / 8);
+}
+
+const llvm::fltSemantics &FP16Type::getFloatSemantics() const {
+  return llvm::APFloat::IEEEhalf();
+}
+
+llvm::TypeSize
+FP16Type::getTypeSizeInBits(const mlir::DataLayout &dataLayout,
+                            mlir::DataLayoutEntryListRef params) const {
+  return llvm::TypeSize::getFixed(getWidth());
+}
+
+uint64_t FP16Type::getABIAlignment(const mlir::DataLayout &dataLayout,
+                                   mlir::DataLayoutEntryListRef params) const {
+  return (uint64_t)(getWidth() / 8);
+}
+
+uint64_t
+FP16Type::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
+                                ::mlir::DataLayoutEntryListRef params) const {
+  return (uint64_t)(getWidth() / 8);
+}
+
+const llvm::fltSemantics &BF16Type::getFloatSemantics() const {
+  return llvm::APFloat::BFloat();
+}
+
+llvm::TypeSize
+BF16Type::getTypeSizeInBits(const mlir::DataLayout &dataLayout,
+                            mlir::DataLayoutEntryListRef params) const {
+  return llvm::TypeSize::getFixed(getWidth());
+}
+
+uint64_t BF16Type::getABIAlignment(const mlir::DataLayout &dataLayout,
+                                   mlir::DataLayoutEntryListRef params) const {
+  return (uint64_t)(getWidth() / 8);
+}
+
+uint64_t
+BF16Type::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
+                                ::mlir::DataLayoutEntryListRef params) const {
+  return (uint64_t)(getWidth() / 8);
+}
+
+const llvm::fltSemantics &FP80Type::getFloatSemantics() const {
+  return llvm::APFloat::x87DoubleExtended();
+}
+
+llvm::TypeSize
+FP80Type::getTypeSizeInBits(const mlir::DataLayout &dataLayout,
+                            mlir::DataLayoutEntryListRef params) const {
+  // Though only 80 bits are used for the value, the type is 128 bits in size.
+  return llvm::TypeSize::getFixed(128);
+}
+
+uint64_t FP80Type::getABIAlignment(const mlir::DataLayout &dataLayout,
+                                   mlir::DataLayoutEntryListRef params) const {
+  return 16;
+}
+
+uint64_t
+FP80Type::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
+                                ::mlir::DataLayoutEntryListRef params) const {
+  return 16;
+}
+
+const llvm::fltSemantics &FP128Type::getFloatSemantics() const {
+  return llvm::APFloat::IEEEquad();
+}
+
+llvm::TypeSize
+FP128Type::getTypeSizeInBits(const mlir::DataLayout &dataLayout,
+                             mlir::DataLayoutEntryListRef params) const {
+  return llvm::TypeSize::getFixed(getWidth());
+}
+
+uint64_t FP128Type::getABIAlignment(const mlir::DataLayout &dataLayout,
+                                    mlir::DataLayoutEntryListRef params) const {
+  return 16;
+}
+
+uint64_t
+FP128Type::getPreferredAlignment(const ::mlir::DataLayout &dataLayout,
+                                 ::mlir::DataLayoutEntryListRef params) const {
+  return 16;
+}
+
+const llvm::fltSemantics &LongDoubleType::getFloatSemantics() const {
+  return mlir::cast(getUnderlying())
+      .getFloatSemantics();
+}
+
+llvm::TypeSize
+LongDoubleType::getTypeSizeInBits(const mlir::DataLayout &dataLayout,
+                                  mlir::DataLayoutEntryListRef params) const {
+  return mlir::cast(getUnderlying())
+      .getTypeSizeInBits(dataLayout, params);
+}
+
+uint64_t
+LongDoubleType::getABIAlignment(const mlir::DataLayout &dataLayout,
+                                mlir::DataLayoutEntryListRef params) const {
+  return mlir::cast(getUnderlying())
+      .getABIAlignment(dataLayout, params);
+}
+
+uint64_t LongDoubleType::getPreferredAlignment(
+    const ::mlir::DataLayout &dataLayout,
+    mlir::DataLayoutEntryListRef params) const {
+  return mlir::cast(getUnderlying())
+      .getPreferredAlignment(dataLayout, params);
+}
+
+LogicalResult
+LongDoubleType::verify(function_ref emitError,
+                       mlir::Type underlying) {
+  if (!mlir::isa(underlying)) {
+    emitError() << "invalid underlying type for long double";
+    return failure();
+  }
+
+  return success();
+}
+
+//===----------------------------------------------------------------------===//
+// Floating-point type helpers
+//===----------------------------------------------------------------------===//
+
+bool cir::isAnyFloatingPointType(mlir::Type t) {
+  return isa(t);
+}
+
+//===----------------------------------------------------------------------===//
+// FuncType Definitions
+//===----------------------------------------------------------------------===//
+
+FuncType FuncType::clone(TypeRange inputs, TypeRange results) const {
+  assert(results.size() == 1 && "expected exactly one result type");
+  return get(llvm::to_vector(inputs), results[0], isVarArg());
+}
+
+mlir::ParseResult parseFuncTypeArgs(mlir::AsmParser &p,
+                                    llvm::SmallVector ¶ms,
+                                    bool &isVarArg) {
+  isVarArg = false;
+  // `(` `)`
+  if (succeeded(p.parseOptionalRParen()))
+    return mlir::success();
+
+  // `(` `...` `)`
+  if (succeeded(p.parseOptionalEllipsis())) {
+    isVarArg = true;
+    return p.parseRParen();
+  }
+
+  // type (`,` type)* (`,` `...`)?
+  mlir::Type type;
+  if (p.parseType(type))
+    return mlir::failure();
+  params.push_back(type);
+  while (succeeded(p.parseOptionalComma())) {
+    if (succeeded(p.parseOptionalEllipsis())) {
+      isVarArg = true;
+      return p.parseRParen();
+    }
+    if (p.parseType(type))
+      return mlir::failure();
+    params.push_back(type);
+  }
+
+  return p.parseRParen();
+}
+
+void printFuncTypeArgs(mlir::AsmPrinter &p, mlir::ArrayRef params,
+                       bool isVarArg) {
+  llvm::interleaveComma(params, p,
+                        [&p](mlir::Type type) { p.printType(type); });
+  if (isVarArg) {
+    if (!params.empty())
+      p << ", ";
+    p << "...";
+  }
+  p << ')';
+}
+
+llvm::ArrayRef FuncType::getReturnTypes() const {
+  return static_cast(getImpl())->returnType;
+}
+
+bool FuncType::isVoid() const { return mlir::isa(getReturnType()); }
+
+//===----------------------------------------------------------------------===//
+// PointerType Definitions
+//===----------------------------------------------------------------------===//
+
+llvm::TypeSize
+PointerType::getTypeSizeInBits(const ::mlir::DataLayout &dataLayout,
+                               ::mlir::DataLayoutEntryListRef params) const {
+  // FIXME: improve this in face of address spaces
+  return llvm::TypeSize::getFixed(64);
+}
+
+uint64_t
+PointerType::getABIAlignment(const ::mlir::DataLayout &dataLayout,
+                             ::mlir::DataLayoutEntryListRef params) const {
+  // FIXME: improve this in face of address spaces
+  return 8;
+}
+
+uint64_t PointerType::getPreferredAlignment(
+    const ::mlir::DataLayout &dataLayout,
+    ::mlir::DataLayoutEntryListRef params) const {
+  // FIXME: improve this in face of address spaces
+  return 8;
+}
+
+mlir::LogicalResult
+PointerType::verify(llvm::function_ref emitError,
+                    mlir::Type pointee) {
+  // TODO(CIR): Verification of the address space goes here.
+  return mlir::success();
+}
+
 //===----------------------------------------------------------------------===//
 // CIR Dialect
 //===----------------------------------------------------------------------===//
diff --git a/clang/lib/CIR/Dialect/IR/CMakeLists.txt b/clang/lib/CIR/Dialect/IR/CMakeLists.txt
index 7ddc4ce501907..baf8bff185221 100644
--- a/clang/lib/CIR/Dialect/IR/CMakeLists.txt
+++ b/clang/lib/CIR/Dialect/IR/CMakeLists.txt
@@ -5,11 +5,13 @@ add_clang_library(MLIRCIR
 
   DEPENDS
   MLIRCIROpsIncGen
+  MLIRCIRAttrsEnumsGen
 
   LINK_LIBS PUBLIC
   MLIRIR
   MLIRDLTIDialect
   MLIRDataLayoutInterfaces
   MLIRFuncDialect
+  MLIRCIRInterfaces
   clangAST
   )
diff --git a/clang/lib/CIR/Interfaces/CIRFPTypeInterface.cpp b/clang/lib/CIR/Interfaces/CIRFPTypeInterface.cpp
new file mode 100644
index 0000000000000..41817e90b5232
--- /dev/null
+++ b/clang/lib/CIR/Interfaces/CIRFPTypeInterface.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Defines the interface to generically handle CIR floating-point types.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/CIR/Interfaces/CIRFPTypeInterface.h"
+
+using namespace cir;
+
+/// Include the generated interfaces.
+#include "clang/CIR/Interfaces/CIRFPTypeInterface.cpp.inc"
diff --git a/clang/lib/CIR/Interfaces/CMakeLists.txt b/clang/lib/CIR/Interfaces/CMakeLists.txt
new file mode 100644
index 0000000000000..b826bf612cc35
--- /dev/null
+++ b/clang/lib/CIR/Interfaces/CMakeLists.txt
@@ -0,0 +1,15 @@
+add_clang_library(MLIRCIRInterfaces
+  CIRFPTypeInterface.cpp
+
+  ADDITIONAL_HEADER_DIRS
+  ${MLIR_MAIN_INCLUDE_DIR}/mlir/Interfaces
+
+  DEPENDS
+  MLIRCIRAttrsEnumsGen
+  MLIRCIRFPTypeInterfaceIncGen
+
+  LINK_LIBS
+  ${dialect_libs}
+  MLIRIR
+  MLIRSupport
+ )
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index e6c9d77d29f6f..04358cd6d7c23 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -1030,6 +1030,9 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
       PB.registerScalarOptimizerLateEPCallback(
           [this](FunctionPassManager &FPM, OptimizationLevel Level) {
             BoundsCheckingPass::ReportingMode Mode;
+            bool Merge = CodeGenOpts.SanitizeMergeHandlers.has(
+                SanitizerKind::LocalBounds);
+
             if (CodeGenOpts.SanitizeTrap.has(SanitizerKind::LocalBounds)) {
               Mode = BoundsCheckingPass::ReportingMode::Trap;
             } else if (CodeGenOpts.SanitizeMinimalRuntime) {
@@ -1041,7 +1044,8 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
                          ? BoundsCheckingPass::ReportingMode::FullRuntime
                          : BoundsCheckingPass::ReportingMode::FullRuntimeAbort;
             }
-            FPM.addPass(BoundsCheckingPass(Mode));
+            BoundsCheckingPass::BoundsCheckingOptions Options(Mode, Merge);
+            FPM.addPass(BoundsCheckingPass(Options));
           });
 
     // Don't add sanitizers if we are here from ThinLTO PostLink. That already
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 50b9dfbbab083..f139c30f3dfd4 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -3235,22 +3235,6 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
 
       llvm::StructType *STy =
           dyn_cast(ArgI.getCoerceToType());
-      if (ArgI.isDirect() && !ArgI.getCanBeFlattened() && STy &&
-          STy->getNumElements() > 1) {
-        [[maybe_unused]] llvm::TypeSize StructSize =
-            CGM.getDataLayout().getTypeAllocSize(STy);
-        [[maybe_unused]] llvm::TypeSize PtrElementSize =
-            CGM.getDataLayout().getTypeAllocSize(ConvertTypeForMem(Ty));
-        if (STy->containsHomogeneousScalableVectorTypes()) {
-          assert(StructSize == PtrElementSize &&
-                 "Only allow non-fractional movement of structure with"
-                 "homogeneous scalable vector type");
-
-          ArgVals.push_back(ParamValue::forDirect(AI));
-          break;
-        }
-      }
-
       Address Alloca = CreateMemTemp(Ty, getContext().getDeclAlign(Arg),
                                      Arg->getName());
 
@@ -5414,21 +5398,6 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
 
       llvm::StructType *STy =
           dyn_cast(ArgInfo.getCoerceToType());
-      if (STy && ArgInfo.isDirect() && !ArgInfo.getCanBeFlattened()) {
-        llvm::Type *SrcTy = ConvertTypeForMem(I->Ty);
-        [[maybe_unused]] llvm::TypeSize SrcTypeSize =
-            CGM.getDataLayout().getTypeAllocSize(SrcTy);
-        [[maybe_unused]] llvm::TypeSize DstTypeSize =
-            CGM.getDataLayout().getTypeAllocSize(STy);
-        if (STy->containsHomogeneousScalableVectorTypes()) {
-          assert(SrcTypeSize == DstTypeSize &&
-                 "Only allow non-fractional movement of structure with "
-                 "homogeneous scalable vector type");
-
-          IRCallArgs[FirstIRArg] = I->getKnownRValue().getScalarVal();
-          break;
-        }
-      }
 
       // FIXME: Avoid the conversion through memory if possible.
       Address Src = Address::invalid();
diff --git a/clang/lib/CodeGen/Targets/AArch64.cpp b/clang/lib/CodeGen/Targets/AArch64.cpp
index be33e26f04784..0680b4828b6da 100644
--- a/clang/lib/CodeGen/Targets/AArch64.cpp
+++ b/clang/lib/CodeGen/Targets/AArch64.cpp
@@ -52,6 +52,7 @@ class AArch64ABIInfo : public ABIInfo {
 
   bool isIllegalVectorType(QualType Ty) const;
 
+  bool passAsAggregateType(QualType Ty) const;
   bool passAsPureScalableType(QualType Ty, unsigned &NV, unsigned &NP,
                               SmallVectorImpl &CoerceToSeq) const;
 
@@ -337,6 +338,10 @@ ABIArgInfo AArch64ABIInfo::coerceAndExpandPureScalableAggregate(
   NSRN += NVec;
   NPRN += NPred;
 
+  // Handle SVE vector tuples.
+  if (Ty->isSVESizelessBuiltinType())
+    return ABIArgInfo::getDirect();
+
   llvm::Type *UnpaddedCoerceToType =
       UnpaddedCoerceToSeq.size() == 1
           ? UnpaddedCoerceToSeq[0]
@@ -362,7 +367,7 @@ ABIArgInfo AArch64ABIInfo::classifyArgumentType(QualType Ty, bool IsVariadicFn,
   if (isIllegalVectorType(Ty))
     return coerceIllegalVector(Ty, NSRN, NPRN);
 
-  if (!isAggregateTypeForABI(Ty)) {
+  if (!passAsAggregateType(Ty)) {
     // Treat an enum type as its underlying type.
     if (const EnumType *EnumTy = Ty->getAs())
       Ty = EnumTy->getDecl()->getIntegerType();
@@ -417,7 +422,7 @@ ABIArgInfo AArch64ABIInfo::classifyArgumentType(QualType Ty, bool IsVariadicFn,
   // elsewhere for GNU compatibility.
   uint64_t Size = getContext().getTypeSize(Ty);
   bool IsEmpty = isEmptyRecord(getContext(), Ty, true);
-  if (IsEmpty || Size == 0) {
+  if (!Ty->isSVESizelessBuiltinType() && (IsEmpty || Size == 0)) {
     if (!getContext().getLangOpts().CPlusPlus || isDarwinPCS())
       return ABIArgInfo::getIgnore();
 
@@ -504,7 +509,7 @@ ABIArgInfo AArch64ABIInfo::classifyReturnType(QualType RetTy,
   if (RetTy->isVectorType() && getContext().getTypeSize(RetTy) > 128)
     return getNaturalAlignIndirect(RetTy);
 
-  if (!isAggregateTypeForABI(RetTy)) {
+  if (!passAsAggregateType(RetTy)) {
     // Treat an enum type as its underlying type.
     if (const EnumType *EnumTy = RetTy->getAs())
       RetTy = EnumTy->getDecl()->getIntegerType();
@@ -519,7 +524,8 @@ ABIArgInfo AArch64ABIInfo::classifyReturnType(QualType RetTy,
   }
 
   uint64_t Size = getContext().getTypeSize(RetTy);
-  if (isEmptyRecord(getContext(), RetTy, true) || Size == 0)
+  if (!RetTy->isSVESizelessBuiltinType() &&
+      (isEmptyRecord(getContext(), RetTy, true) || Size == 0))
     return ABIArgInfo::getIgnore();
 
   const Type *Base = nullptr;
@@ -654,6 +660,15 @@ bool AArch64ABIInfo::isZeroLengthBitfieldPermittedInHomogeneousAggregate()
   return true;
 }
 
+bool AArch64ABIInfo::passAsAggregateType(QualType Ty) const {
+  if (Kind == AArch64ABIKind::AAPCS && Ty->isSVESizelessBuiltinType()) {
+    const auto *BT = Ty->castAs();
+    return !BT->isSVECount() &&
+           getContext().getBuiltinVectorTypeInfo(BT).NumVectors > 1;
+  }
+  return isAggregateTypeForABI(Ty);
+}
+
 // Check if a type needs to be passed in registers as a Pure Scalable Type (as
 // defined by AAPCS64). Return the number of data vectors and the number of
 // predicate vectors in the type, into `NVec` and `NPred`, respectively. Upon
@@ -719,37 +734,38 @@ bool AArch64ABIInfo::passAsPureScalableType(
     return true;
   }
 
-  const auto *VT = Ty->getAs();
-  if (!VT)
-    return false;
+  if (const auto *VT = Ty->getAs()) {
+    if (VT->getVectorKind() == VectorKind::SveFixedLengthPredicate) {
+      ++NPred;
+      if (CoerceToSeq.size() + 1 > 12)
+        return false;
+      CoerceToSeq.push_back(convertFixedToScalableVectorType(VT));
+      return true;
+    }
 
-  if (VT->getVectorKind() == VectorKind::SveFixedLengthPredicate) {
-    ++NPred;
-    if (CoerceToSeq.size() + 1 > 12)
-      return false;
-    CoerceToSeq.push_back(convertFixedToScalableVectorType(VT));
-    return true;
-  }
+    if (VT->getVectorKind() == VectorKind::SveFixedLengthData) {
+      ++NVec;
+      if (CoerceToSeq.size() + 1 > 12)
+        return false;
+      CoerceToSeq.push_back(convertFixedToScalableVectorType(VT));
+      return true;
+    }
 
-  if (VT->getVectorKind() == VectorKind::SveFixedLengthData) {
-    ++NVec;
-    if (CoerceToSeq.size() + 1 > 12)
-      return false;
-    CoerceToSeq.push_back(convertFixedToScalableVectorType(VT));
-    return true;
+    return false;
   }
 
-  if (!VT->isBuiltinType())
+  if (!Ty->isBuiltinType())
     return false;
 
-  switch (cast(VT)->getKind()) {
+  bool isPredicate;
+  switch (Ty->getAs()->getKind()) {
 #define SVE_VECTOR_TYPE(Name, MangledName, Id, SingletonId)                    \
   case BuiltinType::Id:                                                        \
-    ++NVec;                                                                    \
+    isPredicate = false;                                                       \
     break;
 #define SVE_PREDICATE_TYPE(Name, MangledName, Id, SingletonId)                 \
   case BuiltinType::Id:                                                        \
-    ++NPred;                                                                   \
+    isPredicate = true;                                                        \
     break;
 #define SVE_TYPE(Name, Id, SingletonId)
 #include "clang/Basic/AArch64SVEACLETypes.def"
@@ -761,6 +777,10 @@ bool AArch64ABIInfo::passAsPureScalableType(
       getContext().getBuiltinVectorTypeInfo(cast(Ty));
   assert(Info.NumVectors > 0 && Info.NumVectors <= 4 &&
          "Expected 1, 2, 3 or 4 vectors!");
+  if (isPredicate)
+    NPred += Info.NumVectors;
+  else
+    NVec += Info.NumVectors;
   auto VTy = llvm::ScalableVectorType::get(CGT.ConvertType(Info.ElementType),
                                            Info.EC.getKnownMinValue());
 
diff --git a/clang/lib/CodeGen/Targets/RISCV.cpp b/clang/lib/CodeGen/Targets/RISCV.cpp
index b04e436c665f5..873e696e1328f 100644
--- a/clang/lib/CodeGen/Targets/RISCV.cpp
+++ b/clang/lib/CodeGen/Targets/RISCV.cpp
@@ -495,13 +495,7 @@ ABIArgInfo RISCVABIInfo::classifyArgumentType(QualType Ty, bool IsFixed,
         return getNaturalAlignIndirect(Ty, /*ByVal=*/false);
     }
 
-    ABIArgInfo Info = ABIArgInfo::getDirect();
-
-    // If it is tuple type, it can't be flattened.
-    if (llvm::StructType *STy = dyn_cast(CGT.ConvertType(Ty)))
-      Info.setCanBeFlattened(!STy->containsHomogeneousScalableVectorTypes());
-
-    return Info;
+    return ABIArgInfo::getDirect();
   }
 
   if (const VectorType *VT = Ty->getAs())
diff --git a/clang/lib/Driver/SanitizerArgs.cpp b/clang/lib/Driver/SanitizerArgs.cpp
index 7726e464f2b45..98116e2c8336b 100644
--- a/clang/lib/Driver/SanitizerArgs.cpp
+++ b/clang/lib/Driver/SanitizerArgs.cpp
@@ -338,6 +338,14 @@ bool SanitizerArgs::needsUbsanRt() const {
          CoverageFeatures;
 }
 
+bool SanitizerArgs::needsUbsanCXXRt() const {
+  // Link UBSAN C++ runtime very selectively, as it's needed in only very
+  // specific cases, but forces the program to depend on C++ ABI. UBSAN C++
+  // runtime is not included with other sanitizers.
+  return static_cast(Sanitizers.Mask & NeedsUbsanCxxRt &
+                           ~TrapSanitizers.Mask);
+}
+
 bool SanitizerArgs::needsCfiRt() const {
   return !(Sanitizers.Mask & SanitizerKind::CFI & ~TrapSanitizers.Mask) &&
          CfiCrossDso && !ImplicitCfiRuntime;
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 47df650e5b948..8b9639061d543 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -708,6 +708,11 @@ std::string tools::getCPUName(const Driver &D, const ArgList &Args,
   case llvm::Triple::loongarch32:
   case llvm::Triple::loongarch64:
     return loongarch::getLoongArchTargetCPU(Args, T);
+
+  case llvm::Triple::xtensa:
+    if (const Arg *A = Args.getLastArg(options::OPT_mcpu_EQ))
+      return A->getValue();
+    return "";
   }
 }
 
@@ -1454,6 +1459,7 @@ collectSanitizerRuntimes(const ToolChain &TC, const ArgList &Args,
                          SmallVectorImpl &NonWholeStaticRuntimes,
                          SmallVectorImpl &HelperStaticRuntimes,
                          SmallVectorImpl &RequiredSymbols) {
+  assert(!TC.getTriple().isOSDarwin() && "it's not used by Darwin");
   const SanitizerArgs &SanArgs = TC.getSanitizerArgs(Args);
   // Collect shared runtimes.
   if (SanArgs.needsSharedRt()) {
@@ -1561,8 +1567,6 @@ collectSanitizerRuntimes(const ToolChain &TC, const ArgList &Args,
       StaticRuntimes.push_back("ubsan_minimal");
     } else {
       StaticRuntimes.push_back("ubsan_standalone");
-      if (SanArgs.linkCXXRuntimes())
-        StaticRuntimes.push_back("ubsan_standalone_cxx");
     }
   }
   if (SanArgs.needsSafeStackRt()) {
@@ -1572,11 +1576,13 @@ collectSanitizerRuntimes(const ToolChain &TC, const ArgList &Args,
   if (!(SanArgs.needsSharedRt() && SanArgs.needsUbsanRt())) {
     if (SanArgs.needsCfiRt())
       StaticRuntimes.push_back("cfi");
-    if (SanArgs.needsCfiDiagRt()) {
+    if (SanArgs.needsCfiDiagRt())
       StaticRuntimes.push_back("cfi_diag");
-      if (SanArgs.linkCXXRuntimes())
-        StaticRuntimes.push_back("ubsan_standalone_cxx");
-    }
+  }
+  if (SanArgs.linkCXXRuntimes() && !SanArgs.requiresMinimalRuntime() &&
+      ((!SanArgs.needsSharedRt() && SanArgs.needsUbsanCXXRt()) ||
+       SanArgs.needsCfiDiagRt())) {
+    StaticRuntimes.push_back("ubsan_standalone_cxx");
   }
   if (SanArgs.needsStatsRt()) {
     NonWholeStaticRuntimes.push_back("stats");
@@ -2837,8 +2843,7 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
                         : options::OPT_libomptarget_nvptx_bc_path_EQ;
 
   StringRef ArchPrefix = Triple.isAMDGCN() ? "amdgpu" : "nvptx";
-  std::string LibOmpTargetName =
-      ("libomptarget-" + ArchPrefix + "-" + BitcodeSuffix + ".bc").str();
+  std::string LibOmpTargetName = ("libomptarget-" + ArchPrefix + ".bc").str();
 
   // First check whether user specifies bc library
   if (const Arg *A = DriverArgs.getLastArg(LibomptargetBCPathOpt)) {
diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/lib/Driver/ToolChains/Cuda.cpp
index 102794829795d..214f1e5d83478 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -851,7 +851,6 @@ void CudaToolChain::addClangTargetOptions(
   HostTC.addClangTargetOptions(DriverArgs, CC1Args, DeviceOffloadingKind);
 
   StringRef GpuArch = DriverArgs.getLastArgValue(options::OPT_march_EQ);
-  assert(!GpuArch.empty() && "Must have an explicit GPU arch.");
   assert((DeviceOffloadingKind == Action::OFK_OpenMP ||
           DeviceOffloadingKind == Action::OFK_Cuda) &&
          "Only OpenMP or CUDA offloading kinds are supported for NVIDIA GPUs.");
diff --git a/clang/lib/Driver/ToolChains/OHOS.cpp b/clang/lib/Driver/ToolChains/OHOS.cpp
index 6e1a09ae908b2..c9a532771b99e 100644
--- a/clang/lib/Driver/ToolChains/OHOS.cpp
+++ b/clang/lib/Driver/ToolChains/OHOS.cpp
@@ -19,8 +19,8 @@
 #include "llvm/ProfileData/InstrProf.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
-#include "llvm/Support/VirtualFileSystem.h"
 #include "llvm/Support/ScopedPrinter.h"
+#include "llvm/Support/VirtualFileSystem.h"
 
 using namespace clang::driver;
 using namespace clang::driver::toolchains;
@@ -58,11 +58,9 @@ static bool findOHOSMuslMultilibs(const Driver &D,
   return false;
 }
 
-static bool findOHOSMultilibs(const Driver &D,
-                                      const ToolChain &TC,
-                                      const llvm::Triple &TargetTriple,
-                                      StringRef Path, const ArgList &Args,
-                                      DetectedMultilibs &Result) {
+static bool findOHOSMultilibs(const Driver &D, const ToolChain &TC,
+                              const llvm::Triple &TargetTriple, StringRef Path,
+                              const ArgList &Args, DetectedMultilibs &Result) {
   Multilib::flags_list Flags;
   bool IsA7 = false;
   if (const Arg *A = Args.getLastArg(options::OPT_mcpu_EQ))
@@ -172,8 +170,7 @@ OHOS::OHOS(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
       Paths);
 }
 
-ToolChain::RuntimeLibType OHOS::GetRuntimeLibType(
-    const ArgList &Args) const {
+ToolChain::RuntimeLibType OHOS::GetRuntimeLibType(const ArgList &Args) const {
   if (Arg *A = Args.getLastArg(clang::driver::options::OPT_rtlib_EQ)) {
     StringRef Value = A->getValue();
     if (Value != "compiler-rt")
@@ -184,20 +181,19 @@ ToolChain::RuntimeLibType OHOS::GetRuntimeLibType(
   return ToolChain::RLT_CompilerRT;
 }
 
-ToolChain::CXXStdlibType
-OHOS::GetCXXStdlibType(const ArgList &Args) const {
+ToolChain::CXXStdlibType OHOS::GetCXXStdlibType(const ArgList &Args) const {
   if (Arg *A = Args.getLastArg(options::OPT_stdlib_EQ)) {
     StringRef Value = A->getValue();
     if (Value != "libc++")
       getDriver().Diag(diag::err_drv_invalid_stdlib_name)
-        << A->getAsString(Args);
+          << A->getAsString(Args);
   }
 
   return ToolChain::CST_Libcxx;
 }
 
 void OHOS::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
-                                        ArgStringList &CC1Args) const {
+                                     ArgStringList &CC1Args) const {
   const Driver &D = getDriver();
   const llvm::Triple &Triple = getTriple();
   std::string SysRoot = computeSysRoot();
@@ -258,7 +254,7 @@ void OHOS::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
 }
 
 void OHOS::AddCXXStdlibLibArgs(const ArgList &Args,
-                                  ArgStringList &CmdArgs) const {
+                               ArgStringList &CmdArgs) const {
   switch (GetCXXStdlibType(Args)) {
   case ToolChain::CST_Libcxx:
     CmdArgs.push_back("-lc++");
@@ -291,7 +287,8 @@ ToolChain::path_list OHOS::getRuntimePaths() const {
 
   // First try the triple passed to driver as --target=.
   P.assign(D.ResourceDir);
-  llvm::sys::path::append(P, "lib", D.getTargetTriple(), SelectedMultilib.gccSuffix());
+  llvm::sys::path::append(P, "lib", D.getTargetTriple(),
+                          SelectedMultilib.gccSuffix());
   Paths.push_back(P.c_str());
 
   // Second try the normalized triple.
@@ -340,26 +337,20 @@ std::string OHOS::getDynamicLinker(const ArgList &Args) const {
 
 std::string OHOS::getCompilerRT(const ArgList &Args, StringRef Component,
                                 FileType Type) const {
+  std::string CRTBasename =
+      buildCompilerRTBasename(Args, Component, Type, /*AddArch=*/false);
+
   SmallString<128> Path(getDriver().ResourceDir);
   llvm::sys::path::append(Path, "lib", getMultiarchTriple(getTriple()),
-                          SelectedMultilib.gccSuffix());
-  const char *Prefix =
-      Type == ToolChain::FT_Object ? "" : "lib";
-  const char *Suffix;
-  switch (Type) {
-  case ToolChain::FT_Object:
-    Suffix = ".o";
-    break;
-  case ToolChain::FT_Static:
-    Suffix = ".a";
-    break;
-  case ToolChain::FT_Shared:
-    Suffix = ".so";
-    break;
-  }
-  llvm::sys::path::append(
-      Path, Prefix + Twine("clang_rt.") + Component + Suffix);
-  return static_cast(Path.str());
+                          SelectedMultilib.gccSuffix(), CRTBasename);
+  if (getVFS().exists(Path))
+    return std::string(Path);
+
+  std::string NewPath = ToolChain::getCompilerRT(Args, Component, Type);
+  if (getVFS().exists(NewPath))
+    return NewPath;
+
+  return std::string(Path);
 }
 
 void OHOS::addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const {
@@ -396,7 +387,7 @@ SanitizerMask OHOS::getSupportedSanitizers() const {
 
 // TODO: Make a base class for Linux and OHOS and move this there.
 void OHOS::addProfileRTLibs(const llvm::opt::ArgList &Args,
-                             llvm::opt::ArgStringList &CmdArgs) const {
+                            llvm::opt::ArgStringList &CmdArgs) const {
   // Add linker option -u__llvm_profile_runtime to cause runtime
   // initialization module to be linked in.
   if (needsProfileRT(Args))
@@ -413,7 +404,8 @@ ToolChain::path_list OHOS::getArchSpecificLibPaths() const {
   return Paths;
 }
 
-ToolChain::UnwindLibType OHOS::GetUnwindLibType(const llvm::opt::ArgList &Args) const {
+ToolChain::UnwindLibType
+OHOS::GetUnwindLibType(const llvm::opt::ArgList &Args) const {
   if (Args.getLastArg(options::OPT_unwindlib_EQ))
     return Generic_ELF::GetUnwindLibType(Args);
   return GetDefaultUnwindLibType();
diff --git a/clang/lib/Driver/ToolChains/UEFI.cpp b/clang/lib/Driver/ToolChains/UEFI.cpp
index 66cbbec59246c..a9d7e7892c5a6 100644
--- a/clang/lib/Driver/ToolChains/UEFI.cpp
+++ b/clang/lib/Driver/ToolChains/UEFI.cpp
@@ -35,6 +35,24 @@ UEFI::UEFI(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
 
 Tool *UEFI::buildLinker() const { return new tools::uefi::Linker(*this); }
 
+void UEFI::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
+                                     ArgStringList &CC1Args) const {
+  if (DriverArgs.hasArg(options::OPT_nostdinc))
+    return;
+
+  if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
+    SmallString<128> Dir(getDriver().ResourceDir);
+    llvm::sys::path::append(Dir, "include");
+    addSystemInclude(DriverArgs, CC1Args, Dir.str());
+  }
+
+  if (DriverArgs.hasArg(options::OPT_nostdlibinc))
+    return;
+
+  if (std::optional Path = getStdlibIncludePath())
+    addSystemInclude(DriverArgs, CC1Args, *Path);
+}
+
 void tools::uefi::Linker::ConstructJob(Compilation &C, const JobAction &JA,
                                        const InputInfo &Output,
                                        const InputInfoList &Inputs,
diff --git a/clang/lib/Driver/ToolChains/UEFI.h b/clang/lib/Driver/ToolChains/UEFI.h
index a126ac32db6c6..7e038b5cb8b18 100644
--- a/clang/lib/Driver/ToolChains/UEFI.h
+++ b/clang/lib/Driver/ToolChains/UEFI.h
@@ -51,6 +51,10 @@ class LLVM_LIBRARY_VISIBILITY UEFI : public ToolChain {
     return false;
   }
   bool isPICDefaultForced() const override { return true; }
+
+  void
+  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
+                            llvm::opt::ArgStringList &CC1Args) const override;
 };
 
 } // namespace toolchains
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index dcaac4b0d42cc..a5657f2d910f6 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -975,6 +975,8 @@ template <> struct MappingTraits {
                    Style.AllowShortLambdasOnASingleLine);
     IO.mapOptional("AllowShortLoopsOnASingleLine",
                    Style.AllowShortLoopsOnASingleLine);
+    IO.mapOptional("AllowShortNamespacesOnASingleLine",
+                   Style.AllowShortNamespacesOnASingleLine);
     IO.mapOptional("AlwaysBreakAfterDefinitionReturnType",
                    Style.AlwaysBreakAfterDefinitionReturnType);
     IO.mapOptional("AlwaysBreakBeforeMultilineStrings",
@@ -1164,6 +1166,7 @@ template <> struct MappingTraits {
     IO.mapOptional("TypeNames", Style.TypeNames);
     IO.mapOptional("TypenameMacros", Style.TypenameMacros);
     IO.mapOptional("UseTab", Style.UseTab);
+    IO.mapOptional("VariableTemplates", Style.VariableTemplates);
     IO.mapOptional("VerilogBreakBetweenInstancePorts",
                    Style.VerilogBreakBetweenInstancePorts);
     IO.mapOptional("WhitespaceSensitiveMacros",
@@ -1480,6 +1483,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) {
   LLVMStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never;
   LLVMStyle.AllowShortLambdasOnASingleLine = FormatStyle::SLS_All;
   LLVMStyle.AllowShortLoopsOnASingleLine = false;
+  LLVMStyle.AllowShortNamespacesOnASingleLine = false;
   LLVMStyle.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None;
   LLVMStyle.AlwaysBreakBeforeMultilineStrings = false;
   LLVMStyle.AttributeMacros.push_back("__capability");
@@ -3246,8 +3250,15 @@ tooling::Replacements sortCppIncludes(const FormatStyle &Style, StringRef Code,
   SmallVector RawStringMatches;
   std::string RawStringTermination = ")\"";
 
-  for (;;) {
-    auto Pos = Code.find('\n', SearchFrom);
+  for (const auto Size = Code.size(); SearchFrom < Size;) {
+    size_t Pos = SearchFrom;
+    if (Code[SearchFrom] != '\n') {
+      do { // Search for the first newline while skipping line splices.
+        ++Pos;
+        Pos = Code.find('\n', Pos);
+      } while (Pos != StringRef::npos && Code[Pos - 1] == '\\');
+    }
+
     StringRef Line =
         Code.substr(Prev, (Pos != StringRef::npos ? Pos : Code.size()) - Prev);
 
diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h
index f6bb860a1fea3..8917049cefb86 100644
--- a/clang/lib/Format/FormatToken.h
+++ b/clang/lib/Format/FormatToken.h
@@ -186,6 +186,7 @@ namespace format {
   TYPE(UnionLBrace)                                                            \
   TYPE(UnionRBrace)                                                            \
   TYPE(UntouchableMacroFunc)                                                   \
+  TYPE(VariableTemplate)                                                       \
   /* Like in 'assign x = 0, y = 1;' . */                                       \
   TYPE(VerilogAssignComma)                                                     \
   /* like in begin : block */                                                  \
diff --git a/clang/lib/Format/FormatTokenLexer.cpp b/clang/lib/Format/FormatTokenLexer.cpp
index 7a264bddcdfe1..0f8d4940d4369 100644
--- a/clang/lib/Format/FormatTokenLexer.cpp
+++ b/clang/lib/Format/FormatTokenLexer.cpp
@@ -76,6 +76,8 @@ FormatTokenLexer::FormatTokenLexer(
     TemplateNames.insert(&IdentTable.get(TemplateName));
   for (const auto &TypeName : Style.TypeNames)
     TypeNames.insert(&IdentTable.get(TypeName));
+  for (const auto &VariableTemplate : Style.VariableTemplates)
+    VariableTemplates.insert(&IdentTable.get(VariableTemplate));
 }
 
 ArrayRef FormatTokenLexer::lex() {
@@ -1382,6 +1384,8 @@ FormatToken *FormatTokenLexer::getNextToken() {
         FormatTok->setFinalizedType(TT_TemplateName);
       else if (TypeNames.contains(Identifier))
         FormatTok->setFinalizedType(TT_TypeName);
+      else if (VariableTemplates.contains(Identifier))
+        FormatTok->setFinalizedType(TT_VariableTemplate);
     }
   }
 
diff --git a/clang/lib/Format/FormatTokenLexer.h b/clang/lib/Format/FormatTokenLexer.h
index 71389d2ade2b7..61474a3f9ada8 100644
--- a/clang/lib/Format/FormatTokenLexer.h
+++ b/clang/lib/Format/FormatTokenLexer.h
@@ -129,7 +129,8 @@ class FormatTokenLexer {
 
   llvm::SmallMapVector Macros;
 
-  llvm::SmallPtrSet TemplateNames, TypeNames;
+  llvm::SmallPtrSet TemplateNames, TypeNames,
+      VariableTemplates;
 
   bool FormattingDisabled;
 
diff --git a/clang/lib/Format/MacroExpander.cpp b/clang/lib/Format/MacroExpander.cpp
index fd2a16894d643..ba2992889e674 100644
--- a/clang/lib/Format/MacroExpander.cpp
+++ b/clang/lib/Format/MacroExpander.cpp
@@ -233,6 +233,10 @@ MacroExpander::expand(FormatToken *ID,
   if (Result.size() > 1) {
     ++Result[0]->MacroCtx->StartOfExpansion;
     ++Result[Result.size() - 2]->MacroCtx->EndOfExpansion;
+  } else {
+    // If the macro expansion is empty, mark the start and end.
+    Result[0]->MacroCtx->StartOfExpansion = 1;
+    Result[0]->MacroCtx->EndOfExpansion = 1;
   }
   return Result;
 }
diff --git a/clang/lib/Format/MatchFilePath.cpp b/clang/lib/Format/MatchFilePath.cpp
index 062b334dcdd8f..3d8614838e535 100644
--- a/clang/lib/Format/MatchFilePath.cpp
+++ b/clang/lib/Format/MatchFilePath.cpp
@@ -25,9 +25,11 @@ bool matchFilePath(StringRef Pattern, StringRef FilePath) {
   assert(!Pattern.empty());
   assert(!FilePath.empty());
 
+  const auto FilePathBack = FilePath.back();
+
   // No match if `Pattern` ends with a non-meta character not equal to the last
   // character of `FilePath`.
-  if (const auto C = Pattern.back(); !strchr("?*]", C) && C != FilePath.back())
+  if (const auto C = Pattern.back(); !strchr("?*]", C) && C != FilePathBack)
     return false;
 
   constexpr auto Separator = '/';
@@ -49,25 +51,37 @@ bool matchFilePath(StringRef Pattern, StringRef FilePath) {
         return false;
       break;
     case '*': {
-      while (++I < EOP && Pattern[I] == '*') { // Skip consecutive stars.
+      bool Globstar = I == 0 || Pattern[I - 1] == Separator;
+      int StarCount = 1;
+      for (; ++I < EOP && Pattern[I] == '*'; ++StarCount) {
+        // Skip consecutive stars.
       }
+      if (StarCount != 2)
+        Globstar = false;
       const auto K = FilePath.find(Separator, J); // Index of next `Separator`.
       const bool NoMoreSeparatorsInFilePath = K == StringRef::npos;
       if (I == EOP) // `Pattern` ends with a star.
-        return NoMoreSeparatorsInFilePath;
-      // `Pattern` ends with a lone backslash.
-      if (Pattern[I] == '\\' && ++I == EOP)
-        return false;
+        return Globstar || NoMoreSeparatorsInFilePath;
+      if (Pattern[I] != Separator) {
+        Globstar = false;
+        // `Pattern` ends with a lone backslash.
+        if (Pattern[I] == '\\' && ++I == EOP)
+          return false;
+      }
       // The star is followed by a (possibly escaped) `Separator`.
       if (Pattern[I] == Separator) {
-        if (NoMoreSeparatorsInFilePath)
-          return false;
-        J = K; // Skip to next `Separator` in `FilePath`.
-        break;
+        if (!Globstar) {
+          if (NoMoreSeparatorsInFilePath)
+            return false;
+          J = K; // Skip to next `Separator` in `FilePath`.
+          break;
+        }
+        if (++I == EOP)
+          return FilePathBack == Separator;
       }
       // Recurse.
-      for (auto Pat = Pattern.substr(I); J < End && FilePath[J] != Separator;
-           ++J) {
+      for (auto Pat = Pattern.substr(I);
+           J < End && (Globstar || FilePath[J] != Separator); ++J) {
         if (matchFilePath(Pat, FilePath.substr(J)))
           return true;
       }
diff --git a/clang/lib/Format/QualifierAlignmentFixer.cpp b/clang/lib/Format/QualifierAlignmentFixer.cpp
index 593f8efff25aa..530b2dd538cee 100644
--- a/clang/lib/Format/QualifierAlignmentFixer.cpp
+++ b/clang/lib/Format/QualifierAlignmentFixer.cpp
@@ -348,7 +348,7 @@ const FormatToken *LeftRightQualifierAlignmentFixer::analyzeRight(
       }
     }
 
-    if (Next->is(tok::kw_auto))
+    if (Next && Next->is(tok::kw_auto))
       TypeToken = Next;
 
     // Place the Qualifier at the end of the list of qualifiers.
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index f2cfa7f49f62f..b0f570966a63f 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -2792,6 +2792,16 @@ class AnnotatingParser {
       return true;
     }
 
+    auto IsNonVariableTemplate = [](const FormatToken &Tok) {
+      if (Tok.isNot(TT_TemplateCloser))
+        return false;
+      const auto *Less = Tok.MatchingParen;
+      if (!Less)
+        return false;
+      const auto *BeforeLess = Less->getPreviousNonComment();
+      return BeforeLess && BeforeLess->isNot(TT_VariableTemplate);
+    };
+
     // Heuristically try to determine whether the parentheses contain a type.
     auto IsQualifiedPointerOrReference = [](const FormatToken *T,
                                             const LangOptions &LangOpts) {
@@ -2825,10 +2835,11 @@ class AnnotatingParser {
       }
       return T && T->is(TT_PointerOrReference);
     };
-    bool ParensAreType =
-        BeforeRParen->isOneOf(TT_TemplateCloser, TT_TypeDeclarationParen) ||
-        BeforeRParen->isTypeName(LangOpts) ||
-        IsQualifiedPointerOrReference(BeforeRParen, LangOpts);
+
+    bool ParensAreType = IsNonVariableTemplate(*BeforeRParen) ||
+                         BeforeRParen->is(TT_TypeDeclarationParen) ||
+                         BeforeRParen->isTypeName(LangOpts) ||
+                         IsQualifiedPointerOrReference(BeforeRParen, LangOpts);
     bool ParensCouldEndDecl =
         AfterRParen->isOneOf(tok::equal, tok::semi, tok::l_brace, tok::greater);
     if (ParensAreType && !ParensCouldEndDecl)
diff --git a/clang/lib/Format/UnwrappedLineFormatter.cpp b/clang/lib/Format/UnwrappedLineFormatter.cpp
index 1804c1437fd41..803c600cec44d 100644
--- a/clang/lib/Format/UnwrappedLineFormatter.cpp
+++ b/clang/lib/Format/UnwrappedLineFormatter.cpp
@@ -361,9 +361,18 @@ class LineJoiner {
     const auto *FirstNonComment = TheLine->getFirstNonComment();
     if (!FirstNonComment)
       return 0;
+
     // FIXME: There are probably cases where we should use FirstNonComment
     // instead of TheLine->First.
 
+    if (Style.AllowShortNamespacesOnASingleLine &&
+        TheLine->First->is(tok::kw_namespace) &&
+        TheLine->Last->is(tok::l_brace)) {
+      const auto result = tryMergeNamespace(I, E, Limit);
+      if (result > 0)
+        return result;
+    }
+
     if (Style.CompactNamespaces) {
       if (const auto *NSToken = TheLine->First->getNamespaceToken()) {
         int J = 1;
@@ -373,7 +382,7 @@ class LineJoiner {
              ClosingLineIndex == I[J]->MatchingClosingBlockLineIndex &&
              I[J]->Last->TotalLength < Limit;
              ++J, --ClosingLineIndex) {
-          Limit -= I[J]->Last->TotalLength;
+          Limit -= I[J]->Last->TotalLength + 1;
 
           // Reduce indent level for bodies of namespaces which were compacted,
           // but only if their content was indented in the first place.
@@ -420,6 +429,7 @@ class LineJoiner {
         TheLine->First != LastNonComment) {
       return MergeShortFunctions ? tryMergeSimpleBlock(I, E, Limit) : 0;
     }
+
     // Try to merge a control statement block with left brace unwrapped.
     if (TheLine->Last->is(tok::l_brace) && FirstNonComment != TheLine->Last &&
         FirstNonComment->isOneOf(tok::kw_if, tok::kw_while, tok::kw_for,
@@ -616,6 +626,72 @@ class LineJoiner {
     return 1;
   }
 
+  unsigned tryMergeNamespace(SmallVectorImpl::const_iterator I,
+                             SmallVectorImpl::const_iterator E,
+                             unsigned Limit) {
+    if (Limit == 0)
+      return 0;
+
+    assert(I[1]);
+    const auto &L1 = *I[1];
+    if (L1.InPPDirective != (*I)->InPPDirective ||
+        (L1.InPPDirective && L1.First->HasUnescapedNewline)) {
+      return 0;
+    }
+
+    if (std::distance(I, E) <= 2)
+      return 0;
+
+    assert(I[2]);
+    const auto &L2 = *I[2];
+    if (L2.Type == LT_Invalid)
+      return 0;
+
+    Limit = limitConsideringMacros(I + 1, E, Limit);
+
+    if (!nextTwoLinesFitInto(I, Limit))
+      return 0;
+
+    // Check if it's a namespace inside a namespace, and call recursively if so.
+    // '3' is the sizes of the whitespace and closing brace for " _inner_ }".
+    if (L1.First->is(tok::kw_namespace)) {
+      if (L1.Last->is(tok::comment) || !Style.CompactNamespaces)
+        return 0;
+
+      assert(Limit >= L1.Last->TotalLength + 3);
+      const auto InnerLimit = Limit - L1.Last->TotalLength - 3;
+      const auto MergedLines = tryMergeNamespace(I + 1, E, InnerLimit);
+      if (MergedLines == 0)
+        return 0;
+      const auto N = MergedLines + 2;
+      // Check if there is even a line after the inner result.
+      if (std::distance(I, E) <= N)
+        return 0;
+      // Check that the line after the inner result starts with a closing brace
+      // which we are permitted to merge into one line.
+      if (I[N]->First->is(tok::r_brace) && !I[N]->First->MustBreakBefore &&
+          I[MergedLines + 1]->Last->isNot(tok::comment) &&
+          nextNLinesFitInto(I, I + N + 1, Limit)) {
+        return N;
+      }
+      return 0;
+    }
+
+    // There's no inner namespace, so we are considering to merge at most one
+    // line.
+
+    // The line which is in the namespace should end with semicolon.
+    if (L1.Last->isNot(tok::semi))
+      return 0;
+
+    // Last, check that the third line starts with a closing brace.
+    if (L2.First->isNot(tok::r_brace) || L2.First->MustBreakBefore)
+      return 0;
+
+    // If so, merge all three lines.
+    return 2;
+  }
+
   unsigned tryMergeSimpleControlStatement(
       SmallVectorImpl::const_iterator I,
       SmallVectorImpl::const_iterator E, unsigned Limit) {
@@ -916,6 +992,21 @@ class LineJoiner {
     return 1 + I[1]->Last->TotalLength + 1 + I[2]->Last->TotalLength <= Limit;
   }
 
+  bool nextNLinesFitInto(SmallVectorImpl::const_iterator I,
+                         SmallVectorImpl::const_iterator E,
+                         unsigned Limit) {
+    unsigned JoinedLength = 0;
+    for (const auto *J = I + 1; J != E; ++J) {
+      if ((*J)->First->MustBreakBefore)
+        return false;
+
+      JoinedLength += 1 + (*J)->Last->TotalLength;
+      if (JoinedLength > Limit)
+        return false;
+    }
+    return true;
+  }
+
   bool containsMustBreak(const AnnotatedLine *Line) {
     assert(Line->First);
     // Ignore the first token, because in this situation, it applies more to the
diff --git a/clang/lib/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp
index 528eae2c5283e..8a36d835d82b3 100644
--- a/clang/lib/Frontend/DependencyFile.cpp
+++ b/clang/lib/Frontend/DependencyFile.cpp
@@ -10,11 +10,11 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "clang/Frontend/Utils.h"
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Frontend/DependencyOutputOptions.h"
 #include "clang/Frontend/FrontendDiagnostic.h"
+#include "clang/Frontend/Utils.h"
 #include "clang/Lex/DirectoryLookup.h"
 #include "clang/Lex/ModuleMap.h"
 #include "clang/Lex/PPCallbacks.h"
@@ -23,8 +23,10 @@
 #include "llvm/ADT/StringSet.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
+#include "llvm/Support/VirtualFileSystem.h"
 #include "llvm/Support/raw_ostream.h"
 #include 
+#include 
 
 using namespace clang;
 
@@ -236,6 +238,7 @@ void DependencyFileGenerator::attachToPreprocessor(Preprocessor &PP) {
     PP.SetSuppressIncludeNotFoundError(true);
 
   DependencyCollector::attachToPreprocessor(PP);
+  FS = PP.getFileManager().getVirtualFileSystemPtr();
 }
 
 bool DependencyFileGenerator::sawDependency(StringRef Filename, bool FromModule,
@@ -312,11 +315,22 @@ void DependencyFileGenerator::finishedMainFile(DiagnosticsEngine &Diags) {
 /// https://msdn.microsoft.com/en-us/library/dd9y37ha.aspx for NMake info,
 /// https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
 /// for Windows file-naming info.
-static void PrintFilename(raw_ostream &OS, StringRef Filename,
+static void printFilename(raw_ostream &OS, llvm::vfs::FileSystem *FS,
+                          StringRef Filename,
                           DependencyOutputFormat OutputFormat) {
   // Convert filename to platform native path
   llvm::SmallString<256> NativePath;
   llvm::sys::path::native(Filename.str(), NativePath);
+  // Resolve absolute path. Make and Ninja canonicalize paths
+  // without checking for symbolic links in the path, for performance concerns.
+  // If there is something like `/bin/../lib64` -> `/usr/lib64`
+  // (where `/bin` links to `/usr/bin`), Make will see them as `/lib64`.
+  if (FS != nullptr && llvm::sys::path::is_absolute(NativePath)) {
+    llvm::SmallString<256> NativePathTmp = NativePath;
+    std::error_code EC = FS->getRealPath(NativePathTmp, NativePath);
+    if (EC)
+      NativePath = NativePathTmp;
+  }
 
   if (OutputFormat == DependencyOutputFormat::NMake) {
     // Add quotes if needed. These are the characters listed as "special" to
@@ -400,7 +414,7 @@ void DependencyFileGenerator::outputDependencyFile(llvm::raw_ostream &OS) {
       Columns = 2;
     }
     OS << ' ';
-    PrintFilename(OS, File, OutputFormat);
+    printFilename(OS, FS.get(), File, OutputFormat);
     Columns += N + 1;
   }
   OS << '\n';
@@ -411,7 +425,7 @@ void DependencyFileGenerator::outputDependencyFile(llvm::raw_ostream &OS) {
     for (auto I = Files.begin(), E = Files.end(); I != E; ++I) {
       if (Index++ == InputFileIndex)
         continue;
-      PrintFilename(OS, *I, OutputFormat);
+      printFilename(OS, FS.get(), *I, OutputFormat);
       OS << ":\n";
     }
   }
diff --git a/clang/lib/Headers/avx10_2_512convertintrin.h b/clang/lib/Headers/avx10_2_512convertintrin.h
index a34e135fa3047..60a5b1ef4548d 100644
--- a/clang/lib/Headers/avx10_2_512convertintrin.h
+++ b/clang/lib/Headers/avx10_2_512convertintrin.h
@@ -308,13 +308,13 @@ static __inline __m512h __DEFAULT_FN_ATTRS512 _mm512_cvtpbf8_ph(__m256i __A) {
 }
 
 static __inline __m512h __DEFAULT_FN_ATTRS512
-_mm512_mask_cvtpbf8_ph(__m512h __S, __mmask16 __U, __m256i __A) {
+_mm512_mask_cvtpbf8_ph(__m512h __S, __mmask32 __U, __m256i __A) {
   return _mm512_castsi512_ph(
       _mm512_mask_slli_epi16((__m512i)__S, __U, _mm512_cvtepi8_epi16(__A), 8));
 }
 
 static __inline __m512h __DEFAULT_FN_ATTRS512
-_mm512_maskz_cvtpbf8_ph(__mmask16 __U, __m256i __A) {
+_mm512_maskz_cvtpbf8_ph(__mmask32 __U, __m256i __A) {
   return _mm512_castsi512_ph(
       _mm512_slli_epi16(_mm512_maskz_cvtepi8_epi16(__U, __A), 8));
 }
diff --git a/clang/lib/Headers/avx10_2convertintrin.h b/clang/lib/Headers/avx10_2convertintrin.h
index 134adb2850c8d..efe8477cbbf9b 100644
--- a/clang/lib/Headers/avx10_2convertintrin.h
+++ b/clang/lib/Headers/avx10_2convertintrin.h
@@ -580,13 +580,13 @@ static __inline__ __m256h __DEFAULT_FN_ATTRS256 _mm256_cvtpbf8_ph(__m128i __A) {
 }
 
 static __inline__ __m256h __DEFAULT_FN_ATTRS256
-_mm256_mask_cvtpbf8_ph(__m256h __S, __mmask8 __U, __m128i __A) {
+_mm256_mask_cvtpbf8_ph(__m256h __S, __mmask16 __U, __m128i __A) {
   return _mm256_castsi256_ph(
       _mm256_mask_slli_epi16((__m256i)__S, __U, _mm256_cvtepi8_epi16(__A), 8));
 }
 
 static __inline__ __m256h __DEFAULT_FN_ATTRS256
-_mm256_maskz_cvtpbf8_ph(__mmask8 __U, __m128i __A) {
+_mm256_maskz_cvtpbf8_ph(__mmask16 __U, __m128i __A) {
   return _mm256_castsi256_ph(
       _mm256_slli_epi16(_mm256_maskz_cvtepi8_epi16(__U, __A), 8));
 }
diff --git a/clang/lib/Headers/hvx_hexagon_protos.h b/clang/lib/Headers/hvx_hexagon_protos.h
index 7e3679a38b2cf..fd120a589f64f 100644
--- a/clang/lib/Headers/hvx_hexagon_protos.h
+++ b/clang/lib/Headers/hvx_hexagon_protos.h
@@ -5178,6 +5178,433 @@
 #define Q6_Vuh_vmpy_VuhVuh_rs16(Vu,Vv) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpyuhvs)(Vu,Vv)
 #endif /* __HEXAGON_ARCH___ >= 69 */
 
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Vdd32.sf=vadd(Vu32.bf,Vv32.bf)
+   C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vadd_VbfVbf(HVX_Vector Vu,
+   HVX_Vector Vv) Instruction Type:      CVI_VX_DV Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Wsf_vadd_VbfVbf(Vu, Vv)                                             \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_sf_bf)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Vd32.h=Vu32.hf
+   C Intrinsic Prototype: HVX_Vector Q6_Vh_equals_Vhf(HVX_Vector Vu)
+   Instruction Type:      CVI_VS
+   Execution Slots:       SLOT0123
+   ========================================================================== */
+
+#define Q6_Vh_equals_Vhf(Vu)                                                   \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_h_hf)(Vu)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Vd32.hf=Vu32.h
+   C Intrinsic Prototype: HVX_Vector Q6_Vhf_equals_Vh(HVX_Vector Vu)
+   Instruction Type:      CVI_VS
+   Execution Slots:       SLOT0123
+   ========================================================================== */
+
+#define Q6_Vhf_equals_Vh(Vu)                                                   \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_hf_h)(Vu)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Vd32.sf=Vu32.w
+   C Intrinsic Prototype: HVX_Vector Q6_Vsf_equals_Vw(HVX_Vector Vu)
+   Instruction Type:      CVI_VS
+   Execution Slots:       SLOT0123
+   ========================================================================== */
+
+#define Q6_Vsf_equals_Vw(Vu)                                                   \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_sf_w)(Vu)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Vd32.w=Vu32.sf
+   C Intrinsic Prototype: HVX_Vector Q6_Vw_equals_Vsf(HVX_Vector Vu)
+   Instruction Type:      CVI_VS
+   Execution Slots:       SLOT0123
+   ========================================================================== */
+
+#define Q6_Vw_equals_Vsf(Vu)                                                   \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vconv_w_sf)(Vu)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Vd32.bf=vcvt(Vu32.sf,Vv32.sf)
+   C Intrinsic Prototype: HVX_Vector Q6_Vbf_vcvt_VsfVsf(HVX_Vector Vu,
+   HVX_Vector Vv) Instruction Type:      CVI_VX Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Vbf_vcvt_VsfVsf(Vu, Vv)                                             \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_bf_sf)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Qd4=vcmp.gt(Vu32.bf,Vv32.bf)
+   C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gt_VbfVbf(HVX_Vector Vu,
+   HVX_Vector Vv) Instruction Type:      CVI_VA Execution Slots:       SLOT0123
+   ========================================================================== */
+
+#define Q6_Q_vcmp_gt_VbfVbf(Vu, Vv)                                            \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)                          \
+  ((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtbf)(Vu, Vv)), -1)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Qx4&=vcmp.gt(Vu32.bf,Vv32.bf)
+   C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtand_QVbfVbf(HVX_VectorPred
+   Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type:      CVI_VA Execution
+   Slots:       SLOT0123
+   ========================================================================== */
+
+#define Q6_Q_vcmp_gtand_QVbfVbf(Qx, Vu, Vv)                                    \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)                          \
+  ((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtbf_and)(                     \
+       __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu,      \
+       Vv)),                                                                   \
+   -1)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Qx4|=vcmp.gt(Vu32.bf,Vv32.bf)
+   C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtor_QVbfVbf(HVX_VectorPred
+   Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type:      CVI_VA Execution
+   Slots:       SLOT0123
+   ========================================================================== */
+
+#define Q6_Q_vcmp_gtor_QVbfVbf(Qx, Vu, Vv)                                     \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)                          \
+  ((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtbf_or)(                      \
+       __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu,      \
+       Vv)),                                                                   \
+   -1)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Qx4^=vcmp.gt(Vu32.bf,Vv32.bf)
+   C Intrinsic Prototype: HVX_VectorPred Q6_Q_vcmp_gtxacc_QVbfVbf(HVX_VectorPred
+   Qx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type:      CVI_VA Execution
+   Slots:       SLOT0123
+   ========================================================================== */
+
+#define Q6_Q_vcmp_gtxacc_QVbfVbf(Qx, Vu, Vv)                                   \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandqrt)                          \
+  ((__BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vgtbf_xor)(                     \
+       __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vandvrt)((Qx), -1), Vu,      \
+       Vv)),                                                                   \
+   -1)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Vd32.bf=vmax(Vu32.bf,Vv32.bf)
+   C Intrinsic Prototype: HVX_Vector Q6_Vbf_vmax_VbfVbf(HVX_Vector Vu,
+   HVX_Vector Vv) Instruction Type:      CVI_VX_LATE Execution Slots: SLOT23
+   ========================================================================== */
+
+#define Q6_Vbf_vmax_VbfVbf(Vu, Vv)                                             \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmax_bf)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Vd32.bf=vmin(Vu32.bf,Vv32.bf)
+   C Intrinsic Prototype: HVX_Vector Q6_Vbf_vmin_VbfVbf(HVX_Vector Vu,
+   HVX_Vector Vv) Instruction Type:      CVI_VX_LATE Execution Slots: SLOT23
+   ========================================================================== */
+
+#define Q6_Vbf_vmin_VbfVbf(Vu, Vv)                                             \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmin_bf)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Vdd32.sf=vmpy(Vu32.bf,Vv32.bf)
+   C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpy_VbfVbf(HVX_Vector Vu,
+   HVX_Vector Vv) Instruction Type:      CVI_VX_DV Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Wsf_vmpy_VbfVbf(Vu, Vv)                                             \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_sf_bf)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Vxx32.sf+=vmpy(Vu32.bf,Vv32.bf)
+   C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vmpyacc_WsfVbfVbf(HVX_VectorPair
+   Vxx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type:      CVI_VX_DV Execution
+   Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Wsf_vmpyacc_WsfVbfVbf(Vxx, Vu, Vv)                                  \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_sf_bf_acc)(Vxx, Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 73
+/* ==========================================================================
+   Assembly Syntax:       Vdd32.sf=vsub(Vu32.bf,Vv32.bf)
+   C Intrinsic Prototype: HVX_VectorPair Q6_Wsf_vsub_VbfVbf(HVX_Vector Vu,
+   HVX_Vector Vv) Instruction Type:      CVI_VX_DV Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Wsf_vsub_VbfVbf(Vu, Vv)                                             \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_sf_bf)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 73 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vd32=vgetqfext(Vu32.x,Rt32)
+   C Intrinsic Prototype: HVX_Vector Q6_V_vgetqfext_VR(HVX_Vector Vu, Word32 Rt)
+   Instruction Type:      CVI_VX
+   Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_V_vgetqfext_VR(Vu, Rt)                                              \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_get_qfext)(Vu, Rt)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vx32|=vgetqfext(Vu32.x,Rt32)
+   C Intrinsic Prototype: HVX_Vector Q6_V_vgetqfextor_VVR(HVX_Vector Vx,
+   HVX_Vector Vu, Word32 Rt) Instruction Type:      CVI_VX Execution Slots:
+   SLOT23
+   ========================================================================== */
+
+#define Q6_V_vgetqfextor_VVR(Vx, Vu, Rt)                                       \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_get_qfext_oracc)(Vx, Vu, Rt)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vd32.x=vsetqfext(Vu32,Rt32)
+   C Intrinsic Prototype: HVX_Vector Q6_V_vsetqfext_VR(HVX_Vector Vu, Word32 Rt)
+   Instruction Type:      CVI_VX
+   Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_V_vsetqfext_VR(Vu, Rt)                                              \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_set_qfext)(Vu, Rt)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vd32.f8=vabs(Vu32.f8)
+   C Intrinsic Prototype: HVX_Vector Q6_V_vabs_V(HVX_Vector Vu)
+   Instruction Type:      CVI_VX_LATE
+   Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_V_vabs_V(Vu) __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vabs_f8)(Vu)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vdd32.hf=vadd(Vu32.f8,Vv32.f8)
+   C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vadd_VV(HVX_Vector Vu,
+   HVX_Vector Vv) Instruction Type:      CVI_VX_DV Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Whf_vadd_VV(Vu, Vv)                                                 \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vadd_hf_f8)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vd32.b=vcvt2(Vu32.hf,Vv32.hf)
+   C Intrinsic Prototype: HVX_Vector Q6_Vb_vcvt2_VhfVhf(HVX_Vector Vu,
+   HVX_Vector Vv) Instruction Type:      CVI_VX Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Vb_vcvt2_VhfVhf(Vu, Vv)                                             \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt2_b_hf)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vdd32.hf=vcvt2(Vu32.b)
+   C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vcvt2_Vb(HVX_Vector Vu)
+   Instruction Type:      CVI_VX_DV
+   Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Whf_vcvt2_Vb(Vu)                                                    \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt2_hf_b)(Vu)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vdd32.hf=vcvt2(Vu32.ub)
+   C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vcvt2_Vub(HVX_Vector Vu)
+   Instruction Type:      CVI_VX_DV
+   Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Whf_vcvt2_Vub(Vu)                                                   \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt2_hf_ub)(Vu)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vd32.ub=vcvt2(Vu32.hf,Vv32.hf)
+   C Intrinsic Prototype: HVX_Vector Q6_Vub_vcvt2_VhfVhf(HVX_Vector Vu,
+   HVX_Vector Vv) Instruction Type:      CVI_VX Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Vub_vcvt2_VhfVhf(Vu, Vv)                                            \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt2_ub_hf)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vd32.f8=vcvt(Vu32.hf,Vv32.hf)
+   C Intrinsic Prototype: HVX_Vector Q6_V_vcvt_VhfVhf(HVX_Vector Vu, HVX_Vector
+   Vv) Instruction Type:      CVI_VX Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_V_vcvt_VhfVhf(Vu, Vv)                                               \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_f8_hf)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vdd32.hf=vcvt(Vu32.f8)
+   C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vcvt_V(HVX_Vector Vu)
+   Instruction Type:      CVI_VX_DV
+   Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Whf_vcvt_V(Vu)                                                      \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vcvt_hf_f8)(Vu)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vd32.f8=vfmax(Vu32.f8,Vv32.f8)
+   C Intrinsic Prototype: HVX_Vector Q6_V_vfmax_VV(HVX_Vector Vu, HVX_Vector Vv)
+   Instruction Type:      CVI_VX_LATE
+   Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_V_vfmax_VV(Vu, Vv)                                                  \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmax_f8)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vd32.f8=vfmin(Vu32.f8,Vv32.f8)
+   C Intrinsic Prototype: HVX_Vector Q6_V_vfmin_VV(HVX_Vector Vu, HVX_Vector Vv)
+   Instruction Type:      CVI_VX_LATE
+   Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_V_vfmin_VV(Vu, Vv)                                                  \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfmin_f8)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vd32.f8=vfneg(Vu32.f8)
+   C Intrinsic Prototype: HVX_Vector Q6_V_vfneg_V(HVX_Vector Vu)
+   Instruction Type:      CVI_VX_LATE
+   Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_V_vfneg_V(Vu)                                                       \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vfneg_f8)(Vu)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vd32=vmerge(Vu32.x,Vv32.w)
+   C Intrinsic Prototype: HVX_Vector Q6_V_vmerge_VVw(HVX_Vector Vu, HVX_Vector
+   Vv) Instruction Type:      CVI_VS Execution Slots:       SLOT0123
+   ========================================================================== */
+
+#define Q6_V_vmerge_VVw(Vu, Vv)                                                \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmerge_qf)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vdd32.hf=vmpy(Vu32.f8,Vv32.f8)
+   C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vmpy_VV(HVX_Vector Vu,
+   HVX_Vector Vv) Instruction Type:      CVI_VX_DV Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Whf_vmpy_VV(Vu, Vv)                                                 \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_hf_f8)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vxx32.hf+=vmpy(Vu32.f8,Vv32.f8)
+   C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vmpyacc_WhfVV(HVX_VectorPair
+   Vxx, HVX_Vector Vu, HVX_Vector Vv) Instruction Type:      CVI_VX_DV Execution
+   Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Whf_vmpyacc_WhfVV(Vxx, Vu, Vv)                                      \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_hf_f8_acc)(Vxx, Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vd32.qf16=vmpy(Vu32.hf,Rt32.hf)
+   C Intrinsic Prototype: HVX_Vector Q6_Vqf16_vmpy_VhfRhf(HVX_Vector Vu, Word32
+   Rt) Instruction Type:      CVI_VX_DV Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Vqf16_vmpy_VhfRhf(Vu, Rt)                                           \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_rt_hf)(Vu, Rt)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vd32.qf16=vmpy(Vu32.qf16,Rt32.hf)
+   C Intrinsic Prototype: HVX_Vector Q6_Vqf16_vmpy_Vqf16Rhf(HVX_Vector Vu,
+   Word32 Rt) Instruction Type:      CVI_VX_DV Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Vqf16_vmpy_Vqf16Rhf(Vu, Rt)                                         \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_rt_qf16)(Vu, Rt)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vd32.qf32=vmpy(Vu32.sf,Rt32.sf)
+   C Intrinsic Prototype: HVX_Vector Q6_Vqf32_vmpy_VsfRsf(HVX_Vector Vu, Word32
+   Rt) Instruction Type:      CVI_VX_DV Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Vqf32_vmpy_VsfRsf(Vu, Rt)                                           \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vmpy_rt_sf)(Vu, Rt)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
+#if __HVX_ARCH__ >= 79
+/* ==========================================================================
+   Assembly Syntax:       Vdd32.hf=vsub(Vu32.f8,Vv32.f8)
+   C Intrinsic Prototype: HVX_VectorPair Q6_Whf_vsub_VV(HVX_Vector Vu,
+   HVX_Vector Vv) Instruction Type:      CVI_VX_DV Execution Slots:       SLOT23
+   ========================================================================== */
+
+#define Q6_Whf_vsub_VV(Vu, Vv)                                                 \
+  __BUILTIN_VECTOR_WRAP(__builtin_HEXAGON_V6_vsub_hf_f8)(Vu, Vv)
+#endif /* __HEXAGON_ARCH___ >= 79 */
+
 #endif /* __HVX__ */
 
 #endif
diff --git a/clang/lib/Lex/InitHeaderSearch.cpp b/clang/lib/Lex/InitHeaderSearch.cpp
index ea02f5dfb6264..67c9d92b849ea 100644
--- a/clang/lib/Lex/InitHeaderSearch.cpp
+++ b/clang/lib/Lex/InitHeaderSearch.cpp
@@ -301,6 +301,7 @@ bool InitHeaderSearch::ShouldAddDefaultIncludePaths(
   case llvm::Triple::PS5:
   case llvm::Triple::RTEMS:
   case llvm::Triple::Solaris:
+  case llvm::Triple::UEFI:
   case llvm::Triple::WASI:
   case llvm::Triple::ZOS:
     return false;
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index 36e56a92c3092..0710542f5e938 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -2222,8 +2222,15 @@ bool Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec(
     }
   }
 
-  if (SS.isEmpty())
+  if (SS.isEmpty()) {
+    if (getLangOpts().ObjC && !getLangOpts().CPlusPlus &&
+        Tok.is(tok::coloncolon)) {
+      // ObjectiveC does not allow :: as as a scope token.
+      Diag(ConsumeToken(), diag::err_expected_type);
+      return true;
+    }
     return false;
+  }
 
   // A C++ scope specifier that isn't followed by a typename.
   AnnotateScopeToken(SS, IsNewScope);
@@ -2647,10 +2654,10 @@ Decl *Parser::ParseModuleImport(SourceLocation AtLoc,
       SeenError = false;
     break;
   }
-  if (SeenError) {
-    ExpectAndConsumeSemi(diag::err_module_expected_semi);
+  ExpectAndConsumeSemi(diag::err_module_expected_semi);
+
+  if (SeenError)
     return nullptr;
-  }
 
   DeclResult Import;
   if (HeaderUnit)
@@ -2659,7 +2666,6 @@ Decl *Parser::ParseModuleImport(SourceLocation AtLoc,
   else if (!Path.empty())
     Import = Actions.ActOnModuleImport(StartLoc, ExportLoc, ImportLoc, Path,
                                        IsPartition);
-  ExpectAndConsumeSemi(diag::err_module_expected_semi);
   if (Import.isInvalid())
     return nullptr;
 
diff --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp b/clang/lib/Sema/AnalysisBasedWarnings.cpp
index 37d966a5a0463..589869d018657 100644
--- a/clang/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp
@@ -1843,6 +1843,14 @@ class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler {
                : getNotes();
   }
 
+  OptionalNotes makeManagedMismatchNoteForParam(SourceLocation DeclLoc) {
+    return DeclLoc.isValid()
+               ? getNotes(PartialDiagnosticAt(
+                     DeclLoc,
+                     S.PDiag(diag::note_managed_mismatch_here_for_param)))
+               : getNotes();
+  }
+
  public:
   ThreadSafetyReporter(Sema &S, SourceLocation FL, SourceLocation FEL)
     : S(S), FunLocation(FL), FunEndLocation(FEL),
@@ -1863,6 +1871,38 @@ class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler {
     }
   }
 
+  void handleUnmatchedUnderlyingMutexes(SourceLocation Loc, SourceLocation DLoc,
+                                        Name scopeName, StringRef Kind,
+                                        Name expected, Name actual) override {
+    PartialDiagnosticAt Warning(Loc,
+                                S.PDiag(diag::warn_unmatched_underlying_mutexes)
+                                    << Kind << scopeName << expected << actual);
+    Warnings.emplace_back(std::move(Warning),
+                          makeManagedMismatchNoteForParam(DLoc));
+  }
+
+  void handleExpectMoreUnderlyingMutexes(SourceLocation Loc,
+                                         SourceLocation DLoc, Name scopeName,
+                                         StringRef Kind,
+                                         Name expected) override {
+    PartialDiagnosticAt Warning(
+        Loc, S.PDiag(diag::warn_expect_more_underlying_mutexes)
+                 << Kind << scopeName << expected);
+    Warnings.emplace_back(std::move(Warning),
+                          makeManagedMismatchNoteForParam(DLoc));
+  }
+
+  void handleExpectFewerUnderlyingMutexes(SourceLocation Loc,
+                                          SourceLocation DLoc, Name scopeName,
+                                          StringRef Kind,
+                                          Name actual) override {
+    PartialDiagnosticAt Warning(
+        Loc, S.PDiag(diag::warn_expect_fewer_underlying_mutexes)
+                 << Kind << scopeName << actual);
+    Warnings.emplace_back(std::move(Warning),
+                          makeManagedMismatchNoteForParam(DLoc));
+  }
+
   void handleInvalidLockExp(SourceLocation Loc) override {
     PartialDiagnosticAt Warning(Loc, S.PDiag(diag::warn_cannot_resolve_lock)
                                          << Loc);
diff --git a/clang/lib/Sema/HLSLExternalSemaSource.cpp b/clang/lib/Sema/HLSLExternalSemaSource.cpp
index 4faeda856c469..d34d3ef2996ac 100644
--- a/clang/lib/Sema/HLSLExternalSemaSource.cpp
+++ b/clang/lib/Sema/HLSLExternalSemaSource.cpp
@@ -1027,6 +1027,7 @@ void HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() {
     setupBufferType(Decl, *SemaPtr, ResourceClass::SRV, ResourceKind::RawBuffer,
                     /*IsROV=*/false, /*RawBuffer=*/true)
         .addArraySubscriptOperators()
+        .addLoadMethods()
         .completeDefinition();
   });
 
@@ -1037,6 +1038,7 @@ void HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() {
     setupBufferType(Decl, *SemaPtr, ResourceClass::UAV, ResourceKind::RawBuffer,
                     /*IsROV=*/false, /*RawBuffer=*/true)
         .addArraySubscriptOperators()
+        .addLoadMethods()
         .addIncrementCounterMethod()
         .addDecrementCounterMethod()
         .completeDefinition();
@@ -1072,6 +1074,7 @@ void HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() {
     setupBufferType(Decl, *SemaPtr, ResourceClass::UAV, ResourceKind::RawBuffer,
                     /*IsROV=*/true, /*RawBuffer=*/true)
         .addArraySubscriptOperators()
+        .addLoadMethods()
         .addIncrementCounterMethod()
         .addDecrementCounterMethod()
         .completeDefinition();
diff --git a/clang/lib/Sema/SemaARM.cpp b/clang/lib/Sema/SemaARM.cpp
index 3e93b38143f3b..411baa066f709 100644
--- a/clang/lib/Sema/SemaARM.cpp
+++ b/clang/lib/Sema/SemaARM.cpp
@@ -372,7 +372,7 @@ enum ArmSMEState : unsigned {
 
 bool SemaARM::CheckImmediateArg(CallExpr *TheCall, unsigned CheckTy,
                                 unsigned ArgIdx, unsigned EltBitWidth,
-                                unsigned VecBitWidth) {
+                                unsigned ContainerBitWidth) {
   // Function that checks whether the operand (ArgIdx) is an immediate
   // that is one of a given set of values.
   auto CheckImmediateInSet = [&](std::initializer_list Set,
@@ -445,17 +445,17 @@ bool SemaARM::CheckImmediateArg(CallExpr *TheCall, unsigned CheckTy,
     break;
   case ImmCheckType::ImmCheckLaneIndex:
     if (SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0,
-                                        (VecBitWidth / EltBitWidth) - 1))
+                                        (ContainerBitWidth / EltBitWidth) - 1))
       return true;
     break;
   case ImmCheckType::ImmCheckLaneIndexCompRotate:
-    if (SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0,
-                                        (VecBitWidth / (2 * EltBitWidth)) - 1))
+    if (SemaRef.BuiltinConstantArgRange(
+            TheCall, ArgIdx, 0, (ContainerBitWidth / (2 * EltBitWidth)) - 1))
       return true;
     break;
   case ImmCheckType::ImmCheckLaneIndexDot:
-    if (SemaRef.BuiltinConstantArgRange(TheCall, ArgIdx, 0,
-                                        (VecBitWidth / (4 * EltBitWidth)) - 1))
+    if (SemaRef.BuiltinConstantArgRange(
+            TheCall, ArgIdx, 0, (ContainerBitWidth / (4 * EltBitWidth)) - 1))
       return true;
     break;
   case ImmCheckType::ImmCheckComplexRot90_270:
@@ -515,13 +515,13 @@ bool SemaARM::PerformNeonImmChecks(
   bool HasError = false;
 
   for (const auto &I : ImmChecks) {
-    auto [ArgIdx, CheckTy, ElementSizeInBits, VecSizeInBits] = I;
+    auto [ArgIdx, CheckTy, ElementBitWidth, VecBitWidth] = I;
 
     if (OverloadType >= 0)
-      ElementSizeInBits = NeonTypeFlags(OverloadType).getEltSizeInBits();
+      ElementBitWidth = NeonTypeFlags(OverloadType).getEltSizeInBits();
 
-    HasError |= CheckImmediateArg(TheCall, CheckTy, ArgIdx, ElementSizeInBits,
-                                  VecSizeInBits);
+    HasError |= CheckImmediateArg(TheCall, CheckTy, ArgIdx, ElementBitWidth,
+                                  VecBitWidth);
   }
 
   return HasError;
@@ -532,9 +532,9 @@ bool SemaARM::PerformSVEImmChecks(
   bool HasError = false;
 
   for (const auto &I : ImmChecks) {
-    auto [ArgIdx, CheckTy, ElementSizeInBits] = I;
+    auto [ArgIdx, CheckTy, ElementBitWidth] = I;
     HasError |=
-        CheckImmediateArg(TheCall, CheckTy, ArgIdx, ElementSizeInBits, 128);
+        CheckImmediateArg(TheCall, CheckTy, ArgIdx, ElementBitWidth, 128);
   }
 
   return HasError;
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index e703a62ff9cf1..ce846ae88c38b 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -6591,27 +6591,33 @@ void CheckFormatHandler::HandleNonStandardConversionSpecifier(
 
 void CheckFormatHandler::HandlePosition(const char *startPos,
                                         unsigned posLen) {
-  EmitFormatDiagnostic(S.PDiag(diag::warn_format_non_standard_positional_arg),
-                               getLocationOfByte(startPos),
-                               /*IsStringLocation*/true,
-                               getSpecifierRange(startPos, posLen));
+  if (!S.getDiagnostics().isIgnored(
+          diag::warn_format_non_standard_positional_arg, SourceLocation()))
+    EmitFormatDiagnostic(S.PDiag(diag::warn_format_non_standard_positional_arg),
+                         getLocationOfByte(startPos),
+                         /*IsStringLocation*/ true,
+                         getSpecifierRange(startPos, posLen));
 }
 
 void CheckFormatHandler::HandleInvalidPosition(
     const char *startSpecifier, unsigned specifierLen,
     analyze_format_string::PositionContext p) {
-  EmitFormatDiagnostic(
-      S.PDiag(diag::warn_format_invalid_positional_specifier) << (unsigned)p,
-      getLocationOfByte(startSpecifier), /*IsStringLocation*/ true,
-      getSpecifierRange(startSpecifier, specifierLen));
+  if (!S.getDiagnostics().isIgnored(
+          diag::warn_format_invalid_positional_specifier, SourceLocation()))
+    EmitFormatDiagnostic(
+        S.PDiag(diag::warn_format_invalid_positional_specifier) << (unsigned)p,
+        getLocationOfByte(startSpecifier), /*IsStringLocation*/ true,
+        getSpecifierRange(startSpecifier, specifierLen));
 }
 
 void CheckFormatHandler::HandleZeroPosition(const char *startPos,
                                             unsigned posLen) {
-  EmitFormatDiagnostic(S.PDiag(diag::warn_format_zero_positional_specifier),
-                               getLocationOfByte(startPos),
-                               /*IsStringLocation*/true,
-                               getSpecifierRange(startPos, posLen));
+  if (!S.getDiagnostics().isIgnored(diag::warn_format_zero_positional_specifier,
+                                    SourceLocation()))
+    EmitFormatDiagnostic(S.PDiag(diag::warn_format_zero_positional_specifier),
+                         getLocationOfByte(startPos),
+                         /*IsStringLocation*/ true,
+                         getSpecifierRange(startPos, posLen));
 }
 
 void CheckFormatHandler::HandleNullChar(const char *nullCharacter) {
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index ff1df7b71b1a4..539de00bd104f 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -1958,3 +1958,21 @@ concepts::TypeRequirement::TypeRequirement(TypeSourceInfo *T) :
     Value(T),
     Status(T->getType()->isInstantiationDependentType() ? SS_Dependent
                                                         : SS_Satisfied) {}
+
+NormalizedConstraint::CompoundConstraintKind
+NormalizedConstraint::getCompoundKind() const {
+  assert(isCompound() && "getCompoundKind on a non-compound constraint..");
+  return cast(Constraint).getInt();
+}
+
+AtomicConstraint *NormalizedConstraint::getAtomicConstraint() const {
+  assert(isAtomic() && "getAtomicConstraint called on non-atomic constraint.");
+  return cast(Constraint);
+}
+
+FoldExpandedConstraint *
+NormalizedConstraint::getFoldExpandedConstraint() const {
+  assert(isFoldExpanded() &&
+         "getFoldExpandedConstraint called on non-fold-expanded constraint.");
+  return cast(Constraint);
+}
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 5d7ee09738377..bb4d33560b93b 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -271,6 +271,19 @@ static bool checkRecordTypeForCapability(Sema &S, QualType Ty) {
   return checkRecordDeclForAttr(RT->getDecl());
 }
 
+static bool checkRecordTypeForScopedCapability(Sema &S, QualType Ty) {
+  const RecordType *RT = getRecordType(Ty);
+
+  if (!RT)
+    return false;
+
+  // Don't check for the capability if the class hasn't been defined yet.
+  if (RT->isIncompleteType())
+    return true;
+
+  return checkRecordDeclForAttr(RT->getDecl());
+}
+
 static bool checkTypedefTypeForCapability(QualType Ty) {
   const auto *TD = Ty->getAs();
   if (!TD)
@@ -416,6 +429,19 @@ static void checkAttrArgsAreCapabilityObjs(Sema &S, Decl *D,
   }
 }
 
+static bool checkFunParamsAreScopedLockable(Sema &S,
+                                            const ParmVarDecl *ParamDecl,
+                                            const ParsedAttr &AL) {
+  QualType ParamType = ParamDecl->getType();
+  if (const auto *RefType = ParamType->getAs();
+      RefType &&
+      checkRecordTypeForScopedCapability(S, RefType->getPointeeType()))
+    return true;
+  S.Diag(AL.getLoc(), diag::warn_thread_attribute_not_on_scoped_lockable_param)
+      << AL;
+  return false;
+}
+
 //===----------------------------------------------------------------------===//
 // Attribute Implementations
 //===----------------------------------------------------------------------===//
@@ -643,6 +669,10 @@ static void handleLockReturnedAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
 }
 
 static void handleLocksExcludedAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
+  if (const auto *ParmDecl = dyn_cast(D);
+      ParmDecl && !checkFunParamsAreScopedLockable(S, ParmDecl, AL))
+    return;
+
   if (!AL.checkAtLeastNumArgs(S, 1))
     return;
 
@@ -5908,6 +5938,10 @@ static void handleAssertCapabilityAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
 
 static void handleAcquireCapabilityAttr(Sema &S, Decl *D,
                                         const ParsedAttr &AL) {
+  if (const auto *ParmDecl = dyn_cast(D);
+      ParmDecl && !checkFunParamsAreScopedLockable(S, ParmDecl, AL))
+    return;
+
   SmallVector Args;
   if (!checkLockFunAttrCommon(S, D, AL, Args))
     return;
@@ -5928,6 +5962,9 @@ static void handleTryAcquireCapabilityAttr(Sema &S, Decl *D,
 
 static void handleReleaseCapabilityAttr(Sema &S, Decl *D,
                                         const ParsedAttr &AL) {
+  if (const auto *ParmDecl = dyn_cast(D);
+      ParmDecl && !checkFunParamsAreScopedLockable(S, ParmDecl, AL))
+    return;
   // Check that all arguments are lockable objects.
   SmallVector Args;
   checkAttrArgsAreCapabilityObjs(S, D, AL, Args, 0, true);
@@ -5938,6 +5975,10 @@ static void handleReleaseCapabilityAttr(Sema &S, Decl *D,
 
 static void handleRequiresCapabilityAttr(Sema &S, Decl *D,
                                          const ParsedAttr &AL) {
+  if (const auto *ParmDecl = dyn_cast(D);
+      ParmDecl && !checkFunParamsAreScopedLockable(S, ParmDecl, AL))
+    return;
+
   if (!AL.checkAtLeastNumArgs(S, 1))
     return;
 
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 24f7d27c69115..562c98c6babe0 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -3352,6 +3352,7 @@ ExprResult Sema::BuildDeclarationNameExpr(
   case Decl::VarTemplateSpecialization:
   case Decl::VarTemplatePartialSpecialization:
   case Decl::Decomposition:
+  case Decl::Binding:
   case Decl::OMPCapturedExpr:
     // In C, "extern void blah;" is valid and is an r-value.
     if (!getLangOpts().CPlusPlus && !type.hasQualifiers() &&
@@ -3371,20 +3372,13 @@ ExprResult Sema::BuildDeclarationNameExpr(
     // potentially-evaluated contexts? Since the variable isn't actually
     // captured in an unevaluated context, it seems that the answer is no.
     if (!isUnevaluatedContext()) {
-      QualType CapturedType = getCapturedDeclRefType(cast(VD), Loc);
+      QualType CapturedType = getCapturedDeclRefType(cast(VD), Loc);
       if (!CapturedType.isNull())
         type = CapturedType;
     }
-
     break;
   }
 
-  case Decl::Binding:
-    // These are always lvalues.
-    valueKind = VK_LValue;
-    type = type.getNonReferenceType();
-    break;
-
   case Decl::Function: {
     if (unsigned BID = cast(VD)->getBuiltinID()) {
       if (!Context.BuiltinInfo.isDirectlyAddressable(BID)) {
@@ -13297,11 +13291,24 @@ static NonConstCaptureKind isReferenceToNonConstCapture(Sema &S, Expr *E) {
   if (!DRE) return NCCK_None;
   if (!DRE->refersToEnclosingVariableOrCapture()) return NCCK_None;
 
-  // The declaration must be a variable which is not declared 'const'.
-  VarDecl *var = dyn_cast(DRE->getDecl());
-  if (!var) return NCCK_None;
-  if (var->getType().isConstQualified()) return NCCK_None;
-  assert(var->hasLocalStorage() && "capture added 'const' to non-local?");
+  ValueDecl *Value = dyn_cast(DRE->getDecl());
+
+  // The declaration must be a value which is not declared 'const'.
+  if (!Value || Value->getType().isConstQualified())
+    return NCCK_None;
+
+  BindingDecl *Binding = dyn_cast(Value);
+  if (Binding) {
+    assert(S.getLangOpts().CPlusPlus && "BindingDecl outside of C++?");
+    assert(!isa(Binding->getDeclContext()));
+    return NCCK_Lambda;
+  }
+
+  VarDecl *Var = dyn_cast(Value);
+  if (!Var)
+    return NCCK_None;
+
+  assert(Var->hasLocalStorage() && "capture added 'const' to non-local?");
 
   // Decide whether the first capture was for a block or a lambda.
   DeclContext *DC = S.CurContext, *Prev = nullptr;
@@ -13310,16 +13317,16 @@ static NonConstCaptureKind isReferenceToNonConstCapture(Sema &S, Expr *E) {
     // For init-capture, it is possible that the variable belongs to the
     // template pattern of the current context.
     if (auto *FD = dyn_cast(DC))
-      if (var->isInitCapture() &&
-          FD->getTemplateInstantiationPattern() == var->getDeclContext())
+      if (Var->isInitCapture() &&
+          FD->getTemplateInstantiationPattern() == Var->getDeclContext())
         break;
-    if (DC == var->getDeclContext())
+    if (DC == Var->getDeclContext())
       break;
     Prev = DC;
     DC = DC->getParent();
   }
   // Unless we have an init-capture, we've gone one step too far.
-  if (!var->isInitCapture())
+  if (!Var->isInitCapture())
     DC = Prev;
   return (isa(DC) ? NCCK_Block : NCCK_Lambda);
 }
@@ -19247,6 +19254,8 @@ bool Sema::NeedToCaptureVariable(ValueDecl *Var, SourceLocation Loc) {
 }
 
 QualType Sema::getCapturedDeclRefType(ValueDecl *Var, SourceLocation Loc) {
+  assert(Var && "Null value cannot be captured");
+
   QualType CaptureType;
   QualType DeclRefType;
 
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index fff49b759c935..7589701fb81de 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -6977,11 +6977,26 @@ void Sema::AddOverloadCandidate(
     /// have linkage. So that all entities of the same should share one
     /// linkage. But in clang, different entities of the same could have
     /// different linkage.
-    NamedDecl *ND = Function;
-    if (auto *SpecInfo = Function->getTemplateSpecializationInfo())
+    const NamedDecl *ND = Function;
+    bool IsImplicitlyInstantiated = false;
+    if (auto *SpecInfo = Function->getTemplateSpecializationInfo()) {
       ND = SpecInfo->getTemplate();
-
-    if (ND->getFormalLinkage() == Linkage::Internal) {
+      IsImplicitlyInstantiated = SpecInfo->getTemplateSpecializationKind() ==
+                                 TSK_ImplicitInstantiation;
+    }
+
+    /// Don't remove inline functions with internal linkage from the overload
+    /// set if they are declared in a GMF, in violation of C++ [basic.link]p17.
+    /// However:
+    /// - Inline functions with internal linkage are a common pattern in
+    ///   headers to avoid ODR issues.
+    /// - The global module is meant to be a transition mechanism for C and C++
+    ///   headers, and the current rules as written work against that goal.
+    const bool IsInlineFunctionInGMF =
+        Function->isFromGlobalModule() &&
+        (IsImplicitlyInstantiated || Function->isInlined());
+
+    if (ND->getFormalLinkage() == Linkage::Internal && !IsInlineFunctionInGMF) {
       Candidate.Viable = false;
       Candidate.FailureKind = ovl_fail_module_mismatched;
       return;
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 15160b0751f83..fccd79bf74520 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -10642,7 +10642,8 @@ void ASTReader::FinishedDeserializing() {
     // We do this now rather than in finishPendingActions because we want to
     // be able to walk the complete redeclaration chains of the updated decls.
     while (!PendingExceptionSpecUpdates.empty() ||
-           !PendingDeducedTypeUpdates.empty()) {
+           !PendingDeducedTypeUpdates.empty() ||
+           !PendingUndeducedFunctionDecls.empty()) {
       auto ESUpdates = std::move(PendingExceptionSpecUpdates);
       PendingExceptionSpecUpdates.clear();
       for (auto Update : ESUpdates) {
diff --git a/clang/lib/Serialization/MultiOnDiskHashTable.h b/clang/lib/Serialization/MultiOnDiskHashTable.h
index a0d75ec3a9e76..6464220f13aef 100644
--- a/clang/lib/Serialization/MultiOnDiskHashTable.h
+++ b/clang/lib/Serialization/MultiOnDiskHashTable.h
@@ -93,7 +93,7 @@ template class MultiOnDiskHashTable {
     using result_type = OnDiskTable *;
 
     result_type operator()(void *P) const {
-      return Table::getFromOpaqueValue(P).template get();
+      return llvm::cast(Table::getFromOpaqueValue(P));
     }
   };
 
@@ -130,7 +130,7 @@ template class MultiOnDiskHashTable {
     Files.insert(PendingOverrides.begin(), PendingOverrides.end());
     // Explicitly capture Files to work around an MSVC 2015 rejects-valid bug.
     auto ShouldRemove = [&Files](void *T) -> bool {
-      auto *ODT = Table::getFromOpaqueValue(T).template get();
+      auto *ODT = llvm::cast(Table::getFromOpaqueValue(T));
       bool Remove = Files.count(ODT->File);
       if (Remove)
         delete ODT;
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLambdaCapturesChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLambdaCapturesChecker.cpp
index da9698e327562..a57499d52acd0 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLambdaCapturesChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLambdaCapturesChecker.cpp
@@ -155,6 +155,8 @@ class UncountedLambdaCapturesChecker
         if (!Init)
           return nullptr;
         TempExpr = dyn_cast(Init->IgnoreParenCasts());
+        if (!TempExpr)
+          return nullptr;
         return dyn_cast_or_null(TempExpr->getSubExpr());
       }
 
diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
index 0fdef7487b981..bb4a39f68280c 100644
--- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -435,27 +435,27 @@ static SVal processArgument(SVal Value, const Expr *ArgumentExpr,
 /// runtime definition don't match in terms of argument and parameter count.
 static SVal castArgToParamTypeIfNeeded(const CallEvent &Call, unsigned ArgIdx,
                                        SVal ArgVal, SValBuilder &SVB) {
-  const FunctionDecl *RTDecl =
-      Call.getRuntimeDefinition().getDecl()->getAsFunction();
   const auto *CallExprDecl = dyn_cast_or_null(Call.getDecl());
-
-  if (!RTDecl || !CallExprDecl)
+  if (!CallExprDecl)
     return ArgVal;
 
+  const FunctionDecl *Definition = CallExprDecl;
+  Definition->hasBody(Definition);
+
   // The function decl of the Call (in the AST) will not have any parameter
   // declarations, if it was 'only' declared without a prototype. However, the
   // engine will find the appropriate runtime definition - basically a
   // redeclaration, which has a function body (and a function prototype).
-  if (CallExprDecl->hasPrototype() || !RTDecl->hasPrototype())
+  if (CallExprDecl->hasPrototype() || !Definition->hasPrototype())
     return ArgVal;
 
   // Only do this cast if the number arguments at the callsite matches with
   // the parameters at the runtime definition.
-  if (Call.getNumArgs() != RTDecl->getNumParams())
+  if (Call.getNumArgs() != Definition->getNumParams())
     return UnknownVal();
 
   const Expr *ArgExpr = Call.getArgExpr(ArgIdx);
-  const ParmVarDecl *Param = RTDecl->getParamDecl(ArgIdx);
+  const ParmVarDecl *Param = Definition->getParamDecl(ArgIdx);
   return SVB.evalCast(ArgVal, Param->getType(), ArgExpr->getType());
 }
 
diff --git a/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp b/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp
index 96f5d7c44baf8..01d87b02fcdbd 100644
--- a/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp
+++ b/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp
@@ -283,10 +283,10 @@ static bool shouldCompletelyUnroll(const Stmt *LoopStmt, ASTContext &ASTCtx,
   llvm::APInt InitNum =
       Matches[0].getNodeAs("initNum")->getValue();
   auto CondOp = Matches[0].getNodeAs("conditionOperator");
-  if (InitNum.getBitWidth() != BoundNum.getBitWidth()) {
-    InitNum = InitNum.zext(BoundNum.getBitWidth());
-    BoundNum = BoundNum.zext(InitNum.getBitWidth());
-  }
+  unsigned MaxWidth = std::max(InitNum.getBitWidth(), BoundNum.getBitWidth());
+
+  InitNum = InitNum.zext(MaxWidth);
+  BoundNum = BoundNum.zext(MaxWidth);
 
   if (CondOp->getOpcode() == BO_GE || CondOp->getOpcode() == BO_LE)
     maxStep = (BoundNum - InitNum + 1).abs().getZExtValue();
diff --git a/clang/test/AST/ByteCode/builtin-constant-p.cpp b/clang/test/AST/ByteCode/builtin-constant-p.cpp
index 0d222d1c96277..62899b60064c2 100644
--- a/clang/test/AST/ByteCode/builtin-constant-p.cpp
+++ b/clang/test/AST/ByteCode/builtin-constant-p.cpp
@@ -12,3 +12,9 @@ static_assert(__builtin_constant_p(I + 10.0), "");
 static_assert(__builtin_constant_p(nullptr), "");
 static_assert(__builtin_constant_p(&I), ""); // both-error {{failed due to requirement}}
 static_assert(__builtin_constant_p((void)I), ""); // both-error {{failed due to requirement}}
+
+extern int z;
+constexpr int foo(int &a) {
+  return __builtin_constant_p(a);
+}
+static_assert(!foo(z));
diff --git a/clang/test/AST/ByteCode/builtin-functions.cpp b/clang/test/AST/ByteCode/builtin-functions.cpp
index c1fd1bc138150..723764010d9a3 100644
--- a/clang/test/AST/ByteCode/builtin-functions.cpp
+++ b/clang/test/AST/ByteCode/builtin-functions.cpp
@@ -1244,6 +1244,34 @@ namespace BuiltinMemcpy {
   }
   static_assert(cpyptr());
 
+#ifndef __AVR__
+  constexpr int test_memmove(int a, int b, int n) {
+    int arr[4] = {1, 2, 3, 4};
+    __builtin_memmove(arr + a, arr + b, n); // both-note {{destination is not a contiguous array of at least 3 elements of type 'int'}}
+    return result(arr);
+  }
+  static_assert(test_memmove(2, 0, 12) == 4234); // both-error {{constant}} \
+                                                 // both-note {{in call}}
+#endif
+
+  struct Trivial { char k; short s; constexpr bool ok() { return k == 3 && s == 4; } };
+  constexpr bool test_trivial() {
+    Trivial arr[3] = {{1, 2}, {3, 4}, {5, 6}};
+    __builtin_memcpy(arr, arr+1, sizeof(Trivial));
+    __builtin_memmove(arr+1, arr, 2 * sizeof(Trivial));
+
+    return arr[0].ok() && arr[1].ok() && arr[2].ok();
+  }
+  static_assert(test_trivial());
+
+  // Check that an incomplete array is rejected.
+  constexpr int test_incomplete_array_type() { // both-error {{never produces a constant}}
+    extern int arr[];
+    __builtin_memmove(arr, arr, 4 * sizeof(arr[0]));
+    // both-note@-1 2{{'memmove' not supported: source is not a contiguous array of at least 4 elements of type 'int'}}
+    return arr[0] * 1000 + arr[1] * 100 + arr[2] * 10 + arr[3];
+  }
+  static_assert(test_incomplete_array_type() == 1234); // both-error {{constant}} both-note {{in call}}
 }
 
 namespace Memcmp {
diff --git a/clang/test/AST/ByteCode/cxx2a.cpp b/clang/test/AST/ByteCode/cxx2a.cpp
index eaae978e01184..f6006881cee4d 100644
--- a/clang/test/AST/ByteCode/cxx2a.cpp
+++ b/clang/test/AST/ByteCode/cxx2a.cpp
@@ -110,3 +110,63 @@ namespace DtorOrder {
   }
   static_assert(check_abnormal_termination());
 }
+
+namespace std {
+  struct type_info;
+}
+
+namespace TypeId {
+  struct A {
+    const std::type_info &ti = typeid(*this);
+  };
+  struct A2 : A {};
+  static_assert(&A().ti == &typeid(A));
+  static_assert(&typeid((A2())) == &typeid(A2));
+  extern A2 extern_a2;
+  static_assert(&typeid(extern_a2) == &typeid(A2));
+
+  constexpr A2 a2;
+  constexpr const A &a1 = a2;
+  static_assert(&typeid(a1) == &typeid(A));
+
+  struct B {
+    virtual void f();
+    const std::type_info &ti1 = typeid(*this);
+  };
+  struct B2 : B {
+    const std::type_info &ti2 = typeid(*this);
+  };
+  static_assert(&B2().ti1 == &typeid(B));
+  static_assert(&B2().ti2 == &typeid(B2));
+  extern B2 extern_b2;
+  static_assert(&typeid(extern_b2) == &typeid(B2)); // both-error {{constant expression}} \
+                                                    // both-note{{typeid applied to object 'extern_b2' whose dynamic type is not constant}}
+
+
+  constexpr B2 b2;
+  constexpr const B &b1 = b2;
+  static_assert(&typeid(b1) == &typeid(B2));
+
+  constexpr bool side_effects() {
+    // Not polymorphic nor a glvalue.
+    bool OK = true;
+    (void)typeid(OK = false, A2()); // both-warning {{has no effect}}
+    if (!OK) return false;
+
+    // Not polymorphic.
+    A2 a2;
+    (void)typeid(OK = false, a2); // both-warning {{has no effect}}
+    if (!OK) return false;
+
+    // Not a glvalue.
+    (void)typeid(OK = false, B2()); // both-warning {{has no effect}}
+    if (!OK) return false;
+
+    // Polymorphic glvalue: operand evaluated.
+    OK = false;
+    B2 b2;
+    (void)typeid(OK = true, b2); // both-warning {{will be evaluated}}
+    return OK;
+  }
+  static_assert(side_effects());
+}
diff --git a/clang/test/AST/ByteCode/if.cpp b/clang/test/AST/ByteCode/if.cpp
index 540cb76fbaac3..c48b2b8d378c8 100644
--- a/clang/test/AST/ByteCode/if.cpp
+++ b/clang/test/AST/ByteCode/if.cpp
@@ -76,3 +76,30 @@ namespace IfScope {
   }
   static_assert(foo() == 13, "");
 }
+
+namespace IfScope2 {
+  struct __bit_iterator {
+    unsigned __ctz_;
+  };
+  constexpr void __fill_n_bool(__bit_iterator) {}
+
+  constexpr void fill_n(__bit_iterator __first) {
+    if (false)
+      __fill_n_bool(__first);
+    else
+      __fill_n_bool(__first);
+  }
+
+  struct bitset{
+    constexpr void reset() {
+      auto m = __bit_iterator(8);
+      fill_n(m);
+    }
+  };
+  consteval bool foo() {
+    bitset v;
+    v.reset();
+    return true;
+  }
+  static_assert(foo());
+}
diff --git a/clang/test/AST/HLSL/StructuredBuffers-AST.hlsl b/clang/test/AST/HLSL/StructuredBuffers-AST.hlsl
index fd4aa58f5891b..db3f2d405e686 100644
--- a/clang/test/AST/HLSL/StructuredBuffers-AST.hlsl
+++ b/clang/test/AST/HLSL/StructuredBuffers-AST.hlsl
@@ -4,7 +4,7 @@
 //
 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump \
 // RUN:   -DRESOURCE=StructuredBuffer %s | FileCheck -DRESOURCE=StructuredBuffer \
-// RUN:   -check-prefixes=CHECK,CHECK-SRV,CHECK-SUBSCRIPT %s
+// RUN:   -check-prefixes=CHECK,CHECK-SRV,CHECK-SUBSCRIPT,CHECK-LOAD %s
 //
 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -DEMPTY \
 // RUN:  -DRESOURCE=RWStructuredBuffer %s | FileCheck -DRESOURCE=RWStructuredBuffer \
@@ -12,7 +12,7 @@
 //
 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump \
 // RUN:   -DRESOURCE=RWStructuredBuffer %s | FileCheck -DRESOURCE=RWStructuredBuffer \
-// RUN:   -check-prefixes=CHECK,CHECK-UAV,CHECK-SUBSCRIPT,CHECK-COUNTER %s
+// RUN:   -check-prefixes=CHECK,CHECK-UAV,CHECK-SUBSCRIPT,CHECK-COUNTER,CHECK-LOAD %s
 //
 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -DEMPTY \
 // RUN:  -DRESOURCE=AppendStructuredBuffer %s | FileCheck -DRESOURCE=AppendStructuredBuffer \
@@ -36,7 +36,7 @@
 //
 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump \
 // RUN:   -DRESOURCE=RasterizerOrderedStructuredBuffer %s | FileCheck -DRESOURCE=RasterizerOrderedStructuredBuffer \
-// RUN:   -check-prefixes=CHECK,CHECK-UAV,CHECK-ROV,CHECK-SUBSCRIPT %s
+// RUN:   -check-prefixes=CHECK,CHECK-UAV,CHECK-ROV,CHECK-SUBSCRIPT,CHECK-LOAD %s
 
 // This test tests two different AST generations for each structured buffer.
 // The "EMPTY" test mode verifies the AST generated by forward declaration
@@ -125,6 +125,21 @@ RESOURCE Buffer;
 // CHECK-NOSUBSCRIPT-NOT: CXXMethodDecl 0x{{[0-9A-Fa-f]+}} <>  operator[] 'const element_type &(unsigned int) const'
 // CHECK-NOSUBSCRIPT-NOT: CXXMethodDecl 0x{{[0-9A-Fa-f]+}} <>  operator[] 'element_type &(unsigned int)'
 
+// CHECK-LOAD: CXXMethodDecl 0x{{[0-9A-Fa-f]+}} <>  Load 'element_type (unsigned int)'
+// CHECK-LOAD-NEXT: ParmVarDecl 0x{{[0-9A-Fa-f]+}} <>  Index 'unsigned int'
+// CHECK-LOAD-NEXT: CompoundStmt 0x{{[0-9A-Fa-f]+}} <>
+// CHECK-LOAD-NEXT: ReturnStmt 0x{{[0-9A-Fa-f]+}} <>
+// CHECK-LOAD-NEXT: UnaryOperator 0x{{[0-9A-Fa-f]+}} <> 'element_type' prefix '*' cannot overflow
+// CHECK-LOAD-NEXT: CallExpr 0x{{[0-9A-Fa-f]+}} <> 'element_type *'
+// CHECK-LOAD-NEXT: DeclRefExpr 0x{{[0-9A-Fa-f]+}} <> '' Function 0x{{[0-9A-Fa-f]+}} '__builtin_hlsl_resource_getpointer' 'void (...) noexcept'
+// CHECK-LOAD-NEXT: MemberExpr 0x{{[0-9A-Fa-f]+}} <> '__hlsl_resource_t
+// CHECK-LOAD-SAME{LITERAL}: [[hlsl::resource_class(
+// CHECK-LOAD-SAME{LITERAL}: [[hlsl::contained_type(element_type)]]
+// CHECK-LOAD-SAME: ' lvalue .__handle 0x{{[0-9A-Fa-f]+}}
+// CHECK-LOAD-NEXT: CXXThisExpr 0x{{[0-9A-Fa-f]+}} <> '[[RESOURCE]]' lvalue implicit this
+// CHECK-LOAD-NEXT: DeclRefExpr 0x{{[0-9A-Fa-f]+}} <> 'unsigned int' ParmVar 0x{{[0-9A-Fa-f]+}} 'Index' 'unsigned int'
+// CHECK-LOAD-NEXT: AlwaysInlineAttr 0x{{[0-9A-Fa-f]+}} <> Implicit always_inline
+
 // CHECK-COUNTER: CXXMethodDecl 0x{{[0-9A-Fa-f]+}} <>  IncrementCounter 'unsigned int ()'
 // CHECK-COUNTER-NEXT: CompoundStmt 0x{{[0-9A-Fa-f]+}} <>
 // CHECK-COUNTER-NEXT: ReturnStmt 0x{{[0-9A-Fa-f]+}} <>
diff --git a/clang/test/Analysis/Checkers/WebKit/uncounted-lambda-captures-find-lambda-crash.cpp b/clang/test/Analysis/Checkers/WebKit/uncounted-lambda-captures-find-lambda-crash.cpp
new file mode 100644
index 0000000000000..4d9edb75b7ff3
--- /dev/null
+++ b/clang/test/Analysis/Checkers/WebKit/uncounted-lambda-captures-find-lambda-crash.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.UncountedLambdaCapturesChecker -verify %s
+// expected-no-diagnostics
+
+struct Foo {
+  int x;
+  int y;
+  Foo(int x, int y) : x(x) , y(y) { }
+  ~Foo() { }
+};
+
+Foo bar(const Foo&);
+void foo() {
+  int x = 7;
+  int y = 5;
+  bar(Foo(x, y));
+}
diff --git a/clang/test/Analysis/PR121201.cpp b/clang/test/Analysis/PR121201.cpp
new file mode 100644
index 0000000000000..acd2492d011fa
--- /dev/null
+++ b/clang/test/Analysis/PR121201.cpp
@@ -0,0 +1,67 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s \
+// RUN:    -analyzer-config unroll-loops=true
+
+// expected-no-diagnostics
+
+template  using conditional_t = T;
+class basic_format_arg;
+template  struct formatter;
+
+template  struct value {
+  template  value(T) {
+    using value_type = T;
+    (void)format_custom_arg>;
+  }
+
+  template  static void format_custom_arg() {
+    Context ctx;
+    auto f = Formatter();
+    f.format(0, ctx);
+  }
+};
+
+struct context {
+  template  using formatter_type = formatter;
+};
+
+enum { max_packed_args };
+
+template 
+using arg_t = conditional_t, basic_format_arg>;
+
+template  struct format_arg_store {
+  arg_t args;
+};
+
+template 
+auto make_format_args(T... args) -> format_arg_store {
+  return {args...};
+}
+
+template  void write_padded(F write) { write(0); }
+
+template  void format(T... args) { make_format_args(args...); }
+
+template  struct bitset {
+  bitset(long);
+};
+
+template  struct formatter> {
+  struct writer {
+    bitset bs;
+
+    template  void operator()(OutputIt) {
+      for (auto pos = N; pos > 0; --pos) // no-crash
+        ;
+    }
+  };
+
+  template  void format(bitset bs, FormatContext) {
+    write_padded(writer{bs});
+  }
+};
+
+bitset<6> TestBody_bs(2);
+
+void TestBody() { format(TestBody_bs); }
diff --git a/clang/test/CIR/global-var-simple.cpp b/clang/test/CIR/global-var-simple.cpp
index 5230ff53f87d7..ffcc3ef71a6c7 100644
--- a/clang/test/CIR/global-var-simple.cpp
+++ b/clang/test/CIR/global-var-simple.cpp
@@ -13,11 +13,11 @@ unsigned char uc;
 short ss;
 // CHECK: cir.global @ss : !cir.int
 
-unsigned short us;
-// CHECK: cir.global @us : !cir.int
+unsigned short us = 100;
+// CHECK: cir.global @us = #cir.int<100> : !cir.int
 
-int si;
-// CHECK: cir.global @si : !cir.int
+int si = 42;
+// CHECK: cir.global @si = #cir.int<42> : !cir.int
 
 unsigned ui;
 // CHECK: cir.global @ui : !cir.int
@@ -31,8 +31,8 @@ unsigned long ul;
 long long sll;
 // CHECK: cir.global @sll : !cir.int
 
-unsigned long long ull;
-// CHECK: cir.global @ull : !cir.int
+unsigned long long ull = 123456;
+// CHECK: cir.global @ull = #cir.int<123456> : !cir.int
 
 __int128 s128;
 // CHECK: cir.global @s128 : !cir.int
@@ -57,3 +57,42 @@ _BitInt(20) sb20;
 
 unsigned _BitInt(48) ub48;
 // CHECK: cir.global @ub48 : !cir.int
+
+_Float16 f16;
+// CHECK: cir.global @f16 : !cir.f16
+
+__bf16 bf16;
+// CHECK: cir.global @bf16 : !cir.bf16
+
+float f;
+// CHECK: cir.global @f : !cir.float
+
+double d = 1.25;
+// CHECK: cir.global @d = #cir.fp<1.250000e+00> : !cir.double
+
+long double ld;
+// CHECK: cir.global @ld : !cir.long_double
+
+__float128 f128;
+// CHECK: cir.global @f128 : !cir.f128
+
+void *vp;
+// CHECK: cir.global @vp : !cir.ptr
+
+int *ip = 0;
+// CHECK: cir.global @ip = #cir.ptr : !cir.ptr>
+
+double *dp;
+// CHECK: cir.global @dp : !cir.ptr
+
+char **cpp;
+// CHECK: cir.global @cpp : !cir.ptr>>
+
+void (*fp)();
+// CHECK: cir.global @fp : !cir.ptr>
+
+int (*fpii)(int) = 0;
+// CHECK: cir.global @fpii = #cir.ptr : !cir.ptr (!cir.int)>>
+
+void (*fpvar)(int, ...);
+// CHECK: cir.global @fpvar : !cir.ptr, ...)>>
diff --git a/clang/test/CXX/basic/basic.link/p3.cpp b/clang/test/CXX/basic/basic.link/p3.cpp
index 23f39d11b655a..01202264d2591 100644
--- a/clang/test/CXX/basic/basic.link/p3.cpp
+++ b/clang/test/CXX/basic/basic.link/p3.cpp
@@ -15,7 +15,8 @@ export module m; // #1
 
 // Import errors are fatal, so we test them in isolation.
 #if IMPORT_ERROR == 1
-import x = {}; // expected-error {{module 'x' not found}}
+import x = {}; // expected-error {{expected ';' after module name}}
+               // expected-error@-1 {{module 'x' not found}}
 
 #elif IMPORT_ERROR == 2
 struct X;
diff --git a/clang/test/CodeGen/AArch64/fpm-helpers.c b/clang/test/CodeGen/AArch64/fpm-helpers.c
index 4bced01d5c71f..6264b5caeb4f5 100644
--- a/clang/test/CodeGen/AArch64/fpm-helpers.c
+++ b/clang/test/CodeGen/AArch64/fpm-helpers.c
@@ -35,7 +35,7 @@ extern "C" {
 //
 fpm_t test_init() { return __arm_fpm_init(); }
 
-// CHECK-LABEL: define dso_local noundef i64 @test_src1_1(
+// CHECK-LABEL: define dso_local noundef range(i64 0, -6) i64 @test_src1_1(
 // CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    ret i64 -8
@@ -44,7 +44,7 @@ fpm_t test_src1_1() {
   return __arm_set_fpm_src1_format(INIT_ONES, __ARM_FPM_E5M2);
 }
 
-// CHECK-LABEL: define dso_local noundef i64 @test_src1_2(
+// CHECK-LABEL: define dso_local noundef range(i64 0, -6) i64 @test_src1_2(
 // CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    ret i64 1
@@ -53,7 +53,7 @@ fpm_t test_src1_2() {
   return __arm_set_fpm_src1_format(INIT_ZERO, __ARM_FPM_E4M3);
 }
 
-// CHECK-LABEL: define dso_local noundef i64 @test_src2_1(
+// CHECK-LABEL: define dso_local noundef range(i64 0, -48) i64 @test_src2_1(
 // CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    ret i64 -57
@@ -62,7 +62,7 @@ fpm_t test_src2_1() {
   return __arm_set_fpm_src2_format(INIT_ONES, __ARM_FPM_E5M2);
 }
 
-// CHECK-LABEL: define dso_local noundef i64 @test_src2_2(
+// CHECK-LABEL: define dso_local noundef range(i64 0, -48) i64 @test_src2_2(
 // CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    ret i64 8
@@ -71,7 +71,7 @@ fpm_t test_src2_2() {
   return __arm_set_fpm_src2_format(INIT_ZERO, __ARM_FPM_E4M3);
 }
 
-// CHECK-LABEL: define dso_local noundef i64 @test_dst1_1(
+// CHECK-LABEL: define dso_local noundef range(i64 0, -384) i64 @test_dst1_1(
 // CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    ret i64 -449
@@ -80,7 +80,7 @@ fpm_t test_dst1_1() {
   return __arm_set_fpm_dst_format(INIT_ONES, __ARM_FPM_E5M2);
 }
 
-// CHECK-LABEL: define dso_local noundef i64 @test_dst2_2(
+// CHECK-LABEL: define dso_local noundef range(i64 0, -384) i64 @test_dst2_2(
 // CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    ret i64 64
@@ -139,21 +139,21 @@ fpm_t test_lscale() { return __arm_set_fpm_lscale(INIT_ZERO, 127); }
 //
 fpm_t test_lscale2() { return __arm_set_fpm_lscale2(INIT_ZERO, 63); }
 
-// CHECK-LABEL: define dso_local noundef range(i64 0, 4294967296) i64 @test_nscale_1(
+// CHECK-LABEL: define dso_local noundef range(i64 0, 4278190081) i64 @test_nscale_1(
 // CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    ret i64 2147483648
 //
 fpm_t test_nscale_1() { return __arm_set_fpm_nscale(INIT_ZERO, -128); }
 
-// CHECK-LABEL: define dso_local noundef range(i64 0, 4294967296) i64 @test_nscale_2(
+// CHECK-LABEL: define dso_local noundef range(i64 0, 4278190081) i64 @test_nscale_2(
 // CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    ret i64 2130706432
 //
 fpm_t test_nscale_2() { return __arm_set_fpm_nscale(INIT_ZERO, 127); }
 
-// CHECK-LABEL: define dso_local noundef range(i64 0, 4294967296) i64 @test_nscale_3(
+// CHECK-LABEL: define dso_local noundef range(i64 0, 4278190081) i64 @test_nscale_3(
 // CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] {
 // CHECK-NEXT:  [[ENTRY:.*:]]
 // CHECK-NEXT:    ret i64 4278190080
diff --git a/clang/test/CodeGen/AArch64/pure-scalable-args.c b/clang/test/CodeGen/AArch64/pure-scalable-args.c
index a8c3dd9288a5b..b03011e70b6a6 100644
--- a/clang/test/CodeGen/AArch64/pure-scalable-args.c
+++ b/clang/test/CodeGen/AArch64/pure-scalable-args.c
@@ -459,3 +459,22 @@ void test_va_arg(int n, ...) {
 // CHECK-DARWIN-NEXT:   call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %ap)
 // CHECK-DARWIN-NEXT:   ret void
 // CHECK-DARWIN-NEXT: }
+
+// Regression test for incorrect passing of SVE vector tuples
+// The whole `y` need to be passed indirectly.
+void test_tuple_reg_count(svfloat32_t x, svfloat32x2_t y) {
+  void test_tuple_reg_count_callee(svfloat32_t, svfloat32_t, svfloat32_t, svfloat32_t,
+                                   svfloat32_t, svfloat32_t, svfloat32_t, svfloat32x2_t);
+  test_tuple_reg_count_callee(x, x, x, x, x, x, x, y);
+}
+// CHECK-AAPCS: declare void @test_tuple_reg_count_callee(, , , , , , , ptr noundef)
+// CHECK-DARWIN: declare void @test_tuple_reg_count_callee(, , , , , , , , )
+
+// Regression test for incorrect passing of SVE vector tuples
+// The whole `y` need to be passed indirectly.
+void test_tuple_reg_count_bool(svboolx4_t x, svboolx4_t y) {
+  void test_tuple_reg_count_bool_callee(svboolx4_t, svboolx4_t);
+  test_tuple_reg_count_bool_callee(x, y);
+}
+// CHECK-AAPCS:  declare void @test_tuple_reg_count_bool_callee(, , , , ptr noundef)
+// CHECK-DARWIN: declare void @test_tuple_reg_count_bool_callee(, , , , , , , )
diff --git a/clang/test/CodeGen/X86/avx10_2_512convert-builtins.c b/clang/test/CodeGen/X86/avx10_2_512convert-builtins.c
index e71cc0c9ad6b0..6662e0cbf8a91 100644
--- a/clang/test/CodeGen/X86/avx10_2_512convert-builtins.c
+++ b/clang/test/CodeGen/X86/avx10_2_512convert-builtins.c
@@ -299,7 +299,7 @@ __m512h test_mm512_cvtpbf8_ph(__m256i A) {
   return _mm512_cvtpbf8_ph(A);
 }
 
-__m512h test_mm512_mask_cvtpbf8_ph(__m512h S, __mmask16 M, __m256i A) {
+__m512h test_mm512_mask_cvtpbf8_ph(__m512h S, __mmask32 M, __m256i A) {
   // CHECK-LABEL: @test_mm512_mask_cvtpbf8_ph
   // CHECK: sext <32 x i8> %{{.*}} to <32 x i16>
   // CHECK: @llvm.x86.avx512.pslli.w.512
@@ -308,7 +308,7 @@ __m512h test_mm512_mask_cvtpbf8_ph(__m512h S, __mmask16 M, __m256i A) {
   return _mm512_mask_cvtpbf8_ph(S, M, A);
 }
 
-__m512h test_mm512_maskz_cvtpbf8_ph(__mmask16 M, __m256i A) {
+__m512h test_mm512_maskz_cvtpbf8_ph(__mmask32 M, __m256i A) {
   // CHECK-LABEL: @test_mm512_maskz_cvtpbf8_ph
   // CHECK: sext <32 x i8> %{{.*}} to <32 x i16>
   // CHECK: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}
diff --git a/clang/test/CodeGen/bounds-checking.c b/clang/test/CodeGen/bounds-checking.c
index f9319ca61670c..5e6b317a99969 100644
--- a/clang/test/CodeGen/bounds-checking.c
+++ b/clang/test/CodeGen/bounds-checking.c
@@ -1,12 +1,14 @@
-// RUN: %clang_cc1 -fsanitize=local-bounds    -fsanitize-trap=local-bounds -emit-llvm -triple x86_64-apple-darwin10              %s -o - |     FileCheck %s
-// RUN: %clang_cc1 -fsanitize=array-bounds -O                              -emit-llvm -triple x86_64-apple-darwin10 %s -o -              | not FileCheck %s
+// N.B. The clang driver defaults to -fsanitize-merge but clang_cc1 effectively
+// defaults to -fno-sanitize-merge.
 // RUN: %clang_cc1 -fsanitize=array-bounds -O -fsanitize-trap=array-bounds -emit-llvm -triple x86_64-apple-darwin10 -DNO_DYNAMIC %s -o - |     FileCheck %s
+// RUN: %clang_cc1 -fsanitize=array-bounds -O                              -emit-llvm -triple x86_64-apple-darwin10 %s -o -              | not FileCheck %s
 //
-// RUN: %clang_cc1 -fsanitize=local-bounds -fsanitize-trap=local-bounds -O3 -mllvm -bounds-checking-unique-traps -emit-llvm -triple x86_64-apple-darwin10 %s -o - |     FileCheck %s --check-prefixes=NOOPTLOCAL
-// RUN: %clang_cc1 -fsanitize=local-bounds -fsanitize-trap=local-bounds -O3                                      -emit-llvm -triple x86_64-apple-darwin10 %s -o - | not FileCheck %s --check-prefixes=NOOPTLOCAL
+// RUN: %clang_cc1 -fsanitize=local-bounds    -fsanitize-trap=local-bounds -emit-llvm -triple x86_64-apple-darwin10              %s -o - |     FileCheck %s
+//
+// RUN: %clang_cc1 -fsanitize=local-bounds -fsanitize-trap=local-bounds                               -O3 -emit-llvm -triple x86_64-apple-darwin10 %s -o - |     FileCheck %s --check-prefixes=NOOPTLOCAL
+// RUN: %clang_cc1 -fsanitize=local-bounds -fsanitize-trap=local-bounds -fno-sanitize-merge           -O3 -emit-llvm -triple x86_64-apple-darwin10 %s -o - |     FileCheck %s --check-prefixes=NOOPTLOCAL
+// RUN: %clang_cc1 -fsanitize=local-bounds -fsanitize-trap=local-bounds -fsanitize-merge=local-bounds -O3 -emit-llvm -triple x86_64-apple-darwin10 %s -o - | not FileCheck %s --check-prefixes=NOOPTLOCAL
 //
-// N.B. The clang driver defaults to -fsanitize-merge but clang_cc1 effectively
-// defaults to -fno-sanitize-merge.
 // RUN: %clang_cc1 -fsanitize=array-bounds -fsanitize-trap=array-bounds                               -O3 -emit-llvm -triple x86_64-apple-darwin10 %s -o - |     FileCheck %s --check-prefixes=NOOPTARRAY
 // RUN: %clang_cc1 -fsanitize=array-bounds -fsanitize-trap=array-bounds -fno-sanitize-merge           -O3 -emit-llvm -triple x86_64-apple-darwin10 %s -o - |     FileCheck %s --check-prefixes=NOOPTARRAY
 // RUN: %clang_cc1 -fsanitize=array-bounds -fsanitize-trap=array-bounds -fsanitize-merge=array-bounds -O3 -emit-llvm -triple x86_64-apple-darwin10 %s -o - | not FileCheck %s --check-prefixes=NOOPTARRAY
diff --git a/clang/test/CodeGen/builtin-memfns.c b/clang/test/CodeGen/builtin-memfns.c
index 23c3c60b779b3..581eb85eb28e6 100644
--- a/clang/test/CodeGen/builtin-memfns.c
+++ b/clang/test/CodeGen/builtin-memfns.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm < %s| FileCheck %s
+// RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -fexperimental-new-constant-interpreter < %s| FileCheck %s
 
 typedef __WCHAR_TYPE__ wchar_t;
 typedef __SIZE_TYPE__ size_t;
diff --git a/clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp b/clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp
index 9f481e1f0f085..152be26948f28 100644
--- a/clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp
+++ b/clang/test/CodeGenCXX/aarch64-mangle-sve-vectors.cpp
@@ -141,13 +141,13 @@ void f(__clang_svmfloat8x4_t, __clang_svmfloat8x4_t);
 // CHECK-NEXT:    [[COERCE72:%.*]] = alloca { ,  }, align 2
 // CHECK-NEXT:    [[COERCE73:%.*]] = alloca { ,  }, align 2
 // CHECK-NEXT:    [[COERCE74:%.*]] = alloca { , , ,  }, align 2
-// CHECK-NEXT:    [[COERCE75:%.*]] = alloca { , , ,  }, align 2
+// CHECK-NEXT:    [[BYVAL_TEMP:%.*]] = alloca { , , ,  }, align 2
+// CHECK-NEXT:    [[COERCE75:%.*]] = alloca { ,  }, align 16
 // CHECK-NEXT:    [[COERCE76:%.*]] = alloca { ,  }, align 16
-// CHECK-NEXT:    [[COERCE77:%.*]] = alloca { ,  }, align 16
+// CHECK-NEXT:    [[COERCE77:%.*]] = alloca { , ,  }, align 16
 // CHECK-NEXT:    [[COERCE78:%.*]] = alloca { , ,  }, align 16
-// CHECK-NEXT:    [[COERCE79:%.*]] = alloca { , ,  }, align 16
+// CHECK-NEXT:    [[COERCE79:%.*]] = alloca { , , ,  }, align 16
 // CHECK-NEXT:    [[COERCE80:%.*]] = alloca { , , ,  }, align 16
-// CHECK-NEXT:    [[COERCE81:%.*]] = alloca { , , ,  }, align 16
 // CHECK-NEXT:    call void @_Z1fu10__SVInt8_tS_( zeroinitializer,  zeroinitializer)
 // CHECK-NEXT:    call void @_Z1fu11__SVInt16_tS_( zeroinitializer,  zeroinitializer)
 // CHECK-NEXT:    call void @_Z1fu11__SVInt16_tS_( zeroinitializer,  zeroinitializer)
@@ -575,46 +575,41 @@ void f(__clang_svmfloat8x4_t, __clang_svmfloat8x4_t);
 // CHECK-NEXT:    [[COERCE74_EXTRACT1:%.*]] = extractvalue { , , ,  } [[COERCE74_TUPLE]], 1
 // CHECK-NEXT:    [[COERCE74_EXTRACT2:%.*]] = extractvalue { , , ,  } [[COERCE74_TUPLE]], 2
 // CHECK-NEXT:    [[COERCE74_EXTRACT3:%.*]] = extractvalue { , , ,  } [[COERCE74_TUPLE]], 3
-// CHECK-NEXT:    store { , , ,  } zeroinitializer, ptr [[COERCE75]], align 2
-// CHECK-NEXT:    [[COERCE75_TUPLE:%.*]] = load { , , ,  }, ptr [[COERCE75]], align 2
-// CHECK-NEXT:    [[COERCE75_EXTRACT0:%.*]] = extractvalue { , , ,  } [[COERCE75_TUPLE]], 0
-// CHECK-NEXT:    [[COERCE75_EXTRACT1:%.*]] = extractvalue { , , ,  } [[COERCE75_TUPLE]], 1
-// CHECK-NEXT:    [[COERCE75_EXTRACT2:%.*]] = extractvalue { , , ,  } [[COERCE75_TUPLE]], 2
-// CHECK-NEXT:    [[COERCE75_EXTRACT3:%.*]] = extractvalue { , , ,  } [[COERCE75_TUPLE]], 3
-// CHECK-NEXT:    call void @_Z1f10svboolx4_tS_( [[COERCE74_EXTRACT0]],  [[COERCE74_EXTRACT1]],  [[COERCE74_EXTRACT2]],  [[COERCE74_EXTRACT3]],  [[COERCE75_EXTRACT0]],  [[COERCE75_EXTRACT1]],  [[COERCE75_EXTRACT2]],  [[COERCE75_EXTRACT3]])
+// CHECK-NEXT:    store { , , ,  } zeroinitializer, ptr [[BYVAL_TEMP]], align 2
+// CHECK-NEXT:    call void @_Z1f10svboolx4_tS_( [[COERCE74_EXTRACT0]],  [[COERCE74_EXTRACT1]],  [[COERCE74_EXTRACT2]],  [[COERCE74_EXTRACT3]], ptr noundef [[BYVAL_TEMP]])
+// CHECK-NEXT:    store { ,  } zeroinitializer, ptr [[COERCE75]], align 16
+// CHECK-NEXT:    [[COERCE75_TUPLE:%.*]] = load { ,  }, ptr [[COERCE75]], align 16
+// CHECK-NEXT:    [[COERCE75_EXTRACT0:%.*]] = extractvalue { ,  } [[COERCE75_TUPLE]], 0
+// CHECK-NEXT:    [[COERCE75_EXTRACT1:%.*]] = extractvalue { ,  } [[COERCE75_TUPLE]], 1
 // CHECK-NEXT:    store { ,  } zeroinitializer, ptr [[COERCE76]], align 16
 // CHECK-NEXT:    [[COERCE76_TUPLE:%.*]] = load { ,  }, ptr [[COERCE76]], align 16
 // CHECK-NEXT:    [[COERCE76_EXTRACT0:%.*]] = extractvalue { ,  } [[COERCE76_TUPLE]], 0
 // CHECK-NEXT:    [[COERCE76_EXTRACT1:%.*]] = extractvalue { ,  } [[COERCE76_TUPLE]], 1
-// CHECK-NEXT:    store { ,  } zeroinitializer, ptr [[COERCE77]], align 16
-// CHECK-NEXT:    [[COERCE77_TUPLE:%.*]] = load { ,  }, ptr [[COERCE77]], align 16
-// CHECK-NEXT:    [[COERCE77_EXTRACT0:%.*]] = extractvalue { ,  } [[COERCE77_TUPLE]], 0
-// CHECK-NEXT:    [[COERCE77_EXTRACT1:%.*]] = extractvalue { ,  } [[COERCE77_TUPLE]], 1
-// CHECK-NEXT:    call void @_Z1f13svmfloat8x2_tS_( [[COERCE76_EXTRACT0]],  [[COERCE76_EXTRACT1]],  [[COERCE77_EXTRACT0]],  [[COERCE77_EXTRACT1]])
+// CHECK-NEXT:    call void @_Z1f13svmfloat8x2_tS_( [[COERCE75_EXTRACT0]],  [[COERCE75_EXTRACT1]],  [[COERCE76_EXTRACT0]],  [[COERCE76_EXTRACT1]])
+// CHECK-NEXT:    store { , ,  } zeroinitializer, ptr [[COERCE77]], align 16
+// CHECK-NEXT:    [[COERCE77_TUPLE:%.*]] = load { , ,  }, ptr [[COERCE77]], align 16
+// CHECK-NEXT:    [[COERCE77_EXTRACT0:%.*]] = extractvalue { , ,  } [[COERCE77_TUPLE]], 0
+// CHECK-NEXT:    [[COERCE77_EXTRACT1:%.*]] = extractvalue { , ,  } [[COERCE77_TUPLE]], 1
+// CHECK-NEXT:    [[COERCE77_EXTRACT2:%.*]] = extractvalue { , ,  } [[COERCE77_TUPLE]], 2
 // CHECK-NEXT:    store { , ,  } zeroinitializer, ptr [[COERCE78]], align 16
 // CHECK-NEXT:    [[COERCE78_TUPLE:%.*]] = load { , ,  }, ptr [[COERCE78]], align 16
 // CHECK-NEXT:    [[COERCE78_EXTRACT0:%.*]] = extractvalue { , ,  } [[COERCE78_TUPLE]], 0
 // CHECK-NEXT:    [[COERCE78_EXTRACT1:%.*]] = extractvalue { , ,  } [[COERCE78_TUPLE]], 1
 // CHECK-NEXT:    [[COERCE78_EXTRACT2:%.*]] = extractvalue { , ,  } [[COERCE78_TUPLE]], 2
-// CHECK-NEXT:    store { , ,  } zeroinitializer, ptr [[COERCE79]], align 16
-// CHECK-NEXT:    [[COERCE79_TUPLE:%.*]] = load { , ,  }, ptr [[COERCE79]], align 16
-// CHECK-NEXT:    [[COERCE79_EXTRACT0:%.*]] = extractvalue { , ,  } [[COERCE79_TUPLE]], 0
-// CHECK-NEXT:    [[COERCE79_EXTRACT1:%.*]] = extractvalue { , ,  } [[COERCE79_TUPLE]], 1
-// CHECK-NEXT:    [[COERCE79_EXTRACT2:%.*]] = extractvalue { , ,  } [[COERCE79_TUPLE]], 2
-// CHECK-NEXT:    call void @_Z1f13svmfloat8x3_tS_( [[COERCE78_EXTRACT0]],  [[COERCE78_EXTRACT1]],  [[COERCE78_EXTRACT2]],  [[COERCE79_EXTRACT0]],  [[COERCE79_EXTRACT1]],  [[COERCE79_EXTRACT2]])
+// CHECK-NEXT:    call void @_Z1f13svmfloat8x3_tS_( [[COERCE77_EXTRACT0]],  [[COERCE77_EXTRACT1]],  [[COERCE77_EXTRACT2]],  [[COERCE78_EXTRACT0]],  [[COERCE78_EXTRACT1]],  [[COERCE78_EXTRACT2]])
+// CHECK-NEXT:    store { , , ,  } zeroinitializer, ptr [[COERCE79]], align 16
+// CHECK-NEXT:    [[COERCE79_TUPLE:%.*]] = load { , , ,  }, ptr [[COERCE79]], align 16
+// CHECK-NEXT:    [[COERCE79_EXTRACT0:%.*]] = extractvalue { , , ,  } [[COERCE79_TUPLE]], 0
+// CHECK-NEXT:    [[COERCE79_EXTRACT1:%.*]] = extractvalue { , , ,  } [[COERCE79_TUPLE]], 1
+// CHECK-NEXT:    [[COERCE79_EXTRACT2:%.*]] = extractvalue { , , ,  } [[COERCE79_TUPLE]], 2
+// CHECK-NEXT:    [[COERCE79_EXTRACT3:%.*]] = extractvalue { , , ,  } [[COERCE79_TUPLE]], 3
 // CHECK-NEXT:    store { , , ,  } zeroinitializer, ptr [[COERCE80]], align 16
 // CHECK-NEXT:    [[COERCE80_TUPLE:%.*]] = load { , , ,  }, ptr [[COERCE80]], align 16
 // CHECK-NEXT:    [[COERCE80_EXTRACT0:%.*]] = extractvalue { , , ,  } [[COERCE80_TUPLE]], 0
 // CHECK-NEXT:    [[COERCE80_EXTRACT1:%.*]] = extractvalue { , , ,  } [[COERCE80_TUPLE]], 1
 // CHECK-NEXT:    [[COERCE80_EXTRACT2:%.*]] = extractvalue { , , ,  } [[COERCE80_TUPLE]], 2
 // CHECK-NEXT:    [[COERCE80_EXTRACT3:%.*]] = extractvalue { , , ,  } [[COERCE80_TUPLE]], 3
-// CHECK-NEXT:    store { , , ,  } zeroinitializer, ptr [[COERCE81]], align 16
-// CHECK-NEXT:    [[COERCE81_TUPLE:%.*]] = load { , , ,  }, ptr [[COERCE81]], align 16
-// CHECK-NEXT:    [[COERCE81_EXTRACT0:%.*]] = extractvalue { , , ,  } [[COERCE81_TUPLE]], 0
-// CHECK-NEXT:    [[COERCE81_EXTRACT1:%.*]] = extractvalue { , , ,  } [[COERCE81_TUPLE]], 1
-// CHECK-NEXT:    [[COERCE81_EXTRACT2:%.*]] = extractvalue { , , ,  } [[COERCE81_TUPLE]], 2
-// CHECK-NEXT:    [[COERCE81_EXTRACT3:%.*]] = extractvalue { , , ,  } [[COERCE81_TUPLE]], 3
-// CHECK-NEXT:    call void @_Z1f13svmfloat8x4_tS_( [[COERCE80_EXTRACT0]],  [[COERCE80_EXTRACT1]],  [[COERCE80_EXTRACT2]],  [[COERCE80_EXTRACT3]],  [[COERCE81_EXTRACT0]],  [[COERCE81_EXTRACT1]],  [[COERCE81_EXTRACT2]],  [[COERCE81_EXTRACT3]])
+// CHECK-NEXT:    call void @_Z1f13svmfloat8x4_tS_( [[COERCE79_EXTRACT0]],  [[COERCE79_EXTRACT1]],  [[COERCE79_EXTRACT2]],  [[COERCE79_EXTRACT3]],  [[COERCE80_EXTRACT0]],  [[COERCE80_EXTRACT1]],  [[COERCE80_EXTRACT2]],  [[COERCE80_EXTRACT3]])
 // CHECK-NEXT:    ret void
 //
 // COMPAT_17-LABEL: define dso_local void @_Z3foov(
@@ -695,13 +690,13 @@ void f(__clang_svmfloat8x4_t, __clang_svmfloat8x4_t);
 // COMPAT_17-NEXT:    [[COERCE72:%.*]] = alloca { ,  }, align 2
 // COMPAT_17-NEXT:    [[COERCE73:%.*]] = alloca { ,  }, align 2
 // COMPAT_17-NEXT:    [[COERCE74:%.*]] = alloca { , , ,  }, align 2
-// COMPAT_17-NEXT:    [[COERCE75:%.*]] = alloca { , , ,  }, align 2
+// COMPAT_17-NEXT:    [[BYVAL_TEMP:%.*]] = alloca { , , ,  }, align 2
+// COMPAT_17-NEXT:    [[COERCE75:%.*]] = alloca { ,  }, align 16
 // COMPAT_17-NEXT:    [[COERCE76:%.*]] = alloca { ,  }, align 16
-// COMPAT_17-NEXT:    [[COERCE77:%.*]] = alloca { ,  }, align 16
+// COMPAT_17-NEXT:    [[COERCE77:%.*]] = alloca { , ,  }, align 16
 // COMPAT_17-NEXT:    [[COERCE78:%.*]] = alloca { , ,  }, align 16
-// COMPAT_17-NEXT:    [[COERCE79:%.*]] = alloca { , ,  }, align 16
+// COMPAT_17-NEXT:    [[COERCE79:%.*]] = alloca { , , ,  }, align 16
 // COMPAT_17-NEXT:    [[COERCE80:%.*]] = alloca { , , ,  }, align 16
-// COMPAT_17-NEXT:    [[COERCE81:%.*]] = alloca { , , ,  }, align 16
 // COMPAT_17-NEXT:    call void @_Z1fu10__SVInt8_tu10__SVInt8_t( zeroinitializer,  zeroinitializer)
 // COMPAT_17-NEXT:    call void @_Z1fu11__SVInt16_tu11__SVInt16_t( zeroinitializer,  zeroinitializer)
 // COMPAT_17-NEXT:    call void @_Z1fu11__SVInt16_tu11__SVInt16_t( zeroinitializer,  zeroinitializer)
@@ -1129,46 +1124,41 @@ void f(__clang_svmfloat8x4_t, __clang_svmfloat8x4_t);
 // COMPAT_17-NEXT:    [[COERCE74_EXTRACT1:%.*]] = extractvalue { , , ,  } [[COERCE74_TUPLE]], 1
 // COMPAT_17-NEXT:    [[COERCE74_EXTRACT2:%.*]] = extractvalue { , , ,  } [[COERCE74_TUPLE]], 2
 // COMPAT_17-NEXT:    [[COERCE74_EXTRACT3:%.*]] = extractvalue { , , ,  } [[COERCE74_TUPLE]], 3
-// COMPAT_17-NEXT:    store { , , ,  } zeroinitializer, ptr [[COERCE75]], align 2
-// COMPAT_17-NEXT:    [[COERCE75_TUPLE:%.*]] = load { , , ,  }, ptr [[COERCE75]], align 2
-// COMPAT_17-NEXT:    [[COERCE75_EXTRACT0:%.*]] = extractvalue { , , ,  } [[COERCE75_TUPLE]], 0
-// COMPAT_17-NEXT:    [[COERCE75_EXTRACT1:%.*]] = extractvalue { , , ,  } [[COERCE75_TUPLE]], 1
-// COMPAT_17-NEXT:    [[COERCE75_EXTRACT2:%.*]] = extractvalue { , , ,  } [[COERCE75_TUPLE]], 2
-// COMPAT_17-NEXT:    [[COERCE75_EXTRACT3:%.*]] = extractvalue { , , ,  } [[COERCE75_TUPLE]], 3
-// COMPAT_17-NEXT:    call void @_Z1f10svboolx4_t10svboolx4_t( [[COERCE74_EXTRACT0]],  [[COERCE74_EXTRACT1]],  [[COERCE74_EXTRACT2]],  [[COERCE74_EXTRACT3]],  [[COERCE75_EXTRACT0]],  [[COERCE75_EXTRACT1]],  [[COERCE75_EXTRACT2]],  [[COERCE75_EXTRACT3]])
+// COMPAT_17-NEXT:    store { , , ,  } zeroinitializer, ptr [[BYVAL_TEMP]], align 2
+// COMPAT_17-NEXT:    call void @_Z1f10svboolx4_t10svboolx4_t( [[COERCE74_EXTRACT0]],  [[COERCE74_EXTRACT1]],  [[COERCE74_EXTRACT2]],  [[COERCE74_EXTRACT3]], ptr noundef [[BYVAL_TEMP]])
+// COMPAT_17-NEXT:    store { ,  } zeroinitializer, ptr [[COERCE75]], align 16
+// COMPAT_17-NEXT:    [[COERCE75_TUPLE:%.*]] = load { ,  }, ptr [[COERCE75]], align 16
+// COMPAT_17-NEXT:    [[COERCE75_EXTRACT0:%.*]] = extractvalue { ,  } [[COERCE75_TUPLE]], 0
+// COMPAT_17-NEXT:    [[COERCE75_EXTRACT1:%.*]] = extractvalue { ,  } [[COERCE75_TUPLE]], 1
 // COMPAT_17-NEXT:    store { ,  } zeroinitializer, ptr [[COERCE76]], align 16
 // COMPAT_17-NEXT:    [[COERCE76_TUPLE:%.*]] = load { ,  }, ptr [[COERCE76]], align 16
 // COMPAT_17-NEXT:    [[COERCE76_EXTRACT0:%.*]] = extractvalue { ,  } [[COERCE76_TUPLE]], 0
 // COMPAT_17-NEXT:    [[COERCE76_EXTRACT1:%.*]] = extractvalue { ,  } [[COERCE76_TUPLE]], 1
-// COMPAT_17-NEXT:    store { ,  } zeroinitializer, ptr [[COERCE77]], align 16
-// COMPAT_17-NEXT:    [[COERCE77_TUPLE:%.*]] = load { ,  }, ptr [[COERCE77]], align 16
-// COMPAT_17-NEXT:    [[COERCE77_EXTRACT0:%.*]] = extractvalue { ,  } [[COERCE77_TUPLE]], 0
-// COMPAT_17-NEXT:    [[COERCE77_EXTRACT1:%.*]] = extractvalue { ,  } [[COERCE77_TUPLE]], 1
-// COMPAT_17-NEXT:    call void @_Z1f13svmfloat8x2_t13svmfloat8x2_t( [[COERCE76_EXTRACT0]],  [[COERCE76_EXTRACT1]],  [[COERCE77_EXTRACT0]],  [[COERCE77_EXTRACT1]])
+// COMPAT_17-NEXT:    call void @_Z1f13svmfloat8x2_t13svmfloat8x2_t( [[COERCE75_EXTRACT0]],  [[COERCE75_EXTRACT1]],  [[COERCE76_EXTRACT0]],  [[COERCE76_EXTRACT1]])
+// COMPAT_17-NEXT:    store { , ,  } zeroinitializer, ptr [[COERCE77]], align 16
+// COMPAT_17-NEXT:    [[COERCE77_TUPLE:%.*]] = load { , ,  }, ptr [[COERCE77]], align 16
+// COMPAT_17-NEXT:    [[COERCE77_EXTRACT0:%.*]] = extractvalue { , ,  } [[COERCE77_TUPLE]], 0
+// COMPAT_17-NEXT:    [[COERCE77_EXTRACT1:%.*]] = extractvalue { , ,  } [[COERCE77_TUPLE]], 1
+// COMPAT_17-NEXT:    [[COERCE77_EXTRACT2:%.*]] = extractvalue { , ,  } [[COERCE77_TUPLE]], 2
 // COMPAT_17-NEXT:    store { , ,  } zeroinitializer, ptr [[COERCE78]], align 16
 // COMPAT_17-NEXT:    [[COERCE78_TUPLE:%.*]] = load { , ,  }, ptr [[COERCE78]], align 16
 // COMPAT_17-NEXT:    [[COERCE78_EXTRACT0:%.*]] = extractvalue { , ,  } [[COERCE78_TUPLE]], 0
 // COMPAT_17-NEXT:    [[COERCE78_EXTRACT1:%.*]] = extractvalue { , ,  } [[COERCE78_TUPLE]], 1
 // COMPAT_17-NEXT:    [[COERCE78_EXTRACT2:%.*]] = extractvalue { , ,  } [[COERCE78_TUPLE]], 2
-// COMPAT_17-NEXT:    store { , ,  } zeroinitializer, ptr [[COERCE79]], align 16
-// COMPAT_17-NEXT:    [[COERCE79_TUPLE:%.*]] = load { , ,  }, ptr [[COERCE79]], align 16
-// COMPAT_17-NEXT:    [[COERCE79_EXTRACT0:%.*]] = extractvalue { , ,  } [[COERCE79_TUPLE]], 0
-// COMPAT_17-NEXT:    [[COERCE79_EXTRACT1:%.*]] = extractvalue { , ,  } [[COERCE79_TUPLE]], 1
-// COMPAT_17-NEXT:    [[COERCE79_EXTRACT2:%.*]] = extractvalue { , ,  } [[COERCE79_TUPLE]], 2
-// COMPAT_17-NEXT:    call void @_Z1f13svmfloat8x3_t13svmfloat8x3_t( [[COERCE78_EXTRACT0]],  [[COERCE78_EXTRACT1]],  [[COERCE78_EXTRACT2]],  [[COERCE79_EXTRACT0]],  [[COERCE79_EXTRACT1]],  [[COERCE79_EXTRACT2]])
+// COMPAT_17-NEXT:    call void @_Z1f13svmfloat8x3_t13svmfloat8x3_t( [[COERCE77_EXTRACT0]],  [[COERCE77_EXTRACT1]],  [[COERCE77_EXTRACT2]],  [[COERCE78_EXTRACT0]],  [[COERCE78_EXTRACT1]],  [[COERCE78_EXTRACT2]])
+// COMPAT_17-NEXT:    store { , , ,  } zeroinitializer, ptr [[COERCE79]], align 16
+// COMPAT_17-NEXT:    [[COERCE79_TUPLE:%.*]] = load { , , ,  }, ptr [[COERCE79]], align 16
+// COMPAT_17-NEXT:    [[COERCE79_EXTRACT0:%.*]] = extractvalue { , , ,  } [[COERCE79_TUPLE]], 0
+// COMPAT_17-NEXT:    [[COERCE79_EXTRACT1:%.*]] = extractvalue { , , ,  } [[COERCE79_TUPLE]], 1
+// COMPAT_17-NEXT:    [[COERCE79_EXTRACT2:%.*]] = extractvalue { , , ,  } [[COERCE79_TUPLE]], 2
+// COMPAT_17-NEXT:    [[COERCE79_EXTRACT3:%.*]] = extractvalue { , , ,  } [[COERCE79_TUPLE]], 3
 // COMPAT_17-NEXT:    store { , , ,  } zeroinitializer, ptr [[COERCE80]], align 16
 // COMPAT_17-NEXT:    [[COERCE80_TUPLE:%.*]] = load { , , ,  }, ptr [[COERCE80]], align 16
 // COMPAT_17-NEXT:    [[COERCE80_EXTRACT0:%.*]] = extractvalue { , , ,  } [[COERCE80_TUPLE]], 0
 // COMPAT_17-NEXT:    [[COERCE80_EXTRACT1:%.*]] = extractvalue { , , ,  } [[COERCE80_TUPLE]], 1
 // COMPAT_17-NEXT:    [[COERCE80_EXTRACT2:%.*]] = extractvalue { , , ,  } [[COERCE80_TUPLE]], 2
 // COMPAT_17-NEXT:    [[COERCE80_EXTRACT3:%.*]] = extractvalue { , , ,  } [[COERCE80_TUPLE]], 3
-// COMPAT_17-NEXT:    store { , , ,  } zeroinitializer, ptr [[COERCE81]], align 16
-// COMPAT_17-NEXT:    [[COERCE81_TUPLE:%.*]] = load { , , ,  }, ptr [[COERCE81]], align 16
-// COMPAT_17-NEXT:    [[COERCE81_EXTRACT0:%.*]] = extractvalue { , , ,  } [[COERCE81_TUPLE]], 0
-// COMPAT_17-NEXT:    [[COERCE81_EXTRACT1:%.*]] = extractvalue { , , ,  } [[COERCE81_TUPLE]], 1
-// COMPAT_17-NEXT:    [[COERCE81_EXTRACT2:%.*]] = extractvalue { , , ,  } [[COERCE81_TUPLE]], 2
-// COMPAT_17-NEXT:    [[COERCE81_EXTRACT3:%.*]] = extractvalue { , , ,  } [[COERCE81_TUPLE]], 3
-// COMPAT_17-NEXT:    call void @_Z1f13svmfloat8x4_t13svmfloat8x4_t( [[COERCE80_EXTRACT0]],  [[COERCE80_EXTRACT1]],  [[COERCE80_EXTRACT2]],  [[COERCE80_EXTRACT3]],  [[COERCE81_EXTRACT0]],  [[COERCE81_EXTRACT1]],  [[COERCE81_EXTRACT2]],  [[COERCE81_EXTRACT3]])
+// COMPAT_17-NEXT:    call void @_Z1f13svmfloat8x4_t13svmfloat8x4_t( [[COERCE79_EXTRACT0]],  [[COERCE79_EXTRACT1]],  [[COERCE79_EXTRACT2]],  [[COERCE79_EXTRACT3]],  [[COERCE80_EXTRACT0]],  [[COERCE80_EXTRACT1]],  [[COERCE80_EXTRACT2]],  [[COERCE80_EXTRACT3]])
 // COMPAT_17-NEXT:    ret void
 //
 void foo() {
diff --git a/clang/test/CodeGenCXX/matrix-vector-bit-int.cpp b/clang/test/CodeGenCXX/matrix-vector-bit-int.cpp
index 040615f417085..ffbce9ff8d6f4 100644
--- a/clang/test/CodeGenCXX/matrix-vector-bit-int.cpp
+++ b/clang/test/CodeGenCXX/matrix-vector-bit-int.cpp
@@ -1,3 +1,4 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
 // RUN: %clang_cc1 -fenable-matrix %s -emit-llvm -triple x86_64-unknown-linux -disable-llvm-passes -o - -std=c++11 | FileCheck %s
 
 using i8x3 = _BitInt(8) __attribute__((ext_vector_type(3)));
@@ -7,92 +8,104 @@ using i32x3x3 = _BitInt(32) __attribute__((matrix_type(3, 3)));
 using i512x3 = _BitInt(512) __attribute__((ext_vector_type(3)));
 using i512x3x3 = _BitInt(512) __attribute__((matrix_type(3, 3)));
 
-// CHECK-LABEL: define dso_local i32 @_Z2v1Dv3_DB8_(i32 %a.coerce)
+// CHECK-LABEL: define dso_local i32 @_Z2v1Dv3_DB8_(
+// CHECK-SAME: i32 [[A_COERCE:%.*]]) #[[ATTR0:[0-9]+]] {
+// CHECK-NEXT:  [[ENTRY:.*:]]
+// CHECK-NEXT:    [[RETVAL:%.*]] = alloca <3 x i8>, align 4
+// CHECK-NEXT:    [[A:%.*]] = alloca <3 x i8>, align 4
+// CHECK-NEXT:    [[A_ADDR:%.*]] = alloca <3 x i8>, align 4
+// CHECK-NEXT:    store i32 [[A_COERCE]], ptr [[A]], align 4
+// CHECK-NEXT:    [[LOADVEC4:%.*]] = load <4 x i8>, ptr [[A]], align 4
+// CHECK-NEXT:    [[A1:%.*]] = shufflevector <4 x i8> [[LOADVEC4]], <4 x i8> poison, <3 x i32> 
+// CHECK-NEXT:    [[EXTRACTVEC:%.*]] = shufflevector <3 x i8> [[A1]], <3 x i8> poison, <4 x i32> 
+// CHECK-NEXT:    store <4 x i8> [[EXTRACTVEC]], ptr [[A_ADDR]], align 4
+// CHECK-NEXT:    [[LOADVEC42:%.*]] = load <4 x i8>, ptr [[A_ADDR]], align 4
+// CHECK-NEXT:    [[EXTRACTVEC3:%.*]] = shufflevector <4 x i8> [[LOADVEC42]], <4 x i8> poison, <3 x i32> 
+// CHECK-NEXT:    [[LOADVEC44:%.*]] = load <4 x i8>, ptr [[A_ADDR]], align 4
+// CHECK-NEXT:    [[EXTRACTVEC5:%.*]] = shufflevector <4 x i8> [[LOADVEC44]], <4 x i8> poison, <3 x i32> 
+// CHECK-NEXT:    [[ADD:%.*]] = add <3 x i8> [[EXTRACTVEC3]], [[EXTRACTVEC5]]
+// CHECK-NEXT:    store <3 x i8> [[ADD]], ptr [[RETVAL]], align 4
+// CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr [[RETVAL]], align 4
+// CHECK-NEXT:    ret i32 [[TMP0]]
+//
 i8x3 v1(i8x3 a) {
-  // CHECK-NEXT: entry:
-  // CHECK-NEXT:   %retval = alloca <3 x i8>, align 4
-  // CHECK-NEXT:   %a = alloca <3 x i8>, align 4
-  // CHECK-NEXT:   %a.addr = alloca <3 x i8>, align 4
-  // CHECK-NEXT:   store i32 %a.coerce, ptr %a, align 4
-  // CHECK-NEXT:   %loadVec4 = load <4 x i8>, ptr %a, align 4
-  // CHECK-NEXT:   %a1 = shufflevector <4 x i8> %loadVec4, <4 x i8> poison, <3 x i32> 
-  // CHECK-NEXT:   %extractVec = shufflevector <3 x i8> %a1, <3 x i8> poison, <4 x i32> 
-  // CHECK-NEXT:   store <4 x i8> %extractVec, ptr %a.addr, align 4
-  // CHECK-NEXT:   %loadVec42 = load <4 x i8>, ptr %a.addr, align 4
-  // CHECK-NEXT:   %extractVec3 = shufflevector <4 x i8> %loadVec42, <4 x i8> poison, <3 x i32> 
-  // CHECK-NEXT:   %loadVec44 = load <4 x i8>, ptr %a.addr, align 4
-  // CHECK-NEXT:   %extractVec5 = shufflevector <4 x i8> %loadVec44, <4 x i8> poison, <3 x i32> 
-  // CHECK-NEXT:   %add = add <3 x i8> %extractVec3, %extractVec5
-  // CHECK-NEXT:   store <3 x i8> %add, ptr %retval, align 4
-  // CHECK-NEXT:   %0 = load i32, ptr %retval, align 4
-  // CHECK-NEXT:   ret i32 %0
   return a + a;
 }
 
-// CHECK-LABEL: define dso_local noundef <3 x i32> @_Z2v2Dv3_DB32_(<3 x i32> noundef %a)
+// CHECK-LABEL: define dso_local noundef <3 x i32> @_Z2v2Dv3_DB32_(
+// CHECK-SAME: <3 x i32> noundef [[A:%.*]]) #[[ATTR1:[0-9]+]] {
+// CHECK-NEXT:  [[ENTRY:.*:]]
+// CHECK-NEXT:    [[A_ADDR:%.*]] = alloca <3 x i32>, align 16
+// CHECK-NEXT:    [[EXTRACTVEC:%.*]] = shufflevector <3 x i32> [[A]], <3 x i32> poison, <4 x i32> 
+// CHECK-NEXT:    store <4 x i32> [[EXTRACTVEC]], ptr [[A_ADDR]], align 16
+// CHECK-NEXT:    [[LOADVEC4:%.*]] = load <4 x i32>, ptr [[A_ADDR]], align 16
+// CHECK-NEXT:    [[EXTRACTVEC1:%.*]] = shufflevector <4 x i32> [[LOADVEC4]], <4 x i32> poison, <3 x i32> 
+// CHECK-NEXT:    [[LOADVEC42:%.*]] = load <4 x i32>, ptr [[A_ADDR]], align 16
+// CHECK-NEXT:    [[EXTRACTVEC3:%.*]] = shufflevector <4 x i32> [[LOADVEC42]], <4 x i32> poison, <3 x i32> 
+// CHECK-NEXT:    [[ADD:%.*]] = add <3 x i32> [[EXTRACTVEC1]], [[EXTRACTVEC3]]
+// CHECK-NEXT:    ret <3 x i32> [[ADD]]
+//
 i32x3 v2(i32x3 a) {
-  // CHECK-NEXT: entry:
-  // CHECK-NEXT:   %a.addr = alloca <3 x i32>, align 16
-  // CHECK-NEXT:   %extractVec = shufflevector <3 x i32> %a, <3 x i32> poison, <4 x i32> 
-  // CHECK-NEXT:   store <4 x i32> %extractVec, ptr %a.addr, align 16
-  // CHECK-NEXT:   %loadVec4 = load <4 x i32>, ptr %a.addr, align 16
-  // CHECK-NEXT:   %extractVec1 = shufflevector <4 x i32> %loadVec4, <4 x i32> poison, <3 x i32> 
-  // CHECK-NEXT:   %loadVec42 = load <4 x i32>, ptr %a.addr, align 16
-  // CHECK-NEXT:   %extractVec3 = shufflevector <4 x i32> %loadVec42, <4 x i32> poison, <3 x i32> 
-  // CHECK-NEXT:   %add = add <3 x i32> %extractVec1, %extractVec3
-  // CHECK-NEXT:   ret <3 x i32> %add
   return a + a;
 }
 
-// CHECK-LABEL: define dso_local noundef <3 x i512> @_Z2v3Dv3_DB512_(ptr noundef byval(<3 x i512>) align 256 %0)
+// CHECK-LABEL: define dso_local noundef <3 x i512> @_Z2v3Dv3_DB512_(
+// CHECK-SAME: ptr noundef byval(<3 x i512>) align 256 [[TMP0:%.*]]) #[[ATTR2:[0-9]+]] {
+// CHECK-NEXT:  [[ENTRY:.*:]]
+// CHECK-NEXT:    [[A_ADDR:%.*]] = alloca <3 x i512>, align 256
+// CHECK-NEXT:    [[LOADVEC4:%.*]] = load <4 x i512>, ptr [[TMP0]], align 256
+// CHECK-NEXT:    [[A:%.*]] = shufflevector <4 x i512> [[LOADVEC4]], <4 x i512> poison, <3 x i32> 
+// CHECK-NEXT:    [[EXTRACTVEC:%.*]] = shufflevector <3 x i512> [[A]], <3 x i512> poison, <4 x i32> 
+// CHECK-NEXT:    store <4 x i512> [[EXTRACTVEC]], ptr [[A_ADDR]], align 256
+// CHECK-NEXT:    [[LOADVEC41:%.*]] = load <4 x i512>, ptr [[A_ADDR]], align 256
+// CHECK-NEXT:    [[EXTRACTVEC2:%.*]] = shufflevector <4 x i512> [[LOADVEC41]], <4 x i512> poison, <3 x i32> 
+// CHECK-NEXT:    [[LOADVEC43:%.*]] = load <4 x i512>, ptr [[A_ADDR]], align 256
+// CHECK-NEXT:    [[EXTRACTVEC4:%.*]] = shufflevector <4 x i512> [[LOADVEC43]], <4 x i512> poison, <3 x i32> 
+// CHECK-NEXT:    [[ADD:%.*]] = add <3 x i512> [[EXTRACTVEC2]], [[EXTRACTVEC4]]
+// CHECK-NEXT:    ret <3 x i512> [[ADD]]
+//
 i512x3 v3(i512x3 a) {
-  // CHECK-NEXT: entry:
-  // CHECK-NEXT:   %a.addr = alloca <3 x i512>, align 256
-  // CHECK-NEXT:   %loadVec4 = load <4 x i512>, ptr %0, align 256
-  // CHECK-NEXT:   %a = shufflevector <4 x i512> %loadVec4, <4 x i512> poison, <3 x i32> 
-  // CHECK-NEXT:   %extractVec = shufflevector <3 x i512> %a, <3 x i512> poison, <4 x i32> 
-  // CHECK-NEXT:   store <4 x i512> %extractVec, ptr %a.addr, align 256
-  // CHECK-NEXT:   %loadVec41 = load <4 x i512>, ptr %a.addr, align 256
-  // CHECK-NEXT:   %extractVec2 = shufflevector <4 x i512> %loadVec41, <4 x i512> poison, <3 x i32> 
-  // CHECK-NEXT:   %loadVec43 = load <4 x i512>, ptr %a.addr, align 256
-  // CHECK-NEXT:   %extractVec4 = shufflevector <4 x i512> %loadVec43, <4 x i512> poison, <3 x i32> 
-  // CHECK-NEXT:   %add = add <3 x i512> %extractVec2, %extractVec4
-  // CHECK-NEXT:   ret <3 x i512> %add
   return a + a;
 }
 
-// CHECK-LABEL: define dso_local noundef <9 x i8> @_Z2m1u11matrix_typeILm3ELm3EDB8_E(<9 x i8> noundef %a)
+// CHECK-LABEL: define dso_local noundef <9 x i8> @_Z2m1u11matrix_typeILm3ELm3EDB8_E(
+// CHECK-SAME: <9 x i8> noundef [[A:%.*]]) #[[ATTR3:[0-9]+]] {
+// CHECK-NEXT:  [[ENTRY:.*:]]
+// CHECK-NEXT:    [[A_ADDR:%.*]] = alloca [9 x i8], align 1
+// CHECK-NEXT:    store <9 x i8> [[A]], ptr [[A_ADDR]], align 1
+// CHECK-NEXT:    [[TMP0:%.*]] = load <9 x i8>, ptr [[A_ADDR]], align 1
+// CHECK-NEXT:    [[TMP1:%.*]] = load <9 x i8>, ptr [[A_ADDR]], align 1
+// CHECK-NEXT:    [[TMP2:%.*]] = add <9 x i8> [[TMP0]], [[TMP1]]
+// CHECK-NEXT:    ret <9 x i8> [[TMP2]]
+//
 i8x3x3 m1(i8x3x3 a) {
-  // CHECK-NEXT: entry:
-  // CHECK-NEXT:   %a.addr = alloca [9 x i8], align 1
-  // CHECK-NEXT:   store <9 x i8> %a, ptr %a.addr, align 1
-  // CHECK-NEXT:   %0 = load <9 x i8>, ptr %a.addr, align 1
-  // CHECK-NEXT:   %1 = load <9 x i8>, ptr %a.addr, align 1
-  // CHECK-NEXT:   %2 = add <9 x i8> %0, %1
-  // CHECK-NEXT:   ret <9 x i8> %2
   return a + a;
 }
 
-// CHECK-LABEL: define dso_local noundef <9 x i32> @_Z2m2u11matrix_typeILm3ELm3EDB32_E(<9 x i32> noundef %a)
+// CHECK-LABEL: define dso_local noundef <9 x i32> @_Z2m2u11matrix_typeILm3ELm3EDB32_E(
+// CHECK-SAME: <9 x i32> noundef [[A:%.*]]) #[[ATTR4:[0-9]+]] {
+// CHECK-NEXT:  [[ENTRY:.*:]]
+// CHECK-NEXT:    [[A_ADDR:%.*]] = alloca [9 x i32], align 4
+// CHECK-NEXT:    store <9 x i32> [[A]], ptr [[A_ADDR]], align 4
+// CHECK-NEXT:    [[TMP0:%.*]] = load <9 x i32>, ptr [[A_ADDR]], align 4
+// CHECK-NEXT:    [[TMP1:%.*]] = load <9 x i32>, ptr [[A_ADDR]], align 4
+// CHECK-NEXT:    [[TMP2:%.*]] = add <9 x i32> [[TMP0]], [[TMP1]]
+// CHECK-NEXT:    ret <9 x i32> [[TMP2]]
+//
 i32x3x3 m2(i32x3x3 a) {
-  // CHECK-NEXT: entry:
-  // CHECK-NEXT:   %a.addr = alloca [9 x i32], align 4
-  // CHECK-NEXT:   store <9 x i32> %a, ptr %a.addr, align 4
-  // CHECK-NEXT:   %0 = load <9 x i32>, ptr %a.addr, align 4
-  // CHECK-NEXT:   %1 = load <9 x i32>, ptr %a.addr, align 4
-  // CHECK-NEXT:   %2 = add <9 x i32> %0, %1
-  // CHECK-NEXT:   ret <9 x i32> %2
   return a + a;
 }
 
-// CHECK-LABEL: define dso_local noundef <9 x i512> @_Z2m3u11matrix_typeILm3ELm3EDB512_E(<9 x i512> noundef %a)
+// CHECK-LABEL: define dso_local noundef <9 x i512> @_Z2m3u11matrix_typeILm3ELm3EDB512_E(
+// CHECK-SAME: <9 x i512> noundef [[A:%.*]]) #[[ATTR5:[0-9]+]] {
+// CHECK-NEXT:  [[ENTRY:.*:]]
+// CHECK-NEXT:    [[A_ADDR:%.*]] = alloca [9 x i512], align 8
+// CHECK-NEXT:    store <9 x i512> [[A]], ptr [[A_ADDR]], align 8
+// CHECK-NEXT:    [[TMP0:%.*]] = load <9 x i512>, ptr [[A_ADDR]], align 8
+// CHECK-NEXT:    [[TMP1:%.*]] = load <9 x i512>, ptr [[A_ADDR]], align 8
+// CHECK-NEXT:    [[TMP2:%.*]] = add <9 x i512> [[TMP0]], [[TMP1]]
+// CHECK-NEXT:    ret <9 x i512> [[TMP2]]
+//
 i512x3x3 m3(i512x3x3 a) {
-  // CHECK-NEXT: entry:
-  // CHECK-NEXT:   %a.addr = alloca [9 x i512], align 8
-  // CHECK-NEXT:   store <9 x i512> %a, ptr %a.addr, align 8
-  // CHECK-NEXT:   %0 = load <9 x i512>, ptr %a.addr, align 8
-  // CHECK-NEXT:   %1 = load <9 x i512>, ptr %a.addr, align 8
-  // CHECK-NEXT:   %2 = add <9 x i512> %0, %1
-  // CHECK-NEXT:   ret <9 x i512> %2
   return a + a;
 }
diff --git a/clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-lib.hlsl b/clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-lib.hlsl
index 5fc2d2ead564d..383f591f676d9 100644
--- a/clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-lib.hlsl
+++ b/clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-lib.hlsl
@@ -3,12 +3,16 @@
 
 // NOTE: SPIRV codegen for resource methods is not yet implemented
 
+StructuredBuffer SB1 : register(t0);
 RWStructuredBuffer RWSB1 : register(u0);
 RWStructuredBuffer RWSB2 : register(u1);
 AppendStructuredBuffer ASB : register(u2);
 ConsumeStructuredBuffer CSB : register(u3);
 
+// CHECK: %"class.hlsl::StructuredBuffer" = type { target("dx.RawBuffer", float, 0, 0) }
 // CHECK: %"class.hlsl::RWStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0) }
+// CHECK: %"class.hlsl::AppendStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0) }
+// CHECK: %"class.hlsl::ConsumeStructuredBuffer" = type { target("dx.RawBuffer", float, 1, 0) }
 
 export int TestIncrementCounter() {
     return RWSB1.IncrementCounter();
@@ -45,5 +49,16 @@ export float TestConsume() {
 // CHECK-DXIL: %[[VALUE:.*]] = load float, ptr %[[RESPTR]], align 4
 // CHECK-DXIL: ret float %[[VALUE]]
 
+export float TestLoad() {
+    return RWSB1.Load(1) + SB1.Load(2);
+}
+
+// CHECK: define noundef float @_Z8TestLoadv()
+// CHECK: %[[PTR1:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i32 %{{[0-9]+}})
+// CHECK: %[[VALUE1:.*]] = load float, ptr %[[PTR1]]
+// CHECK: %[[PTR2:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_0_0t(target("dx.RawBuffer", float, 0, 0) %{{[0-9]+}}, i32 %{{[0-9]+}})
+// CHECK: %[[VALUE2:.*]] = load float, ptr %[[PTR2]]
+
 // CHECK: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i8)
 // CHECK: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i32)
+// CHECK: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_0_0t(target("dx.RawBuffer", float, 0, 0), i32)
diff --git a/clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-ps.hlsl b/clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-ps.hlsl
index f7c091084d3ed..3d9f4f68ec7d2 100644
--- a/clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-ps.hlsl
+++ b/clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-ps.hlsl
@@ -24,5 +24,14 @@ export void TestDecrementCounter() {
     ROSB2.DecrementCounter();
 }
 
-// CHECK: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i8)
-// CHECK: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1), i8)
+export float TestLoad() {
+    return ROSB1.Load(10);
+}
+
+// CHECK: define noundef float @_Z8TestLoadv()
+// CHECK: %[[PTR1:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %{{[0-9]+}}, i32 %{{[0-9]+}})
+// CHECK: %[[VALUE1:.*]] = load float, ptr %[[PTR1]]
+
+// CHECK: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0), i8) #3
+// CHECK: declare i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1), i8) #3
+// CHECK: declare ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1), i32) #4
diff --git a/clang/test/CoverageMapping/single-byte-counters.cpp b/clang/test/CoverageMapping/single-byte-counters.cpp
index 8e9b613dcc68f..f09e13038d900 100644
--- a/clang/test/CoverageMapping/single-byte-counters.cpp
+++ b/clang/test/CoverageMapping/single-byte-counters.cpp
@@ -1,169 +1,166 @@
 // RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -mllvm -enable-single-byte-coverage=true -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name single-byte-counters.cpp %s | FileCheck %s
 
 // CHECK: testIf
-int testIf(int x) { // CHECK-NEXT: File 0, [[@LINE]]:19 -> [[@LINE+10]]:2 = #0
-                    // CHECK-NEXT: File 0, [[@LINE+5]]:7 -> [[@LINE+5]]:13 = #0
-                    // CHECK-NEXT: Gap,File 0, [[@LINE+4]]:14 -> [[@LINE+5]]:5 = #1
-                    // CHECK-NEXT: File 0, [[@LINE+4]]:5 -> [[@LINE+4]]:16 = #1
-                    // CHECK-NEXT: File 0, [[@LINE+5]]:3 -> [[@LINE+5]]:16 = #2
+int testIf(int x) { // CHECK-NEXT: File 0, [[@LINE]]:19 -> [[@LINE+8]]:2 = [[C00:#0]]
   int result = 0;
-  if (x == 0)
-    result = -1;
+  if (x == 0)       // CHECK-NEXT: File 0, [[@LINE]]:7 -> [[@LINE]]:13 = [[C00]]
 
-  return result;
+                    // CHECK-NEXT: Gap,File 0, [[@LINE-2]]:14 -> [[@LINE+1]]:5 = [[C0T:#1]]
+    result = -1;    // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:16 = [[C0T]]
+
+  return result;    // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE]]:16 = [[C0E:#2]]
 }
 
 // CHECK-NEXT: testIfElse
-int testIfElse(int x) { // CHECK-NEXT: File 0, [[@LINE]]:23 -> [[@LINE+13]]:2 = #0
-                        // CHECK-NEXT: File 0, [[@LINE+7]]:7 -> [[@LINE+7]]:12 = #0
-                        // CHECK-NEXT: Gap,File 0, [[@LINE+6]]:13 -> [[@LINE+7]]:5 = #1
-                        // CHECK-NEXT: File 0, [[@LINE+6]]:5 -> [[@LINE+6]]:15 = #1
-                        // CHECK-NEXT: Gap,File 0, [[@LINE+5]]:16 -> [[@LINE+7]]:5 = #2
-                        // CHECK-NEXT: File 0, [[@LINE+6]]:5 -> [[@LINE+6]]:19 = #2
-                        // CHECK-NEXT: File 0, [[@LINE+6]]:3 -> [[@LINE+6]]:16 = #3
+int testIfElse(int x) { // CHECK-NEXT: File 0, [[@LINE]]:23 -> [[@LINE+9]]:2 = [[C10:#0]]
   int result = 0;
-  if (x < 0)
-    result = 0;
-  else
-    result = x * x;
-  return result;
+  if (x < 0)            // CHECK-NEXT: File 0, [[@LINE]]:7 -> [[@LINE]]:12 = [[C10]]
+
+                        // CHECK-NEXT: Gap,File 0, [[@LINE-2]]:13 -> [[@LINE+1]]:5 = [[C1T:#1]]
+    result = 0;         // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:15 = [[C1T]]
+  else                  // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:16 -> [[@LINE+1]]:5 = [[C1F:#2]]
+    result = x * x;     // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:19 = [[C1F]]
+  return result;        // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE]]:16 = [[C1E:#3]]
 }
 
 // CHECK-NEXT: testIfElseReturn
-int testIfElseReturn(int x) { // CHECK-NEXT: File 0, [[@LINE]]:29 -> [[@LINE+14]]:2 = #0
-                              // CHECK-NEXT: File 0, [[@LINE+8]]:7 -> [[@LINE+8]]:12 = #0
-                              // CHECK-NEXT: Gap,File 0, [[@LINE+7]]:13 -> [[@LINE+8]]:5 = #1
-                              // CHECK-NEXT: File 0, [[@LINE+7]]:5 -> [[@LINE+7]]:19 = #1
-                              // CHECK-NEXT: Gap,File 0, [[@LINE+6]]:20 -> [[@LINE+8]]:5 = #2
-                              // CHECK-NEXT: File 0, [[@LINE+7]]:5 -> [[@LINE+7]]:13 = #2
-                              // CHECK-NEXT: Gap,File 0, [[@LINE+6]]:14 -> [[@LINE+7]]:3 = #3
-                              // CHECK-NEXT: File 0, [[@LINE+6]]:3 -> [[@LINE+6]]:16 = #3
+int testIfElseReturn(int x) { // CHECK-NEXT: File 0, [[@LINE]]:29 -> [[@LINE+10]]:2 = [[C20:#0]]
+  int result = 0;
+  if (x > 0)                  // CHECK-NEXT: File 0, [[@LINE]]:7 -> [[@LINE]]:12 = [[C20]]
+
+                              // CHECK-NEXT: Gap,File 0, [[@LINE-2]]:13 -> [[@LINE+1]]:5 = [[C2T:#1]]
+    result = x * x;           // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:19 = [[C2T]]
+  else                        // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:20 -> [[@LINE+1]]:5 = [[C2F:#2]]
+    return 0;                 // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:13 = [[C2F]]
+                              // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:14 -> [[@LINE+1]]:3 = [[C2E:#3]]
+  return result;              // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE]]:16 = [[C2E:#3]]
+}
+
+// CHECK-NEXT: testIfBothReturn
+int testIfBothReturn(int x) { // CHECK-NEXT: File 0, [[@LINE]]:29 -> [[@LINE+10]]:2 = [[C20:#0]]
   int result = 0;
-  if (x > 0)
-    result = x * x;
-  else
-    return 0;
-  return result;
+  if (x > 0)                  // CHECK-NEXT: File 0, [[@LINE]]:7 -> [[@LINE]]:12 = [[C20]]
+
+                              // CHECK-NEXT: Gap,File 0, [[@LINE-2]]:13 -> [[@LINE+1]]:5 = [[C2T:#1]]
+    return 42;                // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:14 = [[C2T]]
+  else                        // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:15 -> [[@LINE+1]]:5 = [[C2F:#2]]
+    return 0;                 // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:13 = [[C2F]]
+                              // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:14 -> [[@LINE+1]]:3 = #3
+  return -1;                  // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE]]:12 = #3
 }
 
 // CHECK-NEXT: testSwitch
-int testSwitch(int x) { // CHECK-NEXT: File 0, [[@LINE]]:23 -> [[@LINE+22]]:2 = #0
-                        // CHECK-NEXT: Gap,File 0, [[@LINE+9]]:14 -> [[@LINE+17]]:15 = 0
-                        // CHECK-NEXT: File 0, [[@LINE+9]]:3 -> [[@LINE+11]]:10 = #2
-                        // CHECK-NEXT: Gap,File 0, [[@LINE+10]]:11 -> [[@LINE+11]]:3 = 0
-                        // CHECK-NEXT: File 0, [[@LINE+10]]:3 -> [[@LINE+12]]:10 = #3
-                        // CHECK-NEXT: Gap,File 0, [[@LINE+11]]:11 -> [[@LINE+12]]:3 = 0
-                        // CHECK-NEXT: File 0, [[@LINE+11]]:3 -> [[@LINE+12]]:15 = #4
-                        // CHECK-NEXT: Gap,File 0, [[@LINE+12]]:4 -> [[@LINE+14]]:3 = #1
-                        // CHECK-NEXT: File 0, [[@LINE+13]]:3 -> [[@LINE+13]]:16 = #1
+int testSwitch(int x) { // CHECK-NEXT: File 0, [[@LINE]]:23 -> [[@LINE+20]]:2 = [[C30:#0]]
   int result;
   switch (x) {
-  case 1:
+                        // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:14 -> [[@LINE+13]]:15 = 0
+  case 1:               // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+3]]:10 = [[C31:#2]]
+
     result = 1;
     break;
-  case 2:
+                        // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:11 -> [[@LINE+1]]:3 = 0
+  case 2:               // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+3]]:10 = [[C32:#3]]
+
     result = 2;
     break;
-  default:
+                        // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:11 -> [[@LINE+1]]:3 = 0
+  default:              // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+2]]:15 = [[C3D:#4]]
+
     result = 0;
   }
-
-  return result;
+                        // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:4 -> [[@LINE+1]]:3 = [[C3E:#1]]
+  return result;        // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE]]:16 = [[C3E]]
 }
 
 // CHECK-NEXT: testWhile
-int testWhile() { // CHECK-NEXT: File 0, [[@LINE]]:17 -> [[@LINE+13]]:2 = #0
-                  // CHECK-NEXT: File 0, [[@LINE+6]]:10 -> [[@LINE+6]]:16 = #1
-                  // CHECK-NEXT: Gap,File 0, [[@LINE+5]]:17 -> [[@LINE+5]]:18 = #2
-                  // CHECK-NEXT: File 0, [[@LINE+4]]:18 -> [[@LINE+7]]:4 = #2
-                  // CHECK-NEXT: File 0, [[@LINE+8]]:3 -> [[@LINE+8]]:13 = #3
+int testWhile() {       // CHECK-NEXT: File 0, [[@LINE]]:17 -> [[@LINE+12]]:2 = [[C40:#0]]
   int i = 0;
   int sum = 0;
-  while (i < 10) {
+  while (i < 10) {      // CHECK-NEXT: File 0, [[@LINE]]:10 -> [[@LINE]]:16 = [[C4C:#1]]
+
+                        // CHECK-NEXT: Gap,File 0, [[@LINE-2]]:17 -> [[@LINE-2]]:18 = [[C4T:#2]]
+                        // CHECK-NEXT: File 0, [[@LINE-3]]:18 -> [[@LINE+3]]:4 = [[C4T]]
     sum += i;
     i++;
   }
 
-  return sum;
+  return sum;           // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE]]:13 = [[C4E:#3]]
 }
 
-// CHECK-NEXT: testContinue
-int testContinue() { // CHECK-NEXT: File 0, [[@LINE]]:20 -> [[@LINE+21]]:2 = #0
-                     // CHECK-NEXT: File 0, [[@LINE+12]]:10 -> [[@LINE+12]]:16 = #1
-                     // CHECK-NEXT: Gap,File 0, [[@LINE+11]]:17 -> [[@LINE+11]]:18 = #2
-                     // CHECK-NEXT: File 0, [[@LINE+10]]:18 -> [[@LINE+15]]:4 = #2
-                     // CHECK-NEXT: File 0, [[@LINE+10]]:9 -> [[@LINE+10]]:15 = #2
-                     // CHECK-NEXT: Gap,File 0, [[@LINE+9]]:16 -> [[@LINE+10]]:7 = #4
-                     // CHECK-NEXT: File 0, [[@LINE+9]]:7 -> [[@LINE+9]]:15 = #4
-                     // CHECK-NEXT: Gap,File 0, [[@LINE+8]]:16 -> [[@LINE+9]]:5 = #5
-                     // CHECK-NEXT: File 0, [[@LINE+8]]:5 -> [[@LINE+10]]:4 = #5
-                     // CHECK-NEXT: Gap,File 0, [[@LINE+9]]:4 -> [[@LINE+11]]:3 = #3
-                     // CHECK-NEXT: File 0, [[@LINE+10]]:3 -> [[@LINE+10]]:13 = #3
+// CHECK-NEXT: testContinueBreak
+int testContinueBreak() { // CHECK-NEXT: File 0, [[@LINE]]:25 -> [[@LINE+23]]:2 = #0
   int i = 0;
   int sum = 0;
-  while (i < 10) {
-    if (i == 4)
-      continue;
-    sum += i;
+  while (i < 10) {   // CHECK-NEXT: File 0, [[@LINE]]:10 -> [[@LINE]]:16 = #1
+
+                     // CHECK-NEXT: Gap,File 0, [[@LINE-2]]:17 -> [[@LINE-2]]:18 = [[C5B:#2]]
+                     // CHECK-NEXT: File 0, [[@LINE-3]]:18 -> [[@LINE+14]]:4 = [[C5B]]
+    if (i == 4)      // CHECK-NEXT: File 0, [[@LINE]]:9 -> [[@LINE]]:15 = [[C5B]]
+
+                     // CHECK-NEXT: Gap,File 0, [[@LINE-2]]:16 -> [[@LINE+1]]:7 = [[C5T:#4]]
+      continue;      // CHECK-NEXT: File 0, [[@LINE]]:7 -> [[@LINE]]:15 = [[C5T]]
+                     // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:16 -> [[@LINE+2]]:5 = [[C5F:#5]]
+                     // CHECK-NEXT: File 0, [[@LINE+1]]:5 -> [[@LINE+8]]:4 = [[C5F]]
+    if (i == 5)      // CHECK-NEXT: File 0, [[@LINE]]:9 -> [[@LINE]]:15 = [[C5F]]
+
+                     // CHECK-NEXT: Gap,File 0, [[@LINE-2]]:16 -> [[@LINE+1]]:7 = [[C5T1:#6]]
+      break;         // CHECK-NEXT: File 0, [[@LINE]]:7 -> [[@LINE]]:12 = [[C5T1]]
+                     // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:13 -> [[@LINE+1]]:5 = [[C5F1:#7]]
+    sum += i;        // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE+2]]:4 = [[C5F1]]
     i++;
   }
-
-  return sum;
+                     // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:4 -> [[@LINE+1]]:3 = [[C5E:#3]]
+  return sum;        // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE]]:13 = [[C5E]]
 }
 
 // CHECK-NEXT: testFor
-int testFor() { // CHECK-NEXT: File 0, [[@LINE]]:15 -> [[@LINE+13]]:2 = #0
-                // CHECK-NEXT: File 0, [[@LINE+7]]:19 -> [[@LINE+7]]:25 = #1
-                // CHECK-NEXT: File 0, [[@LINE+6]]:27 -> [[@LINE+6]]:30 = #2
-                // CHECK-NEXT: Gap,File 0, [[@LINE+5]]:31 -> [[@LINE+5]]:32 = #3
-                // CHECK-NEXT: File 0, [[@LINE+4]]:32 -> [[@LINE+6]]:4 = #3
-                // CHECK-NEXT: File 0, [[@LINE+7]]:3 -> [[@LINE+7]]:13 = #4
+int testFor() { // CHECK-NEXT: File 0, [[@LINE]]:15 -> [[@LINE+13]]:2 = [[C60:#0]]
   int i;
   int sum = 0;
+                // CHECK-NEXT: File 0, [[@LINE+3]]:19 -> [[@LINE+3]]:25 = [[C61:#1]]
+
+                // CHECK-NEXT: File 0, [[@LINE+1]]:27 -> [[@LINE+1]]:30 = [[C6C:#2]]
   for (int i = 0; i < 10; i++) {
+                // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:31 -> [[@LINE-1]]:32 = [[C6B:#3]]
+                // CHECK-NEXT: File 0, [[@LINE-2]]:32 -> [[@LINE+2]]:4 = [[C6B]]
     sum += i;
   }
 
-  return sum;
+  return sum;   // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE]]:13 = [[C6E:#4]]
 }
 
 // CHECK-NEXT: testForRange
-int testForRange() { // CHECK-NEXT: File 0, [[@LINE]]:20 -> [[@LINE+12]]:2 = #0
-                     // CHECK-NEXT: Gap,File 0, [[@LINE+6]]:28 -> [[@LINE+6]]:29 = #1
-                     // CHECK-NEXT: File 0, [[@LINE+5]]:29 -> [[@LINE+7]]:4 = #1
-                     // CHECK-NEXT: File 0, [[@LINE+8]]:3 -> [[@LINE+8]]:13 = #2
+int testForRange() {    // CHECK-NEXT: File 0, [[@LINE]]:20 -> [[@LINE+11]]:2 = [[C70:#0]]
   int sum = 0;
   int array[] = {1, 2, 3, 4, 5};
 
   for (int element : array) {
+                        // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:28 -> [[@LINE-1]]:29 = [[C7B:#1]]
+                        // CHECK-NEXT: File 0, [[@LINE-2]]:29 -> [[@LINE+2]]:4 = [[C7B]]
       sum += element;
   }
 
-  return sum;
+  return sum;           // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE]]:13 = [[C7E:#2]]
 }
 
 // CHECK-NEXT: testDo
-int testDo() { // CHECK-NEXT: File 0, [[@LINE]]:14 -> [[@LINE+12]]:2 = #0
-               // CHECK-NEXT: File 0, [[@LINE+5]]:6 -> [[@LINE+8]]:4 = #1
-               // CHECK-NEXT: File 0, [[@LINE+7]]:12 -> [[@LINE+7]]:17 = #2
-               // CHECK-NEXT: File 0, [[@LINE+8]]:3 -> [[@LINE+8]]:13 = #3
+int testDo() {          // CHECK-NEXT: File 0, [[@LINE]]:14 -> [[@LINE+9]]:2 = [[C80:#0]]
   int i = 0;
   int sum = 0;
-  do {
+  do {                  // CHECK-NEXT: File 0, [[@LINE]]:6 -> [[@LINE+3]]:4 = [[C8B:#1]]
     sum += i;
     i++;
-  } while (i < 5);
+  } while (i < 5);      // CHECK-NEXT: File 0, [[@LINE]]:12 -> [[@LINE]]:17 = [[C8C:#2]]
 
-  return sum;
+  return sum;           // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE]]:13 = [[C8E:#3]]
 }
 
 // CHECK-NEXT: testConditional
-int testConditional(int x) { // CHECK-NEXT: File 0, [[@LINE]]:28 -> [[@LINE+8]]:2 = #0
-                             // CHECK-NEXT: File 0, [[@LINE+5]]:15 -> [[@LINE+5]]:22 = #0
-                             // CHECK-NEXT: Gap,File 0, [[@LINE+4]]:24 -> [[@LINE+4]]:25 = #2
-                             // CHECK-NEXT: File 0, [[@LINE+3]]:25 -> [[@LINE+3]]:26 = #2
-                             // CHECK-NEXT: File 0, [[@LINE+2]]:29 -> [[@LINE+2]]:31 = #3
-                             // CHECK-NEXT: File 0, [[@LINE+2]]:2 -> [[@LINE+2]]:15 = #1
- int result = (x > 0) ? 1 : -1;
- return result;
+int testConditional(int x) {    // CHECK-NEXT: File 0, [[@LINE]]:28 -> [[@LINE+7]]:2 = [[C90:#0]]
+ int result = (x > 0) ? 1 : -1; // CHECK-NEXT: File 0, [[@LINE]]:15 -> [[@LINE]]:22 = [[C90]]
+
+                                // CHECK-NEXT: Gap,File 0, [[@LINE-2]]:24 -> [[@LINE-2]]:25 = [[C9T:#2]]
+                                // CHECK-NEXT: File 0, [[@LINE-3]]:25 -> [[@LINE-3]]:26 = [[C9T]]
+                                // CHECK-NEXT: File 0, [[@LINE-4]]:29 -> [[@LINE-4]]:31 = [[C9F:#3]]
+ return result;                 // CHECK-NEXT: File 0, [[@LINE]]:2 -> [[@LINE]]:15 = [[C9E:#1]]
 }
diff --git a/clang/test/Driver/Inputs/libomptarget/libomptarget-nvptx-sm_52.bc b/clang/test/Driver/Inputs/libomptarget/libomptarget-nvptx.bc
similarity index 100%
rename from clang/test/Driver/Inputs/libomptarget/libomptarget-nvptx-sm_52.bc
rename to clang/test/Driver/Inputs/libomptarget/libomptarget-nvptx.bc
diff --git a/clang/test/Driver/Inputs/libomptarget/subdir/libomptarget-nvptx-sm_52.bc b/clang/test/Driver/Inputs/libomptarget/subdir/libomptarget-nvptx.bc
similarity index 100%
rename from clang/test/Driver/Inputs/libomptarget/subdir/libomptarget-nvptx-sm_52.bc
rename to clang/test/Driver/Inputs/libomptarget/subdir/libomptarget-nvptx.bc
diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c
index 477e8489e7428..c975727839c0b 100644
--- a/clang/test/Driver/cl-options.c
+++ b/clang/test/Driver/cl-options.c
@@ -680,6 +680,7 @@
 // RUN:     -fcoverage-mapping \
 // RUN:     -fno-coverage-mapping \
 // RUN:     -fdiagnostics-color \
+// RUN:     -fdiagnostics-color=auto \
 // RUN:     -fno-diagnostics-color \
 // RUN:     -fdebug-compilation-dir . \
 // RUN:     -fdebug-compilation-dir=. \
diff --git a/clang/test/Driver/dxc_options.hlsl b/clang/test/Driver/dxc_options.hlsl
new file mode 100644
index 0000000000000..09fdba1c3dd5f
--- /dev/null
+++ b/clang/test/Driver/dxc_options.hlsl
@@ -0,0 +1,8 @@
+// RUN: %clang_dxc \
+// RUN: -fcolor-diagnostics \
+// RUN: -fno-color-diagnostics \
+// RUN: -fdiagnostics-color \
+// RUN: -fno-diagnostics-color \
+// RUN: -fdiagnostics-color=auto \
+// RUN: -Tlib_6_7 -Vd -fdriver-only -- %s 2>&1 |count 0
+
diff --git a/clang/test/Driver/hexagon-toolchain-elf.c b/clang/test/Driver/hexagon-toolchain-elf.c
index 716d82bcf316b..be812dda40d57 100644
--- a/clang/test/Driver/hexagon-toolchain-elf.c
+++ b/clang/test/Driver/hexagon-toolchain-elf.c
@@ -152,6 +152,20 @@
 // CHECK230: "-cc1" {{.*}} "-target-cpu" "hexagonv73"
 // CHECK230: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v73/crt0
 
+// RUN: not %clang -### --target=hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv75 -fuse-ld=hexagon-link \
+// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK240 %s
+// CHECK240: "-cc1" {{.*}} "-target-cpu" "hexagonv75"
+// CHECK240: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v75/crt0
+
+// RUN: not %clang -### --target=hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -mcpu=hexagonv79 -fuse-ld=hexagon-link \
+// RUN:   %s 2>&1 | FileCheck -check-prefix=CHECK250 %s
+// CHECK250: "-cc1" {{.*}} "-target-cpu" "hexagonv79"
+// CHECK250: hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v79/crt0
+
 // -----------------------------------------------------------------------------
 // Test Linker related args
 // -----------------------------------------------------------------------------
diff --git a/clang/test/Driver/hip-device-libs.hip b/clang/test/Driver/hip-device-libs.hip
index 6f1d31508e330..317fd79242697 100644
--- a/clang/test/Driver/hip-device-libs.hip
+++ b/clang/test/Driver/hip-device-libs.hip
@@ -253,5 +253,5 @@
 // NOABI4-NOT: error:
 // NOABI4-NOT: "-mlink-builtin-bitcode" "{{.*}}oclc_abi_version_400.bc"
 // NOABI4-NOT: "-mlink-builtin-bitcode" "{{.*}}oclc_abi_version_500.bc"
-// NOABI5: error: cannot find ROCm device libraryfor ABI version 5; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
-// NOABI6: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
+// NOABI5: error: cannot find ROCm device library for ABI version 5; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
+// NOABI6: error: cannot find ROCm device library for ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
diff --git a/clang/test/Driver/openmp-offload-gpu.c b/clang/test/Driver/openmp-offload-gpu.c
index f6e2245dcdbc0..74bd2a6aeee46 100644
--- a/clang/test/Driver/openmp-offload-gpu.c
+++ b/clang/test/Driver/openmp-offload-gpu.c
@@ -90,8 +90,8 @@
 // RUN:   %s 2>&1 | FileCheck -check-prefix=CHK-ENV-BCLIB %s
 
 // CHK-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget-nvptx-test.bc
-// CHK-BCLIB-DIR: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget{{/|\\\\}}libomptarget-nvptx-sm_52.bc
-// CHK-ENV-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}subdir{{/|\\\\}}libomptarget-nvptx-sm_52.bc
+// CHK-BCLIB-DIR: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}libomptarget{{/|\\\\}}libomptarget-nvptx.bc
+// CHK-ENV-BCLIB: clang{{.*}}-triple{{.*}}nvptx64-nvidia-cuda{{.*}}-mlink-builtin-bitcode{{.*}}subdir{{/|\\\\}}libomptarget-nvptx.bc
 // CHK-BCLIB-NOT: {{error:|warning:}}
 
 /// ###########################################################################
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv9.4-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.4-a.c
index 0032c926c22d9..1cfda6c996b9e 100644
--- a/clang/test/Driver/print-enabled-extensions/aarch64-armv9.4-a.c
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.4-a.c
@@ -58,6 +58,7 @@
 // CHECK-NEXT:     FEAT_SSBS, FEAT_SSBS2                                  Enable Speculative Store Bypass Safe bit
 // CHECK-NEXT:     FEAT_SVE                                               Enable Scalable Vector Extension (SVE) instructions
 // CHECK-NEXT:     FEAT_SVE2                                              Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT:     FEAT_SVE2p1                                            Enable Scalable Vector Extension 2.1 instructions
 // CHECK-NEXT:     FEAT_TLBIOS, FEAT_TLBIRANGE                            Enable Armv8.4-A TLB Range and Maintenance instructions
 // CHECK-NEXT:     FEAT_TRBE                                              Enable Trace Buffer Extension
 // CHECK-NEXT:     FEAT_TRF                                               Enable Armv8.4-A Trace extension
diff --git a/clang/test/Driver/print-enabled-extensions/aarch64-armv9.5-a.c b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.5-a.c
index be24bd0bbddb6..76c8b34a56b75 100644
--- a/clang/test/Driver/print-enabled-extensions/aarch64-armv9.5-a.c
+++ b/clang/test/Driver/print-enabled-extensions/aarch64-armv9.5-a.c
@@ -61,6 +61,7 @@
 // CHECK-NEXT:     FEAT_SSBS, FEAT_SSBS2                                  Enable Speculative Store Bypass Safe bit
 // CHECK-NEXT:     FEAT_SVE                                               Enable Scalable Vector Extension (SVE) instructions
 // CHECK-NEXT:     FEAT_SVE2                                              Enable Scalable Vector Extension 2 (SVE2) instructions
+// CHECK-NEXT:     FEAT_SVE2p1                                            Enable Scalable Vector Extension 2.1 instructions
 // CHECK-NEXT:     FEAT_TLBIOS, FEAT_TLBIRANGE                            Enable Armv8.4-A TLB Range and Maintenance instructions
 // CHECK-NEXT:     FEAT_TRBE                                              Enable Trace Buffer Extension
 // CHECK-NEXT:     FEAT_TRF                                               Enable Armv8.4-A Trace extension
diff --git a/clang/test/Driver/print-supported-extensions-riscv.c b/clang/test/Driver/print-supported-extensions-riscv.c
index 8344c1aa39973..8e46690cce5a6 100644
--- a/clang/test/Driver/print-supported-extensions-riscv.c
+++ b/clang/test/Driver/print-supported-extensions-riscv.c
@@ -189,6 +189,7 @@
 // CHECK-NEXT:     ssctr                1.0       'Ssctr' (Control Transfer Records Supervisor Level)
 // CHECK-NEXT:     svukte               0.3       'Svukte' (Address-Independent Latency of User-Mode Faults to Supervisor Addresses)
 // CHECK-NEXT:     xqcia                0.2       'Xqcia' (Qualcomm uC Arithmetic Extension)
+// CHECK-NEXT:     xqciac               0.2       'Xqciac' (Qualcomm uC Load-Store Address Calculation Extension)
 // CHECK-NEXT:     xqcics               0.2       'Xqcics' (Qualcomm uC Conditional Select Extension)
 // CHECK-NEXT:     xqcicsr              0.2       'Xqcicsr' (Qualcomm uC CSR Extension)
 // CHECK-NEXT:     xqcilsm              0.2       'Xqcilsm' (Qualcomm uC Load Store Multiple Extension)
diff --git a/clang/test/Driver/sanitizer-ld.c b/clang/test/Driver/sanitizer-ld.c
index 8347f9c45935d..71078342b3617 100644
--- a/clang/test/Driver/sanitizer-ld.c
+++ b/clang/test/Driver/sanitizer-ld.c
@@ -1,14 +1,24 @@
 // Test sanitizers ld flags.
 
+// Match all sanitizer related libclang_rt, we are not interested in
+// libclang_rt.builtins, libclang_rt.osx, libclang_rt.ios, libclang_rt.watchos
+// etc.
+//
+// If we need to add sanitizer with name starting with excluded laters, e.g.
+// `bsan`, we can extend expression like this: `([^iow]|b[^u])`.
+//
+// DEFINE: %{filecheck} = FileCheck %s --implicit-check-not="libclang_rt.{{([^biow])}}"
+
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld -fsanitize=address \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX
 //
 // CHECK-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-NOT: "-lc"
-// CHECK-ASAN-LINUX: libclang_rt.asan.a"
+// CHECK-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive"
+// CHECK-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive"
 // CHECK-ASAN-LINUX-NOT: "--export-dynamic"
 // CHECK-ASAN-LINUX: "--dynamic-list={{.*}}libclang_rt.asan.a.syms"
 // CHECK-ASAN-LINUX-NOT: "--export-dynamic"
@@ -21,62 +31,60 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-NO-LINK-RUNTIME-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-NO-LINK-RUNTIME-LINUX
 //
-// CHECK-ASAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.asan_static-x86_64
-// CHECK-ASAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.asan-x86_64
+// CHECK-ASAN-NO-LINK-RUNTIME-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 
 // RUN: %clang -fsanitize=address -fno-sanitize-link-runtime -### %s 2>&1 \
 // RUN:     --target=arm64e-apple-macosx -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-NO-LINK-RUNTIME-DARWIN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-NO-LINK-RUNTIME-DARWIN
 //
-// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN-NOT: libclang_rt.asan_static
-// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN-NOT: libclang_rt.asan
+// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN: "{{.*}}ld{{(.exe)?}}"
 
 // RUN: %clang -fsanitize=address -### %s 2>&1 \
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-EXECUTABLE-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-EXECUTABLE-LINUX
 //
-// CHECK-ASAN-EXECUTABLE-LINUX: libclang_rt.asan_static
-// CHECK-ASAN-EXECUTABLE-LINUX: libclang_rt.asan
+// CHECK-ASAN-EXECUTABLE-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive"
+// CHECK-ASAN-EXECUTABLE-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive"
+// CHECK-ASAN-EXECUTABLE-LINUX: "--dynamic-list={{.*}}libclang_rt.asan.a.syms"
 
 // RUN: %clang -fsanitize=address -shared -### %s 2>&1  \
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-SHARED-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-SHARED-LINUX
 //
 // CHECK-ASAN-SHARED-LINUX: libclang_rt.asan_static
-// CHECK-ASAN-SHARED-LINUX-NOT: libclang_rt.asan
 
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld -fsanitize=address -shared-libsan \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-SHARED-ASAN-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHARED-ASAN-LINUX
 
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld -fsanitize=address -shared-libasan \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-SHARED-ASAN-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHARED-ASAN-LINUX
 
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld -fsanitize=address \
 // RUN:     -shared-libsan -static-libsan -shared-libasan             \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-SHARED-ASAN-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHARED-ASAN-LINUX
 //
 // CHECK-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-SHARED-ASAN-LINUX-NOT: "-lc"
-// CHECK-SHARED-ASAN-LINUX-NOT: libclang_rt.asan.a"
 // CHECK-SHARED-ASAN-LINUX: libclang_rt.asan.so"
 // CHECK-SHARED-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan-preinit.a" "--no-whole-archive"
+// CHECK-SHARED-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive"
 // CHECK-SHARED-ASAN-LINUX-NOT: "-lpthread"
 // CHECK-SHARED-ASAN-LINUX-NOT: "-lrt"
 // CHECK-SHARED-ASAN-LINUX-NOT: "-ldl"
@@ -88,13 +96,12 @@
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld -fsanitize=address -shared-libsan \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-DSO-SHARED-ASAN-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-DSO-SHARED-ASAN-LINUX
 //
 // CHECK-DSO-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-DSO-SHARED-ASAN-LINUX-NOT: "-lc"
-// CHECK-DSO-SHARED-ASAN-LINUX-NOT: libclang_rt.asan.a"
-// CHECK-DSO-SHARED-ASAN-LINUX-NOT: "libclang_rt.asan-preinit.a"
 // CHECK-DSO-SHARED-ASAN-LINUX: libclang_rt.asan.so"
+// CHECK-DSO-SHARED-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive"
 // CHECK-DSO-SHARED-ASAN-LINUX-NOT: "-lpthread"
 // CHECK-DSO-SHARED-ASAN-LINUX-NOT: "-lrt"
 // CHECK-DSO-SHARED-ASAN-LINUX-NOT: "-ldl"
@@ -106,13 +113,12 @@
 // RUN:     --target=i386-unknown-freebsd -fuse-ld=ld -fsanitize=address \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_freebsd_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-FREEBSD %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-FREEBSD
 //
 // CHECK-ASAN-FREEBSD: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-FREEBSD-NOT: "-lc"
-// CHECK-ASAN-FREEBSD-NOT: libclang_rt.asan_cxx
+// CHECK-ASAN-FREEBSD: freebsd{{/|\\+}}libclang_rt.asan_static.a"
 // CHECK-ASAN-FREEBSD: freebsd{{/|\\+}}libclang_rt.asan.a"
-// CHECK-ASAN-FREEBSD-NOT: libclang_rt.asan_cxx
 // CHECK-ASAN-FREEBSD-NOT: "--dynamic-list"
 // CHECK-ASAN-FREEBSD: "--export-dynamic"
 // CHECK-ASAN-FREEBSD: "-lpthread"
@@ -122,23 +128,25 @@
 // RUN:     --target=i386-unknown-freebsd -fuse-ld=ld -fsanitize=address \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_freebsd_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-FREEBSD-LDL %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-FREEBSD-LDL
 //
 // CHECK-ASAN-FREEBSD-LDL: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-FREEBSD-LDL-NOT: "-ldl"
+// CHECK-ASAN-FREEBSD-LDL: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive"
+// CHECK-ASAN-FREEBSD-LDL: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive"
 
 // RUN: %clangxx -### %s 2>&1 \
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld -stdlib=platform -fsanitize=address \
 // RUN:     -resource-dir=%S/Inputs/empty_resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-LINUX-CXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-CXX
 
 // RUN: %clangxx -### %s 2>&1 \
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld -stdlib=platform -fsanitize=address \
 // RUN:     -resource-dir=%S/Inputs/empty_resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:     -fsanitize-link-c++-runtime \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-LINUX-CXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-CXX
 
 // CHECK-ASAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive"
@@ -157,11 +165,10 @@
 // RUN:     -resource-dir=%S/Inputs/empty_resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:     -fno-sanitize-link-c++-runtime \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-LINUX-CNOCXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-CNOCXX
 
 // CHECK-ASAN-LINUX-CNOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-CNOCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive"
-// CHECK-ASAN-LINUX-CNOCXX-NOT: libclang_rt.asan_cxx
 // CHECK-ASAN-LINUX-CNOCXX-SAME: "--export-dynamic"
 // CHECK-ASAN-LINUX-CNOCXX-NOT: stdc++
 // CHECK-ASAN-LINUX-CNOCXX-SAME: "-lpthread"
@@ -175,11 +182,10 @@
 // RUN:     -resource-dir=%S/Inputs/empty_resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:     -fno-sanitize-link-c++-runtime \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-LINUX-NOCXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-NOCXX
 
 // CHECK-ASAN-LINUX-NOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-NOCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive"
-// CHECK-ASAN-LINUX-NOCXX-NOT: libclang_rt.asan_cxx
 // CHECK-ASAN-LINUX-NOCXX-SAME: "--export-dynamic"
 // CHECK-ASAN-LINUX-NOCXX-SAME: "-lstdc++"
 // CHECK-ASAN-LINUX-NOCXX-SAME: "-lpthread"
@@ -193,11 +199,11 @@
 // RUN:     -resource-dir=%S/Inputs/empty_resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:     -nostdlib++ \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-LINUX-NOSTDCXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-NOSTDCXX
 
 // CHECK-ASAN-LINUX-NOSTDCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-NOSTDCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive"
-// CHECK-ASAN-LINUX-NOSTDCXX-SAME: libclang_rt.asan_cxx
+// CHECK-ASAN-LINUX-NOSTDCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan_cxx.a" "--no-whole-archive"
 // CHECK-ASAN-LINUX-NOSTDCXX-SAME: "--export-dynamic"
 // CHECK-ASAN-LINUX-NOSTDCXX-SAME: "-lpthread"
 // CHECK-ASAN-LINUX-NOSTDCXX-SAME: "-lrt"
@@ -209,36 +215,39 @@
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld -stdlib=platform \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree -lstdc++ -static 2>&1 \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-LINUX-CXX-STATIC %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-CXX-STATIC
 //
 // CHECK-ASAN-LINUX-CXX-STATIC: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-CXX-STATIC-NOT: stdc++
 // CHECK-ASAN-LINUX-CXX-STATIC: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive"
+// CHECK-ASAN-LINUX-CXX-STATIC: "--dynamic-list={{.*}}libclang_rt.asan.a.syms"
 // CHECK-ASAN-LINUX-CXX-STATIC: stdc++
 
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=arm-linux-gnueabi -fuse-ld=ld -fsanitize=address \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-ARM %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-ARM
 //
 // CHECK-ASAN-ARM: "{{(.*[^.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-ARM-NOT: "-lc"
+// CHECK-ASAN-ARM: libclang_rt.asan_static.a"
 // CHECK-ASAN-ARM: libclang_rt.asan.a"
 //
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=armv7l-linux-gnueabi -fuse-ld=ld -fsanitize=address \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-ARMv7 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-ARMv7
 //
 // CHECK-ASAN-ARMv7: "{{(.*[^.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-ARMv7-NOT: "-lc"
+// CHECK-ASAN-ARMv7: libclang_rt.asan_static.a"
 // CHECK-ASAN-ARMv7: libclang_rt.asan.a"
 
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=arm-linux-androideabi -fuse-ld=ld -fsanitize=address \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-ANDROID %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-ANDROID
 //
 // CHECK-ASAN-ANDROID: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
 // CHECK-ASAN-ANDROID: "-pie"
@@ -246,6 +255,7 @@
 // CHECK-ASAN-ANDROID-NOT: "-lpthread"
 // CHECK-ASAN-ANDROID-NOT: "-lresolv"
 // CHECK-ASAN-ANDROID: libclang_rt.asan.so"
+// CHECK-ASAN-ANDROID: libclang_rt.asan_static.a"
 // CHECK-ASAN-ANDROID-NOT: "-lpthread"
 // CHECK-ASAN-ANDROID-NOT: "-lresolv"
 
@@ -254,16 +264,17 @@
 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     -static-libsan \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-ANDROID-STATICLIBASAN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-ANDROID-STATICLIBASAN
 //
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=arm-linux-androideabi -fuse-ld=ld -fsanitize=address \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     -static-libasan \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-ANDROID-STATICLIBASAN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-ANDROID-STATICLIBASAN
 //
 // CHECK-ASAN-ANDROID-STATICLIBASAN: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
+// CHECK-ASAN-ANDROID-STATICLIBASAN: libclang_rt.asan_static.a"
 // CHECK-ASAN-ANDROID-STATICLIBASAN: libclang_rt.asan.a"
 // CHECK-ASAN-ANDROID-STATICLIBASAN-NOT: "-lpthread"
 // CHECK-ASAN-ANDROID-STATICLIBASAN-NOT: "-lrt"
@@ -273,7 +284,7 @@
 // RUN:     --target=arm-linux-androideabi -fuse-ld=ld -fsanitize=undefined \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-ANDROID %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-ANDROID
 //
 // CHECK-UBSAN-ANDROID: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
 // CHECK-UBSAN-ANDROID: "-pie"
@@ -289,7 +300,7 @@
 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     -static-libsan \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-ANDROID-STATICLIBASAN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-ANDROID-STATICLIBASAN
 //
 // CHECK-UBSAN-ANDROID-STATICLIBASAN: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
 // CHECK-UBSAN-ANDROID-STATICLIBASAN: libclang_rt.ubsan_standalone.a"
@@ -302,7 +313,7 @@
 // RUN:     --target=i686-linux-android -fuse-ld=ld -fsanitize=address \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-ANDROID-X86 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-ANDROID-X86
 //
 // CHECK-ASAN-ANDROID-X86: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
 // CHECK-ASAN-ANDROID-X86: "-pie"
@@ -310,6 +321,7 @@
 // CHECK-ASAN-ANDROID-X86-NOT: "-lpthread"
 // CHECK-ASAN-ANDROID-X86-NOT: "-lresolv"
 // CHECK-ASAN-ANDROID-X86: libclang_rt.asan.so"
+// CHECK-ASAN-ANDROID-X86: libclang_rt.asan_static.a"
 // CHECK-ASAN-ANDROID-X86-NOT: "-lpthread"
 // CHECK-ASAN-ANDROID-X86-NOT: "-lresolv"
 //
@@ -317,20 +329,23 @@
 // RUN:     --target=arm-linux-androideabi -fsanitize=address \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
 // RUN:     -shared-libsan \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-ANDROID-SHARED-LIBASAN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-ANDROID-SHARED-LIBASAN
 //
 // CHECK-ASAN-ANDROID-SHARED-LIBASAN-NOT: argument unused during compilation: '-shared-libsan'
+// CHECK-ASAN-ANDROID-SHARED-LIBASAN: libclang_rt.asan{{.*}}.so"
+// CHECK-ASAN-ANDROID-SHARED-LIBASAN: libclang_rt.asan_static{{.*}}.a"
 //
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=arm-linux-androideabi -fuse-ld=ld -fsanitize=address \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     -shared \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-ANDROID-SHARED %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-ANDROID-SHARED
 //
 // CHECK-ASAN-ANDROID-SHARED: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
 // CHECK-ASAN-ANDROID-SHARED-NOT: "-lc"
 // CHECK-ASAN-ANDROID-SHARED: libclang_rt.asan.so"
+// CHECK-ASAN-ANDROID-SHARED: libclang_rt.asan_static.a"
 // CHECK-ASAN-ANDROID-SHARED-NOT: "-lpthread"
 // CHECK-ASAN-ANDROID-SHARED-NOT: "-lresolv"
 
@@ -340,7 +355,7 @@
 // RUN:     -fsanitize=type \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-TYSAN-LINUX-CXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-TYSAN-LINUX-CXX
 //
 // CHECK-TYSAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-TYSAN-LINUX-CXX-NOT: stdc++
@@ -352,7 +367,7 @@
 // RUN:     --target=x86_64-apple-darwin13.4.0 -fuse-ld=ld -stdlib=platform \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-TYSAN-DARWIN-CXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-TYSAN-DARWIN-CXX
 // CHECK-TYSAN-DARWIN-CXX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-TYSAN-DARWIN-CXX: libclang_rt.tysan_osx_dynamic.dylib
 // CHECK-TYSAN-DARWIN-CXX-NOT: -lc++abi
@@ -362,7 +377,7 @@
 // RUN:     -fsanitize=thread \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-TSAN-LINUX-CXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-TSAN-LINUX-CXX
 //
 // CHECK-TSAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-TSAN-LINUX-CXX-NOT: stdc++
@@ -381,24 +396,24 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-TSAN-NO-LINK-RUNTIME-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-TSAN-NO-LINK-RUNTIME-LINUX
 //
-// CHECK-TSAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.tsan
+// CHECK-TSAN-NO-LINK-RUNTIME-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 
 // RUN: not %clang -fsanitize=thread -fno-sanitize-link-runtime -### %s 2>&1 \
 // RUN:     --target=arm64e-apple-ios -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-TSAN-NO-LINK-RUNTIME-DARWIN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-TSAN-NO-LINK-RUNTIME-DARWIN
 //
-// CHECK-TSAN-NO-LINK-RUNTIME-DARWIN-NOT: libclang_rt.tsan
+// CHECK-TSAN-NO-LINK-RUNTIME-DARWIN: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 
 // RUN: %clangxx -### %s 2>&1 \
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld -stdlib=platform -lstdc++ \
 // RUN:     -fsanitize=memory \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-MSAN-LINUX-CXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-MSAN-LINUX-CXX
 //
 // CHECK-MSAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-MSAN-LINUX-CXX-NOT: stdc++
@@ -417,35 +432,31 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-MSAN-NO-LINK-RUNTIME-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-MSAN-NO-LINK-RUNTIME-LINUX
 //
-// CHECK-MSAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.msan
+// CHECK-MSAN-NO-LINK-RUNTIME-LINUX: "{{.*}}ld{{(.exe)?}}"
 
 // RUN: %clang -fsanitize=undefined -### %s 2>&1 \
 // RUN:     --target=x86_64-unknown-linux-gnux32 -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-LINUX
 
 // RUN: %clang -fsanitize=float-divide-by-zero -### %s 2>&1 \
 // RUN:     --target=x86_64-unknown-linux-gnux32 -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-LINUX
 
 // RUN: %clang -fsanitize=undefined -### %s 2>&1 \
 // RUN:     --target=x86_64-unknown-linux-gnux32 -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
 // RUN:     -static-libsan \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-LINUX
 
 // CHECK-UBSAN-LINUX: "{{.*}}ld{{(.exe)?}}"
-// CHECK-UBSAN-LINUX-NOT: libclang_rt.asan
-// CHECK-UBSAN-LINUX-NOT: libclang_rt.ubsan_standalone_cxx
 // CHECK-UBSAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone.a" "--no-whole-archive"
-// CHECK-UBSAN-LINUX-NOT: libclang_rt.asan
-// CHECK-UBSAN-LINUX-NOT: libclang_rt.ubsan_standalone_cxx
 // CHECK-UBSAN-LINUX-NOT: "-lstdc++"
 // CHECK-UBSAN-LINUX: "-lpthread"
 // CHECK-UBSAN-LINUX: "-lresolv"
@@ -454,46 +465,46 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-NO-LINK-RUNTIME-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-NO-LINK-RUNTIME-LINUX
 //
-// CHECK-UBSAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.undefined
+// CHECK-UBSAN-NO-LINK-RUNTIME-LINUX: "{{.*}}ld{{(.exe)?}}"
 
 // RUN: %clang -fsanitize=undefined -fno-sanitize-link-runtime -### %s 2>&1 \
 // RUN:     --target=x86_64-apple-darwin -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-NO-LINK-RUNTIME-DARWIN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-NO-LINK-RUNTIME-DARWIN
 //
-// CHECK-UBSAN-NO-LINK-RUNTIME-DARWIN-NOT: libclang_rt.ubsan
+// CHECK-UBSAN-NO-LINK-RUNTIME-DARWIN: "{{.*}}ld{{(.exe)?}}"
 
 // RUN: %clang -fsanitize=fuzzer -fno-sanitize-link-runtime -### %s 2>&1 \
 // RUN:     --target=arm64e-apple-watchos -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-FUZZER-NO-LINK-RUNTIME-DARWIN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-FUZZER-NO-LINK-RUNTIME-DARWIN
 //
-// CHECK-FUZZER-NO-LINK-RUNTIME-DARWIN-NOT: libclang_rt.fuzzer
+// CHECK-FUZZER-NO-LINK-RUNTIME-DARWIN: "{{.*}}ld{{(.exe)?}}"
 
 // RUN: %clang -fsanitize=undefined -### %s 2>&1 \
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:     -shared-libsan \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-LINUX-SHAREDLIBASAN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-LINUX-SHAREDLIBASAN
 
 // RUN: %clang -fsanitize=undefined -### %s 2>&1 \
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:     -static-libsan -shared-libsan \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-LINUX-SHAREDLIBASAN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-LINUX-SHAREDLIBASAN
 
 // RUN: %clang -fsanitize=undefined -### %s 2>&1 \
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:     -shared -shared-libsan \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-LINUX-SHAREDLIBASAN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-LINUX-SHAREDLIBASAN
 
 // CHECK-UBSAN-LINUX-SHAREDLIBASAN: "{{.*}}ld{{(.exe)?}}"
 // CHECK-UBSAN-LINUX-SHAREDLIBASAN: "{{.*}}libclang_rt.ubsan_standalone.so{{.*}}"
@@ -502,7 +513,7 @@
 // RUN:     --target=i386-unknown-linux \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-LINUX-LINK-CXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-LINUX-LINK-CXX
 // CHECK-UBSAN-LINUX-LINK-CXX-NOT: "-lstdc++"
 // CHECK-UBSAN-LINUX-LINK-CXX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone_cxx.a" "--no-whole-archive"
 // CHECK-UBSAN-LINUX-LINK-CXX-NOT: "-lstdc++"
@@ -511,15 +522,11 @@
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld -stdlib=platform \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-LINUX-CXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-LINUX-CXX
 // CHECK-UBSAN-LINUX-CXX: "{{.*}}ld{{(.exe)?}}"
-// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
 // CHECK-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone.a" "--no-whole-archive"
-// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
 // CHECK-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone_cxx.a" "--no-whole-archive"
-// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
 // CHECK-UBSAN-LINUX-CXX: "-lstdc++"
-// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan
 // CHECK-UBSAN-LINUX-CXX: "-lpthread"
 // CHECK-UBSAN-LINUX-CXX: "-lresolv"
 
@@ -527,7 +534,7 @@
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-MINIMAL-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-MINIMAL-LINUX
 // CHECK-UBSAN-MINIMAL-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-UBSAN-MINIMAL-LINUX: "--whole-archive" "{{.*}}libclang_rt.ubsan_minimal.a" "--no-whole-archive"
 // CHECK-UBSAN-MINIMAL-LINUX: "-lpthread"
@@ -536,36 +543,37 @@
 // RUN: %clang -fsanitize=undefined -fsanitize-minimal-runtime -### %s 2>&1 \
 // RUN:     --target=x86_64-apple-darwin -fuse-ld=ld \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-MINIMAL-DARWIN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-MINIMAL-DARWIN
 // CHECK-UBSAN-MINIMAL-DARWIN: "{{.*}}ld{{(.exe)?}}"
 // CHECK-UBSAN-MINIMAL-DARWIN: "{{.*}}libclang_rt.ubsan_minimal_osx_dynamic.dylib"
 
 // RUN: not %clang -fsanitize=undefined -### %s 2>&1 \
 // RUN:     --target=x86_64-apple-darwin -fuse-ld=ld -static-libsan \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-STATIC-DARWIN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-STATIC-DARWIN
 // CHECK-UBSAN-STATIC-DARWIN: {{.*}}error: static UndefinedBehaviorSanitizer runtime is not supported on darwin
 
 // RUN: not %clang -fsanitize=address -### %s 2>&1 \
 // RUN:     --target=x86_64-apple-darwin -fuse-ld=ld -static-libsan \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-STATIC-DARWIN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-STATIC-DARWIN
 // CHECK-ASAN-STATIC-DARWIN: {{.*}}error: static AddressSanitizer runtime is not supported on darwin
 
 // RUN: not %clang -fsanitize=thread -### %s 2>&1 \
 // RUN:     --target=x86_64-apple-darwin -fuse-ld=ld -static-libsan \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-TSAN-STATIC-DARWIN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-TSAN-STATIC-DARWIN
 // CHECK-TSAN-STATIC-DARWIN: {{.*}}error: static ThreadSanitizer runtime is not supported on darwin
 
 // RUN: %clang -fsanitize=address,undefined -### %s 2>&1 \
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-UBSAN-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-UBSAN-LINUX
 // CHECK-ASAN-UBSAN-LINUX: "{{.*}}ld{{(.exe)?}}"
+// CHECK-ASAN-UBSAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive"
 // CHECK-ASAN-UBSAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive"
-// CHECK-ASAN-UBSAN-LINUX-NOT: libclang_rt.ubsan
+// CHECK-ASAN-UBSAN-LINUX: "--dynamic-list={{.*}}libclang_rt.asan.a.syms"
 // CHECK-ASAN-UBSAN-LINUX-NOT: "-lstdc++"
 // CHECK-ASAN-UBSAN-LINUX: "-lpthread"
 // CHECK-ASAN-UBSAN-LINUX: "-lresolv"
@@ -574,53 +582,73 @@
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld -stdlib=platform \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-UBSAN-LINUX-CXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-UBSAN-LINUX-CXX
 // CHECK-ASAN-UBSAN-LINUX-CXX: "{{.*}}ld{{(.exe)?}}"
+// CHECK-ASAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive"
 // CHECK-ASAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive"
+// CHECK-ASAN-UBSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.asan.a.syms"
 // CHECK-ASAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.asan_cxx.a" "--no-whole-archive"
-// CHECK-ASAN-UBSAN-LINUX-CXX-NOT: libclang_rt.ubsan
+// CHECK-ASAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone_cxx.a" "--no-whole-archive"
 // CHECK-ASAN-UBSAN-LINUX-CXX: "-lstdc++"
 // CHECK-ASAN-UBSAN-LINUX-CXX: "-lpthread"
 // CHECK-ASAN-UBSAN-LINUX-CXX: "-lresolv"
 
+// RUN: %clangxx -fsanitize=address,undefined -fno-sanitize=vptr -### %s 2>&1 \
+// RUN:     --target=i386-unknown-linux -fuse-ld=ld -stdlib=platform \
+// RUN:     -resource-dir=%S/Inputs/resource_dir \
+// RUN:     --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX
+// CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX: "{{.*}}ld{{(.exe)?}}"
+// CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive"
+// CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive"
+// CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "--dynamic-list={{.*}}libclang_rt.asan.a.syms"
+// CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan_cxx.a" "--no-whole-archive"
+// CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "-lstdc++"
+// CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "-lpthread"
+// CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "-lresolv"
+
 // RUN: %clangxx -fsanitize=memory,undefined -### %s 2>&1 \
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-MSAN-UBSAN-LINUX-CXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-MSAN-UBSAN-LINUX-CXX
 // CHECK-MSAN-UBSAN-LINUX-CXX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-MSAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.msan.a" "--no-whole-archive"
-// CHECK-MSAN-UBSAN-LINUX-CXX-NOT: libclang_rt.ubsan
+// CHECK-MSAN-UBSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.msan.a.syms"
+// CHECK-MSAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.msan_cxx.a" "--no-whole-archive"
+// CHECK-MSAN-UBSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.msan_cxx.a.syms"
+// CHECK-MSAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone_cxx.a" "--no-whole-archive"
 
 // RUN: %clangxx -fsanitize=thread,undefined -### %s 2>&1 \
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-TSAN-UBSAN-LINUX-CXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-TSAN-UBSAN-LINUX-CXX
 // CHECK-TSAN-UBSAN-LINUX-CXX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-TSAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.tsan.a" "--no-whole-archive"
-// CHECK-TSAN-UBSAN-LINUX-CXX-NOT: libclang_rt.ubsan
+// CHECK-TSAN-UBSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.tsan.a.syms"
+// CHECK-TSAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.tsan_cxx.a" "--no-whole-archive"
+// CHECK-TSAN-UBSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.tsan_cxx.a.syms"
+// CHECK-TSAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone_cxx.a" "--no-whole-archive"
 
 // RUN: %clang -fsanitize=undefined -### %s 2>&1 \
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:     -shared \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-LINUX-SHARED %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-LINUX-SHARED
 // CHECK-UBSAN-LINUX-SHARED: "{{.*}}ld{{(.exe)?}}"
 // CHECK-UBSAN-LINUX-SHARED-NOT: --export-dynamic
 // CHECK-UBSAN-LINUX-SHARED-NOT: --dynamic-list
-// CHECK-UBSAN-LINUX-SHARED-NOT: libclang_rt.ubsan
 
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=leak \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-LSAN-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-LSAN-LINUX
 //
 // CHECK-LSAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-LSAN-LINUX-NOT: "-lc"
-// CHECK-LSAN-LINUX-NOT: libclang_rt.ubsan
 // CHECK-LSAN-LINUX: libclang_rt.lsan.a"
 // CHECK-LSAN-LINUX: "-lpthread"
 // CHECK-LSAN-LINUX: "-ldl"
@@ -630,21 +658,20 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-LSAN-NO-LINK-RUNTIME-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-LSAN-NO-LINK-RUNTIME-LINUX
 //
-// CHECK-LSAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.lsan
+// CHECK-LSAN-NO-LINK-RUNTIME-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 
 // RUN: %clang -### %s 2>&1 \
 // RUN:  --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=leak -fsanitize-coverage=func \
 // RUN:  -resource-dir=%S/Inputs/resource_dir \
 // RUN:  --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-LSAN-COV-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-LSAN-COV-LINUX
 //
 // CHECK-LSAN-COV-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-LSAN-COV-LINUX-NOT: "-lc"
-// CHECK-LSAN-COV-LINUX-NOT: libclang_rt.ubsan
+// CHECK-LSAN-COV-LINUX: libclang_rt.lsan.a
 // CHECK-LSAV-COV-LINUX: libclang_rt.lsan-x86_64.a"
-// CHECK-LSAN-COV-LINUX-NOT: libclang_rt.ubsan
 // CHECK-LSAN-COV-LINUX: "-lpthread"
 // CHECK-LSAN-COV-LINUX: "-ldl"
 // CHECK-LSAN-COV-LINUX: "-lresolv"
@@ -653,20 +680,21 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-LSAN-ASAN-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-LSAN-ASAN-LINUX
 // CHECK-LSAN-ASAN-LINUX: "{{.*}}ld{{(.exe)?}}"
-// CHECK-LSAN-ASAN-LINUX-NOT: libclang_rt.lsan
+// CHECK-LSAN-ASAN-LINUX: libclang_rt.asan_static
 // CHECK-LSAN-ASAN-LINUX: libclang_rt.asan
-// CHECK-LSAN-ASAN-LINUX-NOT: libclang_rt.lsan
+// CHECK-LSAN-ASAN-LINUX: "--dynamic-list={{.*}}libclang_rt.asan.a.syms"
 
 // RUN: %clang -fsanitize=address -fsanitize-coverage=func -### %s 2>&1 \
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-COV-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-COV-LINUX
 // CHECK-ASAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
-// CHECK-ASAN-COV-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive"
-// CHECK-ASAN-COV-LINUX-NOT: libclang_rt.ubsan
+// CHECK-ASAN-COV-LINUX: libclang_rt.asan_static
+// CHECK-ASAN-COV-LINUX: libclang_rt.asan
+// CHECK-ASAN-COV-LINUX: "--dynamic-list={{.*}}libclang_rt.asan.a.syms"
 // CHECK-ASAN-COV-LINUX-NOT: "-lstdc++"
 // CHECK-ASAN-COV-LINUX: "-lpthread"
 // CHECK-ASAN-COV-LINUX: "-lresolv"
@@ -675,10 +703,10 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-MSAN-COV-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-MSAN-COV-LINUX
 // CHECK-MSAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-MSAN-COV-LINUX: "--whole-archive" "{{.*}}libclang_rt.msan.a" "--no-whole-archive"
-// CHECK-MSAN-COV-LINUX-NOT: libclang_rt.ubsan
+// CHECK-MSAN-COV-LINUX: "--dynamic-list={{.*}}libclang_rt.msan.a.syms"
 // CHECK-MSAN-COV-LINUX-NOT: "-lstdc++"
 // CHECK-MSAN-COV-LINUX: "-lpthread"
 // CHECK-MSAN-COV-LINUX: "-lresolv"
@@ -687,10 +715,9 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-DFSAN-COV-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-DFSAN-COV-LINUX
 // CHECK-DFSAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-DFSAN-COV-LINUX: "--whole-archive" "{{.*}}libclang_rt.dfsan.a" "--no-whole-archive"
-// CHECK-DFSAN-COV-LINUX-NOT: libclang_rt.ubsan
 // CHECK-DFSAN-COV-LINUX-NOT: "-lstdc++"
 // CHECK-DFSAN-COV-LINUX: "-lpthread"
 // CHECK-DFSAN-COV-LINUX: "-lresolv"
@@ -699,7 +726,7 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-COV-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-COV-LINUX
 // CHECK-UBSAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-UBSAN-COV-LINUX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone.a" "--no-whole-archive"
 // CHECK-UBSAN-COV-LINUX-NOT: "-lstdc++"
@@ -710,7 +737,7 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-COV-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-COV-LINUX
 // CHECK-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-COV-LINUX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone.a" "--no-whole-archive"
 // CHECK-COV-LINUX-NOT: "-lstdc++"
@@ -721,18 +748,17 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=numerical \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-NSAN-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-NSAN-LINUX
 //
 // CHECK-NSAN-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-NSAN-LINUX-NOT: "-lc"
-// CHECK-NSAN-LINUX-NOT: libclang_rt.ubsan
 // CHECK-NSAN-LINUX: libclang_rt.nsan.a"
 // CHECK-NSAN-LINUX: "-lpthread" "-lrt" "-lm" "-ldl" "-lresolv"
 
 // RUN: %clang -### %s 2>&1 --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=numerical -shared-libsan \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-NSAN-SHARED-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-NSAN-SHARED-LINUX
 
 // CHECK-NSAN-SHARED-LINUX: libclang_rt.nsan.so"
 // CHECK-NSAN-SHARED-LINUX-NOT: "-lpthread"
@@ -742,19 +768,17 @@
 // RUN: %clang -### %s 2>&1 --target=x86_64-unknown-linux -fsanitize=numerical,undefined \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-NSAN-UBSAN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-NSAN-UBSAN
 
 // CHECK-NSAN-UBSAN: "--whole-archive" "{{[^"]*}}libclang_rt.nsan.a" "--no-whole-archive"
-// CHECK-NSAN-UBSAN-NOT: libclang_rt.ubsan
 
 // CFI by itself does not link runtime libraries.
 // RUN: not %clang -fsanitize=cfi -### %s 2>&1 \
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld -rtlib=platform \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-CFI-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-CFI-LINUX
 // CHECK-CFI-LINUX: "{{.*}}ld{{(.exe)?}}"
-// CHECK-CFI-LINUX-NOT: libclang_rt.
 
 // CFI with diagnostics links the UBSan runtime.
 // RUN: not %clang -fsanitize=cfi -fno-sanitize-trap=cfi -fsanitize-recover=cfi \
@@ -762,7 +786,7 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-CFI-DIAG-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-CFI-DIAG-LINUX
 // CHECK-CFI-DIAG-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-CFI-DIAG-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.ubsan_standalone.a" "--no-whole-archive"
 
@@ -771,7 +795,7 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-CFI-CROSS-DSO-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-CFI-CROSS-DSO-LINUX
 // CHECK-CFI-CROSS-DSO-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-CFI-CROSS-DSO-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.cfi.a" "--no-whole-archive"
 // CHECK-CFI-CROSS-DSO-LINUX: -export-dynamic
@@ -782,7 +806,7 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-CFI-CROSS-DSO-DIAG-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-CFI-CROSS-DSO-DIAG-LINUX
 // CHECK-CFI-CROSS-DSO-DIAG-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-CFI-CROSS-DSO-DIAG-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.cfi_diag.a" "--no-whole-archive"
 // CHECK-CFI-CROSS-DSO-DIAG-LINUX: -export-dynamic
@@ -792,9 +816,8 @@
 // RUN:     --target=aarch64-linux-android -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-CFI-CROSS-DSO-ANDROID %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-CFI-CROSS-DSO-ANDROID
 // CHECK-CFI-CROSS-DSO-ANDROID: "{{.*}}ld{{(.exe)?}}"
-// CHECK-CFI-CROSS-DSO-ANDROID-NOT: libclang_rt.cfi
 
 // Cross-DSO CFI with diagnostics on Android links just the UBSAN runtime.
 // RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso -### %s 2>&1 \
@@ -802,7 +825,7 @@
 // RUN:     --target=aarch64-linux-android -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-CFI-CROSS-DSO-DIAG-ANDROID %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-CFI-CROSS-DSO-DIAG-ANDROID
 // CHECK-CFI-CROSS-DSO-DIAG-ANDROID: "{{.*}}ld{{(.exe)?}}"
 // CHECK-CFI-CROSS-DSO-DIAG-ANDROID: "{{[^"]*}}libclang_rt.ubsan_standalone.so"
 // CHECK-CFI-CROSS-DSO-DIAG-ANDROID: "--export-dynamic-symbol=__cfi_check"
@@ -812,7 +835,7 @@
 // RUN:     --target=x86_64-apple-darwin13.4.0 -fuse-ld=ld -stdlib=platform \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-DARWIN106-CXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-DARWIN106-CXX
 // CHECK-ASAN-DARWIN106-CXX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-ASAN-DARWIN106-CXX: libclang_rt.asan_osx_dynamic.dylib
 // CHECK-ASAN-DARWIN106-CXX-NOT: -lc++abi
@@ -822,7 +845,7 @@
 // RUN:     --target=x86_64-apple-darwin13.4.0 -fuse-ld=ld -stdlib=platform \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-LSAN-DARWIN106-CXX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-LSAN-DARWIN106-CXX
 // CHECK-LSAN-DARWIN106-CXX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-LSAN-DARWIN106-CXX: libclang_rt.lsan_osx_dynamic.dylib
 // CHECK-LSAN-DARWIN106-CXX-NOT: -lc++abi
@@ -831,7 +854,7 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=safe-stack \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-SAFESTACK-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SAFESTACK-LINUX
 //
 // CHECK-SAFESTACK-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-SAFESTACK-LINUX-NOT: "-lc"
@@ -844,59 +867,70 @@
 
 // RUN: %clang -fsanitize=shadow-call-stack -### %s 2>&1 \
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
-// RUN:   | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-X86-64 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-X86-64
 // CHECK-SHADOWCALLSTACK-LINUX-X86-64-NOT: error:
+// CHECK-SHADOWCALLSTACK-LINUX-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 
 // RUN: not %clang -fsanitize=shadow-call-stack -### %s 2>&1 \
 // RUN:     --target=aarch64-unknown-linux -fuse-ld=ld \
-// RUN:   | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64
 // CHECK-SHADOWCALLSTACK-LINUX-AARCH64: '-fsanitize=shadow-call-stack' only allowed with '-ffixed-x18'
 
 // RUN: %clang -fsanitize=shadow-call-stack -### %s 2>&1 \
 // RUN:     --target=riscv32-unknown-elf -fuse-ld=ld \
-// RUN:   | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-ELF-RISCV32 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHADOWCALLSTACK-ELF-RISCV32
 // CHECK-SHADOWCALLSTACK-ELF-RISCV32-NOT: error:
+// CHECK-SHADOWCALLSTACK-ELF-RISCV32: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
 
 // RUN: %clang -fsanitize=shadow-call-stack -### %s 2>&1 \
 // RUN:     --target=riscv64-unknown-linux -fuse-ld=ld \
-// RUN:   | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-RISCV64 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-RISCV64
 // CHECK-SHADOWCALLSTACK-LINUX-RISCV64-NOT: error:
+// CHECK-SHADOWCALLSTACK-LINUX-RISCV64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 
 // RUN: %clang -target riscv64-linux-android -fsanitize=shadow-call-stack %s -### 2>&1 \
-// RUN:   | FileCheck %s --check-prefix=CHECK-SHADOWCALLSTACK-ANDROID-RISCV64
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHADOWCALLSTACK-ANDROID-RISCV64
 // CHECK-SHADOWCALLSTACK-ANDROID-RISCV64-NOT: error:
+// CHECK-SHADOWCALLSTACK-ANDROID-RISCV64: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
 
 // RUN: %clang -fsanitize=shadow-call-stack -### %s 2>&1 \
 // RUN:     --target=riscv64-unknown-fuchsia -fuse-ld=ld \
-// RUN:   | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-FUCHSIA-RISCV64 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHADOWCALLSTACK-FUCHSIA-RISCV64
 // CHECK-SHADOWCALLSTACK-FUCHSIA-RISCV64-NOT: error:
+// CHECK-SHADOWCALLSTACK-FUCHSIA-RISCV64: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
 
 // RUN: %clang -fsanitize=shadow-call-stack -### %s 2>&1 \
 // RUN:     --target=aarch64-unknown-linux -fuse-ld=ld -ffixed-x18 \
-// RUN:   | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18
 // RUN: %clang -fsanitize=shadow-call-stack -### %s 2>&1 \
 // RUN:     --target=arm64-unknown-ios -fuse-ld=ld \
-// RUN:   | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18
+// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-NOT: error:
+// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
+
 // RUN: %clang -fsanitize=shadow-call-stack -### %s 2>&1 \
 // RUN:     --target=aarch64-unknown-linux-android -fuse-ld=ld \
-// RUN:   | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18 %s
-// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-NOT: error:
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID
+// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID-NOT: error:
+// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
 
 // RUN: not %clang -fsanitize=shadow-call-stack -### %s 2>&1 \
 // RUN:     --target=x86-unknown-linux -fuse-ld=ld \
-// RUN:   | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-X86 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-X86
 // CHECK-SHADOWCALLSTACK-LINUX-X86: error: unsupported option '-fsanitize=shadow-call-stack' for target 'x86-unknown-linux'
 
 // RUN: %clang -fsanitize=shadow-call-stack -### %s 2>&1 \
 // RUN:     -fsanitize=safe-stack --target=x86_64-unknown-linux -fuse-ld=ld \
-// RUN:   | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-SAFESTACK %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHADOWCALLSTACK-SAFESTACK
 // CHECK-SHADOWCALLSTACK-SAFESTACK-NOT: error:
+// CHECK-SHADOWCALLSTACK-SAFESTACK: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
+// CHECK-SHADOWCALLSTACK-SAFESTACK: libclang_rt.safestack.a
 
 // RUN: not %clang -fsanitize=cfi -fsanitize-stats -### %s 2>&1 \
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-CFI-STATS-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-CFI-STATS-LINUX
 // CHECK-CFI-STATS-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-CFI-STATS-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.stats_client.a" "--no-whole-archive"
 // CHECK-CFI-STATS-LINUX-NOT: "--whole-archive"
@@ -905,7 +939,7 @@
 // RUN: not %clang -fsanitize=cfi -fsanitize-stats -### %s 2>&1 \
 // RUN:     --target=x86_64-apple-darwin -fuse-ld=ld \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-CFI-STATS-DARWIN %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-CFI-STATS-DARWIN
 // CHECK-CFI-STATS-DARWIN: "{{.*}}ld{{(.exe)?}}"
 // CHECK-CFI-STATS-DARWIN: "{{[^"]*}}libclang_rt.stats_client_osx.a"
 // CHECK-CFI-STATS-DARWIN: "{{[^"]*}}libclang_rt.stats_osx_dynamic.dylib"
@@ -913,7 +947,7 @@
 // RUN: not %clang -fsanitize=cfi -fsanitize-stats -### %s 2>&1 \
 // RUN:     --target=x86_64-pc-windows \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-CFI-STATS-WIN64 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-CFI-STATS-WIN64
 // CHECK-CFI-STATS-WIN64: "--dependent-lib=clang_rt.stats_client{{(-x86_64)?}}.lib"
 // CHECK-CFI-STATS-WIN64: "--dependent-lib=clang_rt.stats{{(-x86_64)?}}.lib"
 // CHECK-CFI-STATS-WIN64: "--linker-option=/include:__sanitizer_stats_register"
@@ -921,13 +955,13 @@
 // RUN: not %clang -fsanitize=cfi -fsanitize-stats -### %s 2>&1 \
 // RUN:     --target=i686-pc-windows \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-CFI-STATS-WIN32 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-CFI-STATS-WIN32
 // RUN: not %clang -fsanitize=cfi -fsanitize-stats -### %s 2>&1 \
 // RUN:     --target=i686-pc-windows \
 // RUN:     -fno-rtlib-defaultlib \
 // RUN:     -frtlib-defaultlib \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-CFI-STATS-WIN32 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-CFI-STATS-WIN32
 // CHECK-CFI-STATS-WIN32: "--dependent-lib=clang_rt.stats_client{{(-i386)?}}.lib"
 // CHECK-CFI-STATS-WIN32: "--dependent-lib=clang_rt.stats{{(-i386)?}}.lib"
 // CHECK-CFI-STATS-WIN32: "--linker-option=/include:___sanitizer_stats_register"
@@ -936,38 +970,35 @@
 // RUN:     --target=i686-pc-windows \
 // RUN:     -fno-rtlib-defaultlib \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-CFI-STATS-WIN32-NODEF %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-CFI-STATS-WIN32-NODEF
 // CHECK-CFI-STATS-WIN32-NODEF-NOT: "--dependent-lib=clang_rt.stats_client{{(-i386)?}}.lib"
 // CHECK-CFI-STATS-WIN32-NODEF-NOT: "--dependent-lib=clang_rt.stats{{(-i386)?}}.lib"
 
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=arm-linux-androideabi -fuse-ld=ld -fsanitize=safe-stack \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-SAFESTACK-ANDROID-ARM %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SAFESTACK-ANDROID-ARM
 //
 // CHECK-SAFESTACK-ANDROID-ARM: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
-// CHECK-SAFESTACK-ANDROID-ARM-NOT: libclang_rt.safestack
 
 // RUN: %clang -### %s -shared 2>&1 \
 // RUN:     --target=arm-linux-androideabi -fuse-ld=ld -fsanitize=safe-stack \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-SAFESTACK-SHARED-ANDROID-ARM %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SAFESTACK-SHARED-ANDROID-ARM
 //
 // CHECK-SAFESTACK-SHARED-ANDROID-ARM: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
-// CHECK-SAFESTACK-SHARED-ANDROID-ARM-NOT: libclang_rt.safestack
 
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=aarch64-linux-android -fuse-ld=ld -fsanitize=safe-stack \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-SAFESTACK-ANDROID-AARCH64 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SAFESTACK-ANDROID-AARCH64
 //
 // CHECK-SAFESTACK-ANDROID-AARCH64: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
-// CHECK-SAFESTACK-ANDROID-AARCH64-NOT: libclang_rt.safestack
 
 // RUN: not %clang -fsanitize=undefined -### %s 2>&1 \
 // RUN:     --target=x86_64-scei-ps4 -fuse-ld=ld \
 // RUN:     -shared \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-PS4 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-PS4
 // CHECK-UBSAN-PS4: --dependent-lib=libSceDbgUBSanitizer_stub_weak.a
 // CHECK-UBSAN-PS4: "{{.*}}ld{{(.gold)?(.exe)?}}"
 // CHECK-UBSAN-PS4: -lSceDbgUBSanitizer_stub_weak
@@ -975,7 +1006,7 @@
 // RUN: not %clang -fsanitize=undefined -### %s 2>&1 \
 // RUN:     --target=x86_64-sie-ps5 -fuse-ld=ld \
 // RUN:     -shared \
-// RUN:   | FileCheck --check-prefix=CHECK-UBSAN-PS5 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-UBSAN-PS5
 // CHECK-UBSAN-PS5: --dependent-lib=libSceUBSanitizer_nosubmission_stub_weak.a
 // CHECK-UBSAN-PS5: "{{.*}}ld{{(.gold)?(.exe)?}}"
 // CHECK-UBSAN-PS5: -lSceUBSanitizer_nosubmission_stub_weak
@@ -983,7 +1014,7 @@
 // RUN: not %clang -fsanitize=address -### %s 2>&1 \
 // RUN:     --target=x86_64-scei-ps4 -fuse-ld=ld \
 // RUN:     -shared \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-PS4 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-PS4
 // CHECK-ASAN-PS4: --dependent-lib=libSceDbgAddressSanitizer_stub_weak.a
 // CHECK-ASAN-PS4: "{{.*}}ld{{(.gold)?(.exe)?}}"
 // CHECK-ASAN-PS4: -lSceDbgAddressSanitizer_stub_weak
@@ -991,7 +1022,7 @@
 // RUN: not %clang -fsanitize=address -### %s 2>&1 \
 // RUN:     --target=x86_64-sie-ps5 -fuse-ld=ld \
 // RUN:     -shared \
-// RUN:   | FileCheck --check-prefix=CHECK-ASAN-PS5 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-PS5
 // CHECK-ASAN-PS5: --dependent-lib=libSceAddressSanitizer_nosubmission_stub_weak.a
 // CHECK-ASAN-PS5: "{{.*}}ld{{(.gold)?(.exe)?}}"
 // CHECK-ASAN-PS5: -lSceAddressSanitizer_nosubmission_stub_weak
@@ -999,7 +1030,7 @@
 // RUN: not %clang -fsanitize=address,undefined -### %s 2>&1 \
 // RUN:     --target=x86_64-scei-ps4 -fuse-ld=ld \
 // RUN:     -shared \
-// RUN:   | FileCheck --check-prefix=CHECK-AUBSAN-PS4 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-AUBSAN-PS4
 // CHECK-AUBSAN-PS4-NOT: --dependent-lib=libSceDbgUBSanitizer_stub_weak.a
 // CHECK-AUBSAN-PS4: --dependent-lib=libSceDbgAddressSanitizer_stub_weak.a
 // CHECK-AUBSAN-PS4-NOT: --dependent-lib=libSceDbgUBSanitizer_stub_weak.a
@@ -1009,7 +1040,7 @@
 // RUN: not %clang -fsanitize=address,undefined -### %s 2>&1 \
 // RUN:     --target=x86_64-sie-ps5 -fuse-ld=ld \
 // RUN:     -shared \
-// RUN:   | FileCheck --check-prefix=CHECK-AUBSAN-PS5 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-AUBSAN-PS5
 // CHECK-AUBSAN-PS5-NOT: --dependent-lib=libSceUBSanitizer_nosubmission_stub_weak.a
 // CHECK-AUBSAN-PS5: --dependent-lib=libSceAddressSanitizer_nosubmission_stub_weak.a
 // CHECK-AUBSAN-PS5-NOT: --dependent-lib=libSceUBSanitizer_nosubmission_stub_weak.a
@@ -1020,21 +1051,21 @@
 // RUN:     --target=x86_64-scei-ps4 -fuse-ld=ld \
 // RUN:     -shared \
 // RUN:     -nostdlib \
-// RUN:   | FileCheck --check-prefix=CHECK-NOLIB-PS4 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-NOLIB-PS4
 // CHECK-NOLIB-PS4-NOT: SceDbgAddressSanitizer_stub_weak
 
 // RUN: not %clang -fsanitize=address,undefined -### %s 2>&1 \
 // RUN:     --target=x86_64-sie-ps5 -fuse-ld=ld \
 // RUN:     -shared \
 // RUN:     -nostdlib \
-// RUN:   | FileCheck --check-prefix=CHECK-NOLIB-PS5 %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-NOLIB-PS5
 // CHECK-NOLIB-PS5-NOT: SceAddressSanitizer_nosubmission_stub_weak
 
 // RUN: %clang -fsanitize=scudo -### %s 2>&1 \
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-SCUDO-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SCUDO-LINUX
 // CHECK-SCUDO-LINUX: "{{.*}}ld{{(.exe)?}}"
 // CHECK-SCUDO-LINUX: "--whole-archive" "{{.*}}libclang_rt.scudo_standalone.a" "--no-whole-archive"
 // CHECK-SCUDO-LINUX-NOT: "-lstdc++"
@@ -1046,11 +1077,10 @@
 // RUN:     --target=i386-unknown-linux -fuse-ld=ld -fsanitize=scudo -shared-libsan \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-SCUDO-SHARED-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SCUDO-SHARED-LINUX
 //
 // CHECK-SCUDO-SHARED-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-SCUDO-SHARED-LINUX-NOT: "-lc"
-// CHECK-SCUDO-SHARED-LINUX-NOT: libclang_rt.scudo_standalone.a"
 // CHECK-SCUDO-SHARED-LINUX: libclang_rt.scudo_standalone.so"
 // CHECK-SCUDO-SHARED-LINUX-NOT: "-lpthread"
 // CHECK-SCUDO-SHARED-LINUX-NOT: "-lrt"
@@ -1062,7 +1092,7 @@
 // RUN: %clang -### %s 2>&1 \
 // RUN:     --target=arm-linux-androideabi -fuse-ld=ld -fsanitize=scudo \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
-// RUN:   | FileCheck --check-prefix=CHECK-SCUDO-ANDROID %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SCUDO-ANDROID
 //
 // CHECK-SCUDO-ANDROID: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
 // CHECK-SCUDO-ANDROID-NOT: "-lc"
@@ -1077,7 +1107,7 @@
 // RUN:     --target=arm-linux-androideabi -fuse-ld=ld -fsanitize=scudo \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
 // RUN:     -static-libsan \
-// RUN:   | FileCheck --check-prefix=CHECK-SCUDO-ANDROID-STATIC %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SCUDO-ANDROID-STATIC
 // CHECK-SCUDO-ANDROID-STATIC: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
 // CHECK-SCUDO-ANDROID-STATIC: "-pie"
 // CHECK-SCUDO-ANDROID-STATIC: "--whole-archive" "{{.*}}libclang_rt.scudo_standalone.a" "--no-whole-archive"
@@ -1090,7 +1120,7 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=hwaddress \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-HWASAN-X86-64-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-HWASAN-X86-64-LINUX
 //
 // CHECK-HWASAN-X86-64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-HWASAN-X86-64-LINUX-NOT: "-lc"
@@ -1107,11 +1137,12 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=hwaddress \
 // RUN:     -shared-libsan -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-SHARED-HWASAN-X86-64-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHARED-HWASAN-X86-64-LINUX
 //
 // CHECK-SHARED-HWASAN-X86-64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-SHARED-HWASAN-X86-64-LINUX-NOT: "-lc"
 // CHECK-SHARED-HWASAN-X86-64-LINUX: libclang_rt.hwasan.so"
+// CHECK-SHARED-HWASAN-X86-64-LINUX: libclang_rt.hwasan-preinit.a"
 // CHECK-SHARED-HWASAN-X86-64-LINUX-NOT: "-lpthread"
 // CHECK-SHARED-HWASAN-X86-64-LINUX-NOT: "-lrt"
 // CHECK-SHARED-HWASAN-X86-64-LINUX-NOT: "-ldl"
@@ -1123,7 +1154,7 @@
 // RUN:     --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=hwaddress \
 // RUN:     -shared-libsan -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-DSO-SHARED-HWASAN-X86-64-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-DSO-SHARED-HWASAN-X86-64-LINUX
 //
 // CHECK-DSO-SHARED-HWASAN-X86-64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-DSO-SHARED-HWASAN-X86-64-LINUX-NOT: "-lc"
@@ -1139,7 +1170,7 @@
 // RUN:     --target=aarch64-unknown-linux -fuse-ld=ld -fsanitize=hwaddress \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-HWASAN-AARCH64-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-HWASAN-AARCH64-LINUX
 //
 // CHECK-HWASAN-AARCH64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-HWASAN-AARCH64-LINUX-NOT: "-lc"
@@ -1157,11 +1188,12 @@
 // RUN:     -shared-libsan \
 // RUN:     -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-SHARED-HWASAN-AARCH64-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-SHARED-HWASAN-AARCH64-LINUX
 //
 // CHECK-SHARED-HWASAN-AARCH64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-SHARED-HWASAN-AARCH64-LINUX-NOT: "-lc"
 // CHECK-SHARED-HWASAN-AARCH64-LINUX: libclang_rt.hwasan.so"
+// CHECK-SHARED-HWASAN-AARCH64-LINUX: libclang_rt.hwasan-preinit.a"
 // CHECK-SHARED-HWASAN-AARCH64-LINUX-NOT: "-lpthread"
 // CHECK-SHARED-HWASAN-AARCH64-LINUX-NOT: "-lrt"
 // CHECK-SHARED-HWASAN-AARCH64-LINUX-NOT: "-ldl"
@@ -1173,7 +1205,7 @@
 // RUN:     --target=aarch64-unknown-linux -fuse-ld=ld -fsanitize=hwaddress \
 // RUN:     -shared-libsan -resource-dir=%S/Inputs/resource_dir \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-// RUN:   | FileCheck --check-prefix=CHECK-DSO-SHARED-HWASAN-AARCH64-LINUX %s
+// RUN:   | %{filecheck} --check-prefix=CHECK-DSO-SHARED-HWASAN-AARCH64-LINUX
 //
 // CHECK-DSO-SHARED-HWASAN-AARCH64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-DSO-SHARED-HWASAN-AARCH64-LINUX-NOT: "-lc"
diff --git a/clang/test/Driver/uefi-defines.c b/clang/test/Driver/uefi-defines.c
new file mode 100644
index 0000000000000..45f27bfdb9fa9
--- /dev/null
+++ b/clang/test/Driver/uefi-defines.c
@@ -0,0 +1,6 @@
+// RUN: %clang -target x86_64-unknown-uefi %s -emit-llvm -S -c -o - | FileCheck %s
+
+// CHECK: __UEFI__defined
+#ifdef __UEFI__
+void __UEFI__defined() {}
+#endif
diff --git a/clang/test/Driver/unknown-arg-drivermodes.test b/clang/test/Driver/unknown-arg-drivermodes.test
index a7ea73af345e0..0125d79b47afa 100644
--- a/clang/test/Driver/unknown-arg-drivermodes.test
+++ b/clang/test/Driver/unknown-arg-drivermodes.test
@@ -1,6 +1,5 @@
 // RUN: %clang_cl                  \
 // RUN: --config                   \
-// RUN: -fdiagnostics-color=auto   \
 // RUN: -fno-record-command-line   \
 // RUN: -frecord-command-line      \
 // RUN: -nodefaultlibs             \
@@ -15,7 +14,6 @@
 
 // RUN: not %clang_dxc             \
 // RUN: --config                   \
-// RUN: -fdiagnostics-color=auto   \
 // RUN: -fno-record-command-line   \
 // RUN: -frecord-command-line      \
 // RUN: -nodefaultlibs             \
@@ -30,7 +28,6 @@
 // RUN: | FileCheck %s --check-prefix=DXC --implicit-check-not="error:"
 
 // CL: warning: unknown argument ignored in clang-cl: '--config'
-// CL: warning: unknown argument ignored in clang-cl: '-fdiagnostics-color=auto'
 // CL: warning: unknown argument ignored in clang-cl: '-fno-record-command-line'
 // CL: warning: unknown argument ignored in clang-cl: '-frecord-command-line'
 // CL: warning: unknown argument ignored in clang-cl: '-nodefaultlibs'
@@ -42,7 +39,6 @@
 // CL: warning: unknown argument ignored in clang-cl: '-Xoffload-linker'
 
 // DXC: error: unknown argument: '--config'
-// DXC: error: unknown argument: '-fdiagnostics-color=auto'
 // DXC: error: unknown argument: '-fno-record-command-line'
 // DXC: error: unknown argument: '-frecord-command-line'
 // DXC: error: unknown argument: '-nodefaultlibs'
diff --git a/clang/test/Frontend/dependency-gen-symlink.c b/clang/test/Frontend/dependency-gen-symlink.c
index 2fa339ad2abf2..15664a46b90c8 100644
--- a/clang/test/Frontend/dependency-gen-symlink.c
+++ b/clang/test/Frontend/dependency-gen-symlink.c
@@ -15,7 +15,7 @@
 // CHECK: dependency-gen-symlink.c.o
 // CHECK: dependency-gen-symlink.c
 // CHECK: a/header.h
-// CHECK: b/header.h
+// CHECK-NOT: b/header.h
 // CHECK-NOT: with-header-guard.h
 #include "a/header.h"
 #include "b/header.h"
diff --git a/clang/test/Frontend/dependency-gen-windows-duplicates.c b/clang/test/Frontend/dependency-gen-windows-duplicates.c
index abd351377dc33..0ecc23226fb9c 100644
--- a/clang/test/Frontend/dependency-gen-windows-duplicates.c
+++ b/clang/test/Frontend/dependency-gen-windows-duplicates.c
@@ -9,7 +9,7 @@
 // RUN: %clang -MD -MF - %t.dir/test.c -fsyntax-only -I %t.dir/subdir | FileCheck %s
 // CHECK: test.o:
 // CHECK-NEXT: \test.c
-// CHECK-NEXT: \SubDir\X.h
+// CHECK-NEXT: \subdir\x.h
 // File x.h must appear only once (case insensitive check).
 // CHECK-NOT: {{\\|/}}{{x|X}}.{{h|H}}
 
diff --git a/clang/test/Misc/target-invalid-cpu-note/hexagon.c b/clang/test/Misc/target-invalid-cpu-note/hexagon.c
index a7b73f33cccae..e3f5ef0fae1b3 100644
--- a/clang/test/Misc/target-invalid-cpu-note/hexagon.c
+++ b/clang/test/Misc/target-invalid-cpu-note/hexagon.c
@@ -18,4 +18,6 @@
 // CHECK-SAME: {{^}}, hexagonv71
 // CHECK-SAME: {{^}}, hexagonv71t
 // CHECK-SAME: {{^}}, hexagonv73
+// CHECK-SAME: {{^}}, hexagonv75
+// CHECK-SAME: {{^}}, hexagonv79
 // CHECK-SAME: {{$}}
diff --git a/clang/test/Modules/expose-static-inline-from-gmf-1.cppm b/clang/test/Modules/expose-static-inline-from-gmf-1.cppm
new file mode 100644
index 0000000000000..4de9b583dac8d
--- /dev/null
+++ b/clang/test/Modules/expose-static-inline-from-gmf-1.cppm
@@ -0,0 +1,37 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+//
+// RUN: %clang -std=c++20 %t/a.cppm --precompile -o %t/a.pcm \
+// RUN:   -DTEST_INLINE
+// RUN: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify \
+// RUN:   -DTEST_INLINE
+//
+// RUN: %clang -std=c++20 %t/a.cppm --precompile -o %t/a.pcm
+// RUN: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify
+
+//--- a.h
+#ifdef TEST_INLINE
+#define INLINE inline
+#else
+#define INLINE
+#endif
+static INLINE void func(long) {}
+template  void a() { func(T{}); }
+
+//--- a.cppm
+module;
+#include "a.h"
+export module a;
+export using ::a;
+
+//--- test.cc
+import a;
+auto m = (a(), 0);
+
+#ifdef TEST_INLINE
+// expected-no-diagnostics
+#else
+// expected-error@a.h:7 {{no matching function for call to 'func'}}
+// expected-note@test.cc:2 {{in instantiation of function template specialization 'a' requested here}}
+#endif
diff --git a/clang/test/Modules/expose-static-inline-from-gmf-2.cppm b/clang/test/Modules/expose-static-inline-from-gmf-2.cppm
new file mode 100644
index 0000000000000..c89b613f5074b
--- /dev/null
+++ b/clang/test/Modules/expose-static-inline-from-gmf-2.cppm
@@ -0,0 +1,22 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+//
+// RUN: %clang -std=c++20 %t/a.cppm --precompile -o %t/a.pcm
+// RUN: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify
+
+//--- a.h
+template  static inline void func() {}
+template  void a() { func(); }
+
+//--- a.cppm
+module;
+#include "a.h"
+export module a;
+export using ::a;
+
+//--- test.cc
+import a;
+auto m = (a(), 0);
+
+// expected-no-diagnostics
diff --git a/clang/test/Modules/expose-static-inline-from-gmf-3.cppm b/clang/test/Modules/expose-static-inline-from-gmf-3.cppm
new file mode 100644
index 0000000000000..dee7cddafdf70
--- /dev/null
+++ b/clang/test/Modules/expose-static-inline-from-gmf-3.cppm
@@ -0,0 +1,24 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+//
+// RUN: %clang -std=c++20 %t/a.cppm --precompile -o %t/a.pcm
+// RUN: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify
+
+//--- a.h
+namespace ns {
+template  static void func() {}
+template  void a() { func(); }
+}
+
+//--- a.cppm
+module;
+#include "a.h"
+export module a;
+export using ns::a;
+
+//--- test.cc
+import a;
+auto m = (a(), 0);
+
+// expected-no-diagnostics
diff --git a/clang/test/Modules/expose-static-inline-from-gmf-4.cppm b/clang/test/Modules/expose-static-inline-from-gmf-4.cppm
new file mode 100644
index 0000000000000..09c6b1ffd9c79
--- /dev/null
+++ b/clang/test/Modules/expose-static-inline-from-gmf-4.cppm
@@ -0,0 +1,40 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+//
+// RUN: %clang -std=c++20 %t/a.cppm --precompile -o %t/a.pcm \
+// RUN:   -DTEST_INLINE
+// RUN: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify \
+// RUN:   -DTEST_INLINE
+//
+// RUN: %clang -std=c++20 %t/a.cppm --precompile -o %t/a.pcm
+// RUN: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify
+
+//--- a.h
+#ifdef TEST_INLINE
+#define INLINE inline
+#else
+#define INLINE
+#endif
+namespace ns {
+template  static void func() {}
+template <> INLINE void func() {}
+template  void a() { func(); }
+}
+
+//--- a.cppm
+module;
+#include "a.h"
+export module a;
+export using ns::a;
+
+//--- test.cc
+import a;
+auto m = (a(), 0);
+
+#ifdef TEST_INLINE
+// expected-no-diagnostics
+#else
+// expected-error@a.h:9 {{no matching function for call to 'func'}}
+// expected-note@test.cc:2 {{in instantiation of function template specialization 'ns::a' requested here}}
+#endif
diff --git a/clang/test/Modules/expose-static-inline-from-gmf-5.cppm b/clang/test/Modules/expose-static-inline-from-gmf-5.cppm
new file mode 100644
index 0000000000000..334af845a693d
--- /dev/null
+++ b/clang/test/Modules/expose-static-inline-from-gmf-5.cppm
@@ -0,0 +1,26 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+//
+// RUN: %clang -std=c++20 %t/a.cppm --precompile -o %t/a.pcm
+// RUN: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify
+
+//--- a.h
+namespace ns {
+namespace {
+template  void func() {}
+}
+template  void a() { func(); }
+}
+
+//--- a.cppm
+module;
+#include "a.h"
+export module a;
+export using ns::a;
+
+//--- test.cc
+import a;
+auto m = (a(), 0);
+
+// expected-no-diagnostics
diff --git a/clang/test/Modules/pr120277.cppm b/clang/test/Modules/pr120277.cppm
new file mode 100644
index 0000000000000..a4f55ef113b2c
--- /dev/null
+++ b/clang/test/Modules/pr120277.cppm
@@ -0,0 +1,58 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+//
+// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
+// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm \
+// RUN:     -fprebuilt-module-path=%t
+// RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-module-interface -o %t/c.pcm \
+// RUN:     -fprebuilt-module-path=%t
+// RUN: %clang_cc1 -std=c++20 %t/d.cppm -emit-module-interface -o %t/d.pcm \
+// RUN:     -fprebuilt-module-path=%t
+// RUN: %clang_cc1 -std=c++20 %t/d.pcm -emit-llvm -o %t/d.ll \
+// RUN:     -fprebuilt-module-path=%t
+// RUN: cat %t/d.ll | FileCheck %t/d.cppm
+
+//--- a.cppm
+export module a;
+
+export template
+struct a {
+	static auto f() {
+	}
+};
+
+//--- b.cppm
+export module b;
+
+import a;
+
+void b() {
+	a<0> t;
+}
+
+//--- c.cppm
+export module c;
+
+import a;
+
+void c() {
+	a<0>::f();
+}
+
+//--- d.cppm
+export module d;
+
+import a;
+import b;
+import c;
+
+struct d {
+	static void g() {
+		a<0>::f();
+		a<1>::f();
+	}
+};
+
+// fine enough to check it won't crash
+// CHECK: define
diff --git a/clang/test/Modules/pr121066.cpp b/clang/test/Modules/pr121066.cpp
new file mode 100644
index 0000000000000..e92a81c53d683
--- /dev/null
+++ b/clang/test/Modules/pr121066.cpp
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only %s -verify 
+
+import mod // expected-error {{expected ';' after module name}}
+           // expected-error@-1 {{module 'mod' not found}}
diff --git a/clang/test/Parser/objc-coloncolon.m b/clang/test/Parser/objc-coloncolon.m
new file mode 100644
index 0000000000000..04a24fd81ec08
--- /dev/null
+++ b/clang/test/Parser/objc-coloncolon.m
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -x objective-c -fsyntax-only -Wno-objc-root-class -verify %s
+
+int GV = 42;
+
+@interface A
++ (int) getGV;
+- (instancetype)init:(::A *) foo; // expected-error {{expected a type}}
+@end
+
+@implementation A
+- (void)performSelector:(SEL)selector {}
+- (void)double:(int)firstArg :(int)secondArg colon:(int)thirdArg {}
+- (void)test {
+  // The `::` below should not trigger an error.
+  [self performSelector:@selector(double::colon:)];
+}
++ (int) getGV { return ::GV; } // expected-error {{expected a type}}
+- (instancetype)init:(::A *) foo { return self; } // expected-error {{expected a type}}
+@end
diff --git a/clang/test/Parser/objcxx-coloncolon.mm b/clang/test/Parser/objcxx-coloncolon.mm
new file mode 100644
index 0000000000000..864a7df8400c1
--- /dev/null
+++ b/clang/test/Parser/objcxx-coloncolon.mm
@@ -0,0 +1,9 @@
+// Test to make sure the parser does not get stuck on the optional
+// scope specifier on the type B.
+// RUN: %clang_cc1 -fsyntax-only %s
+
+class B;
+
+@interface A
+- (void) init:(::B *) foo;
+@end
diff --git a/clang/test/Preprocessor/hexagon-predefines.c b/clang/test/Preprocessor/hexagon-predefines.c
index 188f465520056..eebf48117d80c 100644
--- a/clang/test/Preprocessor/hexagon-predefines.c
+++ b/clang/test/Preprocessor/hexagon-predefines.c
@@ -137,6 +137,39 @@
 // CHECK-V73HVX-128B: #define __HVX__ 1
 // CHECK-V73HVX-128B: #define __hexagon__ 1
 
+// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv75 %s\
+// RUN: | FileCheck %s -check-prefix CHECK-V75
+// CHECK-V75: #define __HEXAGON_ARCH__ 75
+// CHECK-V75: #define __HEXAGON_PHYSICAL_SLOTS__ 4
+// CHECK-V75: #define __HEXAGON_V75__ 1
+// CHECK-V75: #define __hexagon__ 1
+
+// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv75 \
+// RUN: -target-feature +hvxv75 -target-feature +hvx-length128b %s | FileCheck \
+// RUN: %s -check-prefix CHECK-V75HVX-128B
+// CHECK-V75HVX-128B: #define __HEXAGON_ARCH__ 75
+// CHECK-V75HVX-128B: #define __HEXAGON_V75__ 1
+// CHECK-V75HVX-128B: #define __HVX_ARCH__ 75
+// CHECK-V75HVX-128B: #define __HVX_LENGTH__ 128
+// CHECK-V75HVX-128B: #define __HVX__ 1
+// CHECK-V75HVX-128B: #define __hexagon__ 1
+
+// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv79 %s\
+// RUN: | FileCheck %s -check-prefix CHECK-V79
+// CHECK-V79: #define __HEXAGON_ARCH__ 79
+// CHECK-V79: #define __HEXAGON_PHYSICAL_SLOTS__ 4
+// CHECK-V79: #define __HEXAGON_V79__ 1
+// CHECK-V79: #define __hexagon__ 1
+
+// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv79 \
+// RUN: -target-feature +hvxv79 -target-feature +hvx-length128b %s | FileCheck \
+// RUN: %s -check-prefix CHECK-V79HVX-128B
+// CHECK-V79HVX-128B: #define __HEXAGON_ARCH__ 79
+// CHECK-V79HVX-128B: #define __HEXAGON_V79__ 1
+// CHECK-V79HVX-128B: #define __HVX_ARCH__ 79
+// CHECK-V79HVX-128B: #define __HVX_LENGTH__ 128
+// CHECK-V79HVX-128B: #define __HVX__ 1
+// CHECK-V79HVX-128B: #define __hexagon__ 1
 
 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv67 \
 // RUN: -target-feature +hvxv67 -target-feature +hvx-length128b %s | FileCheck \
diff --git a/clang/test/Preprocessor/init.c b/clang/test/Preprocessor/init.c
index 05225c120b13d..5999b9c1d1bc3 100644
--- a/clang/test/Preprocessor/init.c
+++ b/clang/test/Preprocessor/init.c
@@ -2742,3 +2742,256 @@
 // RISCV64-LINUX: #define __unix__ 1
 // RISCV64-LINUX: #define linux 1
 // RISCV64-LINUX: #define unix 1
+
+// RUN: %clang_cc1 -dM -triple=x86_64-uefi -E /dev/null | FileCheck -match-full-lines -check-prefix UEFI %s
+
+// UEFI: #define __UEFI__ 1
+
+// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=xtensa  < /dev/null \
+// RUN:   | FileCheck -match-full-lines -check-prefix=XTENSA %s
+// XTENSA: #define _ILP32 1
+// XTENSA: #define __ATOMIC_ACQUIRE 2
+// XTENSA: #define __ATOMIC_ACQ_REL 4
+// XTENSA: #define __ATOMIC_CONSUME 1
+// XTENSA: #define __ATOMIC_RELAXED 0
+// XTENSA: #define __ATOMIC_RELEASE 3
+// XTENSA: #define __ATOMIC_SEQ_CST 5
+// XTENSA: #define __BIGGEST_ALIGNMENT__ 4
+// XTENSA: #define __BITINT_MAXWIDTH__ 128
+// XTENSA: #define __BOOL_WIDTH__ 1
+// XTENSA: #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
+// XTENSA: #define __CHAR16_TYPE__ unsigned short
+// XTENSA: #define __CHAR32_TYPE__ unsigned int
+// XTENSA: #define __CHAR_BIT__ 8
+// XTENSA: #define __CLANG_ATOMIC_BOOL_LOCK_FREE 2
+// XTENSA: #define __CLANG_ATOMIC_CHAR16_T_LOCK_FREE 2
+// XTENSA: #define __CLANG_ATOMIC_CHAR32_T_LOCK_FREE 2
+// XTENSA: #define __CLANG_ATOMIC_CHAR_LOCK_FREE 2
+// XTENSA: #define __CLANG_ATOMIC_INT_LOCK_FREE 2
+// XTENSA: #define __CLANG_ATOMIC_LLONG_LOCK_FREE 1
+// XTENSA: #define __CLANG_ATOMIC_LONG_LOCK_FREE 2
+// XTENSA: #define __CLANG_ATOMIC_POINTER_LOCK_FREE 2
+// XTENSA: #define __CLANG_ATOMIC_SHORT_LOCK_FREE 2
+// XTENSA: #define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2
+// XTENSA: #define __CONSTANT_CFSTRINGS__ 1
+// XTENSA: #define __DBL_DECIMAL_DIG__ 17
+// XTENSA: #define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// XTENSA: #define __DBL_DIG__ 15
+// XTENSA: #define __DBL_EPSILON__ 2.2204460492503131e-16
+// XTENSA: #define __DBL_HAS_DENORM__ 1
+// XTENSA: #define __DBL_HAS_INFINITY__ 1
+// XTENSA: #define __DBL_HAS_QUIET_NAN__ 1
+// XTENSA: #define __DBL_MANT_DIG__ 53
+// XTENSA: #define __DBL_MAX_10_EXP__ 308
+// XTENSA: #define __DBL_MAX_EXP__ 1024
+// XTENSA: #define __DBL_MAX__ 1.7976931348623157e+308
+// XTENSA: #define __DBL_MIN_10_EXP__ (-307)
+// XTENSA: #define __DBL_MIN_EXP__ (-1021)
+// XTENSA: #define __DBL_MIN__ 2.2250738585072014e-308
+// XTENSA: #define __DBL_NORM_MAX__ 1.7976931348623157e+308
+// XTENSA: #define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
+// XTENSA: #define __ELF__ 1
+// XTENSA: #define __FINITE_MATH_ONLY__ 0
+// XTENSA: #define __FLT_DECIMAL_DIG__ 9
+// XTENSA: #define __FLT_DENORM_MIN__ 1.40129846e-45F
+// XTENSA: #define __FLT_DIG__ 6
+// XTENSA: #define __FLT_EPSILON__ 1.19209290e-7F
+// XTENSA: #define __FLT_HAS_DENORM__ 1
+// XTENSA: #define __FLT_HAS_INFINITY__ 1
+// XTENSA: #define __FLT_HAS_QUIET_NAN__ 1
+// XTENSA: #define __FLT_MANT_DIG__ 24
+// XTENSA: #define __FLT_MAX_10_EXP__ 38
+// XTENSA: #define __FLT_MAX_EXP__ 128
+// XTENSA: #define __FLT_MAX__ 3.40282347e+38F
+// XTENSA: #define __FLT_MIN_10_EXP__ (-37)
+// XTENSA: #define __FLT_MIN_EXP__ (-125)
+// XTENSA: #define __FLT_MIN__ 1.17549435e-38F
+// XTENSA: #define __FLT_NORM_MAX__ 3.40282347e+38F
+// XTENSA: #define __FLT_RADIX__ 2
+// XTENSA: #define __FPCLASS_NEGINF 0x0004
+// XTENSA: #define __FPCLASS_NEGNORMAL 0x0008
+// XTENSA: #define __FPCLASS_NEGSUBNORMAL 0x0010
+// XTENSA: #define __FPCLASS_NEGZERO 0x0020
+// XTENSA: #define __FPCLASS_POSINF 0x0200
+// XTENSA: #define __FPCLASS_POSNORMAL 0x0100
+// XTENSA: #define __FPCLASS_POSSUBNORMAL 0x0080
+// XTENSA: #define __FPCLASS_POSZERO 0x0040
+// XTENSA: #define __FPCLASS_QNAN 0x0002
+// XTENSA: #define __FPCLASS_SNAN 0x0001
+// XTENSA: #define __GCC_ATOMIC_BOOL_LOCK_FREE 2
+// XTENSA: #define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
+// XTENSA: #define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
+// XTENSA: #define __GCC_ATOMIC_CHAR_LOCK_FREE 2
+// XTENSA: #define __GCC_ATOMIC_INT_LOCK_FREE 2
+// XTENSA: #define __GCC_ATOMIC_LLONG_LOCK_FREE 1
+// XTENSA: #define __GCC_ATOMIC_LONG_LOCK_FREE 2
+// XTENSA: #define __GCC_ATOMIC_POINTER_LOCK_FREE 2
+// XTENSA: #define __GCC_ATOMIC_SHORT_LOCK_FREE 2
+// XTENSA: #define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
+// XTENSA: #define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
+// XTENSA: #define __GCC_CONSTRUCTIVE_SIZE 64
+// XTENSA: #define __GCC_DESTRUCTIVE_SIZE 64
+// XTENSA: #define __GNUC_MINOR__ {{.*}}
+// XTENSA: #define __GNUC_PATCHLEVEL__ {{.*}}
+// XTENSA: #define __GNUC_STDC_INLINE__ 1
+// XTENSA: #define __GNUC__ {{.*}}
+// XTENSA: #define __GXX_ABI_VERSION {{.*}}
+// XTENSA: #define __ILP32__ 1
+// XTENSA: #define __INT16_C_SUFFIX__ 
+// XTENSA: #define __INT16_MAX__ 32767
+// XTENSA: #define __INT16_TYPE__ short
+// XTENSA: #define __INT32_C_SUFFIX__ 
+// XTENSA: #define __INT32_MAX__ 2147483647
+// XTENSA: #define __INT32_TYPE__ int
+// XTENSA: #define __INT64_C_SUFFIX__ LL
+// XTENSA: #define __INT64_MAX__ 9223372036854775807LL
+// XTENSA: #define __INT64_TYPE__ long long int
+// XTENSA: #define __INT8_C_SUFFIX__ 
+// XTENSA: #define __INT8_MAX__ 127
+// XTENSA: #define __INT8_TYPE__ signed char
+// XTENSA: #define __INTMAX_C_SUFFIX__ LL
+// XTENSA: #define __INTMAX_MAX__ 9223372036854775807LL
+// XTENSA: #define __INTMAX_TYPE__ long long int
+// XTENSA: #define __INTMAX_WIDTH__ 64
+// XTENSA: #define __INTPTR_MAX__ 2147483647
+// XTENSA: #define __INTPTR_TYPE__ int
+// XTENSA: #define __INTPTR_WIDTH__ 32
+// TODO: Xtensa GCC defines INT_FAST16 as int
+// XTENSA: #define __INT_FAST16_MAX__ 32767
+// XTENSA: #define __INT_FAST16_TYPE__ short
+// XTENSA: #define __INT_FAST16_WIDTH__ 16
+// XTENSA: #define __INT_FAST32_MAX__ 2147483647
+// XTENSA: #define __INT_FAST32_TYPE__ int
+// XTENSA: #define __INT_FAST32_WIDTH__ 32
+// XTENSA: #define __INT_FAST64_MAX__ 9223372036854775807LL
+// XTENSA: #define __INT_FAST64_TYPE__ long long int
+// XTENSA: #define __INT_FAST64_WIDTH__ 64
+// TODO: Xtensa GCC defines INT_FAST8 as int
+// XTENSA: #define __INT_FAST8_MAX__ 127
+// XTENSA: #define __INT_FAST8_TYPE__ signed char
+// XTENSA: #define __INT_FAST8_WIDTH__ 8
+// XTENSA: #define __INT_LEAST16_MAX__ 32767
+// XTENSA: #define __INT_LEAST16_TYPE__ short
+// XTENSA: #define __INT_LEAST16_WIDTH__ 16
+// XTENSA: #define __INT_LEAST32_MAX__ 2147483647
+// XTENSA: #define __INT_LEAST32_TYPE__ int
+// XTENSA: #define __INT_LEAST32_WIDTH__ 32
+// XTENSA: #define __INT_LEAST64_MAX__ 9223372036854775807LL
+// XTENSA: #define __INT_LEAST64_TYPE__ long long int
+// XTENSA: #define __INT_LEAST64_WIDTH__ 64
+// XTENSA: #define __INT_LEAST8_MAX__ 127
+// XTENSA: #define __INT_LEAST8_TYPE__ signed char
+// XTENSA: #define __INT_LEAST8_WIDTH__ 8
+// XTENSA: #define __INT_MAX__ 2147483647
+// XTENSA: #define __INT_WIDTH__ 32
+// XTENSA: #define __LDBL_DECIMAL_DIG__ 17
+// XTENSA: #define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
+// XTENSA: #define __LDBL_DIG__ 15
+// XTENSA: #define __LDBL_EPSILON__ 2.2204460492503131e-16L
+// XTENSA: #define __LDBL_HAS_DENORM__ 1
+// XTENSA: #define __LDBL_HAS_INFINITY__ 1
+// XTENSA: #define __LDBL_HAS_QUIET_NAN__ 1
+// XTENSA: #define __LDBL_MANT_DIG__ 53
+// XTENSA: #define __LDBL_MAX_10_EXP__ 308
+// XTENSA: #define __LDBL_MAX_EXP__ 1024
+// XTENSA: #define __LDBL_MAX__ 1.7976931348623157e+308L
+// XTENSA: #define __LDBL_MIN_10_EXP__ (-307)
+// XTENSA: #define __LDBL_MIN_EXP__ (-1021)
+// XTENSA: #define __LDBL_MIN__ 2.2250738585072014e-308L
+// XTENSA: #define __LDBL_NORM_MAX__ 1.7976931348623157e+308L
+// XTENSA: #define __LITTLE_ENDIAN__ 1
+// XTENSA: #define __LLONG_WIDTH__ 64
+// XTENSA: #define __LONG_LONG_MAX__ 9223372036854775807LL
+// XTENSA: #define __LONG_MAX__ 2147483647L
+// XTENSA: #define __LONG_WIDTH__ 32
+// XTENSA: #define __MEMORY_SCOPE_DEVICE 1
+// XTENSA: #define __MEMORY_SCOPE_SINGLE 4
+// XTENSA: #define __MEMORY_SCOPE_SYSTEM 0
+// XTENSA: #define __MEMORY_SCOPE_WRKGRP 2
+// XTENSA: #define __MEMORY_SCOPE_WVFRNT 3
+// XTENSA: #define __NO_INLINE__ 1
+// XTENSA: #define __NO_MATH_ERRNO__ 1
+// XTENSA: #define __OBJC_BOOL_IS_BOOL 0
+// XTENSA: #define __POINTER_WIDTH__ 32
+// XTENSA: #define __PRAGMA_REDEFINE_EXTNAME 1
+// XTENSA: #define __PTRDIFF_MAX__ 2147483647
+// XTENSA: #define __PTRDIFF_TYPE__ int
+// XTENSA: #define __PTRDIFF_WIDTH__ 32
+// XTENSA: #define __SCHAR_MAX__ 127
+// XTENSA: #define __SHRT_MAX__ 32767
+// XTENSA: #define __SHRT_WIDTH__ 16
+// XTENSA: #define __SIG_ATOMIC_MAX__ 2147483647
+// XTENSA: #define __SIG_ATOMIC_WIDTH__ 32
+// XTENSA: #define __SIZEOF_DOUBLE__ 8
+// XTENSA: #define __SIZEOF_FLOAT__ 4
+// XTENSA: #define __SIZEOF_INT__ 4
+// XTENSA: #define __SIZEOF_LONG_DOUBLE__ 8
+// XTENSA: #define __SIZEOF_LONG_LONG__ 8
+// XTENSA: #define __SIZEOF_LONG__ 4
+// XTENSA: #define __SIZEOF_POINTER__ 4
+// XTENSA: #define __SIZEOF_PTRDIFF_T__ 4
+// XTENSA: #define __SIZEOF_SHORT__ 2
+// XTENSA: #define __SIZEOF_SIZE_T__ 4
+// XTENSA: #define __SIZEOF_WCHAR_T__ 4
+// XTENSA: #define __SIZEOF_WINT_T__ 4
+// XTENSA: #define __SIZE_MAX__ 4294967295U
+// XTENSA: #define __SIZE_TYPE__ unsigned int
+// XTENSA: #define __SIZE_WIDTH__ 32
+// XTENSA: #define __STDC_EMBED_EMPTY__ 2
+// XTENSA: #define __STDC_EMBED_FOUND__ 1
+// XTENSA: #define __STDC_EMBED_NOT_FOUND__ 0
+// XTENSA: #define __STDC_HOSTED__ 0
+// XTENSA: #define __STDC_UTF_16__ 1
+// XTENSA: #define __STDC_UTF_32__ 1
+// XTENSA: #define __STDC_VERSION__ 201710L
+// XTENSA: #define __STDC__ 1
+// XTENSA: #define __UINT16_C_SUFFIX__ 
+// XTENSA: #define __UINT16_MAX__ 65535
+// XTENSA: #define __UINT16_TYPE__ unsigned short
+// XTENSA: #define __UINT32_C_SUFFIX__ U
+// XTENSA: #define __UINT32_MAX__ 4294967295U
+// XTENSA: #define __UINT32_TYPE__ unsigned int
+// XTENSA: #define __UINT64_C_SUFFIX__ ULL
+// XTENSA: #define __UINT64_MAX__ 18446744073709551615ULL
+// XTENSA: #define __UINT64_TYPE__ long long unsigned int
+// XTENSA: #define __UINT8_C_SUFFIX__ 
+// XTENSA: #define __UINT8_MAX__ 255
+// XTENSA: #define __UINT8_TYPE__ unsigned char
+// XTENSA: #define __UINTMAX_C_SUFFIX__ ULL
+// XTENSA: #define __UINTMAX_MAX__ 18446744073709551615ULL
+// XTENSA: #define __UINTMAX_TYPE__ long long unsigned int
+// XTENSA: #define __UINTMAX_WIDTH__ 64
+// XTENSA: #define __UINTPTR_MAX__ 4294967295U
+// XTENSA: #define __UINTPTR_TYPE__ unsigned int
+// XTENSA: #define __UINTPTR_WIDTH__ 32
+// XTENSA: #define __UINT_FAST16_MAX__ 65535
+// XTENSA: #define __UINT_FAST16_TYPE__ unsigned short
+// XTENSA: #define __UINT_FAST32_MAX__ 4294967295U
+// XTENSA: #define __UINT_FAST32_TYPE__ unsigned int
+// XTENSA: #define __UINT_FAST64_MAX__ 18446744073709551615ULL
+// XTENSA: #define __UINT_FAST64_TYPE__ long long unsigned int
+// XTENSA: #define __UINT_FAST8_MAX__ 255
+// XTENSA: #define __UINT_FAST8_TYPE__ unsigned char
+// XTENSA: #define __UINT_LEAST16_MAX__ 65535
+// XTENSA: #define __UINT_LEAST16_TYPE__ unsigned short
+// XTENSA: #define __UINT_LEAST32_MAX__ 4294967295U
+// XTENSA: #define __UINT_LEAST32_TYPE__ unsigned int
+// XTENSA: #define __UINT_LEAST64_MAX__ 18446744073709551615ULL
+// XTENSA: #define __UINT_LEAST64_TYPE__ long long unsigned int
+// XTENSA: #define __UINT_LEAST8_MAX__ 255
+// XTENSA: #define __UINT_LEAST8_TYPE__ unsigned char
+// XTENSA: #define __USER_LABEL_PREFIX__ 
+// XTENSA: #define __WCHAR_MAX__ 2147483647
+// XTENSA: #define __WCHAR_TYPE__ int
+// XTENSA: #define __WCHAR_WIDTH__ 32
+// XTENSA: #define __WINT_MAX__ 4294967295U
+// XTENSA: #define __WINT_TYPE__ unsigned int
+// XTENSA: #define __WINT_UNSIGNED__ 1
+// XTENSA: #define __WINT_WIDTH__ 32
+// XTENSA: #define __XCHAL_HAVE_ABS 1
+// XTENSA: #define __XCHAL_HAVE_ADDX 1
+// XTENSA: #define __XCHAL_HAVE_BE 0
+// XTENSA: #define __XCHAL_HAVE_L32R 1
+// XTENSA: #define __XTENSA_EL__ 1
+// XTENSA: #define __XTENSA__ 1
+// XTENSA: #define __xtensa__ 1
diff --git a/clang/test/Preprocessor/predefined-win-macros.c b/clang/test/Preprocessor/predefined-win-macros.c
index 8e539a2a1faf8..86708e02e8dc0 100644
--- a/clang/test/Preprocessor/predefined-win-macros.c
+++ b/clang/test/Preprocessor/predefined-win-macros.c
@@ -113,6 +113,13 @@
 // CHECK-ARM64EC-WIN: #define _WIN32 1
 // CHECK-ARM64EC-WIN: #define _WIN64 1
 
+// RUN: %clang_cc1 -triple mipsel-windows %s -E -dM -o - \
+// RUN:   | FileCheck -match-full-lines %s --check-prefix=CHECK-MIPSEL-WIN
+
+// CHECK-MIPSEL-WIN: #define _M_MRX000 4000
+// CHECK-MIPSEL-WIN: #define _WIN32 1
+// CHECK-MIPSEL-WIN-NOT: #define _MIPS_ 1
+
 // RUN: %clang_cc1 -triple i686-windows-gnu %s -E -dM -o - \
 // RUN:   | FileCheck -match-full-lines %s --check-prefix=CHECK-X86-MINGW
 
@@ -173,3 +180,12 @@
 // CHECK-ARM64EC-MINGW: #define __arm64ec__ 1
 // CHECK-ARM64EC-MINGW: #define __x86_64 1
 // CHECK-ARM64EC-MINGW: #define __x86_64__ 1
+
+// RUN: %clang_cc1 -triple mipsel-windows-gnu %s -E -dM -o - \
+// RUN:   | FileCheck -match-full-lines %s --check-prefix=CHECK-MIPSEL-MINGW
+
+// CHECK-MIPSEL-MINGW-NOT: #define _M_MRX000 4000
+// CHECK-MIPSEL-MINGW: #define _MIPS_ 1
+// CHECK-MIPSEL-MINGW: #define _WIN32 1
+// CHECK-MIPSEL-MINGW: #define __mips 32
+// CHECK-MIPSEL-MINGW: #define __mips__ 1
diff --git a/clang/test/Preprocessor/stdint.c b/clang/test/Preprocessor/stdint.c
index 7cb33ed54739a..af1d6983fd995 100644
--- a/clang/test/Preprocessor/stdint.c
+++ b/clang/test/Preprocessor/stdint.c
@@ -1498,6 +1498,113 @@
 // XCORE:INTMAX_C_(0) 0LL
 // XCORE:UINTMAX_C_(0) 0ULL
 //
+// RUN: %clang_cc1 -E -ffreestanding -triple=xtensa %s | FileCheck -check-prefix XTENSA %s
+//
+// XTENSA:typedef long long int int64_t;
+// XTENSA:typedef long long unsigned int uint64_t;
+// XTENSA:typedef int64_t int_least64_t;
+// XTENSA:typedef uint64_t uint_least64_t;
+// XTENSA:typedef int64_t int_fast64_t;
+// XTENSA:typedef uint64_t uint_fast64_t;
+//
+// XTENSA:typedef int int32_t;
+// XTENSA:typedef unsigned int uint32_t;
+// XTENSA:typedef int32_t int_least32_t;
+// XTENSA:typedef uint32_t uint_least32_t;
+// XTENSA:typedef int32_t int_fast32_t;
+// XTENSA:typedef uint32_t uint_fast32_t;
+//
+// XTENSA:typedef short int16_t;
+// XTENSA:typedef unsigned short uint16_t;
+// XTENSA:typedef int16_t int_least16_t;
+// XTENSA:typedef uint16_t uint_least16_t;
+// XTENSA:typedef int16_t int_fast16_t;
+// XTENSA:typedef uint16_t uint_fast16_t;
+//
+// XTENSA:typedef signed char int8_t;
+// XTENSA:typedef unsigned char uint8_t;
+// XTENSA:typedef int8_t int_least8_t;
+// XTENSA:typedef uint8_t uint_least8_t;
+// XTENSA:typedef int8_t int_fast8_t;
+// XTENSA:typedef uint8_t uint_fast8_t;
+//
+// XTENSA:typedef int intptr_t;
+// XTENSA:typedef unsigned int uintptr_t;
+//
+// XTENSA:typedef long long int intmax_t;
+// XTENSA:typedef long long unsigned int uintmax_t;
+//
+// XTENSA:INT8_MAX_ 127
+// XTENSA:INT8_MIN_ (-127 -1)
+// XTENSA:UINT8_MAX_ 255
+// XTENSA:INT_LEAST8_MIN_ (-127 -1)
+// XTENSA:INT_LEAST8_MAX_ 127
+// XTENSA:UINT_LEAST8_MAX_ 255
+// XTENSA:INT_FAST8_MIN_ (-127 -1)
+// XTENSA:INT_FAST8_MAX_ 127
+// XTENSA:UINT_FAST8_MAX_ 255
+//
+// XTENSA:INT16_MAX_ 32767
+// XTENSA:INT16_MIN_ (-32767 -1)
+// XTENSA:UINT16_MAX_ 65535
+// XTENSA:INT_LEAST16_MIN_ (-32767 -1)
+// XTENSA:INT_LEAST16_MAX_ 32767
+// XTENSA:UINT_LEAST16_MAX_ 65535
+// XTENSA:INT_FAST16_MIN_ (-32767 -1)
+// XTENSA:INT_FAST16_MAX_ 32767
+// XTENSA:UINT_FAST16_MAX_ 65535
+//
+// XTENSA:INT32_MAX_ 2147483647
+// XTENSA:INT32_MIN_ (-2147483647 -1)
+// XTENSA:UINT32_MAX_ 4294967295U
+// XTENSA:INT_LEAST32_MIN_ (-2147483647 -1)
+// XTENSA:INT_LEAST32_MAX_ 2147483647
+// XTENSA:UINT_LEAST32_MAX_ 4294967295U
+// XTENSA:INT_FAST32_MIN_ (-2147483647 -1)
+// XTENSA:INT_FAST32_MAX_ 2147483647
+// XTENSA:UINT_FAST32_MAX_ 4294967295U
+//
+// XTENSA:INT64_MAX_ 9223372036854775807LL
+// XTENSA:INT64_MIN_ (-9223372036854775807LL -1)
+// XTENSA:UINT64_MAX_ 18446744073709551615ULL
+// XTENSA:INT_LEAST64_MIN_ (-9223372036854775807LL -1)
+// XTENSA:INT_LEAST64_MAX_ 9223372036854775807LL
+// XTENSA:UINT_LEAST64_MAX_ 18446744073709551615ULL
+// XTENSA:INT_FAST64_MIN_ (-9223372036854775807LL -1)
+// XTENSA:INT_FAST64_MAX_ 9223372036854775807LL
+// XTENSA:UINT_FAST64_MAX_ 18446744073709551615ULL
+//
+// XTENSA:INTPTR_MIN_ (-2147483647 -1)
+// XTENSA:INTPTR_MAX_ 2147483647
+// XTENSA:UINTPTR_MAX_ 4294967295U
+// XTENSA:PTRDIFF_MIN_ (-2147483647 -1)
+// XTENSA:PTRDIFF_MAX_ 2147483647
+// XTENSA:SIZE_MAX_ 4294967295U
+//
+// XTENSA:INTMAX_MIN_ (-9223372036854775807LL -1)
+// XTENSA:INTMAX_MAX_ 9223372036854775807LL
+// XTENSA:UINTMAX_MAX_ 18446744073709551615ULL
+//
+// XTENSA:SIG_ATOMIC_MIN_ (-2147483647 -1)
+// XTENSA:SIG_ATOMIC_MAX_ 2147483647
+// XTENSA:WINT_MIN_ 0U
+// XTENSA:WINT_MAX_ 4294967295U
+//
+// XTENSA:WCHAR_MAX_ 2147483647
+// XTENSA:WCHAR_MIN_ (-2147483647 -1)
+//
+// XTENSA:INT8_C_(0) 0
+// XTENSA:UINT8_C_(0) 0U
+// XTENSA:INT16_C_(0) 0
+// XTENSA:UINT16_C_(0) 0U
+// XTENSA:INT32_C_(0) 0
+// XTENSA:UINT32_C_(0) 0U
+// XTENSA:INT64_C_(0) 0LL
+// XTENSA:UINT64_C_(0) 0ULL
+//
+// XTENSA:INTMAX_C_(0) 0LL
+// XTENSA:UINTMAX_C_(0) 0ULL
+//
 //
 // stdint.h forms several macro definitions by pasting together identifiers
 // to form names (eg. int32_t is formed from int ## 32 ## _t). The following 
diff --git a/clang/test/Sema/constant_builtins_vector.cpp b/clang/test/Sema/constant_builtins_vector.cpp
index b2f56e5a87ab1..8659fa9e46612 100644
--- a/clang/test/Sema/constant_builtins_vector.cpp
+++ b/clang/test/Sema/constant_builtins_vector.cpp
@@ -798,6 +798,21 @@ static_assert(__builtin_reduce_xor((vector4long){(long long)0x1111111111111111L,
 static_assert(__builtin_reduce_xor((vector4uint){0x11111111U, 0x22222222U, 0x44444444U, 0x88888888U}) == 0xFFFFFFFFU);
 static_assert(__builtin_reduce_xor((vector4ulong){0x1111111111111111UL, 0x2222222222222222UL, 0x4444444444444444UL, 0x8888888888888888UL}) == 0xFFFFFFFFFFFFFFFFUL);
 
+static_assert(__builtin_reduce_min((vector4char){}) == 0);
+static_assert(__builtin_reduce_min((vector4char){(char)0x11, (char)0x22, (char)0x44, (char)0x88}) == (char)0x88);
+static_assert(__builtin_reduce_min((vector4short){(short)0x1111, (short)0x2222, (short)0x4444, (short)0x8888}) == (short)0x8888);
+static_assert(__builtin_reduce_min((vector4int){(int)0x11111111, (int)0x22222222, (int)0x44444444, (int)0x88888888}) == (int)0x88888888);
+static_assert(__builtin_reduce_min((vector4long){(long long)0x1111111111111111L, (long long)0x2222222222222222L, (long long)0x4444444444444444L, (long long)0x8888888888888888L}) == (long long)0x8888888888888888L);
+static_assert(__builtin_reduce_min((vector4uint){0x11111111U, 0x22222222U, 0x44444444U, 0x88888888U}) == 0x11111111U);
+static_assert(__builtin_reduce_min((vector4ulong){0x1111111111111111UL, 0x2222222222222222UL, 0x4444444444444444UL, 0x8888888888888888UL}) == 0x1111111111111111UL);
+static_assert(__builtin_reduce_max((vector4char){}) == 0);
+static_assert(__builtin_reduce_max((vector4char){(char)0x11, (char)0x22, (char)0x44, (char)0x88}) == (char)0x44);
+static_assert(__builtin_reduce_max((vector4short){(short)0x1111, (short)0x2222, (short)0x4444, (short)0x8888}) == (short)0x4444);
+static_assert(__builtin_reduce_max((vector4int){(int)0x11111111, (int)0x22222222, (int)0x44444444, (int)0x88888888}) == (int)0x44444444);
+static_assert(__builtin_reduce_max((vector4long){(long long)0x1111111111111111L, (long long)0x2222222222222222L, (long long)0x4444444444444444L, (long long)0x8888888888888888L}) == (long long)0x4444444444444444L);
+static_assert(__builtin_reduce_max((vector4uint){0x11111111U, 0x22222222U, 0x44444444U, 0x88888888U}) == 0x88888888U);
+static_assert(__builtin_reduce_max((vector4ulong){0x1111111111111111UL, 0x2222222222222222UL, 0x4444444444444444UL, 0x8888888888888888UL}) == 0x8888888888888888UL);
+
 static_assert(__builtin_bit_cast(unsigned, __builtin_elementwise_popcount((vector4char){1, 2, 3, 4})) == (LITTLE_END ? 0x01020101 : 0x01010201));
 static_assert(__builtin_bit_cast(unsigned long long, __builtin_elementwise_popcount((vector4short){0, 0x0F0F, ~0, ~0x0F0F})) == (LITTLE_END ? 0x0008001000080000 : 0x0000000800100008));
 static_assert(__builtin_reduce_add(__builtin_elementwise_popcount((vector4int){1, 2, 3, 4})) == 5);
diff --git a/clang/test/SemaCXX/cxx20-decomposition.cpp b/clang/test/SemaCXX/cxx20-decomposition.cpp
index 430a158ff458e..ccc1af5898059 100644
--- a/clang/test/SemaCXX/cxx20-decomposition.cpp
+++ b/clang/test/SemaCXX/cxx20-decomposition.cpp
@@ -183,3 +183,26 @@ namespace ODRUseTests {
     }(0); }(0); // expected-note 2{{in instantiation}}
   }
 }
+
+
+namespace GH95081 {
+    void prevent_assignment_check() {
+        int arr[] = {1,2};
+        auto [e1, e2] = arr;
+
+        auto lambda = [e1] {
+            e1 = 42;  // expected-error {{cannot assign to a variable captured by copy in a non-mutable lambda}}
+        };
+    }
+
+    void f(int&) = delete;
+    void f(const int&);
+
+    int arr[1];
+    void foo() {
+        auto [x] = arr;
+        [x]() {
+            f(x); // deleted f(int&) used to be picked up erroneously
+        } ();
+    }
+}
diff --git a/clang/test/SemaCXX/cxx2c-pack-indexing.cpp b/clang/test/SemaCXX/cxx2c-pack-indexing.cpp
index cb679a6c3ad87..58b642d2735b6 100644
--- a/clang/test/SemaCXX/cxx2c-pack-indexing.cpp
+++ b/clang/test/SemaCXX/cxx2c-pack-indexing.cpp
@@ -305,3 +305,19 @@ template  struct mdispatch_ {
 mdispatch_ d;
 
 } // namespace GH116105
+
+namespace GH121242 {
+    // Non-dependent type pack access
+    template 
+    int y = x...[0];
+
+    struct X {};
+
+    template 
+    X z = x...[0];
+
+    void foo() {
+        (void)y<0>;
+        (void)z;
+    }
+} // namespace GH121242
diff --git a/clang/test/SemaCXX/warn-thread-safety-analysis.cpp b/clang/test/SemaCXX/warn-thread-safety-analysis.cpp
index 3c52c8165d852..018d6d1bb258b 100644
--- a/clang/test/SemaCXX/warn-thread-safety-analysis.cpp
+++ b/clang/test/SemaCXX/warn-thread-safety-analysis.cpp
@@ -3196,6 +3196,378 @@ void lockUnlock() EXCLUSIVE_LOCKS_REQUIRED(mu) {
 
 } // end namespace ScopedUnlock
 
+namespace PassingScope {
+
+class SCOPED_LOCKABLE RelockableScope {
+public:
+  RelockableScope(Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu);
+  void Release() UNLOCK_FUNCTION();
+  void Acquire() EXCLUSIVE_LOCK_FUNCTION();
+  ~RelockableScope() EXCLUSIVE_UNLOCK_FUNCTION();
+};
+
+class SCOPED_LOCKABLE ReaderRelockableScope {
+public:
+  ReaderRelockableScope(Mutex *mu) SHARED_LOCK_FUNCTION(mu);
+  void Release() UNLOCK_FUNCTION();
+  void Acquire() SHARED_LOCK_FUNCTION();
+  ~ReaderRelockableScope() UNLOCK_FUNCTION();
+};
+
+Mutex mu;
+Mutex mu1;
+Mutex mu2;
+int x GUARDED_BY(mu);
+int y GUARDED_BY(mu) GUARDED_BY(mu2);
+void print(int);
+
+// Analysis inside the function with annotated parameters
+
+void sharedRequired(ReleasableMutexLock& scope SHARED_LOCKS_REQUIRED(mu)) {
+  print(x); // OK.
+}
+
+void sharedAcquire(ReaderRelockableScope& scope SHARED_LOCK_FUNCTION(mu)) {
+  scope.Acquire();
+  print(x);
+}
+
+void sharedRelease(RelockableScope& scope SHARED_UNLOCK_FUNCTION(mu)) {
+  print(x);
+  scope.Release();
+  print(x); // expected-warning{{reading variable 'x' requires holding mutex 'mu'}}
+}
+
+void requiredLock(ReleasableMutexLock& scope EXCLUSIVE_LOCKS_REQUIRED(mu)) {
+  x = 1; // OK.
+}
+
+void reacquireRequiredLock(RelockableScope& scope EXCLUSIVE_LOCKS_REQUIRED(mu)) {
+  scope.Release();
+  scope.Acquire();
+  x = 2; // OK.
+}
+
+void releaseSingleMutex(ReleasableMutexLock& scope EXCLUSIVE_UNLOCK_FUNCTION(mu)) {
+  x = 1; // OK.
+  scope.Release();
+  x = 2; // expected-warning{{writing variable 'x' requires holding mutex 'mu' exclusively}}
+}
+
+void releaseMultipleMutexes(ReleasableMutexLock& scope EXCLUSIVE_UNLOCK_FUNCTION(mu, mu2)) {
+  y = 1; // OK.
+  scope.Release();
+  y = 2; // expected-warning{{writing variable 'y' requires holding mutex 'mu' exclusively}}
+         // expected-warning@-1{{writing variable 'y' requires holding mutex 'mu2' exclusively}}
+}
+
+void acquireLock(RelockableScope& scope EXCLUSIVE_LOCK_FUNCTION(mu)) {
+  x = 1; // expected-warning{{writing variable 'x' requires holding mutex 'mu' exclusively}}
+  scope.Acquire();
+  x = 2; // OK.
+}
+
+void acquireMultipleLocks(RelockableScope& scope EXCLUSIVE_LOCK_FUNCTION(mu, mu2)) {
+  y = 1; // expected-warning{{writing variable 'y' requires holding mutex 'mu' exclusively}}
+         // expected-warning@-1{{writing variable 'y' requires holding mutex 'mu2' exclusively}}
+  scope.Acquire();
+  y = 2;  // OK.
+}
+
+void excludedLock(ReleasableMutexLock& scope LOCKS_EXCLUDED(mu)) {
+  x = 1; // expected-warning{{writing variable 'x' requires holding mutex 'mu' exclusively}}
+}
+
+void acquireAndReleaseExcludedLocks(RelockableScope& scope LOCKS_EXCLUDED(mu)) {
+  scope.Acquire();
+  scope.Release();
+}
+
+// expected-note@+1{{mutex acquired here}}
+void unreleasedMutex(ReleasableMutexLock& scope EXCLUSIVE_UNLOCK_FUNCTION(mu)) {
+  x = 1; // OK.
+} // expected-warning{{mutex 'mu' is still held at the end of function}}
+
+// expected-note@+1{{mutex acquired here}}
+void acquireAlreadyHeldMutex(RelockableScope& scope EXCLUSIVE_UNLOCK_FUNCTION(mu)) {
+  scope.Acquire(); // expected-warning{{acquiring mutex 'mu' that is already held}}
+  scope.Release();
+}
+
+void reacquireMutex(RelockableScope& scope EXCLUSIVE_UNLOCK_FUNCTION(mu)) {
+  scope.Release();
+  scope.Acquire(); // expected-note{{mutex acquired here}}
+  x = 2; // OK.
+} // expected-warning{{mutex 'mu' is still held at the end of function}}
+
+// expected-note@+1{{mutex acquired here}}
+void requireSingleMutex(ReleasableMutexLock& scope EXCLUSIVE_LOCKS_REQUIRED(mu)) {
+  x = 1; // OK.
+  scope.Release();
+  x = 2; // expected-warning{{writing variable 'x' requires holding mutex 'mu' exclusively}}
+} // expected-warning{{expecting mutex 'mu' to be held at the end of function}}
+
+// expected-note@+1 2{{mutex acquired here}}
+void requireMultipleMutexes(ReleasableMutexLock& scope EXCLUSIVE_LOCKS_REQUIRED(mu, mu2)) {
+  y = 1; // OK.
+  scope.Release();
+  y = 2; // expected-warning{{writing variable 'y' requires holding mutex 'mu' exclusively}}
+         // expected-warning@-1{{writing variable 'y' requires holding mutex 'mu2' exclusively}}
+} // expected-warning{{expecting mutex 'mu' to be held at the end of function}}
+  // expected-warning@-1{{expecting mutex 'mu2' to be held at the end of function}}
+
+// expected-note@+1{{mutex acquired here}}
+void acquireAlreadyHeldLock(RelockableScope& scope EXCLUSIVE_LOCKS_REQUIRED(mu)) {
+  scope.Acquire(); // expected-warning{{acquiring mutex 'mu' that is already held}}
+}
+
+// expected-note@+1 {{mutex acquired here}}
+void releaseWithoutHoldingLock(ReleasableMutexLock& scope EXCLUSIVE_LOCK_FUNCTION(mu)) {
+  scope.Release(); // expected-warning{{releasing mutex 'mu' that was not held}}
+} // expected-warning{{expecting mutex 'mu' to be held at the end of function}}
+
+// expected-note@+1 {{mutex acquired here}}
+void endWithReleasedMutex(RelockableScope& scope EXCLUSIVE_LOCK_FUNCTION(mu)) {
+  scope.Acquire();
+  scope.Release();
+} // expected-warning{{expecting mutex 'mu' to be held at the end of function}}
+
+void acquireExcludedLock(RelockableScope& scope LOCKS_EXCLUDED(mu)) {
+  x = 1; // expected-warning{{writing variable 'x' requires holding mutex 'mu' exclusively}}
+  scope.Acquire(); // expected-note {{mutex acquired here}}
+  x = 2; // OK.
+} // expected-warning{{mutex 'mu' is still held at the end of function}}
+
+void acquireMultipleExcludedLocks(RelockableScope& scope LOCKS_EXCLUDED(mu, mu2)) {
+  y = 1; // expected-warning{{writing variable 'y' requires holding mutex 'mu' exclusively}}
+         // expected-warning@-1{{writing variable 'y' requires holding mutex 'mu2' exclusively}}
+  scope.Acquire(); // expected-note 2{{mutex acquired here}}
+  y = 2; // OK.
+} // expected-warning{{mutex 'mu' is still held at the end of function}}
+  // expected-warning@-1{{mutex 'mu2' is still held at the end of function}}
+
+void reacquireExcludedLocks(RelockableScope& scope LOCKS_EXCLUDED(mu)) {
+  scope.Release(); // expected-warning{{releasing mutex 'mu' that was not held}}
+  scope.Acquire(); // expected-note {{mutex acquired here}}
+  x = 2; // OK.
+} // expected-warning{{mutex 'mu' is still held at the end of function}}
+
+// expected-note@+1{{mutex acquired here}}
+void sharedRequired2(ReleasableMutexLock& scope SHARED_LOCKS_REQUIRED(mu)) {
+  print(x); // OK.
+  scope.Release();
+  print(x); // expected-warning{{reading variable 'x' requires holding mutex 'mu'}}
+} // expected-warning{{expecting mutex 'mu' to be held at the end of function}}
+
+// expected-note@+1{{mutex acquired here}}
+void sharedAcquire2(RelockableScope& scope SHARED_LOCK_FUNCTION(mu)) {
+  print(x); // expected-warning{{reading variable 'x' requires holding mutex 'mu'}}
+  scope.Release(); // expected-warning{{releasing mutex 'mu' that was not held}}
+} // expected-warning{{expecting mutex 'mu' to be held at the end of function}}
+
+// expected-note@+1 2{{mutex acquired here}}
+void sharedRelease2(RelockableScope& scope SHARED_UNLOCK_FUNCTION(mu)) {
+  scope.Acquire(); //expected-warning{{acquiring mutex 'mu' that is already held}}
+} //expected-warning{{mutex 'mu' is still held at the end of function}}
+
+// Handling the call of the function with annotated parameters
+
+// expected-note@+1{{see attribute on parameter here}}
+void release(ReleasableMutexLock& scope EXCLUSIVE_UNLOCK_FUNCTION(mu));
+// expected-note@+1{{see attribute on parameter here}}
+void release_DoubleMutexLock(DoubleMutexLock& scope EXCLUSIVE_UNLOCK_FUNCTION(mu));
+// expected-note@+1 2{{see attribute on parameter here}}
+void release_two(ReleasableMutexLock& scope EXCLUSIVE_UNLOCK_FUNCTION(mu, mu2));
+// expected-note@+1{{see attribute on parameter here}}
+void release_double(DoubleMutexLock& scope EXCLUSIVE_UNLOCK_FUNCTION(mu, mu2));
+void require(ReleasableMutexLock& scope EXCLUSIVE_LOCKS_REQUIRED(mu));
+void acquire(RelockableScope& scope EXCLUSIVE_LOCK_FUNCTION(mu));
+void exclude(RelockableScope& scope LOCKS_EXCLUDED(mu));
+
+void release_shared(ReaderRelockableScope& scope SHARED_UNLOCK_FUNCTION(mu));
+void require_shared(ReleasableMutexLock& scope SHARED_LOCKS_REQUIRED(mu));
+void acquire_shared(ReaderRelockableScope& scope SHARED_LOCK_FUNCTION(mu));
+
+void unlockCall() {
+  ReleasableMutexLock scope(&mu);
+  x = 1; // OK.
+  release(scope);
+  x = 2; // expected-warning{{writing variable 'x' requires holding mutex 'mu' exclusively}}
+}
+
+void unlockSharedCall() {
+  ReaderRelockableScope scope(&mu);
+  print(x); // OK.
+  release_shared(scope);
+  print(x); // expected-warning{{reading variable 'x' requires holding mutex 'mu'}}
+}
+
+void requireCall() {
+  ReleasableMutexLock scope(&mu);
+  x = 1; // OK.
+  require(scope);
+  x = 2; // Ok.
+}
+
+void requireSharedCall() {
+  ReleasableMutexLock scope(&mu);
+  print(x); // OK.
+  require_shared(scope);
+  print(x); // Ok.
+}
+
+void acquireCall() {
+  RelockableScope scope(&mu);
+  scope.Release();
+  acquire(scope);
+  x = 2; // Ok.
+}
+
+void acquireSharedCall() {
+  ReaderRelockableScope scope(&mu);
+  scope.Release();
+  acquire_shared(scope);
+  print(x); // Ok.
+}
+
+void writeAfterExcludeCall() {
+  RelockableScope scope(&mu);
+  scope.Release();
+  exclude(scope);
+  x = 2; // expected-warning{{writing variable 'x' requires holding mutex 'mu' exclusively}}
+}
+
+void unlockCallAfterExplicitRelease() {
+  ReleasableMutexLock scope(&mu);
+  x = 1; // OK.
+  scope.Release(); // expected-note{{mutex released here}}
+  release(scope); // expected-warning{{releasing mutex 'mu' that was not held}}
+  x = 2; // expected-warning{{writing variable 'x' requires holding mutex 'mu' exclusively}}
+}
+
+void unmatchedMutexes() {
+  ReleasableMutexLock scope(&mu2);
+  release(scope); // expected-warning{{mutex managed by 'scope' is 'mu2' instead of 'mu'}}
+                  // expected-warning@-1{{releasing mutex 'mu' that was not held}}
+}
+
+void wrongOrder() {
+  DoubleMutexLock scope(&mu2, &mu);
+  release_double(scope); // expected-warning{{mutex managed by 'scope' is 'mu2' instead of 'mu'}}
+}
+
+void differentNumberOfMutexes() {
+  ReleasableMutexLock scope(&mu);
+  release_two(scope); // expected-warning{{mutex 'mu2' not managed by 'scope'}}
+                      // expected-warning@-1{{releasing mutex 'mu2' that was not held}}
+}
+
+void differentNumberOfMutexes2() {
+  ReleasableMutexLock scope(&mu2);
+  release_two(scope); // expected-warning{{mutex managed by 'scope' is 'mu2' instead of 'mu'}}
+                      // expected-warning@-1{{releasing mutex 'mu' that was not held}}
+}
+
+void differentNumberOfMutexes3() {
+  DoubleMutexLock scope(&mu, &mu2);
+  release_DoubleMutexLock(scope); // expected-warning{{did not expect mutex 'mu2' to be managed by 'scope'}}
+}
+
+void releaseDefault(ReleasableMutexLock& scope EXCLUSIVE_UNLOCK_FUNCTION(mu), int = 0);
+
+void unlockFunctionDefault() {
+  ReleasableMutexLock scope(&mu);
+  x = 1; // OK.
+  releaseDefault(scope);
+  x = 2; // expected-warning{{writing variable 'x' requires holding mutex 'mu' exclusively}}
+}
+
+void requireCallWithReleasedLock() {
+  ReleasableMutexLock scope(&mu);
+  scope.Release();
+  require(scope);  // expected-warning{{calling function 'require' requires holding mutex 'mu' exclusively}}
+}
+
+void acquireCallWithAlreadyHeldLock() {
+  RelockableScope scope(&mu); // expected-note{{mutex acquired here}}
+  acquire(scope); // expected-warning{{acquiring mutex 'mu' that is already held}}
+  x = 1;
+}
+
+void excludeCallWithAlreadyHeldLock() {
+  RelockableScope scope(&mu);
+  exclude(scope); // expected-warning{{cannot call function 'exclude' while mutex 'mu' is held}}
+  x = 2; // OK.
+}
+
+void requireConst(const ReleasableMutexLock& scope EXCLUSIVE_LOCKS_REQUIRED(mu));
+void requireConstCall() {
+  requireConst(ReleasableMutexLock(&mu));
+}
+
+void passScopeUndeclared(ReleasableMutexLock &scope) {
+  release(scope); // expected-warning{{calling function 'release' requires holding mutex 'scope' exclusively}}
+                  // expected-warning@-1{{releasing mutex 'mu' that was not held}}
+}
+
+class SCOPED_LOCKABLE ScopedWithoutLock {
+public:
+  ScopedWithoutLock();
+
+  ~ScopedWithoutLock() EXCLUSIVE_UNLOCK_FUNCTION();
+};
+
+void require(ScopedWithoutLock &scope EXCLUSIVE_LOCKS_REQUIRED(mu));
+
+void constructWithoutLock() {
+  ScopedWithoutLock scope;
+  require(scope); // expected-warning{{calling function 'require' requires holding mutex 'mu' exclusively}}
+                  // expected-warning@-1{{calling function 'require' requires holding mutex 'scope' exclusively}}
+} // expected-warning {{releasing mutex 'scope' that was not held}}
+
+void requireConst(const ScopedWithoutLock& scope EXCLUSIVE_LOCKS_REQUIRED(mu));
+
+void requireCallWithReleasedLock2() {
+  requireConst(ScopedWithoutLock());
+  // expected-warning@-1{{calling function 'requireConst' requires holding mutex '#undefined' exclusively}}
+  // expected-warning@-2{{calling function 'requireConst' requires holding mutex 'mu' exclusively}}
+}
+
+void requireDecl(RelockableScope &scope EXCLUSIVE_LOCKS_REQUIRED(mu));
+void requireDecl(RelockableScope &scope) {
+  scope.Release();
+  scope.Acquire();
+}
+
+struct foo
+{
+  Mutex mu;
+  // expected-note@+1{{see attribute on parameter here}}
+  void require(RelockableScope &scope EXCLUSIVE_LOCKS_REQUIRED(mu));
+  void callRequire(){
+    RelockableScope scope(&mu);
+    // TODO: False positive due to incorrect parsing of parameter attribute arguments.
+    require(scope);
+    // expected-warning@-1{{calling function 'require' requires holding mutex 'mu' exclusively}}
+    // expected-warning@-2{{mutex managed by 'scope' is 'mu' instead of 'mu'}}
+  }
+};
+
+struct ObjectWithMutex {
+  Mutex mu;
+  int x GUARDED_BY(mu);
+};
+void releaseMember(ObjectWithMutex& object, ReleasableMutexLock& scope EXCLUSIVE_UNLOCK_FUNCTION(object.mu)) {
+  object.x = 1;
+  scope.Release();
+}
+void releaseMemberCall() {
+  ObjectWithMutex obj;
+  ReleasableMutexLock lock(&obj.mu);
+  releaseMember(obj, lock);
+}
+
+} // end namespace PassingScope
 
 namespace TrylockFunctionTest {
 
diff --git a/clang/test/SemaCXX/warn-thread-safety-parsing.cpp b/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
index 0c5b0cc85897b..752803e4a0543 100644
--- a/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
+++ b/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
@@ -62,6 +62,12 @@ class MuDoubleWrapper {
   }
 };
 
+class SCOPED_LOCKABLE MutexLock {
+ public:
+  MutexLock(Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu);
+  ~MutexLock() UNLOCK_FUNCTION();
+};
+
 Mutex mu1;
 UnlockableMu umu;
 Mutex mu2;
@@ -599,8 +605,11 @@ class EXCLUSIVE_LOCK_FUNCTION() ElfTestClass { // \
   // expected-warning {{'exclusive_lock_function' attribute only applies to functions}}
 };
 
-void elf_fun_params(int lvar EXCLUSIVE_LOCK_FUNCTION()); // \
-  // expected-warning {{'exclusive_lock_function' attribute only applies to functions}}
+void elf_fun_params1(MutexLock& scope EXCLUSIVE_LOCK_FUNCTION(mu1));
+void elf_fun_params2(int lvar EXCLUSIVE_LOCK_FUNCTION(mu1)); // \
+  // expected-warning{{'exclusive_lock_function' attribute applies to function parameters only if their type is a reference to a 'scoped_lockable'-annotated type}}
+void elf_fun_params3(MutexLock& scope EXCLUSIVE_LOCK_FUNCTION()); // \
+  // expected-warning{{'exclusive_lock_function' attribute without capability arguments can only be applied to non-static methods of a class}}
 
 // Check argument parsing.
 
@@ -660,8 +669,11 @@ int slf_testfn(int y) {
 int slf_test_var SHARED_LOCK_FUNCTION(); // \
   // expected-warning {{'shared_lock_function' attribute only applies to functions}}
 
-void slf_fun_params(int lvar SHARED_LOCK_FUNCTION()); // \
-  // expected-warning {{'shared_lock_function' attribute only applies to functions}}
+void slf_fun_params1(MutexLock& scope SHARED_LOCK_FUNCTION(mu1));
+void slf_fun_params2(int lvar SHARED_LOCK_FUNCTION(mu1)); // \
+  // expected-warning {{'shared_lock_function' attribute applies to function parameters only if their type is a reference to a 'scoped_lockable'-annotated type}}
+void slf_fun_params3(MutexLock& scope SHARED_LOCK_FUNCTION()); // \
+  // expected-warning {{'shared_lock_function' attribute without capability arguments can only be applied to non-static methods of a class}}
 
 class SlfFoo {
  private:
@@ -903,8 +915,11 @@ class NO_THREAD_SAFETY_ANALYSIS UfTestClass { // \
   // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions}}
 };
 
-void uf_fun_params(int lvar UNLOCK_FUNCTION()); // \
-  // expected-warning {{'unlock_function' attribute only applies to functions}}
+void uf_fun_params1(MutexLock& scope UNLOCK_FUNCTION(mu1));
+void uf_fun_params2(int lvar UNLOCK_FUNCTION(mu1)); // \
+  // expected-warning {{'unlock_function' attribute applies to function parameters only if their type is a reference to a 'scoped_lockable'-annotated type}}
+void uf_fun_params3(MutexLock& scope UNLOCK_FUNCTION()); // \
+  // expected-warning {{'unlock_function' attribute without capability arguments can only be applied to non-static methods of a class}}
 
 // Check argument parsing.
 
@@ -1035,8 +1050,9 @@ int le_testfn(int y) {
 int le_test_var LOCKS_EXCLUDED(mu1); // \
   // expected-warning {{'locks_excluded' attribute only applies to functions}}
 
-void le_fun_params(int lvar LOCKS_EXCLUDED(mu1)); // \
-  // expected-warning {{'locks_excluded' attribute only applies to functions}}
+void le_fun_params1(MutexLock& scope LOCKS_EXCLUDED(mu1));
+void le_fun_params2(int lvar LOCKS_EXCLUDED(mu1)); // \
+  // expected-warning{{'locks_excluded' attribute applies to function parameters only if their type is a reference to a 'scoped_lockable'-annotated type}}
 
 class LeFoo {
  private:
@@ -1102,8 +1118,9 @@ int elr_testfn(int y) {
 int elr_test_var EXCLUSIVE_LOCKS_REQUIRED(mu1); // \
   // expected-warning {{'exclusive_locks_required' attribute only applies to functions}}
 
-void elr_fun_params(int lvar EXCLUSIVE_LOCKS_REQUIRED(mu1)); // \
-  // expected-warning {{'exclusive_locks_required' attribute only applies to functions}}
+void elr_fun_params1(MutexLock& scope EXCLUSIVE_LOCKS_REQUIRED(mu1));
+void elr_fun_params2(int lvar EXCLUSIVE_LOCKS_REQUIRED(mu1)); // \
+  // expected-warning {{'exclusive_locks_required' attribute applies to function parameters only if their type is a reference to a 'scoped_lockable'-annotated type}}
 
 class ElrFoo {
  private:
@@ -1170,8 +1187,9 @@ int slr_testfn(int y) {
 int slr_test_var SHARED_LOCKS_REQUIRED(mu1); // \
   // expected-warning {{'shared_locks_required' attribute only applies to functions}}
 
-void slr_fun_params(int lvar SHARED_LOCKS_REQUIRED(mu1)); // \
-  // expected-warning {{'shared_locks_required' attribute only applies to functions}}
+void slr_fun_params1(MutexLock& scope SHARED_LOCKS_REQUIRED(mu1));
+void slr_fun_params2(int lvar SHARED_LOCKS_REQUIRED(mu1)); // \
+  // expected-warning {{'shared_locks_required' attribute applies to function parameters only if their type is a reference to a 'scoped_lockable'-annotated type}}
 
 class SlrFoo {
  private:
diff --git a/clang/test/VFS/external-names.c b/clang/test/VFS/external-names.c
index 5b7c443b36e56..dd0b5eb501840 100644
--- a/clang/test/VFS/external-names.c
+++ b/clang/test/VFS/external-names.c
@@ -47,4 +47,4 @@
 
 // RUN: %clang_cc1 -D REINCLUDE -I %t -ivfsoverlay %t.yaml -Eonly %s -MTfoo -dependency-file %t.dep
 // RUN: cat %t.dep | FileCheck --check-prefix=CHECK-DEP %s
-// CHECK-DEP-NOT: Inputs
+// CHECK-DEP: Inputs{{..?}}external-names.h
diff --git a/clang/tools/include-mapping/cppreference_parser.py b/clang/tools/include-mapping/cppreference_parser.py
index 9101f3dbff0f9..f7da2ba8bb6d8 100644
--- a/clang/tools/include-mapping/cppreference_parser.py
+++ b/clang/tools/include-mapping/cppreference_parser.py
@@ -139,7 +139,7 @@ def _ParseIndexPage(index_page_html):
 
 
 def _ReadSymbolPage(path, name, qual_name):
-    with open(path) as f:
+    with open(path, encoding="utf-8") as f:
         return _ParseSymbolPage(f.read(), name, qual_name)
 
 
@@ -156,7 +156,7 @@ def _GetSymbols(pool, root_dir, index_page_name, namespace, variants_to_accept):
     #      contains the defined header.
     #   2. Parse the symbol page to get the defined header.
     index_page_path = os.path.join(root_dir, index_page_name)
-    with open(index_page_path, "r") as f:
+    with open(index_page_path, "r", encoding="utf-8") as f:
         # Read each symbol page in parallel.
         results = []  # (symbol_name, promise of [header...])
         for symbol_name, symbol_page_path, variant in _ParseIndexPage(f.read()):
diff --git a/clang/unittests/AST/ASTImporterTest.cpp b/clang/unittests/AST/ASTImporterTest.cpp
index f3f314b723dfc..ee1d896f1ca6d 100644
--- a/clang/unittests/AST/ASTImporterTest.cpp
+++ b/clang/unittests/AST/ASTImporterTest.cpp
@@ -3172,9 +3172,6 @@ TEST_P(ImportDecl, ImportFieldOrder) {
              recordDecl(hasFieldOrder({"b", "a"})));
 }
 
-const internal::VariadicDynCastAllOfMatcher
-    dependentScopeDeclRefExpr;
-
 TEST_P(ImportExpr, DependentScopeDeclRefExpr) {
   MatchVerifier Verifier;
   testImport("template  struct S { static T foo; };"
@@ -3199,9 +3196,6 @@ TEST_P(ImportExpr, DependentScopeDeclRefExpr) {
                  has(callExpr(has(dependentScopeDeclRefExpr())))))))));
 }
 
-const internal::VariadicDynCastAllOfMatcher
-    dependentNameType;
-
 TEST_P(ImportExpr, DependentNameType) {
   MatchVerifier Verifier;
   testImport("template  struct declToImport {"
diff --git a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
index 9bc287e07224a..b8521e2f95768 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
@@ -556,6 +556,21 @@ TEST_P(ASTMatchersTest, DeclRefExpr) {
                          Reference));
 }
 
+TEST_P(ASTMatchersTest, DependentScopeDeclRefExpr) {
+  if (!GetParam().isCXX() || GetParam().hasDelayedTemplateParsing()) {
+    // FIXME: Fix this test to work with delayed template parsing.
+    return;
+  }
+
+  EXPECT_TRUE(matches("template  class X : T { void f() { T::v; } };",
+                      dependentScopeDeclRefExpr()));
+
+  EXPECT_TRUE(
+      matches("template  struct S { static T Foo; };"
+              "template  void declToImport() { (void)S::Foo; }",
+              dependentScopeDeclRefExpr()));
+}
+
 TEST_P(ASTMatchersTest, CXXMemberCallExpr) {
   if (!GetParam().isCXX()) {
     return;
@@ -629,10 +644,8 @@ TEST_P(ASTMatchersTest, MemberExpr_MatchesVariable) {
   EXPECT_TRUE(matches("template "
                       "class X : T { void f() { this->T::v; } };",
                       cxxDependentScopeMemberExpr()));
-  // FIXME: Add a matcher for DependentScopeDeclRefExpr.
-  EXPECT_TRUE(
-      notMatches("template  class X : T { void f() { T::v; } };",
-                 cxxDependentScopeMemberExpr()));
+  EXPECT_TRUE(matches("template  class X : T { void f() { T::v; } };",
+                      dependentScopeDeclRefExpr()));
   EXPECT_TRUE(matches("template  void x() { T t; t.v; }",
                       cxxDependentScopeMemberExpr()));
 }
@@ -1899,6 +1912,20 @@ TEST_P(ASTMatchersTest, DeducedTemplateSpecializationType) {
               deducedTemplateSpecializationType()));
 }
 
+TEST_P(ASTMatchersTest, DependentNameType) {
+  if (!GetParam().isCXX()) {
+    return;
+  }
+
+  EXPECT_TRUE(matches(
+      R"(
+        template  struct declToImport {
+          typedef typename T::type dependent_name;
+        };
+      )",
+      dependentNameType()));
+}
+
 TEST_P(ASTMatchersTest, RecordType) {
   EXPECT_TRUE(matches("struct S {}; struct S s;",
                       recordType(hasDeclaration(recordDecl(hasName("S"))))));
diff --git a/clang/unittests/Format/ConfigParseTest.cpp b/clang/unittests/Format/ConfigParseTest.cpp
index 7fc7492271668..b249bf073aa45 100644
--- a/clang/unittests/Format/ConfigParseTest.cpp
+++ b/clang/unittests/Format/ConfigParseTest.cpp
@@ -159,6 +159,7 @@ TEST(ConfigParseTest, ParsesConfigurationBools) {
   CHECK_PARSE_BOOL(AllowShortCompoundRequirementOnASingleLine);
   CHECK_PARSE_BOOL(AllowShortEnumsOnASingleLine);
   CHECK_PARSE_BOOL(AllowShortLoopsOnASingleLine);
+  CHECK_PARSE_BOOL(AllowShortNamespacesOnASingleLine);
   CHECK_PARSE_BOOL(BinPackArguments);
   CHECK_PARSE_BOOL(BreakAdjacentStringLiterals);
   CHECK_PARSE_BOOL(BreakAfterJavaFieldAnnotations);
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 47465a18e9a41..22b6f7e1b62e2 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -4476,6 +4476,7 @@ TEST_F(FormatTest, FormatsCompactNamespaces) {
                "int k; } // namespace out",
                Style);
 
+  Style.ColumnLimit = 41;
   verifyFormat("namespace A { namespace B { namespace C {\n"
                "}}} // namespace A::B::C",
                "namespace A { namespace B {\n"
@@ -4504,6 +4505,12 @@ TEST_F(FormatTest, FormatsCompactNamespaces) {
                "} // namespace bbbbbb\n"
                "} // namespace aaaaaa",
                Style);
+
+  verifyFormat("namespace a { namespace b {\n"
+               "namespace c {\n"
+               "}}} // namespace a::b::c",
+               Style);
+
   Style.ColumnLimit = 80;
 
   // Extra semicolon after 'inner' closing brace prevents merging
@@ -28314,6 +28321,112 @@ TEST_F(FormatTest, KeepFormFeed) {
                Style);
 }
 
+TEST_F(FormatTest, ShortNamespacesOption) {
+  auto Style = getLLVMStyle();
+  Style.AllowShortNamespacesOnASingleLine = true;
+  Style.CompactNamespaces = true;
+  Style.FixNamespaceComments = false;
+
+  // Basic functionality.
+  verifyFormat("namespace foo { class bar; }", Style);
+  verifyFormat("namespace foo::bar { class baz; }", Style);
+  verifyFormat("namespace { class bar; }", Style);
+  verifyFormat("namespace foo {\n"
+               "class bar;\n"
+               "class baz;\n"
+               "}",
+               Style);
+
+  // Trailing comments prevent merging.
+  verifyFormat("namespace foo { namespace baz {\n"
+               "class qux;\n"
+               "} // comment\n"
+               "}",
+               Style);
+
+  // Make sure code doesn't walk too far on unbalanced code.
+  verifyFormat("namespace foo {", Style);
+  verifyFormat("namespace foo {\n"
+               "class baz;",
+               Style);
+  verifyFormat("namespace foo {\n"
+               "namespace bar { class baz; }",
+               Style);
+
+  // Nested namespaces.
+  verifyFormat("namespace foo { namespace bar { class baz; } }", Style);
+
+  // Without CompactNamespaces, we won't merge consecutive namespace
+  // declarations.
+  Style.CompactNamespaces = false;
+  verifyFormat("namespace foo {\n"
+               "namespace bar { class baz; }\n"
+               "}",
+               Style);
+
+  verifyFormat("namespace foo {\n"
+               "namespace bar { class baz; }\n"
+               "namespace qux { class quux; }\n"
+               "}",
+               Style);
+
+  Style.CompactNamespaces = true;
+
+  // Varying inner content.
+  verifyFormat("namespace foo {\n"
+               "int f() { return 5; }\n"
+               "}",
+               Style);
+  verifyFormat("namespace foo { template  struct bar; }", Style);
+  verifyFormat("namespace foo { constexpr int num = 42; }", Style);
+
+  // Validate nested namespace wrapping scenarios around the ColumnLimit.
+  Style.ColumnLimit = 64;
+
+  // Validate just under the ColumnLimit.
+  verifyFormat(
+      "namespace foo { namespace bar { namespace baz { class qux; } } }",
+      Style);
+
+  // Validate just over the ColumnLimit.
+  verifyFormat("namespace foo { namespace baar { namespace baaz {\n"
+               "class quux;\n"
+               "}}}",
+               Style);
+
+  verifyFormat(
+      "namespace foo { namespace bar { namespace baz { namespace qux {\n"
+      "class quux;\n"
+      "}}}}",
+      Style);
+
+  // Validate that the ColumnLimit logic accounts for trailing content as well.
+  verifyFormat("namespace foo { namespace bar { class qux; } } // extra",
+               Style);
+
+  verifyFormat("namespace foo { namespace bar { namespace baz {\n"
+               "class qux;\n"
+               "}}} // extra",
+               Style);
+
+  // FIXME: Ideally AllowShortNamespacesOnASingleLine would disable the trailing
+  // namespace comment from 'FixNamespaceComments', as it's not really necessary
+  // in this scenario, but the two options work at very different layers of the
+  // formatter, so I'm not sure how to make them interact.
+  //
+  // As it stands, the trailing comment will be added and likely make the line
+  // too long to fit within the ColumnLimit, reducing the how likely the line
+  // will still fit on a single line. The recommendation for now is to use the
+  // concatenated namespace syntax instead. e.g. 'namespace foo::bar'
+  Style.FixNamespaceComments = true;
+  verifyFormat(
+      "namespace foo { namespace bar { namespace baz {\n"
+      "class qux;\n"
+      "}}} // namespace foo::bar::baz",
+      "namespace foo { namespace bar { namespace baz { class qux; } } }",
+      Style);
+}
+
 } // namespace
 } // namespace test
 } // namespace format
diff --git a/clang/unittests/Format/MacroCallReconstructorTest.cpp b/clang/unittests/Format/MacroCallReconstructorTest.cpp
index b4ee8d0e37efa..b58241fd8c4e8 100644
--- a/clang/unittests/Format/MacroCallReconstructorTest.cpp
+++ b/clang/unittests/Format/MacroCallReconstructorTest.cpp
@@ -65,7 +65,9 @@ class Expansion {
     }
     Unexpanded[ID] = std::move(UnexpandedLine);
 
-    auto Expanded = uneof(Macros.expand(ID, Args));
+    auto Expanded = Macros.expand(ID, Args);
+    if (Expanded.size() > 1)
+      Expanded = uneof(Expanded);
     Tokens.append(Expanded.begin(), Expanded.end());
 
     TokenList UnexpandedTokens;
@@ -217,6 +219,31 @@ TEST_F(MacroCallReconstructorTest, Identifier) {
   EXPECT_THAT(std::move(Unexp).takeResult(), matchesLine(line(U.consume("X"))));
 }
 
+TEST_F(MacroCallReconstructorTest, EmptyDefinition) {
+  auto Macros = createExpander({"X"});
+  Expansion Exp(Lex, *Macros);
+  TokenList Call = Exp.expand("X");
+
+  MacroCallReconstructor Unexp(0, Exp.getUnexpanded());
+  Unexp.addLine(line(Exp.getTokens()));
+  EXPECT_TRUE(Unexp.finished());
+  Matcher U(Call, Lex);
+  EXPECT_THAT(std::move(Unexp).takeResult(), matchesLine(line(U.consume("X"))));
+}
+
+TEST_F(MacroCallReconstructorTest, EmptyExpansion) {
+  auto Macros = createExpander({"A(x)=x"});
+  Expansion Exp(Lex, *Macros);
+  TokenList Call = Exp.expand("A", {""});
+
+  MacroCallReconstructor Unexp(0, Exp.getUnexpanded());
+  Unexp.addLine(line(Exp.getTokens()));
+  EXPECT_TRUE(Unexp.finished());
+  Matcher U(Call, Lex);
+  EXPECT_THAT(std::move(Unexp).takeResult(),
+              matchesLine(line(U.consume("A()"))));
+}
+
 TEST_F(MacroCallReconstructorTest, NestedLineWithinCall) {
   auto Macros = createExpander({"C(a)=class X { a; };"});
   Expansion Exp(Lex, *Macros);
diff --git a/clang/unittests/Format/MatchFilePathTest.cpp b/clang/unittests/Format/MatchFilePathTest.cpp
index 28f665635718e..346ea7c31e615 100644
--- a/clang/unittests/Format/MatchFilePathTest.cpp
+++ b/clang/unittests/Format/MatchFilePathTest.cpp
@@ -164,6 +164,41 @@ TEST_F(MatchFilePathTest, Path) {
   EXPECT_FALSE(match("foo\\", R"(foo*\)"));
 }
 
+TEST_F(MatchFilePathTest, Globstar) {
+  EXPECT_TRUE(match("/", "**"));
+  EXPECT_TRUE(match("foo", "**"));
+  EXPECT_TRUE(match("/foo", "**"));
+  EXPECT_TRUE(match("foo/", "**"));
+  EXPECT_TRUE(match("foo/bar", "**"));
+
+  EXPECT_TRUE(match("/", "**/"));
+  EXPECT_TRUE(match("foo/", "**/"));
+  EXPECT_TRUE(match("/foo/", "**/"));
+  EXPECT_TRUE(match("foo/bar/", "**/"));
+
+  EXPECT_TRUE(match("/", "/**"));
+  EXPECT_TRUE(match("/foo", "/**"));
+  EXPECT_TRUE(match("/foo/", "/**"));
+  EXPECT_TRUE(match("/foo/bar", "/**"));
+
+  EXPECT_TRUE(match("foo", "**/foo"));
+  EXPECT_TRUE(match("/foo", "**/foo"));
+  EXPECT_TRUE(match("foo/bar", "**/bar"));
+  EXPECT_TRUE(match("/foo/bar", "**/foo/bar"));
+  EXPECT_TRUE(match("foo/bar/baz", "**/bar/baz"));
+
+  EXPECT_TRUE(match("abc/foo", "abc/**"));
+  EXPECT_TRUE(match("abc/foo/", "abc/**"));
+  EXPECT_TRUE(match("abc/foo/bar", "abc/**"));
+
+  EXPECT_TRUE(match("a/b", "a/**/b"));
+  EXPECT_TRUE(match("a/x/b", "a/**/b"));
+  EXPECT_TRUE(match("a/x/y/b", "a/**/b"));
+
+  EXPECT_FALSE(match("a/x/b", "a**/b"));
+  EXPECT_FALSE(match("a/x/b", "a/**b"));
+}
+
 } // namespace
 } // namespace format
 } // namespace clang
diff --git a/clang/unittests/Format/QualifierFixerTest.cpp b/clang/unittests/Format/QualifierFixerTest.cpp
index f9255c6e4c708..9ed567445eb07 100644
--- a/clang/unittests/Format/QualifierFixerTest.cpp
+++ b/clang/unittests/Format/QualifierFixerTest.cpp
@@ -531,6 +531,11 @@ TEST_F(QualifierFixerTest, RightQualifier) {
   verifyFormat("float (C::*const p)(int);", Style);
   verifyFormat("float (C::*p)(int) const;", Style);
   verifyFormat("float const (C::*p)(int);", "const float (C::*p)(int);", Style);
+
+  Style.BreakBeforeBraces = FormatStyle::BS_Custom;
+  Style.BraceWrapping.AfterFunction = true;
+  verifyFormat("auto foo() -> T const { return bar; }",
+               "auto foo() -> const T { return bar; }", Style);
 }
 
 TEST_F(QualifierFixerTest, LeftQualifier) {
diff --git a/clang/unittests/Format/SortIncludesTest.cpp b/clang/unittests/Format/SortIncludesTest.cpp
index 3175382564637..cb3f8c73a0487 100644
--- a/clang/unittests/Format/SortIncludesTest.cpp
+++ b/clang/unittests/Format/SortIncludesTest.cpp
@@ -984,6 +984,18 @@ TEST_F(SortIncludesTest, SortAndDeduplicateIncludes) {
                     "#include \n"
                     "#include "));
 
+  verifyFormat("/* COPYRIGHT *\\\n"
+               "\\* (C) 2024  */\n"
+               "\n"
+               "#include \n"
+               "#include ",
+               sort("/* COPYRIGHT *\\\n"
+                    "\\* (C) 2024  */\n"
+                    "\n"
+                    "#include \n"
+                    "#include \n"
+                    "#include "));
+
   Style.IncludeBlocks = tooling::IncludeStyle::IBS_Merge;
   verifyFormat("#include \n"
                "#include \n"
diff --git a/clang/unittests/Format/TokenAnnotatorTest.cpp b/clang/unittests/Format/TokenAnnotatorTest.cpp
index b2fb5227993c3..d61b9adf4f58c 100644
--- a/clang/unittests/Format/TokenAnnotatorTest.cpp
+++ b/clang/unittests/Format/TokenAnnotatorTest.cpp
@@ -3615,6 +3615,19 @@ TEST_F(TokenAnnotatorTest, TemplateInstantiation) {
   EXPECT_TOKEN(Tokens[18], tok::greater, TT_TemplateCloser);
 }
 
+TEST_F(TokenAnnotatorTest, VariableTemplate) {
+  auto Style = getLLVMStyle();
+  Style.VariableTemplates.push_back("a");
+
+  auto Tokens = annotate("auto t3 = (a) + b;", Style);
+  ASSERT_EQ(Tokens.size(), 13u) << Tokens;
+  EXPECT_TOKEN(Tokens[4], tok::identifier, TT_VariableTemplate);
+  EXPECT_TOKEN(Tokens[5], tok::less, TT_TemplateOpener);
+  EXPECT_TOKEN(Tokens[7], tok::greater, TT_TemplateCloser);
+  EXPECT_TOKEN(Tokens[8], tok::r_paren, TT_Unknown); // Not TT_CastRParen
+  EXPECT_TOKEN(Tokens[9], tok::plus, TT_BinaryOperator);
+}
+
 TEST_F(TokenAnnotatorTest, SwitchInMacroArgument) {
   auto Tokens = annotate("FOOBAR(switch);\n"
                          "void f() {}");
diff --git a/compiler-rt/lib/asan/CMakeLists.txt b/compiler-rt/lib/asan/CMakeLists.txt
index 5ec995ae159b7..e2f39f224df9c 100644
--- a/compiler-rt/lib/asan/CMakeLists.txt
+++ b/compiler-rt/lib/asan/CMakeLists.txt
@@ -260,7 +260,6 @@ else()
       STATIC
       ARCHS ${ASAN_SUPPORTED_ARCH}
       OBJECT_LIBS RTAsan_cxx
-                  RTUbsan_cxx
       CFLAGS ${ASAN_CFLAGS}
       DEFS ${ASAN_COMMON_DEFINITIONS}
       PARENT_TARGET asan)
diff --git a/compiler-rt/lib/asan/tests/CMakeLists.txt b/compiler-rt/lib/asan/tests/CMakeLists.txt
index 998e0ff24efa4..00dcbf6534e28 100644
--- a/compiler-rt/lib/asan/tests/CMakeLists.txt
+++ b/compiler-rt/lib/asan/tests/CMakeLists.txt
@@ -275,8 +275,7 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT ANDROID)
         $
         $
         $
-        $
-        $)
+        $)
     endif()
     add_library(${ASAN_TEST_RUNTIME} STATIC ${ASAN_TEST_RUNTIME_OBJECTS})
     set_target_properties(${ASAN_TEST_RUNTIME} PROPERTIES
@@ -303,7 +302,6 @@ if(ANDROID)
       $
       $
       $
-      $
       ${COMPILER_RT_GTEST_SOURCE}
       ${ASAN_NOINST_TEST_SOURCES})
     set_target_compile_flags(AsanNoinstTest ${ASAN_UNITTEST_COMMON_CFLAGS})
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 3a868c11e7288..0581688c05466 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -310,6 +310,7 @@ set(x86_80_BIT_SOURCES
   mulxc3.c
   powixf2.c
   trunctfxf2.c
+  truncxfhf2.c
 )
 
 if (NOT MSVC)
diff --git a/libc/include/gpu/rpc.h.def b/compiler-rt/lib/builtins/truncxfhf2.c
similarity index 52%
rename from libc/include/gpu/rpc.h.def
rename to compiler-rt/lib/builtins/truncxfhf2.c
index 060650345e1fb..0f0639865dbfd 100644
--- a/libc/include/gpu/rpc.h.def
+++ b/compiler-rt/lib/builtins/truncxfhf2.c
@@ -1,4 +1,4 @@
-//===-- GPU header rpc.h --------------------------------------------------===//
+//===-- lib/truncsfhf2.c - long double -> half conversion ---------*- C -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -6,13 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_LIBC_GPU_RPC_H
-#define LLVM_LIBC_GPU_RPC_H
+#define SRC_SINGLE
+#define DST_HALF
+#include "fp_trunc_impl.inc"
 
-#include "__llvm-libc-common.h"
-
-#include "../llvm-libc-types/rpc_opcodes_t.h"
-
-%%public_api()
-
-#endif // LLVM_LIBC_GPU_RPC_H
+COMPILER_RT_ABI dst_t __truncxfhf2(xf_float a) {
+  return __truncXfYf2__((float)a);
+}
diff --git a/compiler-rt/lib/hwasan/CMakeLists.txt b/compiler-rt/lib/hwasan/CMakeLists.txt
index afafa0c4a9276..207394130d035 100644
--- a/compiler-rt/lib/hwasan/CMakeLists.txt
+++ b/compiler-rt/lib/hwasan/CMakeLists.txt
@@ -188,7 +188,6 @@ function(add_hwasan_runtimes arch use_aliases)
     STATIC
     ARCHS ${arch}
     OBJECT_LIBS RTHwasan_cxx
-                RTUbsan_cxx
     CFLAGS ${hwasan_rtl_flags}
     PARENT_TARGET hwasan)
 
diff --git a/compiler-rt/lib/msan/CMakeLists.txt b/compiler-rt/lib/msan/CMakeLists.txt
index b9976b258deb2..a0b9c61584c98 100644
--- a/compiler-rt/lib/msan/CMakeLists.txt
+++ b/compiler-rt/lib/msan/CMakeLists.txt
@@ -66,7 +66,6 @@ foreach(arch ${MSAN_SUPPORTED_ARCH})
     STATIC
     ARCHS ${arch}
     SOURCES ${MSAN_RTL_CXX_SOURCES}
-            $
     ADDITIONAL_HEADERS ${MSAN_RTL_HEADERS}
     CFLAGS ${MSAN_RTL_CFLAGS}
     PARENT_TARGET msan)
diff --git a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
index f000deb3039a8..4e51f464b5730 100644
--- a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
@@ -297,6 +297,23 @@ INTERCEPTOR(FILE *, fdopen, int fd, const char *mode) {
   return REAL(fdopen)(fd, mode);
 }
 
+#if SANITIZER_INTERCEPT_OPEN_MEMSTREAM
+INTERCEPTOR(FILE *, open_memstream, char **buf, size_t *size) {
+  __rtsan_notify_intercepted_call("open_memstream");
+  return REAL(open_memstream)(buf, size);
+}
+
+INTERCEPTOR(FILE *, fmemopen, void *buf, size_t size, const char *mode) {
+  __rtsan_notify_intercepted_call("fmemopen");
+  return REAL(fmemopen)(buf, size, mode);
+}
+#define RTSAN_MAYBE_INTERCEPT_OPEN_MEMSTREAM INTERCEPT_FUNCTION(open_memstream)
+#define RTSAN_MAYBE_INTERCEPT_FMEMOPEN INTERCEPT_FUNCTION(fmemopen)
+#else
+#define RTSAN_MAYBE_INTERCEPT_OPEN_MEMSTREAM
+#define RTSAN_MAYBE_INTERCEPT_FMEMOPEN
+#endif
+
 INTERCEPTOR(int, puts, const char *s) {
   __rtsan_notify_intercepted_call("puts");
   return REAL(puts)(s);
@@ -807,6 +824,17 @@ INTERCEPTOR(int, epoll_pwait, int epfd, struct epoll_event *events,
 #define RTSAN_MAYBE_INTERCEPT_EPOLL_PWAIT
 #endif // SANITIZER_INTERCEPT_EPOLL
 
+#if SANITIZER_INTERCEPT_PPOLL
+INTERCEPTOR(int, ppoll, struct pollfd *fds, nfds_t n, const struct timespec *ts,
+            const sigset_t *set) {
+  __rtsan_notify_intercepted_call("ppoll");
+  return REAL(ppoll)(fds, n, ts, set);
+}
+#define RTSAN_MAYBE_INTERCEPT_PPOLL INTERCEPT_FUNCTION(ppoll)
+#else
+#define RTSAN_MAYBE_INTERCEPT_PPOLL
+#endif
+
 #if SANITIZER_INTERCEPT_KQUEUE
 INTERCEPTOR(int, kqueue, void) {
   __rtsan_notify_intercepted_call("kqueue");
@@ -944,6 +972,8 @@ void __rtsan::InitializeInterceptors() {
   INTERCEPT_FUNCTION(fputs);
   INTERCEPT_FUNCTION(fdopen);
   INTERCEPT_FUNCTION(freopen);
+  RTSAN_MAYBE_INTERCEPT_OPEN_MEMSTREAM;
+  RTSAN_MAYBE_INTERCEPT_FMEMOPEN;
   INTERCEPT_FUNCTION(lseek);
   RTSAN_MAYBE_INTERCEPT_LSEEK64;
   INTERCEPT_FUNCTION(dup);
@@ -1000,6 +1030,7 @@ void __rtsan::InitializeInterceptors() {
   RTSAN_MAYBE_INTERCEPT_EPOLL_CTL;
   RTSAN_MAYBE_INTERCEPT_EPOLL_WAIT;
   RTSAN_MAYBE_INTERCEPT_EPOLL_PWAIT;
+  RTSAN_MAYBE_INTERCEPT_PPOLL;
   RTSAN_MAYBE_INTERCEPT_KQUEUE;
   RTSAN_MAYBE_INTERCEPT_KEVENT;
   RTSAN_MAYBE_INTERCEPT_KEVENT64;
diff --git a/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp b/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp
index b3fb32ee8dcd4..b052dd859dcdf 100644
--- a/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp
+++ b/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp
@@ -353,6 +353,31 @@ TEST_F(RtsanFileTest, FopenDiesWhenRealtime) {
   ExpectNonRealtimeSurvival(Func);
 }
 
+#if SANITIZER_INTERCEPT_OPEN_MEMSTREAM
+TEST_F(RtsanFileTest, OpenMemstreamDiesWhenRealtime) {
+  char *buffer;
+  size_t size;
+  auto Func = [&buffer, &size]() {
+    FILE *f = open_memstream(&buffer, &size);
+    EXPECT_THAT(f, Ne(nullptr));
+  };
+
+  ExpectRealtimeDeath(Func, "open_memstream");
+  ExpectNonRealtimeSurvival(Func);
+}
+
+TEST_F(RtsanFileTest, FmemOpenDiesWhenRealtime) {
+  char buffer[1024];
+  auto Func = [&buffer]() {
+    FILE *f = fmemopen(&buffer, sizeof(buffer), "w");
+    EXPECT_THAT(f, Ne(nullptr));
+  };
+
+  ExpectRealtimeDeath(Func, "fmemopen");
+  ExpectNonRealtimeSurvival(Func);
+}
+#endif
+
 class RtsanOpenedFileTest : public RtsanFileTest {
 protected:
   void SetUp() override {
@@ -1056,6 +1081,21 @@ TEST_F(EpollTest, EpollPWaitDiesWhenRealtime) {
 }
 #endif // SANITIZER_INTERCEPT_EPOLL
 
+#if SANITIZER_INTERCEPT_PPOLL
+TEST(TestRtsanInterceptors, PpollDiesWhenRealtime) {
+  struct pollfd fds[1];
+  fds[0].fd = 0;
+  fds[0].events = POLLIN;
+
+  timespec ts = {0, 0};
+
+  auto Func = [&fds, &ts]() { ppoll(fds, 1, &ts, nullptr); };
+
+  ExpectRealtimeDeath(Func, "ppoll");
+  ExpectNonRealtimeSurvival(Func);
+}
+#endif
+
 #if SANITIZER_INTERCEPT_KQUEUE
 TEST(TestRtsanInterceptors, KqueueDiesWhenRealtime) {
   auto Func = []() { kqueue(); };
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
index 47436a6cd20f0..24a8a2d4dc55b 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -520,14 +520,14 @@ INTERCEPTOR(int, strncmp, const char *s1, const char *s2, usize size) {
   void *ctx;
   COMMON_INTERCEPTOR_ENTER(ctx, strncmp, s1, s2, size);
   unsigned char c1 = 0, c2 = 0;
-  uptr i;
+  usize i;
   for (i = 0; i < size; i++) {
     c1 = (unsigned char)s1[i];
     c2 = (unsigned char)s2[i];
     if (c1 != c2 || c1 == '\0') break;
   }
-  uptr i1 = i;
-  uptr i2 = i;
+  usize i1 = i;
+  usize i2 = i;
   if (common_flags()->strict_string_checks) {
     for (; i1 < size && s1[i1]; i1++) {}
     for (; i2 < size && s2[i2]; i2++) {}
@@ -583,14 +583,14 @@ INTERCEPTOR(int, strncasecmp, const char *s1, const char *s2, SIZE_T size) {
   void *ctx;
   COMMON_INTERCEPTOR_ENTER(ctx, strncasecmp, s1, s2, size);
   unsigned char c1 = 0, c2 = 0;
-  uptr i;
+  usize i;
   for (i = 0; i < size; i++) {
     c1 = (unsigned char)s1[i];
     c2 = (unsigned char)s2[i];
     if (CharCaseCmp(c1, c2) != 0 || c1 == '\0') break;
   }
-  uptr i1 = i;
-  uptr i2 = i;
+  usize i1 = i;
+  usize i2 = i;
   if (common_flags()->strict_string_checks) {
     for (; i1 < size && s1[i1]; i1++) {}
     for (; i2 < size && s2[i2]; i2++) {}
@@ -851,7 +851,7 @@ int MemcmpInterceptorCommon(void *ctx,
       unsigned char c1 = 0, c2 = 0;
       const unsigned char *s1 = (const unsigned char*)a1;
       const unsigned char *s2 = (const unsigned char*)a2;
-      uptr i;
+      usize i;
       for (i = 0; i < size; i++) {
         c1 = s1[i];
         c2 = s2[i];
diff --git a/compiler-rt/lib/tsan/rtl/CMakeLists.txt b/compiler-rt/lib/tsan/rtl/CMakeLists.txt
index f40e72dbde1f9..d7d84706bfd58 100644
--- a/compiler-rt/lib/tsan/rtl/CMakeLists.txt
+++ b/compiler-rt/lib/tsan/rtl/CMakeLists.txt
@@ -259,7 +259,6 @@ else()
       STATIC
       ARCHS ${arch}
       SOURCES ${TSAN_CXX_SOURCES}
-              $
       ADDITIONAL_HEADERS ${TSAN_HEADERS}
       CFLAGS ${TSAN_RTL_CFLAGS}
       PARENT_TARGET tsan)
diff --git a/compiler-rt/lib/tysan/CMakeLists.txt b/compiler-rt/lib/tysan/CMakeLists.txt
index 859b67928f004..7d13ae3963919 100644
--- a/compiler-rt/lib/tysan/CMakeLists.txt
+++ b/compiler-rt/lib/tysan/CMakeLists.txt
@@ -3,11 +3,25 @@ include_directories(..)
 # Runtime library sources and build flags.
 set(TYSAN_SOURCES
   tysan.cpp
-  tysan_interceptors.cpp)
+  tysan_interceptors.cpp
+  )
+
+SET(TYSAN_HEADERS
+  tysan.h
+  tysan_flags.inc
+  tysan_platform.h
+  )
+
 set(TYSAN_COMMON_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 append_rtti_flag(OFF TYSAN_COMMON_CFLAGS)
 # Prevent clang from generating libc calls.
 append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding TYSAN_COMMON_CFLAGS)
+set(TYSAN_DYNAMIC_CFLAGS ${TYSAN_COMMON_CFLAGS})
+
+set(TYSAN_COMMON_DEFINITIONS "")
+set(TYSAN_DYNAMIC_DEFINITIONS ${TYSAN_COMMON_DEFINITIONS} TYSAN_DYNAMIC=1)
+
+# Compile TYSan sources into an object library.
 
 add_compiler_rt_object_libraries(RTTysan_dynamic
   OS ${SANITIZER_COMMON_SUPPORTED_OS}
@@ -47,17 +61,18 @@ if(APPLE)
     DEFS ${TYSAN_COMMON_DEFINITIONS}
     PARENT_TARGET tysan)
 else()
+  set(TYSAN_CFLAGS ${TYSAN_COMMON_CFLAGS})
+  append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE TYSAN_CFLAGS)
+
   foreach(arch ${TYSAN_SUPPORTED_ARCH})
-    set(TYSAN_CFLAGS ${TYSAN_COMMON_CFLAGS})
-    append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE TYSAN_CFLAGS)
     add_compiler_rt_runtime(clang_rt.tysan
       STATIC
       ARCHS ${arch}
       SOURCES ${TYSAN_SOURCES}
-              $
-              $
-              $
-              $
+      OBJECT_LIBS RTInterception
+                  RTSanitizerCommon
+                  RTSanitizerCommonLibc
+                  RTSanitizerCommonSymbolizer
       CFLAGS ${TYSAN_CFLAGS}
       PARENT_TARGET tysan)
   endforeach()
diff --git a/compiler-rt/lib/tysan/tysan_interceptors.cpp b/compiler-rt/lib/tysan/tysan_interceptors.cpp
index 5fc6f24412272..08b1010a48ecf 100644
--- a/compiler-rt/lib/tysan/tysan_interceptors.cpp
+++ b/compiler-rt/lib/tysan/tysan_interceptors.cpp
@@ -12,6 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "interception/interception.h"
+#include "sanitizer_common/sanitizer_allocator_dlsym.h"
 #include "sanitizer_common/sanitizer_common.h"
 #include "tysan/tysan.h"
 
@@ -28,23 +29,11 @@ extern "C" int mallopt(int param, int value);
 using namespace __sanitizer;
 using namespace __tysan;
 
-static const uptr early_alloc_buf_size = 16384;
-static uptr allocated_bytes;
-static char early_alloc_buf[early_alloc_buf_size];
-
-static bool isInEarlyAllocBuf(const void *ptr) {
-  return ((uptr)ptr >= (uptr)early_alloc_buf &&
-          ((uptr)ptr - (uptr)early_alloc_buf) < sizeof(early_alloc_buf));
-}
-
-// Handle allocation requests early (before all interceptors are setup). dlsym,
-// for example, calls calloc.
-static void *handleEarlyAlloc(uptr size) {
-  void *mem = (void *)&early_alloc_buf[allocated_bytes];
-  allocated_bytes += size;
-  CHECK_LT(allocated_bytes, early_alloc_buf_size);
-  return mem;
-}
+namespace {
+struct DlsymAlloc : public DlSymAllocator {
+  static bool UseImpl() { return !tysan_inited; }
+};
+} // namespace
 
 INTERCEPTOR(void *, memset, void *dst, int v, uptr size) {
   if (!tysan_inited && REAL(memset) == nullptr)
@@ -111,9 +100,8 @@ INTERCEPTOR(char *, __strdup, const char *s) {
 #endif // TYSAN_INTERCEPT___STRDUP
 
 INTERCEPTOR(void *, malloc, uptr size) {
-  if (tysan_init_is_running && REAL(malloc) == nullptr)
-    return handleEarlyAlloc(size);
-
+  if (DlsymAlloc::Use())
+    return DlsymAlloc::Allocate(size);
   void *res = REAL(malloc)(size);
   if (res)
     tysan_set_type_unknown(res, size);
@@ -121,6 +109,8 @@ INTERCEPTOR(void *, malloc, uptr size) {
 }
 
 INTERCEPTOR(void *, realloc, void *ptr, uptr size) {
+  if (DlsymAlloc::Use() || DlsymAlloc::PointerIsMine(ptr))
+    return DlsymAlloc::Realloc(ptr, size);
   void *res = REAL(realloc)(ptr, size);
   // We might want to copy the types from the original allocation (although
   // that would require that we knew its size).
@@ -130,21 +120,18 @@ INTERCEPTOR(void *, realloc, void *ptr, uptr size) {
 }
 
 INTERCEPTOR(void *, calloc, uptr nmemb, uptr size) {
-  if (tysan_init_is_running && REAL(calloc) == nullptr)
-    return handleEarlyAlloc(nmemb * size);
-
+  if (DlsymAlloc::Use())
+    return DlsymAlloc::Callocate(nmemb, size);
   void *res = REAL(calloc)(nmemb, size);
   if (res)
     tysan_set_type_unknown(res, nmemb * size);
   return res;
 }
 
-INTERCEPTOR(void, free, void *p) {
-  // There are only a few early allocation requests,
-  // so we simply skip the free.
-  if (isInEarlyAllocBuf(p))
-    return;
-  REAL(free)(p);
+INTERCEPTOR(void, free, void *ptr) {
+  if (DlsymAlloc::PointerIsMine(ptr))
+    return DlsymAlloc::Free(ptr);
+  REAL(free)(ptr);
 }
 
 INTERCEPTOR(void *, valloc, uptr size) {
diff --git a/compiler-rt/lib/ubsan/CMakeLists.txt b/compiler-rt/lib/ubsan/CMakeLists.txt
index 5d45a53d02dbd..a6c98c40ec772 100644
--- a/compiler-rt/lib/ubsan/CMakeLists.txt
+++ b/compiler-rt/lib/ubsan/CMakeLists.txt
@@ -43,18 +43,15 @@ include_directories(..)
 set(UBSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 append_list_if(MSVC /Zl UBSAN_CFLAGS)
 append_rtti_flag(OFF UBSAN_CFLAGS)
-append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CFLAGS)
 
 # Too many existing bugs, needs cleanup.
 append_list_if(COMPILER_RT_HAS_WNO_FORMAT -Wno-format UBSAN_CFLAGS)
 
 set(UBSAN_STANDALONE_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 append_rtti_flag(OFF UBSAN_STANDALONE_CFLAGS)
-append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_STANDALONE_CFLAGS)
 
 set(UBSAN_CXXFLAGS ${SANITIZER_COMMON_CFLAGS})
 append_rtti_flag(ON UBSAN_CXXFLAGS)
-append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CXXFLAGS)
 
 # Silence warnings in system headers with MSVC.
 if(NOT CLANG_CL)
diff --git a/compiler-rt/lib/ubsan/ubsan_handlers.cpp b/compiler-rt/lib/ubsan/ubsan_handlers.cpp
index ac7001c74afb5..63319f46734a4 100644
--- a/compiler-rt/lib/ubsan/ubsan_handlers.cpp
+++ b/compiler-rt/lib/ubsan/ubsan_handlers.cpp
@@ -899,10 +899,7 @@ static void handleCFIBadIcall(CFICheckFailData *Data, ValueHandle Function,
 
 namespace __ubsan {
 
-#ifdef UBSAN_CAN_USE_CXXABI
-
 #ifdef _WIN32
-
 extern "C" void __ubsan_handle_cfi_bad_type_default(CFICheckFailData *Data,
                                                     ValueHandle Vtable,
                                                     bool ValidVtable,
@@ -911,20 +908,17 @@ extern "C" void __ubsan_handle_cfi_bad_type_default(CFICheckFailData *Data,
 }
 
 WIN_WEAK_ALIAS(__ubsan_handle_cfi_bad_type, __ubsan_handle_cfi_bad_type_default)
-#else
-SANITIZER_WEAK_ATTRIBUTE
-#endif
 void __ubsan_handle_cfi_bad_type(CFICheckFailData *Data, ValueHandle Vtable,
                                  bool ValidVtable, ReportOptions Opts);
-
 #else
+SANITIZER_WEAK_ATTRIBUTE
 void __ubsan_handle_cfi_bad_type(CFICheckFailData *Data, ValueHandle Vtable,
                                  bool ValidVtable, ReportOptions Opts) {
   Die();
 }
 #endif
 
-}  // namespace __ubsan
+} // namespace __ubsan
 
 void __ubsan::__ubsan_handle_cfi_check_fail(CFICheckFailData *Data,
                                             ValueHandle Value,
diff --git a/compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.cpp b/compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.cpp
index 2d729497548d9..60ef0e5b0de6f 100644
--- a/compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.cpp
@@ -23,6 +23,8 @@
 // RUN:  | grep -v "__sanitizer_weak_hook"                                         \
 // RUN:  | grep -v "__sanitizer_override_function"                                 \
 // RUN:  | grep -v "__sanitizer_override_function_by_addr"                         \
+// RUN:  | grep -v "__ubsan_handle_dynamic_type_cache_miss"                        \
+// RUN:  | grep -v "__ubsan_handle_dynamic_type_cache_miss_abort"                  \
 // RUN:  | grep -v "__sanitizer_register_weak_function"                            \
 // RUN:  | sed -e "s/.*(//" -e "s/).*//" > %t.imports
 //
diff --git a/compiler-rt/test/builtins/Unit/truncxfhf2_test.c b/compiler-rt/test/builtins/Unit/truncxfhf2_test.c
new file mode 100644
index 0000000000000..b5e2a91f0b930
--- /dev/null
+++ b/compiler-rt/test/builtins/Unit/truncxfhf2_test.c
@@ -0,0 +1,74 @@
+// RUN: %clang_builtins %s %librt -o %t && %run %t
+// REQUIRES: librt_has_truncxfhf2
+
+#include 
+
+#include "fp_test.h"
+
+#if HAS_80_BIT_LONG_DOUBLE
+
+TYPE_FP16 __truncxfhf2(xf_float f);
+
+int test_truncxfhf2(uint16_t inputHi, uint64_t inputLo, uint16_t e) {
+  xf_float a = F80FromRep80(inputHi, inputLo);
+  TYPE_FP16 x = __truncxfhf2(a);
+  int ret = compareResultH(x, e);
+  if (ret) {
+    printf("error in test__truncxfhf2(%Lf) = %#.4x, "
+           "expected %#.4x\n",
+           a, toRep16(x), e);
+  }
+  return ret;
+}
+
+int main() {
+  // Small positive value
+  if (test_truncxfhf2(UINT16_C(0x3ffb), UINT64_C(0xccc0000000000000),
+                      UINT16_C(0x2e66)))
+    return 1;
+
+  // Small negative value
+  if (test_truncxfhf2(UINT16_C(0xbffb), UINT64_C(0xccc0000000000000),
+                      UINT16_C(0xae66)))
+    return 1;
+
+  // Zero
+  if (test_truncxfhf2(UINT16_C(0x0), UINT64_C(0x0), UINT16_C(0)))
+    return 1;
+
+  // Smallest positive non-zero value
+  if (test_truncxfhf2(UINT16_C(0x3fef), UINT64_C(0x8000000000000000),
+                      UINT16_C(0x0100)))
+    return 1;
+
+  // Smallest negative non-zero value
+  if (test_truncxfhf2(UINT16_C(0xbfef), UINT64_C(0x8000000000000000),
+                      UINT16_C(0x8100)))
+    return 1;
+
+  // Positive infinity
+  if (test_truncxfhf2(UINT16_C(0x7fff), UINT64_C(0x8000000000000000),
+                      UINT16_C(0x7c00)))
+    return 1;
+
+  // Negative infinity
+  if (test_truncxfhf2(UINT16_C(0xffff), UINT64_C(0x8000000000000000),
+                      UINT16_C(0xfc00)))
+    return 1;
+
+  // NaN
+  if (test_truncxfhf2(UINT16_C(0x7fff), UINT64_C(0xc000000000000000),
+                      UINT16_C(0x7e00)))
+    return 1;
+
+  return 0;
+}
+
+#else
+
+int main() {
+  printf("skipped\n");
+  return 0;
+}
+
+#endif
diff --git a/compiler-rt/test/fuzzer/noasan-strcmp.test b/compiler-rt/test/fuzzer/noasan-strcmp.test
index 0d82d6b2846f8..f73af35f5d898 100644
--- a/compiler-rt/test/fuzzer/noasan-strcmp.test
+++ b/compiler-rt/test/fuzzer/noasan-strcmp.test
@@ -1,4 +1,4 @@
-UNSUPPORTED: darwin, target={{.*(freebsd|windows).*}}
+UNSUPPORTED: darwin, target={{.*(freebsd|windows).*}}, target=aarch64{{.*}}
 
 RUN: %cpp_compiler -fno-sanitize=address %S/StrcmpTest.cpp -o %t-NoAsanStrcmpTest
 RUN: not %run %t-NoAsanStrcmpTest -seed=1 -runs=2000000   2>&1 | FileCheck %s
diff --git a/compiler-rt/test/profile/ContinuousSyncMode/basic.c b/compiler-rt/test/profile/ContinuousSyncMode/basic.c
index e8bd087a0f59d..531877b78a1a2 100644
--- a/compiler-rt/test/profile/ContinuousSyncMode/basic.c
+++ b/compiler-rt/test/profile/ContinuousSyncMode/basic.c
@@ -1,4 +1,4 @@
-// REQUIRES: target={{.*(darwin|aix).*}}
+// REQUIRES: continuous-mode
 
 // RUN: %clang_profgen_cont -fcoverage-mapping -o %t.exe %s
 // RUN: echo "garbage" > %t.profraw
diff --git a/compiler-rt/test/profile/ContinuousSyncMode/get-filename.c b/compiler-rt/test/profile/ContinuousSyncMode/get-filename.c
index 40a0cc5ffd688..e341dd429eb84 100644
--- a/compiler-rt/test/profile/ContinuousSyncMode/get-filename.c
+++ b/compiler-rt/test/profile/ContinuousSyncMode/get-filename.c
@@ -1,4 +1,4 @@
-// REQUIRES: target={{.*(darwin|aix).*}}
+// REQUIRES: continuous-mode
 
 // RUN: %clang_pgogen_cont -o %t.exe %s
 // RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe %t.profraw
diff --git a/compiler-rt/test/profile/ContinuousSyncMode/image-with-mcdc.c b/compiler-rt/test/profile/ContinuousSyncMode/image-with-mcdc.c
index d171badbf4d33..fa24e26c4c53b 100644
--- a/compiler-rt/test/profile/ContinuousSyncMode/image-with-mcdc.c
+++ b/compiler-rt/test/profile/ContinuousSyncMode/image-with-mcdc.c
@@ -1,4 +1,4 @@
-// REQUIRES: target={{.*(darwin|aix).*}}
+// REQUIRES: continuous-mode
 
 // RUN: %clang_profgen_cont -fcoverage-mapping -fcoverage-mcdc -O3 -o %t.exe %s
 // RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe 3 3
diff --git a/compiler-rt/test/profile/ContinuousSyncMode/multi-threaded.cpp b/compiler-rt/test/profile/ContinuousSyncMode/multi-threaded.cpp
index ff05a69a5e7d4..aa0a46e0fc396 100644
--- a/compiler-rt/test/profile/ContinuousSyncMode/multi-threaded.cpp
+++ b/compiler-rt/test/profile/ContinuousSyncMode/multi-threaded.cpp
@@ -1,4 +1,4 @@
-// REQUIRES: target={{.*(darwin|aix).*}}
+// REQUIRES: continuous-mode
 
 // RUN: rm -f %t.profraw
 // RUN: %clangxx_pgogen_cont -lpthread %s -o %t.exe -mllvm -disable-vp -fprofile-update=atomic
diff --git a/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c b/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c
index 54346487a5c79..c1931410f8c76 100644
--- a/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c
+++ b/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c
@@ -1,4 +1,4 @@
-// REQUIRES: target={{.*(darwin|aix).*}}
+// REQUIRES: continuous-mode
 
 // Test the online merging mode (%m) along with continuous mode (%c).
 //
diff --git a/compiler-rt/test/profile/ContinuousSyncMode/pid-substitution.c b/compiler-rt/test/profile/ContinuousSyncMode/pid-substitution.c
index 309b685a95c5b..8a00b28825cae 100644
--- a/compiler-rt/test/profile/ContinuousSyncMode/pid-substitution.c
+++ b/compiler-rt/test/profile/ContinuousSyncMode/pid-substitution.c
@@ -1,4 +1,4 @@
-// REQUIRES: target={{.*(darwin|aix).*}}
+// REQUIRES: continuous-mode
 
 // RUN: rm -rf %t.dir && mkdir -p %t.dir
 // RUN: %clang_pgogen_cont -o %t.exe %s
diff --git a/compiler-rt/test/profile/ContinuousSyncMode/set-filename.c b/compiler-rt/test/profile/ContinuousSyncMode/set-filename.c
index 106e12e4e3b6e..abc72646d16b4 100644
--- a/compiler-rt/test/profile/ContinuousSyncMode/set-filename.c
+++ b/compiler-rt/test/profile/ContinuousSyncMode/set-filename.c
@@ -1,4 +1,4 @@
-// REQUIRES: target={{.*(darwin|aix).*}}
+// REQUIRES: continuous-mode
 
 // RUN: %clang_pgogen_cont -o %t.exe %s
 // RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe %t.profraw %t.bad
diff --git a/compiler-rt/test/profile/lit.cfg.py b/compiler-rt/test/profile/lit.cfg.py
index 72a389eaf0dfb..fc2baf7c40b8f 100644
--- a/compiler-rt/test/profile/lit.cfg.py
+++ b/compiler-rt/test/profile/lit.cfg.py
@@ -31,7 +31,7 @@ def get_required_attr(config, attr_name):
 target_is_msvc = bool(re.match(r".*-windows-msvc$", config.target_triple))
 
 # Whether continous profile collection (%c) requires runtime counter relocation on this platform
-runtime_reloc = bool(config.host_os in ["AIX"])
+runtime_reloc = bool(config.host_os in ["AIX", "Linux"])
 
 if config.host_os in ["Linux"]:
     extra_link_flags = ["-ldl"]
@@ -210,3 +210,6 @@ def exclude_unsupported_files_for_aix(dirname):
 
 if config.have_curl:
     config.available_features.add("curl")
+
+if config.host_os in ("AIX", "Darwin", "Linux"):
+    config.available_features.add("continuous-mode")
diff --git a/flang/docs/Extensions.md b/flang/docs/Extensions.md
index 626bf4399d632..2d1c967a6068d 100644
--- a/flang/docs/Extensions.md
+++ b/flang/docs/Extensions.md
@@ -141,6 +141,18 @@ end
   This interpretation has usability advantages and is what six other
   Fortran compilers do, but is not conforming now that J3 approved an
   "interp" in June 2024 to the contrary.
+* Arm has processors that allow a user to control what happens when an
+  arithmetic exception is signaled, as well as processors that do not
+  have this capability. An Arm executable will run on either type of
+  processor, so it is effectively unknown at compile time whether or
+  not this support will be available at runtime. The standard requires
+  that a call to intrinsic module procedure `IEEE_SUPPORT_HALTING` with
+  a constant argument has a compile time constant result in `constant
+  expression` and `specification expression` contexts. In compilations
+  where this information is not known at compile time, f18 generates code
+  to determine the absence or presence of this capability at runtime.
+  A call to `IEEE_SUPPORT_HALTING` in contexts that the standard requires
+  to be constant will generate a compilation error.
 
 ## Extensions, deletions, and legacy features supported by default
 
diff --git a/flang/include/flang/Common/idioms.h b/flang/include/flang/Common/idioms.h
index 99f383ec75b99..06631bcf2e445 100644
--- a/flang/include/flang/Common/idioms.h
+++ b/flang/include/flang/Common/idioms.h
@@ -87,7 +87,10 @@ template  visitors(LAMBDAS... x) -> visitors;
 // To disable, compile with '-DCHECK=(void)'
 #ifndef CHECK
 #define CHECK(x) ((x) || (DIE("CHECK(" #x ") failed"), false))
+#endif
+
 // Same as above, but with a custom error message.
+#ifndef CHECK_MSG
 #define CHECK_MSG(x, y) ((x) || (DIE("CHECK(" #x ") failed: " #y), false))
 #endif
 
diff --git a/flang/include/flang/Evaluate/target.h b/flang/include/flang/Evaluate/target.h
index 9d86000b2f8aa..154561ce868eb 100644
--- a/flang/include/flang/Evaluate/target.h
+++ b/flang/include/flang/Evaluate/target.h
@@ -36,6 +36,13 @@ class TargetCharacteristics {
   bool isBigEndian() const { return isBigEndian_; }
   void set_isBigEndian(bool isBig = true);
 
+  bool haltingSupportIsUnknownAtCompileTime() const {
+    return haltingSupportIsUnknownAtCompileTime_;
+  }
+  void set_haltingSupportIsUnknownAtCompileTime(bool yes = true) {
+    haltingSupportIsUnknownAtCompileTime_ = yes;
+  }
+
   bool areSubnormalsFlushedToZero() const {
     return areSubnormalsFlushedToZero_;
   }
@@ -50,6 +57,14 @@ class TargetCharacteristics {
   Rounding roundingMode() const { return roundingMode_; }
   void set_roundingMode(Rounding);
 
+  void set_ieeeFeature(IeeeFeature ieeeFeature, bool yes = true) {
+    if (yes) {
+      ieeeFeatures_.set(ieeeFeature);
+    } else {
+      ieeeFeatures_.reset(ieeeFeature);
+    }
+  }
+
   std::size_t procedurePointerByteSize() const {
     return procedurePointerByteSize_;
   }
@@ -112,6 +127,7 @@ class TargetCharacteristics {
   bool isBigEndian_{false};
   bool isPPC_{false};
   bool isOSWindows_{false};
+  bool haltingSupportIsUnknownAtCompileTime_{false};
   bool areSubnormalsFlushedToZero_{false};
   bool hasSubnormalFlushingControl_[maxKind + 1]{};
   Rounding roundingMode_{defaultRounding};
@@ -123,10 +139,9 @@ class TargetCharacteristics {
   std::string compilerOptionsString_;
   std::string compilerVersionString_;
   IeeeFeatures ieeeFeatures_{IeeeFeature::Denormal, IeeeFeature::Divide,
-      IeeeFeature::Flags, IeeeFeature::Halting, IeeeFeature::Inf,
-      IeeeFeature::Io, IeeeFeature::NaN, IeeeFeature::Rounding,
-      IeeeFeature::Sqrt, IeeeFeature::Standard, IeeeFeature::Subnormal,
-      IeeeFeature::UnderflowControl};
+      IeeeFeature::Flags, IeeeFeature::Inf, IeeeFeature::Io, IeeeFeature::NaN,
+      IeeeFeature::Rounding, IeeeFeature::Sqrt, IeeeFeature::Standard,
+      IeeeFeature::Subnormal, IeeeFeature::UnderflowControl};
 };
 
 } // namespace Fortran::evaluate
diff --git a/flang/include/flang/Frontend/FrontendActions.h b/flang/include/flang/Frontend/FrontendActions.h
index 374fd76c8ae17..4e3d3cb2657db 100644
--- a/flang/include/flang/Frontend/FrontendActions.h
+++ b/flang/include/flang/Frontend/FrontendActions.h
@@ -19,6 +19,7 @@
 #include "flang/Semantics/semantics.h"
 
 #include "mlir/IR/BuiltinOps.h"
+#include "mlir/IR/OwningOpRef.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/IR/Module.h"
 #include 
@@ -215,8 +216,8 @@ class CodeGenAction : public FrontendAction {
   CodeGenAction(BackendActionTy act) : action{act} {};
   /// @name MLIR
   /// {
-  std::unique_ptr mlirModule;
   std::unique_ptr mlirCtx;
+  mlir::OwningOpRef mlirModule;
   /// }
 
   /// @name LLVM IR
diff --git a/flang/include/flang/Lower/AbstractConverter.h b/flang/include/flang/Lower/AbstractConverter.h
index 8f026ac3280bf..607aff41f6459 100644
--- a/flang/include/flang/Lower/AbstractConverter.h
+++ b/flang/include/flang/Lower/AbstractConverter.h
@@ -62,7 +62,7 @@ struct SymbolBox;
 namespace pft {
 struct Variable;
 struct FunctionLikeUnit;
-}
+} // namespace pft
 
 using SomeExpr = Fortran::evaluate::Expr;
 using SymbolRef = Fortran::common::Reference;
@@ -295,7 +295,7 @@ class AbstractConverter {
   /// Get the OpBuilder
   virtual fir::FirOpBuilder &getFirOpBuilder() = 0;
   /// Get the ModuleOp
-  virtual mlir::ModuleOp &getModuleOp() = 0;
+  virtual mlir::ModuleOp getModuleOp() = 0;
   /// Get the MLIRContext
   virtual mlir::MLIRContext &getMLIRContext() = 0;
   /// Unique a symbol (add a containing scope specific prefix)
diff --git a/flang/include/flang/Lower/Bridge.h b/flang/include/flang/Lower/Bridge.h
index 8ea5ed52e2821..6404a16f7785a 100644
--- a/flang/include/flang/Lower/Bridge.h
+++ b/flang/include/flang/Lower/Bridge.h
@@ -23,6 +23,7 @@
 #include "flang/Optimizer/Builder/FIRBuilder.h"
 #include "flang/Optimizer/Dialect/Support/KindMapping.h"
 #include "mlir/IR/BuiltinOps.h"
+#include "mlir/IR/OwningOpRef.h"
 #include 
 
 namespace llvm {
@@ -83,7 +84,8 @@ class LoweringBridge {
   mlir::MLIRContext &getMLIRContext() { return context; }
 
   /// Get the ModuleOp. It can never be null, which is asserted in the ctor.
-  mlir::ModuleOp &getModule() { return *module.get(); }
+  mlir::ModuleOp getModule() { return *module; }
+  mlir::ModuleOp getModuleAndRelease() { return module.release(); }
 
   const Fortran::common::IntrinsicTypeDefaultKinds &getDefaultKinds() const {
     return defaultKinds;
@@ -166,7 +168,7 @@ class LoweringBridge {
   const Fortran::evaluate::TargetCharacteristics &targetCharacteristics;
   const Fortran::parser::AllCookedSources *cooked;
   mlir::MLIRContext &context;
-  std::unique_ptr module;
+  mlir::OwningOpRef module;
   fir::KindMapping &kindMap;
   const Fortran::lower::LoweringOptions &loweringOptions;
   const std::vector &envDefaults;
diff --git a/flang/include/flang/Lower/OpenACC.h b/flang/include/flang/Lower/OpenACC.h
index fbf61e7184ae2..0d7038a7fd856 100644
--- a/flang/include/flang/Lower/OpenACC.h
+++ b/flang/include/flang/Lower/OpenACC.h
@@ -19,7 +19,7 @@ namespace llvm {
 template 
 class SmallVector;
 class StringRef;
-}
+} // namespace llvm
 
 namespace mlir {
 class Location;
@@ -44,7 +44,7 @@ struct OpenACCRoutineConstruct;
 namespace semantics {
 class SemanticsContext;
 class Symbol;
-}
+} // namespace semantics
 
 namespace lower {
 
@@ -78,11 +78,11 @@ void genOpenACCDeclarativeConstruct(AbstractConverter &,
                                     AccRoutineInfoMappingList &);
 void genOpenACCRoutineConstruct(AbstractConverter &,
                                 Fortran::semantics::SemanticsContext &,
-                                mlir::ModuleOp &,
+                                mlir::ModuleOp,
                                 const parser::OpenACCRoutineConstruct &,
                                 AccRoutineInfoMappingList &);
 
-void finalizeOpenACCRoutineAttachment(mlir::ModuleOp &,
+void finalizeOpenACCRoutineAttachment(mlir::ModuleOp,
                                       AccRoutineInfoMappingList &);
 
 /// Get a acc.private.recipe op for the given type or create it if it does not
diff --git a/flang/include/flang/Optimizer/Builder/IntrinsicCall.h b/flang/include/flang/Optimizer/Builder/IntrinsicCall.h
index 6899505eeb39d..3d0516555f761 100644
--- a/flang/include/flang/Optimizer/Builder/IntrinsicCall.h
+++ b/flang/include/flang/Optimizer/Builder/IntrinsicCall.h
@@ -296,9 +296,10 @@ struct IntrinsicLibrary {
   mlir::Value genIeeeSignalingCompare(mlir::Type resultType,
                                       llvm::ArrayRef);
   mlir::Value genIeeeSignbit(mlir::Type, llvm::ArrayRef);
-  fir::ExtendedValue
-      genIeeeSupportFlagOrHalting(mlir::Type,
-                                  llvm::ArrayRef);
+  fir::ExtendedValue genIeeeSupportFlag(mlir::Type,
+                                        llvm::ArrayRef);
+  fir::ExtendedValue genIeeeSupportHalting(mlir::Type,
+                                           llvm::ArrayRef);
   mlir::Value genIeeeSupportRounding(mlir::Type, llvm::ArrayRef);
   template 
   mlir::Value genIeeeTypeCompare(mlir::Type, llvm::ArrayRef);
diff --git a/flang/include/flang/Optimizer/Builder/Runtime/Exceptions.h b/flang/include/flang/Optimizer/Builder/Runtime/Exceptions.h
index f2f83b46f20fd..f44e0c95ef6d4 100644
--- a/flang/include/flang/Optimizer/Builder/Runtime/Exceptions.h
+++ b/flang/include/flang/Optimizer/Builder/Runtime/Exceptions.h
@@ -26,6 +26,9 @@ namespace fir::runtime {
 mlir::Value genMapExcept(fir::FirOpBuilder &builder, mlir::Location loc,
                          mlir::Value excepts);
 
+mlir::Value genSupportHalting(fir::FirOpBuilder &builder, mlir::Location loc,
+                              mlir::Value excepts);
+
 mlir::Value genGetUnderflowMode(fir::FirOpBuilder &builder, mlir::Location loc);
 void genSetUnderflowMode(fir::FirOpBuilder &builder, mlir::Location loc,
                          mlir::Value bit);
diff --git a/flang/include/flang/Runtime/CUDA/descriptor.h b/flang/include/flang/Runtime/CUDA/descriptor.h
index 4c6c2c4694fd4..55878aaac57fb 100644
--- a/flang/include/flang/Runtime/CUDA/descriptor.h
+++ b/flang/include/flang/Runtime/CUDA/descriptor.h
@@ -18,11 +18,11 @@ namespace Fortran::runtime::cuda {
 extern "C" {
 
 /// Allocate a descriptor in managed.
-Descriptor *RTDECL(CUFAllocDesciptor)(
+Descriptor *RTDECL(CUFAllocDescriptor)(
     std::size_t, const char *sourceFile = nullptr, int sourceLine = 0);
 
 /// Deallocate a descriptor allocated in managed or unified memory.
-void RTDECL(CUFFreeDesciptor)(
+void RTDECL(CUFFreeDescriptor)(
     Descriptor *, const char *sourceFile = nullptr, int sourceLine = 0);
 
 /// Retrieve the device pointer from the host one.
diff --git a/flang/include/flang/Runtime/exceptions.h b/flang/include/flang/Runtime/exceptions.h
index bd6c439b150ab..483d0271bcab0 100644
--- a/flang/include/flang/Runtime/exceptions.h
+++ b/flang/include/flang/Runtime/exceptions.h
@@ -24,6 +24,10 @@ extern "C" {
 // This mapping is done at runtime to support cross compilation.
 std::uint32_t RTNAME(MapException)(std::uint32_t excepts);
 
+// Check if the processor has the ability to control whether to halt
+// or continue exeuction when a given exception is raised.
+bool RTNAME(SupportHalting)(uint32_t except);
+
 // Get and set the ieee underflow mode if supported; otherwise nops.
 bool RTNAME(GetUnderflowMode)(void);
 void RTNAME(SetUnderflowMode)(bool flag);
diff --git a/flang/include/flang/Tools/CrossToolHelpers.h b/flang/include/flang/Tools/CrossToolHelpers.h
index c0091e1c953b8..0286f2aa14519 100644
--- a/flang/include/flang/Tools/CrossToolHelpers.h
+++ b/flang/include/flang/Tools/CrossToolHelpers.h
@@ -174,7 +174,7 @@ struct OffloadModuleOpts {
 //  Shares assinging of the OpenMP OffloadModuleInterface and its assorted
 //  attributes accross Flang tools (bbc/flang)
 [[maybe_unused]] static void setOffloadModuleInterfaceAttributes(
-    mlir::ModuleOp &module, OffloadModuleOpts Opts) {
+    mlir::ModuleOp module, OffloadModuleOpts Opts) {
   // Should be registered by the OpenMPDialect
   if (auto offloadMod = llvm::dyn_cast(
           module.getOperation())) {
@@ -198,7 +198,7 @@ struct OffloadModuleOpts {
 }
 
 [[maybe_unused]] static void setOpenMPVersionAttribute(
-    mlir::ModuleOp &module, int64_t version) {
+    mlir::ModuleOp module, int64_t version) {
   module.getOperation()->setAttr(
       mlir::StringAttr::get(module.getContext(), llvm::Twine{"omp.version"}),
       mlir::omp::VersionAttr::get(module.getContext(), version));
diff --git a/flang/include/flang/Tools/TargetSetup.h b/flang/include/flang/Tools/TargetSetup.h
index 1889140ddce75..709c4bbe4b7b0 100644
--- a/flang/include/flang/Tools/TargetSetup.h
+++ b/flang/include/flang/Tools/TargetSetup.h
@@ -34,6 +34,13 @@ namespace Fortran::tools {
     targetCharacteristics.set_hasSubnormalFlushingControl(/*kind=*/4);
     targetCharacteristics.set_hasSubnormalFlushingControl(/*kind=*/8);
   }
+  if (targetTriple.isARM() || targetTriple.isAArch64()) {
+    targetCharacteristics.set_haltingSupportIsUnknownAtCompileTime();
+    targetCharacteristics.set_ieeeFeature(
+        evaluate::IeeeFeature::Halting, false);
+  } else {
+    targetCharacteristics.set_ieeeFeature(evaluate::IeeeFeature::Halting);
+  }
 
   // Figure out if we can support F128: see
   // flang/runtime/Float128Math/math-entries.h
diff --git a/flang/lib/Evaluate/fold-logical.cpp b/flang/lib/Evaluate/fold-logical.cpp
index 6c7758e99a448..e3ec1a1af8881 100644
--- a/flang/lib/Evaluate/fold-logical.cpp
+++ b/flang/lib/Evaluate/fold-logical.cpp
@@ -881,8 +881,11 @@ Expr> FoldIntrinsicFunction(
     return Expr{context.targetCharacteristics().ieeeFeatures().test(
         IeeeFeature::Flags)};
   } else if (name == "__builtin_ieee_support_halting") {
-    return Expr{context.targetCharacteristics().ieeeFeatures().test(
-        IeeeFeature::Halting)};
+    if (!context.targetCharacteristics()
+             .haltingSupportIsUnknownAtCompileTime()) {
+      return Expr{context.targetCharacteristics().ieeeFeatures().test(
+          IeeeFeature::Halting)};
+    }
   } else if (name == "__builtin_ieee_support_inf") {
     return Expr{
         context.targetCharacteristics().ieeeFeatures().test(IeeeFeature::Inf)};
diff --git a/flang/lib/Frontend/FrontendActions.cpp b/flang/lib/Frontend/FrontendActions.cpp
index 77631f70dfd19..603cb039d20b1 100644
--- a/flang/lib/Frontend/FrontendActions.cpp
+++ b/flang/lib/Frontend/FrontendActions.cpp
@@ -149,7 +149,7 @@ bool PrescanAndSemaDebugAction::beginSourceFileAction() {
          (runSemanticChecks() || true) && (generateRtTypeTables() || true);
 }
 
-static void addDependentLibs(mlir::ModuleOp &mlirModule, CompilerInstance &ci) {
+static void addDependentLibs(mlir::ModuleOp mlirModule, CompilerInstance &ci) {
   const std::vector &libs =
       ci.getInvocation().getCodeGenOpts().DependentLibs;
   if (libs.empty()) {
@@ -171,7 +171,7 @@ static void addDependentLibs(mlir::ModuleOp &mlirModule, CompilerInstance &ci) {
 // Add to MLIR code target specific items which are dependent on target
 // configuration specified by the user.
 // Clang equivalent function: AMDGPUTargetCodeGenInfo::emitTargetGlobals
-static void addAMDGPUSpecificMLIRItems(mlir::ModuleOp &mlirModule,
+static void addAMDGPUSpecificMLIRItems(mlir::ModuleOp mlirModule,
                                        CompilerInstance &ci) {
   const TargetOptions &targetOpts = ci.getInvocation().getTargetOpts();
   const llvm::Triple triple(targetOpts.triple);
@@ -269,7 +269,7 @@ bool CodeGenAction::beginSourceFileAction() {
       return false;
     }
 
-    mlirModule = std::make_unique(module.release());
+    mlirModule = std::move(module);
     const llvm::DataLayout &dl = targetMachine.createDataLayout();
     fir::support::setMLIRDataLayout(*mlirModule, dl);
     return true;
@@ -303,14 +303,11 @@ bool CodeGenAction::beginSourceFileAction() {
       ci.getInvocation().getFrontendOpts().features, targetMachine,
       ci.getInvocation().getTargetOpts(), ci.getInvocation().getCodeGenOpts());
 
-  // Fetch module from lb, so we can set
-  mlirModule = std::make_unique(lb.getModule());
-
   if (ci.getInvocation().getFrontendOpts().features.IsEnabled(
           Fortran::common::LanguageFeature::OpenMP)) {
-    setOffloadModuleInterfaceAttributes(*mlirModule,
+    setOffloadModuleInterfaceAttributes(lb.getModule(),
                                         ci.getInvocation().getLangOpts());
-    setOpenMPVersionAttribute(*mlirModule,
+    setOpenMPVersionAttribute(lb.getModule(),
                               ci.getInvocation().getLangOpts().OpenMPVersion);
   }
 
@@ -318,6 +315,9 @@ bool CodeGenAction::beginSourceFileAction() {
   Fortran::parser::Program &parseTree{*ci.getParsing().parseTree()};
   lb.lower(parseTree, ci.getSemanticsContext());
 
+  // Fetch module from lb, so we can set
+  mlirModule = lb.getModuleAndRelease();
+
   // Add target specific items like dependent libraries, target specific
   // constants etc.
   addDependentLibs(*mlirModule, ci);
@@ -961,6 +961,9 @@ static void generateMachineCodeOrAssemblyImpl(clang::DiagnosticsEngine &diags,
 
   // Run the passes
   codeGenPasses.run(llvmModule);
+
+  // Cleanup
+  delete tlii;
 }
 
 void CodeGenAction::runOptimizationPipeline(llvm::raw_pwrite_stream &os) {
@@ -1043,6 +1046,9 @@ void CodeGenAction::runOptimizationPipeline(llvm::raw_pwrite_stream &os) {
 
   // Run the passes.
   mpm.run(*llvmModule, mam);
+
+  // Cleanup
+  delete tlii;
 }
 
 // This class handles optimization remark messages requested if
diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp
index 17b794d147c6f..c7e2635230e98 100644
--- a/flang/lib/Lower/Bridge.cpp
+++ b/flang/lib/Lower/Bridge.cpp
@@ -1028,7 +1028,7 @@ class FirConverter : public Fortran::lower::AbstractConverter {
 
   fir::FirOpBuilder &getFirOpBuilder() override final { return *builder; }
 
-  mlir::ModuleOp &getModuleOp() override final { return bridge.getModule(); }
+  mlir::ModuleOp getModuleOp() override final { return bridge.getModule(); }
 
   mlir::MLIRContext &getMLIRContext() override final {
     return bridge.getMLIRContext();
@@ -6137,10 +6137,7 @@ void Fortran::lower::LoweringBridge::lower(
 }
 
 void Fortran::lower::LoweringBridge::parseSourceFile(llvm::SourceMgr &srcMgr) {
-  mlir::OwningOpRef owningRef =
-      mlir::parseSourceFile(srcMgr, &context);
-  module.reset(new mlir::ModuleOp(owningRef.get().getOperation()));
-  owningRef.release();
+  module = mlir::parseSourceFile(srcMgr, &context);
 }
 
 Fortran::lower::LoweringBridge::LoweringBridge(
@@ -6207,19 +6204,18 @@ Fortran::lower::LoweringBridge::LoweringBridge(
   };
 
   // Create the module and attach the attributes.
-  module = std::make_unique(
+  module = mlir::OwningOpRef(
       mlir::ModuleOp::create(getPathLocation()));
-  assert(module.get() && "module was not created");
-  fir::setTargetTriple(*module.get(), triple);
-  fir::setKindMapping(*module.get(), kindMap);
-  fir::setTargetCPU(*module.get(), targetMachine.getTargetCPU());
-  fir::setTuneCPU(*module.get(), targetOpts.cpuToTuneFor);
-  fir::setTargetFeatures(*module.get(), targetMachine.getTargetFeatureString());
-  fir::support::setMLIRDataLayout(*module.get(),
-                                  targetMachine.createDataLayout());
-  fir::setIdent(*module.get(), Fortran::common::getFlangFullVersion());
+  assert(*module && "module was not created");
+  fir::setTargetTriple(*module, triple);
+  fir::setKindMapping(*module, kindMap);
+  fir::setTargetCPU(*module, targetMachine.getTargetCPU());
+  fir::setTuneCPU(*module, targetOpts.cpuToTuneFor);
+  fir::setTargetFeatures(*module, targetMachine.getTargetFeatureString());
+  fir::support::setMLIRDataLayout(*module, targetMachine.createDataLayout());
+  fir::setIdent(*module, Fortran::common::getFlangFullVersion());
   if (cgOpts.RecordCommandLine)
-    fir::setCommandline(*module.get(), *cgOpts.RecordCommandLine);
+    fir::setCommandline(*module, *cgOpts.RecordCommandLine);
 }
 
 void Fortran::lower::genCleanUpInRegionIfAny(
diff --git a/flang/lib/Lower/IO.cpp b/flang/lib/Lower/IO.cpp
index 0d4f95fdcc4d8..75453721d91a2 100644
--- a/flang/lib/Lower/IO.cpp
+++ b/flang/lib/Lower/IO.cpp
@@ -32,6 +32,7 @@
 #include "flang/Optimizer/Builder/Todo.h"
 #include "flang/Optimizer/Dialect/FIRDialect.h"
 #include "flang/Optimizer/Dialect/Support/FIRContext.h"
+#include "flang/Optimizer/Support/InternalNames.h"
 #include "flang/Parser/parse-tree.h"
 #include "flang/Runtime/io-api-consts.h"
 #include "flang/Semantics/runtime-type-info.h"
@@ -298,9 +299,10 @@ getNonTbpDefinedIoTableAddr(Fortran::lower::AbstractConverter &converter,
   mlir::Location loc = converter.getCurrentLocation();
   mlir::Type refTy = fir::ReferenceType::get(mlir::NoneType::get(context));
   std::string suffix = ".nonTbpDefinedIoTable";
-  std::string tableMangleName = definedIoProcMap.empty()
-                                    ? "default" + suffix
-                                    : converter.mangleName(suffix);
+  std::string tableMangleName =
+      definedIoProcMap.empty()
+          ? fir::NameUniquer::doGenerated("default" + suffix)
+          : converter.mangleName(suffix);
   if (auto table = builder.getNamedGlobal(tableMangleName))
     return builder.createConvert(
         loc, refTy,
diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp
index ed18ad89c16ef..8155c36396b11 100644
--- a/flang/lib/Lower/OpenACC.cpp
+++ b/flang/lib/Lower/OpenACC.cpp
@@ -2670,11 +2670,13 @@ static void genACCDataOp(Fortran::lower::AbstractConverter &converter,
           asyncOnlyDeviceTypes);
       attachEntryOperands.append(dataClauseOperands.begin() + crtDataStart,
                                  dataClauseOperands.end());
-    } else if(const auto *defaultClause = 
-                  std::get_if(&clause.u)) {
+    } else if (const auto *defaultClause =
+                   std::get_if(
+                       &clause.u)) {
       if ((defaultClause->v).v == llvm::acc::DefaultValue::ACC_Default_none)
         hasDefaultNone = true;
-      else if ((defaultClause->v).v == llvm::acc::DefaultValue::ACC_Default_present)
+      else if ((defaultClause->v).v ==
+               llvm::acc::DefaultValue::ACC_Default_present)
         hasDefaultPresent = true;
     }
   }
@@ -3830,7 +3832,7 @@ genDeclareInFunction(Fortran::lower::AbstractConverter &converter,
 
 static void
 genDeclareInModule(Fortran::lower::AbstractConverter &converter,
-                   mlir::ModuleOp &moduleOp,
+                   mlir::ModuleOp moduleOp,
                    const Fortran::parser::AccClauseList &accClauseList) {
   mlir::OpBuilder modBuilder(moduleOp.getBodyRegion());
   for (const Fortran::parser::AccClause &clause : accClauseList.v) {
@@ -3981,7 +3983,7 @@ static void attachRoutineInfo(mlir::func::FuncOp func,
 
 void Fortran::lower::genOpenACCRoutineConstruct(
     Fortran::lower::AbstractConverter &converter,
-    Fortran::semantics::SemanticsContext &semanticsContext, mlir::ModuleOp &mod,
+    Fortran::semantics::SemanticsContext &semanticsContext, mlir::ModuleOp mod,
     const Fortran::parser::OpenACCRoutineConstruct &routineConstruct,
     Fortran::lower::AccRoutineInfoMappingList &accRoutineInfos) {
   fir::FirOpBuilder &builder = converter.getFirOpBuilder();
@@ -4139,7 +4141,7 @@ void Fortran::lower::genOpenACCRoutineConstruct(
 }
 
 void Fortran::lower::finalizeOpenACCRoutineAttachment(
-    mlir::ModuleOp &mod,
+    mlir::ModuleOp mod,
     Fortran::lower::AccRoutineInfoMappingList &accRoutineInfos) {
   for (auto &mapping : accRoutineInfos) {
     mlir::func::FuncOp funcOp =
diff --git a/flang/lib/Lower/OpenMP/ClauseProcessor.cpp b/flang/lib/Lower/OpenMP/ClauseProcessor.cpp
index 3c9831120351e..c4ab5e0033d04 100644
--- a/flang/lib/Lower/OpenMP/ClauseProcessor.cpp
+++ b/flang/lib/Lower/OpenMP/ClauseProcessor.cpp
@@ -153,10 +153,13 @@ genDependKindAttr(lower::AbstractConverter &converter,
     pbKind = mlir::omp::ClauseTaskDepend::taskdependinout;
     break;
   case omp::clause::DependenceType::Mutexinoutset:
+    pbKind = mlir::omp::ClauseTaskDepend::taskdependmutexinoutset;
+    break;
   case omp::clause::DependenceType::Inoutset:
+    pbKind = mlir::omp::ClauseTaskDepend::taskdependinoutset;
+    break;
   case omp::clause::DependenceType::Depobj:
-    TODO(currentLocation,
-         "INOUTSET, MUTEXINOUTSET and DEPOBJ dependence-types");
+    TODO(currentLocation, "DEPOBJ dependence-type");
     break;
   case omp::clause::DependenceType::Sink:
   case omp::clause::DependenceType::Source:
diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index 4de5ecf187a4c..b07e89d201d19 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -2867,7 +2867,6 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable,
         !std::holds_alternative(clause.u) &&
         !std::holds_alternative(clause.u) &&
         !std::holds_alternative(clause.u) &&
-        !std::holds_alternative(clause.u) &&
         !std::holds_alternative(clause.u) &&
         !std::holds_alternative(clause.u)) {
       std::string name =
diff --git a/flang/lib/Optimizer/Analysis/AliasAnalysis.cpp b/flang/lib/Optimizer/Analysis/AliasAnalysis.cpp
index 0b0f83d024ce3..611f212269fb7 100644
--- a/flang/lib/Optimizer/Analysis/AliasAnalysis.cpp
+++ b/flang/lib/Optimizer/Analysis/AliasAnalysis.cpp
@@ -599,8 +599,9 @@ AliasAnalysis::Source AliasAnalysis::getSource(mlir::Value v,
           // If load is inside target and it points to mapped item,
           // continue tracking.
           Operation *loadMemrefOp = op.getMemref().getDefiningOp();
-          bool isDeclareOp = llvm::isa(loadMemrefOp) ||
-                             llvm::isa(loadMemrefOp);
+          bool isDeclareOp =
+              llvm::isa_and_present(loadMemrefOp) ||
+              llvm::isa_and_present(loadMemrefOp);
           if (isDeclareOp &&
               llvm::isa(loadMemrefOp->getParentOp())) {
             v = op.getMemref();
diff --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
index bbbacd25bca62..9a3777994a9df 100644
--- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
+++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
@@ -389,10 +389,10 @@ static constexpr IntrinsicHandler handlers[]{
      &I::genIeeeSignalingCompare},
     {"ieee_signbit", &I::genIeeeSignbit},
     {"ieee_support_flag",
-     &I::genIeeeSupportFlagOrHalting,
+     &I::genIeeeSupportFlag,
      {{{"flag", asValue}, {"x", asInquired, handleDynamicOptional}}},
      /*isElemental=*/false},
-    {"ieee_support_halting", &I::genIeeeSupportFlagOrHalting},
+    {"ieee_support_halting", &I::genIeeeSupportHalting},
     {"ieee_support_rounding", &I::genIeeeSupportRounding},
     {"ieee_unordered", &I::genIeeeUnordered},
     {"ieee_value", &I::genIeeeValue},
@@ -5259,14 +5259,14 @@ mlir::Value IntrinsicLibrary::genIeeeSignbit(mlir::Type resultType,
   return builder.createConvert(loc, resultType, sign);
 }
 
-// IEEE_SUPPORT_FLAG, IEEE_SUPPORT_HALTING
-fir::ExtendedValue IntrinsicLibrary::genIeeeSupportFlagOrHalting(
-    mlir::Type resultType, llvm::ArrayRef args) {
-  // Check if a floating point exception or halting mode FLAG is supported.
-  // An IEEE_SUPPORT_FLAG flag is supported either for all type kinds or none.
-  // An optional kind argument X is therefore ignored.
-  // Standard flags are all supported.
-  // The nonstandard DENORM extension is not supported. (At least for now.)
+// IEEE_SUPPORT_FLAG
+fir::ExtendedValue
+IntrinsicLibrary::genIeeeSupportFlag(mlir::Type resultType,
+                                     llvm::ArrayRef args) {
+  // Check if a floating point exception flag is supported. A flag is
+  // supported either for all type kinds or none. An optional kind argument X
+  // is therefore ignored. Standard flags are all supported. The nonstandard
+  // DENORM extension is not supported, at least for now.
   assert(args.size() == 1 || args.size() == 2);
   auto [fieldRef, fieldTy] = getFieldRef(builder, loc, fir::getBase(args[0]));
   mlir::Value flag = builder.create(loc, fieldRef);
@@ -5283,6 +5283,22 @@ fir::ExtendedValue IntrinsicLibrary::genIeeeSupportFlagOrHalting(
           builder.createIntegerConstant(loc, fieldTy, 0)));
 }
 
+// IEEE_SUPPORT_HALTING
+fir::ExtendedValue IntrinsicLibrary::genIeeeSupportHalting(
+    mlir::Type resultType, llvm::ArrayRef args) {
+  // Check if halting is supported for a floating point exception flag.
+  // Standard flags are all supported. The nonstandard DENORM extension is
+  // not supported, at least for now.
+  assert(args.size() == 1);
+  mlir::Type i32Ty = builder.getIntegerType(32);
+  auto [fieldRef, ignore] = getFieldRef(builder, loc, getBase(args[0]));
+  mlir::Value field = builder.create(loc, fieldRef);
+  return builder.createConvert(
+      loc, resultType,
+      fir::runtime::genSupportHalting(
+          builder, loc, {builder.create(loc, i32Ty, field)}));
+}
+
 // IEEE_SUPPORT_ROUNDING
 mlir::Value
 IntrinsicLibrary::genIeeeSupportRounding(mlir::Type resultType,
diff --git a/flang/lib/Optimizer/Builder/Runtime/Exceptions.cpp b/flang/lib/Optimizer/Builder/Runtime/Exceptions.cpp
index 85f38424eabdc..630281fdb593d 100644
--- a/flang/lib/Optimizer/Builder/Runtime/Exceptions.cpp
+++ b/flang/lib/Optimizer/Builder/Runtime/Exceptions.cpp
@@ -21,6 +21,14 @@ mlir::Value fir::runtime::genMapExcept(fir::FirOpBuilder &builder,
   return builder.create(loc, func, excepts).getResult(0);
 }
 
+mlir::Value fir::runtime::genSupportHalting(fir::FirOpBuilder &builder,
+                                            mlir::Location loc,
+                                            mlir::Value excepts) {
+  mlir::func::FuncOp func{
+      fir::runtime::getRuntimeFunc(loc, builder)};
+  return builder.create(loc, func, excepts).getResult(0);
+}
+
 mlir::Value fir::runtime::genGetUnderflowMode(fir::FirOpBuilder &builder,
                                               mlir::Location loc) {
   mlir::func::FuncOp func{
diff --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
index 2f4cd84dda7de..4edea86b417c3 100644
--- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp
+++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
@@ -1210,12 +1210,12 @@ genCUFAllocDescriptor(mlir::Location loc,
       llvmPointerType, {llvmIntPtrType, llvmPointerType, llvmInt32Type});
 
   auto llvmFunc = mod.lookupSymbol(
-      RTNAME_STRING(CUFAllocDesciptor));
+      RTNAME_STRING(CUFAllocDescriptor));
   auto funcFunc =
-      mod.lookupSymbol(RTNAME_STRING(CUFAllocDesciptor));
+      mod.lookupSymbol(RTNAME_STRING(CUFAllocDescriptor));
   if (!llvmFunc && !funcFunc)
     mlir::OpBuilder::atBlockEnd(mod.getBody())
-        .create(loc, RTNAME_STRING(CUFAllocDesciptor),
+        .create(loc, RTNAME_STRING(CUFAllocDescriptor),
                                         fctTy);
 
   mlir::Type structTy = typeConverter.convertBoxTypeAsStruct(boxTy);
@@ -1224,7 +1224,7 @@ genCUFAllocDescriptor(mlir::Location loc,
       genConstantIndex(loc, llvmIntPtrType, rewriter, boxSize);
   llvm::SmallVector args = {sizeInBytes, sourceFile, sourceLine};
   return rewriter
-      .create(loc, fctTy, RTNAME_STRING(CUFAllocDesciptor),
+      .create(loc, fctTy, RTNAME_STRING(CUFAllocDescriptor),
                                   args)
       .getResult();
 }
@@ -1613,12 +1613,13 @@ struct EmboxCommonConversion : public fir::FIROpConversion {
         if (gepArgs.size() != 1)
           fir::emitFatalError(loc,
                               "corrupted substring GEP in fir.embox/fir.rebox");
-        mlir::Type outterOffsetTy = gepArgs[0].get().getType();
+        mlir::Type outterOffsetTy =
+            llvm::cast(gepArgs[0]).getType();
         mlir::Value cast =
             this->integerCast(loc, rewriter, outterOffsetTy, *substringOffset);
 
         gepArgs[0] = rewriter.create(
-            loc, outterOffsetTy, gepArgs[0].get(), cast);
+            loc, outterOffsetTy, llvm::cast(gepArgs[0]), cast);
       }
     }
     mlir::Type llvmPtrTy = ::getLlvmPtrType(resultTy.getContext());
@@ -1725,13 +1726,20 @@ struct EmboxOpConversion : public EmboxCommonConversion {
 };
 
 static bool isDeviceAllocation(mlir::Value val) {
+  if (auto loadOp = mlir::dyn_cast_or_null(val.getDefiningOp()))
+    return isDeviceAllocation(loadOp.getMemref());
+  if (auto boxAddrOp =
+          mlir::dyn_cast_or_null(val.getDefiningOp()))
+    return isDeviceAllocation(boxAddrOp.getVal());
   if (auto convertOp =
           mlir::dyn_cast_or_null(val.getDefiningOp()))
-    val = convertOp.getValue();
+    return isDeviceAllocation(convertOp.getValue());
   if (auto callOp = mlir::dyn_cast_or_null(val.getDefiningOp()))
     if (callOp.getCallee() &&
-        callOp.getCallee().value().getRootReference().getValue().starts_with(
-            RTNAME_STRING(CUFMemAlloc)))
+        (callOp.getCallee().value().getRootReference().getValue().starts_with(
+             RTNAME_STRING(CUFMemAlloc)) ||
+         callOp.getCallee().value().getRootReference().getValue().starts_with(
+             RTNAME_STRING(CUFAllocDescriptor))))
       return true;
   return false;
 }
@@ -2045,7 +2053,8 @@ struct XReboxOpConversion : public EmboxCommonConversion {
     }
     dest = insertBaseAddress(rewriter, loc, dest, base);
     mlir::Value result =
-        placeInMemoryIfNotGlobalInit(rewriter, rebox.getLoc(), destBoxTy, dest);
+        placeInMemoryIfNotGlobalInit(rewriter, rebox.getLoc(), destBoxTy, dest,
+                                     isDeviceAllocation(rebox.getBox()));
     rewriter.replaceOp(rebox, result);
     return mlir::success();
   }
@@ -2990,10 +2999,12 @@ struct GlobalOpConversion : public fir::FIROpConversion {
       g.setAlignment(*global.getAlignment());
 
     auto module = global->getParentOfType();
+    auto gpuMod = global->getParentOfType();
     // Add comdat if necessary
     if (fir::getTargetTriple(module).supportsCOMDAT() &&
         (linkage == mlir::LLVM::Linkage::Linkonce ||
-         linkage == mlir::LLVM::Linkage::LinkonceODR)) {
+         linkage == mlir::LLVM::Linkage::LinkonceODR) &&
+        !gpuMod) {
       addComdat(g, rewriter, module);
     }
 
@@ -3076,7 +3087,7 @@ struct GlobalOpConversion : public fir::FIROpConversion {
 private:
   static void addComdat(mlir::LLVM::GlobalOp &global,
                         mlir::ConversionPatternRewriter &rewriter,
-                        mlir::ModuleOp &module) {
+                        mlir::ModuleOp module) {
     const char *comdatName = "__llvm_comdat";
     mlir::LLVM::ComdatOp comdatOp =
         module.lookupSymbol(comdatName);
@@ -3120,7 +3131,7 @@ struct LoadOpConversion : public fir::FIROpConversion {
               inputBoxStorage.getDefiningOp())) {
         if (callOp.getCallee() &&
             (*callOp.getCallee())
-                .starts_with(RTNAME_STRING(CUFAllocDesciptor))) {
+                .starts_with(RTNAME_STRING(CUFAllocDescriptor))) {
           // CUDA Fortran local descriptor are allocated in managed memory. So
           // new storage must be allocated the same way.
           auto mod = load->getParentOfType();
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp b/flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp
index 769e14b1316d6..b68fe6ee0c747 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/InlineElementals.cpp
@@ -125,7 +125,7 @@ class InlineElementalsPass
     mlir::RewritePatternSet patterns(context);
     patterns.insert(context);
 
-    if (mlir::failed(mlir::applyPatternsAndFoldGreedily(
+    if (mlir::failed(mlir::applyPatternsGreedily(
             getOperation(), std::move(patterns), config))) {
       mlir::emitError(getOperation()->getLoc(),
                       "failure in HLFIR elemental inlining");
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp b/flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp
index 36fae90c83fd6..091ed7ed999df 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp
@@ -520,8 +520,8 @@ class LowerHLFIRIntrinsics
     config.enableRegionSimplification =
         mlir::GreedySimplifyRegionLevel::Disabled;
 
-    if (mlir::failed(mlir::applyPatternsAndFoldGreedily(
-            module, std::move(patterns), config))) {
+    if (mlir::failed(
+            mlir::applyPatternsGreedily(module, std::move(patterns), config))) {
       mlir::emitError(mlir::UnknownLoc::get(context),
                       "failure in HLFIR intrinsic lowering");
       signalPassFailure();
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp b/flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp
index c152c27c0a05b..bf3cf861e46f4 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp
@@ -1372,7 +1372,7 @@ class OptimizedBufferizationPass
     // patterns.insert>(context);
     // patterns.insert>(context);
 
-    if (mlir::failed(mlir::applyPatternsAndFoldGreedily(
+    if (mlir::failed(mlir::applyPatternsGreedily(
             getOperation(), std::move(patterns), config))) {
       mlir::emitError(getOperation()->getLoc(),
                       "failure in HLFIR optimized bufferization");
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp b/flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp
index 28325bc8e5489..bf3d261e7e883 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp
@@ -491,7 +491,7 @@ class SimplifyHLFIRIntrinsics
     patterns.insert(context);
     patterns.insert(context);
 
-    if (mlir::failed(mlir::applyPatternsAndFoldGreedily(
+    if (mlir::failed(mlir::applyPatternsGreedily(
             getOperation(), std::move(patterns), config))) {
       mlir::emitError(getOperation()->getLoc(),
                       "failure in HLFIR intrinsic simplification");
diff --git a/flang/lib/Optimizer/Transforms/AddAliasTags.cpp b/flang/lib/Optimizer/Transforms/AddAliasTags.cpp
index f1e70875de0ba..e6fc2ed992e38 100644
--- a/flang/lib/Optimizer/Transforms/AddAliasTags.cpp
+++ b/flang/lib/Optimizer/Transforms/AddAliasTags.cpp
@@ -227,7 +227,7 @@ void AddAliasTagsPass::runOnAliasInterface(fir::FirAliasTagOpInterface op,
       source.kind == fir::AliasAnalysis::SourceKind::Argument) {
     LLVM_DEBUG(llvm::dbgs().indent(2)
                << "Found reference to dummy argument at " << *op << "\n");
-    std::string name = getFuncArgName(source.origin.u.get());
+    std::string name = getFuncArgName(llvm::cast(source.origin.u));
     if (!name.empty())
       tag = state.getFuncTreeWithScope(func, scopeOp)
                 .dummyArgDataTree.getTag(name);
@@ -240,7 +240,7 @@ void AddAliasTagsPass::runOnAliasInterface(fir::FirAliasTagOpInterface op,
   } else if (enableGlobals &&
              source.kind == fir::AliasAnalysis::SourceKind::Global &&
              !source.isBoxData()) {
-    mlir::SymbolRefAttr glbl = source.origin.u.get();
+    mlir::SymbolRefAttr glbl = llvm::cast(source.origin.u);
     const char *name = glbl.getRootReference().data();
     LLVM_DEBUG(llvm::dbgs().indent(2) << "Found reference to global " << name
                                       << " at " << *op << "\n");
@@ -250,8 +250,7 @@ void AddAliasTagsPass::runOnAliasInterface(fir::FirAliasTagOpInterface op,
   } else if (enableDirect &&
              source.kind == fir::AliasAnalysis::SourceKind::Global &&
              source.isBoxData()) {
-    if (source.origin.u.is()) {
-      mlir::SymbolRefAttr glbl = source.origin.u.get();
+    if (auto glbl = llvm::dyn_cast(source.origin.u)) {
       const char *name = glbl.getRootReference().data();
       LLVM_DEBUG(llvm::dbgs().indent(2) << "Found reference to direct " << name
                                         << " at " << *op << "\n");
@@ -269,7 +268,7 @@ void AddAliasTagsPass::runOnAliasInterface(fir::FirAliasTagOpInterface op,
              source.kind == fir::AliasAnalysis::SourceKind::Allocate) {
     std::optional name;
     mlir::Operation *sourceOp =
-        source.origin.u.get().getDefiningOp();
+        llvm::cast(source.origin.u).getDefiningOp();
     if (auto alloc = mlir::dyn_cast_or_null(sourceOp))
       name = alloc.getUniqName();
     else if (auto alloc = mlir::dyn_cast_or_null(sourceOp))
diff --git a/flang/lib/Optimizer/Transforms/AlgebraicSimplification.cpp b/flang/lib/Optimizer/Transforms/AlgebraicSimplification.cpp
index fd58375da618a..fab1f0299ede9 100644
--- a/flang/lib/Optimizer/Transforms/AlgebraicSimplification.cpp
+++ b/flang/lib/Optimizer/Transforms/AlgebraicSimplification.cpp
@@ -39,8 +39,7 @@ struct AlgebraicSimplification
 void AlgebraicSimplification::runOnOperation() {
   RewritePatternSet patterns(&getContext());
   populateMathAlgebraicSimplificationPatterns(patterns);
-  (void)applyPatternsAndFoldGreedily(getOperation(), std::move(patterns),
-                                     config);
+  (void)applyPatternsGreedily(getOperation(), std::move(patterns), config);
 }
 
 std::unique_ptr fir::createAlgebraicSimplificationPass() {
diff --git a/flang/lib/Optimizer/Transforms/AssumedRankOpConversion.cpp b/flang/lib/Optimizer/Transforms/AssumedRankOpConversion.cpp
index 2c9c73e8a5394..eb59045a5fde7 100644
--- a/flang/lib/Optimizer/Transforms/AssumedRankOpConversion.cpp
+++ b/flang/lib/Optimizer/Transforms/AssumedRankOpConversion.cpp
@@ -154,7 +154,7 @@ class AssumedRankOpConversion
     mlir::GreedyRewriteConfig config;
     config.enableRegionSimplification =
         mlir::GreedySimplifyRegionLevel::Disabled;
-    (void)applyPatternsAndFoldGreedily(mod, std::move(patterns), config);
+    (void)applyPatternsGreedily(mod, std::move(patterns), config);
   }
 };
 } // namespace
diff --git a/flang/lib/Optimizer/Transforms/CUFOpConversion.cpp b/flang/lib/Optimizer/Transforms/CUFOpConversion.cpp
index 1df82e6accfed..de5c51556eecf 100644
--- a/flang/lib/Optimizer/Transforms/CUFOpConversion.cpp
+++ b/flang/lib/Optimizer/Transforms/CUFOpConversion.cpp
@@ -342,7 +342,7 @@ struct CUFAllocOpConversion : public mlir::OpRewritePattern {
     // Convert descriptor allocations to function call.
     auto boxTy = mlir::dyn_cast_or_null(op.getInType());
     mlir::func::FuncOp func =
-        fir::runtime::getRuntimeFunc(loc, builder);
+        fir::runtime::getRuntimeFunc(loc, builder);
     auto fTy = func.getFunctionType();
     mlir::Value sourceLine =
         fir::factory::locationToLineNo(builder, loc, fTy.getInput(2));
@@ -451,7 +451,7 @@ struct CUFFreeOpConversion : public mlir::OpRewritePattern {
 
     // Convert cuf.free on descriptors.
     mlir::func::FuncOp func =
-        fir::runtime::getRuntimeFunc(loc, builder);
+        fir::runtime::getRuntimeFunc(loc, builder);
     auto fTy = func.getFunctionType();
     mlir::Value sourceLine =
         fir::factory::locationToLineNo(builder, loc, fTy.getInput(2));
diff --git a/flang/lib/Optimizer/Transforms/ConstantArgumentGlobalisation.cpp b/flang/lib/Optimizer/Transforms/ConstantArgumentGlobalisation.cpp
index eef6f047fc1bf..562f3058f20f3 100644
--- a/flang/lib/Optimizer/Transforms/ConstantArgumentGlobalisation.cpp
+++ b/flang/lib/Optimizer/Transforms/ConstantArgumentGlobalisation.cpp
@@ -173,8 +173,8 @@ class ConstantArgumentGlobalisationOpt
     config.strictMode = mlir::GreedyRewriteStrictness::ExistingOps;
 
     patterns.insert(context, *di);
-    if (mlir::failed(mlir::applyPatternsAndFoldGreedily(
-            mod, std::move(patterns), config))) {
+    if (mlir::failed(
+            mlir::applyPatternsGreedily(mod, std::move(patterns), config))) {
       mlir::emitError(mod.getLoc(),
                       "error in constant globalisation optimization\n");
       signalPassFailure();
diff --git a/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp b/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
index cc99698ead33f..8ae3d313d881c 100644
--- a/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
+++ b/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
@@ -325,7 +325,7 @@ static bool canCacheThisType(mlir::LLVM::DICompositeTypeAttr comTy) {
 std::pair
 DebugTypeGenerator::getFieldSizeAndAlign(mlir::Type fieldTy) {
   mlir::Type llvmTy;
-  if (auto boxTy = mlir::dyn_cast_or_null(fieldTy))
+  if (auto boxTy = mlir::dyn_cast_if_present(fieldTy))
     llvmTy = llvmTypeConverter.convertBoxTypeAsStruct(boxTy, getBoxRank(boxTy));
   else
     llvmTy = llvmTypeConverter.convertType(fieldTy);
@@ -371,7 +371,7 @@ mlir::LLVM::DITypeAttr DebugTypeGenerator::convertRecordType(
     std::optional> lowerBounds =
         fir::getComponentLowerBoundsIfNonDefault(Ty, fieldName, module,
                                                  symbolTable);
-    auto seqTy = mlir::dyn_cast_or_null(fieldTy);
+    auto seqTy = mlir::dyn_cast_if_present(fieldTy);
 
     // For members of the derived types, the information about the shift in
     // lower bounds is not part of the declOp but has to be extracted from the
@@ -622,10 +622,10 @@ mlir::LLVM::DITypeAttr DebugTypeGenerator::convertPointerLikeType(
   // Arrays and character need different treatment because DWARF have special
   // constructs for them to get the location from the descriptor. Rest of
   // types are handled like pointer to underlying type.
-  if (auto seqTy = mlir::dyn_cast_or_null(elTy))
+  if (auto seqTy = mlir::dyn_cast_if_present(elTy))
     return convertBoxedSequenceType(seqTy, fileAttr, scope, declOp,
                                     genAllocated, genAssociated);
-  if (auto charTy = mlir::dyn_cast_or_null(elTy))
+  if (auto charTy = mlir::dyn_cast_if_present(elTy))
     return convertCharacterType(charTy, fileAttr, scope, declOp,
                                 /*hasDescriptor=*/true);
 
@@ -638,7 +638,7 @@ mlir::LLVM::DITypeAttr DebugTypeGenerator::convertPointerLikeType(
 
   return mlir::LLVM::DIDerivedTypeAttr::get(
       context, llvm::dwarf::DW_TAG_pointer_type,
-      mlir::StringAttr::get(context, ""), elTyAttr, ptrSize,
+      mlir::StringAttr::get(context, ""), elTyAttr, /*sizeInBits=*/ptrSize * 8,
       /*alignInBits=*/0, /*offset=*/0,
       /*optional
=*/std::nullopt, /*extra data=*/nullptr); } @@ -654,22 +654,22 @@ DebugTypeGenerator::convertType(mlir::Type Ty, mlir::LLVM::DIFileAttr fileAttr, } else if (mlir::isa(Ty)) { return genBasicType(context, mlir::StringAttr::get(context, "real"), Ty.getIntOrFloatBitWidth(), llvm::dwarf::DW_ATE_float); - } else if (auto logTy = mlir::dyn_cast_or_null(Ty)) { + } else if (auto logTy = mlir::dyn_cast_if_present(Ty)) { return genBasicType(context, mlir::StringAttr::get(context, logTy.getMnemonic()), kindMapping.getLogicalBitsize(logTy.getFKind()), llvm::dwarf::DW_ATE_boolean); - } else if (auto cplxTy = mlir::dyn_cast_or_null(Ty)) { + } else if (auto cplxTy = mlir::dyn_cast_if_present(Ty)) { auto floatTy = mlir::cast(cplxTy.getElementType()); unsigned bitWidth = floatTy.getWidth(); return genBasicType(context, mlir::StringAttr::get(context, "complex"), bitWidth * 2, llvm::dwarf::DW_ATE_complex_float); - } else if (auto seqTy = mlir::dyn_cast_or_null(Ty)) { + } else if (auto seqTy = mlir::dyn_cast_if_present(Ty)) { return convertSequenceType(seqTy, fileAttr, scope, declOp); - } else if (auto charTy = mlir::dyn_cast_or_null(Ty)) { + } else if (auto charTy = mlir::dyn_cast_if_present(Ty)) { return convertCharacterType(charTy, fileAttr, scope, declOp, /*hasDescriptor=*/false); - } else if (auto recTy = mlir::dyn_cast_or_null(Ty)) { + } else if (auto recTy = mlir::dyn_cast_if_present(Ty)) { return convertRecordType(recTy, fileAttr, scope, declOp); } else if (auto tupleTy = mlir::dyn_cast_if_present(Ty)) { return convertTupleType(tupleTy, fileAttr, scope, declOp); @@ -678,22 +678,22 @@ DebugTypeGenerator::convertType(mlir::Type Ty, mlir::LLVM::DIFileAttr fileAttr, return convertPointerLikeType(elTy, fileAttr, scope, declOp, /*genAllocated=*/false, /*genAssociated=*/false); - } else if (auto vecTy = mlir::dyn_cast_or_null(Ty)) { + } else if (auto vecTy = mlir::dyn_cast_if_present(Ty)) { return convertVectorType(vecTy, fileAttr, scope, declOp); } else if (mlir::isa(Ty)) { return genBasicType(context, mlir::StringAttr::get(context, "integer"), llvmTypeConverter.getIndexTypeBitwidth(), llvm::dwarf::DW_ATE_signed); - } else if (auto boxTy = mlir::dyn_cast_or_null(Ty)) { + } else if (auto boxTy = mlir::dyn_cast_if_present(Ty)) { auto elTy = boxTy.getEleTy(); - if (auto seqTy = mlir::dyn_cast_or_null(elTy)) + if (auto seqTy = mlir::dyn_cast_if_present(elTy)) return convertBoxedSequenceType(seqTy, fileAttr, scope, declOp, false, false); - if (auto heapTy = mlir::dyn_cast_or_null(elTy)) + if (auto heapTy = mlir::dyn_cast_if_present(elTy)) return convertPointerLikeType(heapTy.getElementType(), fileAttr, scope, declOp, /*genAllocated=*/true, /*genAssociated=*/false); - if (auto ptrTy = mlir::dyn_cast_or_null(elTy)) + if (auto ptrTy = mlir::dyn_cast_if_present(elTy)) return convertPointerLikeType(ptrTy.getElementType(), fileAttr, scope, declOp, /*genAllocated=*/false, /*genAssociated=*/true); diff --git a/flang/lib/Optimizer/Transforms/LoopVersioning.cpp b/flang/lib/Optimizer/Transforms/LoopVersioning.cpp index adc39861840ab..b534ec160ce21 100644 --- a/flang/lib/Optimizer/Transforms/LoopVersioning.cpp +++ b/flang/lib/Optimizer/Transforms/LoopVersioning.cpp @@ -145,11 +145,45 @@ struct ArgsUsageInLoop { }; } // namespace -static fir::SequenceType getAsSequenceType(mlir::Value *v) { - mlir::Type argTy = fir::unwrapPassByRefType(fir::unwrapRefType(v->getType())); +static fir::SequenceType getAsSequenceType(mlir::Value v) { + mlir::Type argTy = fir::unwrapPassByRefType(fir::unwrapRefType(v.getType())); return mlir::dyn_cast(argTy); } +/// Return the rank and the element size (in bytes) of the given +/// value \p v. If it is not an array or the element type is not +/// supported, then return <0, 0>. Only trivial data types +/// are currently supported. +/// When \p isArgument is true, \p v is assumed to be a function +/// argument. If \p v's type does not look like a type of an assumed +/// shape array, then the function returns <0, 0>. +/// When \p isArgument is false, array types with known innermost +/// dimension are allowed to proceed. +static std::pair +getRankAndElementSize(const fir::KindMapping &kindMap, + const mlir::DataLayout &dl, mlir::Value v, + bool isArgument = false) { + if (auto seqTy = getAsSequenceType(v)) { + unsigned rank = seqTy.getDimension(); + if (rank > 0 && + (!isArgument || + seqTy.getShape()[0] == fir::SequenceType::getUnknownExtent())) { + size_t typeSize = 0; + mlir::Type elementType = fir::unwrapSeqOrBoxedSeqType(v.getType()); + if (fir::isa_trivial(elementType)) { + auto [eleSize, eleAlign] = fir::getTypeSizeAndAlignmentOrCrash( + v.getLoc(), elementType, dl, kindMap); + typeSize = llvm::alignTo(eleSize, eleAlign); + } + if (typeSize) + return {rank, typeSize}; + } + } + + LLVM_DEBUG(llvm::dbgs() << "Unsupported rank/type: " << v << '\n'); + return {0, 0}; +} + /// if a value comes from a fir.declare, follow it to the original source, /// otherwise return the value static mlir::Value unwrapFirDeclare(mlir::Value val) { @@ -160,12 +194,48 @@ static mlir::Value unwrapFirDeclare(mlir::Value val) { return val; } +/// Return true, if \p rebox operation keeps the input array +/// continuous in the innermost dimension, if it is initially continuous +/// in the innermost dimension. +static bool reboxPreservesContinuity(fir::ReboxOp rebox) { + // If slicing is not involved, then the rebox does not affect + // the continuity of the array. + auto sliceArg = rebox.getSlice(); + if (!sliceArg) + return true; + + // A slice with step=1 in the innermost dimension preserves + // the continuity of the array in the innermost dimension. + if (auto sliceOp = + mlir::dyn_cast_or_null(sliceArg.getDefiningOp())) { + if (sliceOp.getFields().empty() && sliceOp.getSubstr().empty()) { + auto triples = sliceOp.getTriples(); + if (triples.size() > 2) + if (auto innermostStep = fir::getIntIfConstant(triples[2])) + if (*innermostStep == 1) + return true; + } + + LLVM_DEBUG(llvm::dbgs() + << "REBOX with slicing may produce non-contiguous array: " + << sliceOp << '\n' + << rebox << '\n'); + return false; + } + + LLVM_DEBUG(llvm::dbgs() << "REBOX with unknown slice" << sliceArg << '\n' + << rebox << '\n'); + return false; +} + /// if a value comes from a fir.rebox, follow the rebox to the original source, /// of the value, otherwise return the value static mlir::Value unwrapReboxOp(mlir::Value val) { - // don't support reboxes of reboxes - if (fir::ReboxOp rebox = val.getDefiningOp()) + while (fir::ReboxOp rebox = val.getDefiningOp()) { + if (!reboxPreservesContinuity(rebox)) + break; val = rebox.getBox(); + } return val; } @@ -257,25 +327,10 @@ void LoopVersioningPass::runOnOperation() { continue; } - if (auto seqTy = getAsSequenceType(&arg)) { - unsigned rank = seqTy.getDimension(); - if (rank > 0 && - seqTy.getShape()[0] == fir::SequenceType::getUnknownExtent()) { - size_t typeSize = 0; - mlir::Type elementType = fir::unwrapSeqOrBoxedSeqType(arg.getType()); - if (mlir::isa(elementType) || - mlir::isa(elementType) || - mlir::isa(elementType)) { - auto [eleSize, eleAlign] = fir::getTypeSizeAndAlignmentOrCrash( - arg.getLoc(), elementType, *dl, kindMap); - typeSize = llvm::alignTo(eleSize, eleAlign); - } - if (typeSize) - argsOfInterest.push_back({arg, typeSize, rank, {}}); - else - LLVM_DEBUG(llvm::dbgs() << "Type not supported\n"); - } - } + auto [rank, typeSize] = + getRankAndElementSize(kindMap, *dl, arg, /*isArgument=*/true); + if (rank != 0 && typeSize != 0) + argsOfInterest.push_back({arg, typeSize, rank, {}}); } if (argsOfInterest.empty()) { @@ -326,6 +381,13 @@ void LoopVersioningPass::runOnOperation() { if (arrayCoor.getSlice()) argsInLoop.cannotTransform.insert(a.arg); + // We need to compute the rank and element size + // based on the operand, not the original argument, + // because array slicing may affect it. + std::tie(a.rank, a.size) = getRankAndElementSize(kindMap, *dl, a.arg); + if (a.rank == 0 || a.size == 0) + argsInLoop.cannotTransform.insert(a.arg); + if (argsInLoop.cannotTransform.contains(a.arg)) { // Remove any previously recorded usage, if any. argsInLoop.usageInfo.erase(a.arg); @@ -416,8 +478,8 @@ void LoopVersioningPass::runOnOperation() { mlir::Location loc = builder.getUnknownLoc(); mlir::IndexType idxTy = builder.getIndexType(); - LLVM_DEBUG(llvm::dbgs() << "Module Before transformation:"); - LLVM_DEBUG(module->dump()); + LLVM_DEBUG(llvm::dbgs() << "Func Before transformation:\n"); + LLVM_DEBUG(func->dump()); LLVM_DEBUG(llvm::dbgs() << "loopsOfInterest: " << loopsOfInterest.size() << "\n"); @@ -551,8 +613,8 @@ void LoopVersioningPass::runOnOperation() { } } - LLVM_DEBUG(llvm::dbgs() << "After transform:\n"); - LLVM_DEBUG(module->dump()); + LLVM_DEBUG(llvm::dbgs() << "Func After transform:\n"); + LLVM_DEBUG(func->dump()); LLVM_DEBUG(llvm::dbgs() << "=== End " DEBUG_TYPE " ===\n"); } diff --git a/flang/lib/Optimizer/Transforms/StackArrays.cpp b/flang/lib/Optimizer/Transforms/StackArrays.cpp index 0c474f463f09c..bdcb8199b790d 100644 --- a/flang/lib/Optimizer/Transforms/StackArrays.cpp +++ b/flang/lib/Optimizer/Transforms/StackArrays.cpp @@ -76,8 +76,9 @@ class InsertionPoint { /// Get contained pointer type or nullptr template T *tryGetPtr() const { - if (location.is()) - return location.get(); + // Use llvm::dyn_cast_if_present because location may be null here. + if (T *ptr = llvm::dyn_cast_if_present(location)) + return ptr; return nullptr; } @@ -793,8 +794,8 @@ void StackArraysPass::runOnOperation() { config.enableRegionSimplification = mlir::GreedySimplifyRegionLevel::Disabled; patterns.insert(&context, *candidateOps); - if (mlir::failed(mlir::applyOpPatternsAndFold(opsToConvert, - std::move(patterns), config))) { + if (mlir::failed(mlir::applyOpPatternsGreedily( + opsToConvert, std::move(patterns), config))) { mlir::emitError(func->getLoc(), "error in stack arrays optimization\n"); signalPassFailure(); } diff --git a/flang/runtime/CUDA/descriptor.cpp b/flang/runtime/CUDA/descriptor.cpp index 58bc0dbed6bab..391c47e84241d 100644 --- a/flang/runtime/CUDA/descriptor.cpp +++ b/flang/runtime/CUDA/descriptor.cpp @@ -18,12 +18,12 @@ namespace Fortran::runtime::cuda { extern "C" { RT_EXT_API_GROUP_BEGIN -Descriptor *RTDEF(CUFAllocDesciptor)( +Descriptor *RTDEF(CUFAllocDescriptor)( std::size_t sizeInBytes, const char *sourceFile, int sourceLine) { return reinterpret_cast(CUFAllocManaged(sizeInBytes)); } -void RTDEF(CUFFreeDesciptor)( +void RTDEF(CUFFreeDescriptor)( Descriptor *desc, const char *sourceFile, int sourceLine) { CUFFreeManaged(reinterpret_cast(desc)); } diff --git a/flang/runtime/CUDA/kernel.cpp b/flang/runtime/CUDA/kernel.cpp index 88cdf3cf42622..bdc04ccb17672 100644 --- a/flang/runtime/CUDA/kernel.cpp +++ b/flang/runtime/CUDA/kernel.cpp @@ -48,13 +48,13 @@ void RTDEF(CUFLaunchKernel)(const void *kernel, intptr_t gridX, intptr_t gridY, maxBlocks = multiProcCount * maxBlocks; } if (maxBlocks > 0) { - if (gridDim.x > 0) { + if (gridX > 0) { maxBlocks = maxBlocks / gridDim.x; } - if (gridDim.y > 0) { + if (gridY > 0) { maxBlocks = maxBlocks / gridDim.y; } - if (gridDim.z > 0) { + if (gridZ > 0) { maxBlocks = maxBlocks / gridDim.z; } if (maxBlocks < 1) { @@ -113,13 +113,13 @@ void RTDEF(CUFLaunchClusterKernel)(const void *kernel, intptr_t clusterX, maxBlocks = multiProcCount * maxBlocks; } if (maxBlocks > 0) { - if (config.gridDim.x > 0) { + if (gridX > 0) { maxBlocks = maxBlocks / config.gridDim.x; } - if (config.gridDim.y > 0) { + if (gridY > 0) { maxBlocks = maxBlocks / config.gridDim.y; } - if (config.gridDim.z > 0) { + if (gridZ > 0) { maxBlocks = maxBlocks / config.gridDim.z; } if (maxBlocks < 1) { diff --git a/flang/runtime/exceptions.cpp b/flang/runtime/exceptions.cpp index 993c996c9ce75..2fa2baa2ec84a 100644 --- a/flang/runtime/exceptions.cpp +++ b/flang/runtime/exceptions.cpp @@ -81,6 +81,27 @@ uint32_t RTNAME(MapException)(uint32_t excepts) { // on some systems, e.g. Solaris, so omit object size comparison for now. // TODO: consider femode_t object size comparison once its more mature. +// Check if the processor has the ability to control whether to halt or +// continue execution when a given exception is raised. +bool RTNAME(SupportHalting)([[maybe_unused]] uint32_t except) { +#ifdef __USE_GNU + except = RTNAME(MapException)(except); + int currentSet = fegetexcept(), flipSet, ok; + if (currentSet & except) { + ok = fedisableexcept(except); + flipSet = fegetexcept(); + ok |= feenableexcept(except); + } else { + ok = feenableexcept(except); + flipSet = fegetexcept(); + ok |= fedisableexcept(except); + } + return ok != -1 && currentSet != flipSet; +#else + return false; +#endif +} + bool RTNAME(GetUnderflowMode)(void) { #if __x86_64__ // The MXCSR Flush to Zero flag is the negation of the ieee_get_underflow_mode diff --git a/flang/test/Evaluate/fold-ieee.f90 b/flang/test/Evaluate/fold-ieee.f90 index e70d558af1668..99f8526fd23db 100644 --- a/flang/test/Evaluate/fold-ieee.f90 +++ b/flang/test/Evaluate/fold-ieee.f90 @@ -26,11 +26,13 @@ module m logical, parameter :: test_fl_ix_all = ieee_support_flag(ieee_inexact) logical, parameter :: test_fl_ix_4 = ieee_support_flag(ieee_inexact, 1.) logical, parameter :: test_fl_ix_8 = ieee_support_flag(ieee_inexact, 1.d0) +#if __x86_64__ logical, parameter :: test_halt_in = ieee_support_halting(ieee_invalid) logical, parameter :: test_halt_ov = ieee_support_halting(ieee_overflow) logical, parameter :: test_halt_d0 = ieee_support_halting(ieee_divide_by_zero) logical, parameter :: test_halt_un = ieee_support_halting(ieee_underflow) logical, parameter :: test_halt_ix = ieee_support_halting(ieee_inexact) +#endif logical, parameter :: test_inf_all = ieee_support_inf() logical, parameter :: test_inf_4 = ieee_support_inf(1.) logical, parameter :: test_inf_8 = ieee_support_inf(1.d0) @@ -58,7 +60,9 @@ module m logical, parameter :: test_sn_all = ieee_support_subnormal() logical, parameter :: test_sn_4 = ieee_support_subnormal(1.) logical, parameter :: test_sn_8 = ieee_support_subnormal(1.d0) -! logical, parameter :: test_uc_all = .not. ieee_support_underflow_control() -! logical, parameter :: test_uc_4 = ieee_support_underflow_control(1.) -! logical, parameter :: test_uc_8 = ieee_support_underflow_control(1.d0) +#if __x86_64__ + logical, parameter :: test_uc_all = .not. ieee_support_underflow_control() + logical, parameter :: test_uc_4 = ieee_support_underflow_control(1.) + logical, parameter :: test_uc_8 = ieee_support_underflow_control(1.d0) +#endif end diff --git a/flang/test/Fir/CUDA/cuda-allocate.fir b/flang/test/Fir/CUDA/cuda-allocate.fir index 9b87c7546d1e9..2f805d4a2b6bb 100644 --- a/flang/test/Fir/CUDA/cuda-allocate.fir +++ b/flang/test/Fir/CUDA/cuda-allocate.fir @@ -15,7 +15,7 @@ func.func @_QPsub1() { } // CHECK-LABEL: func.func @_QPsub1() -// CHECK: %[[DESC_RT_CALL:.*]] = fir.call @_FortranACUFAllocDesciptor(%{{.*}}, %{{.*}}, %{{.*}}) : (i64, !fir.ref, i32) -> !fir.ref> +// CHECK: %[[DESC_RT_CALL:.*]] = fir.call @_FortranACUFAllocDescriptor(%{{.*}}, %{{.*}}, %{{.*}}) : (i64, !fir.ref, i32) -> !fir.ref> // CHECK: %[[DESC:.*]] = fir.convert %[[DESC_RT_CALL]] : (!fir.ref>) -> !fir.ref>>> // CHECK: %[[DECL_DESC:.*]]:2 = hlfir.declare %[[DESC]] {data_attr = #cuf.cuda, fortran_attrs = #fir.var_attrs, uniq_name = "_QFsub1Ea"} : (!fir.ref>>>) -> (!fir.ref>>>, !fir.ref>>>) // CHECK: %[[BOX_NONE:.*]] = fir.convert %[[DECL_DESC]]#1 : (!fir.ref>>>) -> !fir.ref> @@ -24,7 +24,7 @@ func.func @_QPsub1() { // CHECK: %[[BOX_NONE:.*]] = fir.convert %[[DECL_DESC]]#1 : (!fir.ref>>>) -> !fir.ref> // CHECK: %{{.*}} = fir.call @_FortranAAllocatableDeallocate(%[[BOX_NONE]], %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) : (!fir.ref>, i1, !fir.box, !fir.ref, i32) -> i32 // CHECK: %[[BOX_NONE:.*]] = fir.convert %[[DECL_DESC]]#1 : (!fir.ref>>>) -> !fir.ref> -// CHECK: fir.call @_FortranACUFFreeDesciptor(%[[BOX_NONE]], %{{.*}}, %{{.*}}) : (!fir.ref>, !fir.ref, i32) -> none +// CHECK: fir.call @_FortranACUFFreeDescriptor(%[[BOX_NONE]], %{{.*}}, %{{.*}}) : (!fir.ref>, !fir.ref, i32) -> none fir.global @_QMmod1Ea {data_attr = #cuf.cuda} : !fir.box>> { %0 = fir.zero_bits !fir.heap> diff --git a/flang/test/Fir/CUDA/cuda-code-gen.mlir b/flang/test/Fir/CUDA/cuda-code-gen.mlir index a34c2770c5f6c..0f1b8b1cd6a8e 100644 --- a/flang/test/Fir/CUDA/cuda-code-gen.mlir +++ b/flang/test/Fir/CUDA/cuda-code-gen.mlir @@ -8,7 +8,7 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry : %c48 = arith.constant 48 : index %1 = fir.convert %c48 : (index) -> i64 %2 = fir.convert %0 : (!fir.ref>) -> !fir.ref - %3 = fir.call @_FortranACUFAllocDesciptor(%1, %2, %c4_i32) : (i64, !fir.ref, i32) -> !fir.ref> + %3 = fir.call @_FortranACUFAllocDescriptor(%1, %2, %c4_i32) : (i64, !fir.ref, i32) -> !fir.ref> %4 = fir.convert %3 : (!fir.ref>) -> !fir.ref>>> %5 = fir.zero_bits !fir.heap> %6 = fircg.ext_embox %5(%c0) {allocator_idx = 2 : i32} : (!fir.heap>, index) -> !fir.box>> @@ -18,13 +18,13 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry : } // CHECK-LABEL: llvm.func @_QQmain() - // CHECK-COUNT-2: llvm.call @_FortranACUFAllocDesciptor + // CHECK-COUNT-2: llvm.call @_FortranACUFAllocDescriptor fir.global linkonce @_QQclX3C737464696E3E00 constant : !fir.char<1,8> { %0 = fir.string_lit "\00"(8) : !fir.char<1,8> fir.has_value %0 : !fir.char<1,8> } - func.func private @_FortranACUFAllocDesciptor(i64, !fir.ref, i32) -> !fir.ref> attributes {fir.runtime} + func.func private @_FortranACUFAllocDescriptor(i64, !fir.ref, i32) -> !fir.ref> attributes {fir.runtime} } // ----- @@ -55,4 +55,118 @@ module attributes {dlti.dl_spec = #dlti.dl_spec : vector<2xi64> // CHECK-LABEL: llvm.func @_QQmain() // CHECK: llvm.call @_FortranACUFMemAlloc -// CHECK: llvm.call @_FortranACUFAllocDesciptor +// CHECK: llvm.call @_FortranACUFAllocDescriptor + +// ----- + +module attributes {dlti.dl_spec = #dlti.dl_spec : vector<2xi64>, i128 = dense<128> : vector<2xi64>, i64 = dense<64> : vector<2xi64>, !llvm.ptr<272> = dense<64> : vector<4xi64>, !llvm.ptr<271> = dense<32> : vector<4xi64>, !llvm.ptr<270> = dense<32> : vector<4xi64>, f128 = dense<128> : vector<2xi64>, f64 = dense<64> : vector<2xi64>, f16 = dense<16> : vector<2xi64>, i32 = dense<32> : vector<2xi64>, i16 = dense<16> : vector<2xi64>, i8 = dense<8> : vector<2xi64>, i1 = dense<8> : vector<2xi64>, !llvm.ptr = dense<64> : vector<4xi64>, "dlti.endianness" = "little", "dlti.stack_alignment" = 128 : i64>} { + func.func @_QQmain() attributes {fir.bindc_name = "p1"} { + %c1_i32 = arith.constant 1 : i32 + %c0_i32 = arith.constant 0 : i32 + %c16_i32 = arith.constant 16 : i32 + %c1 = arith.constant 1 : index + %c0 = arith.constant 0 : index + %0 = fir.alloca i32 {bindc_name = "iblk", uniq_name = "_QFEiblk"} + %1 = fir.alloca i32 {bindc_name = "ithr", uniq_name = "_QFEithr"} + %2 = fir.address_of(@_QQclX64756D6D792E6D6C697200) : !fir.ref> + %c14_i32 = arith.constant 14 : i32 + %c72 = arith.constant 72 : index + %3 = fir.convert %c72 : (index) -> i64 + %4 = fir.convert %2 : (!fir.ref>) -> !fir.ref + %5 = fir.call @_FortranACUFAllocDescriptor(%3, %4, %c14_i32) : (i64, !fir.ref, i32) -> !fir.ref> + %6 = fir.convert %5 : (!fir.ref>) -> !fir.ref>>> + %7 = fir.zero_bits !fir.heap> + %8 = fircg.ext_embox %7(%c0, %c0) {allocator_idx = 2 : i32} : (!fir.heap>, index, index) -> !fir.box>> + fir.store %8 to %6 : !fir.ref>>> + %9 = fir.address_of(@_QQclX64756D6D792E6D6C697200) : !fir.ref> + %c20_i32 = arith.constant 20 : i32 + %c48 = arith.constant 48 : index + %10 = fir.convert %c48 : (index) -> i64 + %11 = fir.convert %9 : (!fir.ref>) -> !fir.ref + %12 = fir.call @_FortranACUFAllocDescriptor(%10, %11, %c20_i32) : (i64, !fir.ref, i32) -> !fir.ref> + %13 = fir.convert %12 : (!fir.ref>) -> !fir.ref>>> + %14 = fir.zero_bits !fir.heap> + %15 = fircg.ext_embox %14(%c0) {allocator_idx = 2 : i32} : (!fir.heap>, index) -> !fir.box>> + fir.store %15 to %13 : !fir.ref>>> + %16 = fir.convert %6 : (!fir.ref>>>) -> !fir.ref> + %17 = fir.convert %c1 : (index) -> i64 + %18 = fir.convert %c16_i32 : (i32) -> i64 + %19 = fir.call @_FortranAAllocatableSetBounds(%16, %c0_i32, %17, %18) fastmath : (!fir.ref>, i32, i64, i64) -> none + %20 = fir.call @_FortranAAllocatableSetBounds(%16, %c1_i32, %17, %18) fastmath : (!fir.ref>, i32, i64, i64) -> none + %21 = fir.address_of(@_QQclX64756D6D792E6D6C697200) : !fir.ref> + %c31_i32 = arith.constant 31 : i32 + %false = arith.constant false + %22 = fir.absent !fir.box + %c-1_i64 = arith.constant -1 : i64 + %23 = fir.convert %6 : (!fir.ref>>>) -> !fir.ref> + %24 = fir.convert %21 : (!fir.ref>) -> !fir.ref + %25 = fir.call @_FortranACUFAllocatableAllocate(%23, %c-1_i64, %false, %22, %24, %c31_i32) : (!fir.ref>, i64, i1, !fir.box, !fir.ref, i32) -> i32 + %26 = fir.convert %13 : (!fir.ref>>>) -> !fir.ref> + %27 = fir.call @_FortranAAllocatableSetBounds(%26, %c0_i32, %17, %18) fastmath : (!fir.ref>, i32, i64, i64) -> none + %28 = fir.address_of(@_QQclX64756D6D792E6D6C697200) : !fir.ref> + %c34_i32 = arith.constant 34 : i32 + %false_0 = arith.constant false + %29 = fir.absent !fir.box + %c-1_i64_1 = arith.constant -1 : i64 + %30 = fir.convert %13 : (!fir.ref>>>) -> !fir.ref> + %31 = fir.convert %28 : (!fir.ref>) -> !fir.ref + %32 = fir.call @_FortranACUFAllocatableAllocate(%30, %c-1_i64_1, %false_0, %29, %31, %c34_i32) : (!fir.ref>, i64, i1, !fir.box, !fir.ref, i32) -> i32 + %33 = fir.load %6 : !fir.ref>>> + %34 = fircg.ext_rebox %33 : (!fir.box>>) -> !fir.box> + return + } + func.func private @_FortranAAllocatableSetBounds(!fir.ref>, i32, i64, i64) -> none attributes {fir.runtime} + fir.global linkonce @_QQclX64756D6D792E6D6C697200 constant : !fir.char<1,11> { + %0 = fir.string_lit "dummy.mlir\00"(11) : !fir.char<1,11> + fir.has_value %0 : !fir.char<1,11> + } + func.func private @_FortranACUFAllocDescriptor(i64, !fir.ref, i32) -> !fir.ref> attributes {fir.runtime} + func.func private @_FortranACUFAllocatableAllocate(!fir.ref>, i64, i1, !fir.box, !fir.ref, i32) -> i32 attributes {fir.runtime} +} + +// CHECK-LABEL: llvm.func @_QQmain() +// CHECK-COUNT-4: llvm.call @_FortranACUFAllocDescriptor + +// ----- + +module attributes {dlti.dl_spec = #dlti.dl_spec = dense<32> : vector<4xi64>, f128 = dense<128> : vector<2xi64>, f64 = dense<64> : vector<2xi64>, f16 = dense<16> : vector<2xi64>, i32 = dense<32> : vector<2xi64>, i64 = dense<64> : vector<2xi64>, !llvm.ptr<272> = dense<64> : vector<4xi64>, !llvm.ptr<271> = dense<32> : vector<4xi64>, f80 = dense<128> : vector<2xi64>, i128 = dense<128> : vector<2xi64>, i16 = dense<16> : vector<2xi64>, i8 = dense<8> : vector<2xi64>, !llvm.ptr = dense<64> : vector<4xi64>, i1 = dense<8> : vector<2xi64>, "dlti.endianness" = "little", "dlti.stack_alignment" = 128 : i64>, fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", gpu.container_module, llvm.data_layout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128", llvm.ident = "flang version 20.0.0 (git@github.com:clementval/llvm-project.git efc2415bcce8e8a9e73e77aa122c8aba1c1fbbd2)", llvm.target_triple = "x86_64-unknown-linux-gnu"} { + func.func @_QQmain() { + %c1_i32 = arith.constant 1 : i32 + %c2 = arith.constant 2 : index + %c10 = arith.constant 10 : index + %c1 = arith.constant 1 : index + %c0 = arith.constant 0 : index + %0 = fir.address_of(@_QQclX3C737464696E3E00) : !fir.ref> + %c11_i32 = arith.constant 11 : i32 + %c72 = arith.constant 72 : index + %1 = fir.convert %c72 : (index) -> i64 + %2 = fir.convert %0 : (!fir.ref>) -> !fir.ref + %3 = fir.call @_FortranACUFAllocDescriptor(%1, %2, %c11_i32) : (i64, !fir.ref, i32) -> !fir.ref> + %4 = fir.convert %3 : (!fir.ref>) -> !fir.ref>>> + %5 = fir.zero_bits !fir.heap> + %6 = fircg.ext_embox %5(%c0, %c0) {allocator_idx = 2 : i32} : (!fir.heap>, index, index) -> !fir.box>> + fir.store %6 to %4 : !fir.ref>>> + %7 = fir.load %4 : !fir.ref>>> + %8 = fir.box_addr %7 : (!fir.box>>) -> !fir.heap> + %c0_0 = arith.constant 0 : index + %9:3 = fir.box_dims %7, %c0_0 : (!fir.box>>, index) -> (index, index, index) + %c1_1 = arith.constant 1 : index + %10:3 = fir.box_dims %7, %c1_1 : (!fir.box>>, index) -> (index, index, index) + %11 = fircg.ext_embox %8(%9#1, %10#1) origin %9#0, %10#0[%c1, %c10, %c1, %c1, %c2, %c1] : (!fir.heap>, index, index, index, index, index, index, index, index, index, index) -> !fir.box> + return + } + gpu.module @cuda_device_mod { + gpu.func @_QMassumedPglob(%arg0: !fir.box>) kernel { + gpu.return + } + } + fir.global linkonce @_QQclX3C737464696E3E00 constant : !fir.char<1,8> { + %0 = fir.string_lit "\00"(8) : !fir.char<1,8> + fir.has_value %0 : !fir.char<1,8> + } + func.func private @_FortranACUFAllocDescriptor(i64, !fir.ref, i32) -> !fir.ref> attributes {fir.runtime} + func.func private @_FortranACUFFreeDescriptor(!fir.ref>, !fir.ref, i32) -> none attributes {fir.runtime} +} + +// CHECK-LABEL: llvm.func @_QQmain() +// CHECK-COUNT-3: llvm.call @_FortranACUFAllocDescriptor diff --git a/flang/test/Fir/CUDA/cuda-compiler-generated-names.mlir b/flang/test/Fir/CUDA/cuda-compiler-generated-names.mlir index 4507e444d1b51..8c5503d7baf8c 100644 --- a/flang/test/Fir/CUDA/cuda-compiler-generated-names.mlir +++ b/flang/test/Fir/CUDA/cuda-compiler-generated-names.mlir @@ -8,6 +8,22 @@ module @mod1 attributes {gpu.container} { %0 = fir.embox %arg0() : (!fir.ref>) -> !fir.box> return } + + fir.global @_QQdefault.nonTbpDefinedIoTable constant : tuple, !fir.ref, i32, i1>>>, i1> { + %true = arith.constant true + %c0_i64 = arith.constant 0 : i64 + %0 = fir.undefined tuple, !fir.ref, i32, i1>>>, i1> + %1 = fir.insert_value %0, %c0_i64, [0 : index] : (tuple, !fir.ref, i32, i1>>>, i1>, i64) -> tuple, !fir.ref, i32, i1>>>, i1> + %2 = fir.zero_bits !fir.ref, !fir.ref, i32, i1>>> + %3 = fir.insert_value %1, %2, [1 : index] : (tuple, !fir.ref, i32, i1>>>, i1>, !fir.ref, !fir.ref, i32, i1>>>) -> tuple, !fir.ref, i32, i1>>>, i1> + %4 = fir.insert_value %3, %true, [2 : index] : (tuple, !fir.ref, i32, i1>>>, i1>, i1) -> tuple, !fir.ref, i32, i1>>>, i1> + fir.has_value %4 : tuple, !fir.ref, i32, i1>>>, i1> + } + + func.func @special() { + %0 = fir.address_of(@_QQdefault.nonTbpDefinedIoTable) : !fir.ref, !fir.ref, i32, i1>>>, i1>> + return + } } } @@ -15,3 +31,5 @@ module @mod1 attributes {gpu.container} { // CHECK: llvm.mlir.global linkonce constant @_QMtest_dinitEXdtXtseq // CHECK: llvm.mlir.addressof @_QMtest_dinitEXdtXtseq : !llvm.ptr +// CHECK: llvm.mlir.global external constant @_QQdefaultXnonTbpDefinedIoTable() +// CHECK: llvm.mlir.addressof @_QQdefaultXnonTbpDefinedIoTable diff --git a/flang/test/HLFIR/opt-variable-assign-omp.fir b/flang/test/HLFIR/opt-variable-assign-omp.fir new file mode 100755 index 0000000000000..10cb2b4408fb8 --- /dev/null +++ b/flang/test/HLFIR/opt-variable-assign-omp.fir @@ -0,0 +1,43 @@ +// RUN: fir-opt %s --opt-bufferization | FileCheck %s + +// Test that alias analysis doesn't crash determining if the arguments to +// hlfir.assign alias. +// CHECK: omp.private {type = firstprivate} @_QFFbEl_firstprivate_box_Uxi32 + +// TODO: we can't currently optimize this assign because alias analysis doesn't +// know that the block arguments of the copy region cannot alias. + +omp.private {type = firstprivate} @_QFFbEl_firstprivate_box_Uxi32 : !fir.ref>> alloc { +^bb0(%arg0: !fir.ref>>): + %0 = fir.load %arg0 : !fir.ref>> + %c0 = arith.constant 0 : index + %1:3 = fir.box_dims %0, %c0 : (!fir.box>, index) -> (index, index, index) + %2 = fir.shape %1#1 : (index) -> !fir.shape<1> + %3 = fir.allocmem !fir.array, %1#1 {bindc_name = ".tmp", uniq_name = ""} + %true = arith.constant true + %4:2 = hlfir.declare %3(%2) {uniq_name = ".tmp"} : (!fir.heap>, !fir.shape<1>) -> (!fir.box>, !fir.heap>) + %c0_0 = arith.constant 0 : index + %5:3 = fir.box_dims %0, %c0_0 : (!fir.box>, index) -> (index, index, index) + %6 = fir.shape_shift %5#0, %5#1 : (index, index) -> !fir.shapeshift<1> + %7 = fir.rebox %4#0(%6) : (!fir.box>, !fir.shapeshift<1>) -> !fir.box> + %8 = fir.alloca !fir.box> + fir.store %7 to %8 : !fir.ref>> + omp.yield(%8 : !fir.ref>>) +} copy { +^bb0(%arg0: !fir.ref>>, %arg1 : !fir.ref>>): + %0 = fir.load %arg0 {test.ptr = "load_from_block_arg"} : !fir.ref>> + hlfir.assign %0 to %arg1 : !fir.box>, !fir.ref>> + omp.yield(%arg1 : !fir.ref>>) +} dealloc { +^bb0(%arg0: !fir.ref>>): + %0 = fir.load %arg0 : !fir.ref>> + %1 = fir.box_addr %0 : (!fir.box>) -> !fir.ref> + %2 = fir.convert %1 : (!fir.ref>) -> i64 + %c0_i64 = arith.constant 0 : i64 + %3 = arith.cmpi ne, %2, %c0_i64 : i64 + fir.if %3 { + %4 = fir.convert %1 : (!fir.ref>) -> !fir.heap> + fir.freemem %4 : !fir.heap> + } + omp.yield +} diff --git a/flang/test/Lower/Intrinsics/ieee_flag.f90 b/flang/test/Lower/Intrinsics/ieee_flag.f90 index 862cfbd8b2875..e4addc0d658dc 100644 --- a/flang/test/Lower/Intrinsics/ieee_flag.f90 +++ b/flang/test/Lower/Intrinsics/ieee_flag.f90 @@ -271,7 +271,7 @@ print*, 'Halting' ! CHECK: %[[V_211:[0-9]+]] = fir.call @_FortranAioBeginExternalListOutput - ! CHECK: %[[V_220:[0-9]+]] = fir.call @_FortranAioOutputLogical(%[[V_211]], %true) fastmath : (!fir.ref, i1) -> i1 + ! CHECK: %[[V_220:[0-9]+]] = fir.call @_FortranAioOutputLogical(%[[V_211]] print*, 'support invalid: ', ieee_support_halting(ieee_invalid) ! CHECK: %[[V_222:[0-9]+]] = fir.declare %[[V_80]] {fortran_attrs = #fir.var_attrs, uniq_name = "_QQro._QM__fortran_builtinsT__builtin_ieee_flag_type.0"} : (!fir.ref>) -> !fir.ref> diff --git a/flang/test/Lower/OpenMP/Todo/depend-clause-depobj.f90 b/flang/test/Lower/OpenMP/Todo/depend-clause-depobj.f90 index 3bc730f849192..4e98d77d0bb3e 100644 --- a/flang/test/Lower/OpenMP/Todo/depend-clause-depobj.f90 +++ b/flang/test/Lower/OpenMP/Todo/depend-clause-depobj.f90 @@ -1,7 +1,7 @@ !RUN: %not_todo_cmd bbc -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s !RUN: %not_todo_cmd %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s -!CHECK: not yet implemented: INOUTSET, MUTEXINOUTSET and DEPOBJ dependence-types +!CHECK: not yet implemented: DEPOBJ dependence-type subroutine f00(x) integer :: x diff --git a/flang/test/Lower/OpenMP/Todo/depend-clause-inoutset.f90 b/flang/test/Lower/OpenMP/Todo/depend-clause-inoutset.f90 deleted file mode 100644 index 160893fccdc5f..0000000000000 --- a/flang/test/Lower/OpenMP/Todo/depend-clause-inoutset.f90 +++ /dev/null @@ -1,11 +0,0 @@ -!RUN: %not_todo_cmd bbc -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s -!RUN: %not_todo_cmd %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s - -!CHECK: not yet implemented: INOUTSET, MUTEXINOUTSET and DEPOBJ dependence-types -subroutine f00(x) - integer :: x - !$omp task depend(inoutset: x) - x = x + 1 - !$omp end task -end - diff --git a/flang/test/Lower/OpenMP/Todo/depend-clause-mutexinoutset.f90 b/flang/test/Lower/OpenMP/Todo/depend-clause-mutexinoutset.f90 deleted file mode 100644 index 17cc3894c548f..0000000000000 --- a/flang/test/Lower/OpenMP/Todo/depend-clause-mutexinoutset.f90 +++ /dev/null @@ -1,11 +0,0 @@ -!RUN: %not_todo_cmd bbc -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s -!RUN: %not_todo_cmd %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s - -!CHECK: not yet implemented: INOUTSET, MUTEXINOUTSET and DEPOBJ dependence-types -subroutine f00(x) - integer :: x - !$omp task depend(mutexinoutset: x) - x = x + 1 - !$omp end task -end - diff --git a/flang/test/Lower/OpenMP/Todo/task_untied.f90 b/flang/test/Lower/OpenMP/Todo/task_untied.f90 new file mode 100644 index 0000000000000..87d242ba3e9d2 --- /dev/null +++ b/flang/test/Lower/OpenMP/Todo/task_untied.f90 @@ -0,0 +1,13 @@ +! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s +! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s + +!=============================================================================== +! `untied` clause +!=============================================================================== + +! CHECK: not yet implemented: UNTIED clause is not implemented yet +subroutine omp_task_untied() + !$omp task untied + call foo() + !$omp end task +end subroutine omp_task_untied diff --git a/flang/test/Lower/OpenMP/task.f90 b/flang/test/Lower/OpenMP/task.f90 index a8cc16c540c9c..f5591bd9d8609 100644 --- a/flang/test/Lower/OpenMP/task.f90 +++ b/flang/test/Lower/OpenMP/task.f90 @@ -144,6 +144,18 @@ subroutine task_depend_multi_task() x = x + 12 !CHECK: omp.terminator !$omp end task + !CHECK: omp.task depend(taskdependmutexinoutset -> %{{.+}} : !fir.ref) + !$omp task depend(mutexinoutset : x) + !CHECK: arith.subi + x = x - 12 + !CHECK: omp.terminator + !$omp end task + !CHECK: omp.task depend(taskdependinoutset -> %{{.+}} : !fir.ref) + !$omp task depend(inoutset : x) + !CHECK: arith.subi + x = x - 12 + !CHECK: omp.terminator + !$omp end task end subroutine task_depend_multi_task !=============================================================================== @@ -235,10 +247,6 @@ subroutine task_multiple_clauses() !$omp end task end subroutine task_multiple_clauses -!=============================================================================== -! `mergeable` clause -!=============================================================================== - subroutine task_mergeable() !CHECK: omp.task mergeable { !CHECK: omp.terminator @@ -246,16 +254,3 @@ subroutine task_mergeable() !$omp task mergeable !$omp end task end subroutine - -!=============================================================================== -! `untied` clause -!=============================================================================== - -!CHECK-LABEL: func.func @_QPomp_task_untied() { -subroutine omp_task_untied() - !CHECK: omp.task untied { - !$omp task untied - call foo() - !CHECK: omp.terminator - !$omp end task -end subroutine omp_task_untied diff --git a/flang/test/Lower/io-derived-type.f90 b/flang/test/Lower/io-derived-type.f90 index 08b1207f55ad1..8ac995739afd7 100644 --- a/flang/test/Lower/io-derived-type.f90 +++ b/flang/test/Lower/io-derived-type.f90 @@ -51,7 +51,7 @@ subroutine test1 ! CHECK: fir.store %c2{{.*}} to %[[V_36]] : !fir.ref ! CHECK: %[[V_37:[0-9]+]] = fir.embox %{{.*}} : (!fir.ref>) -> !fir.box> ! CHECK: %[[V_38:[0-9]+]] = fir.convert %[[V_37]] : (!fir.box>) -> !fir.box - ! CHECK: %[[V_39:[0-9]+]] = fir.address_of(@default.nonTbpDefinedIoTable) : !fir.ref, !fir.ref, i32, i1>>>, i1>> + ! CHECK: %[[V_39:[0-9]+]] = fir.address_of(@_QQdefault.nonTbpDefinedIoTable) : !fir.ref, !fir.ref, i32, i1>>>, i1>> ! CHECK: %[[V_40:[0-9]+]] = fir.convert %[[V_39]] : (!fir.ref, !fir.ref, i32, i1>>>, i1>>) -> !fir.ref ! CHECK: %[[V_41:[0-9]+]] = fir.call @_FortranAioOutputDerivedType(%{{.*}}, %[[V_38]], %[[V_40]]) fastmath : (!fir.ref, !fir.box, !fir.ref) -> i1 print *, 'test1 block, should not call wft: ', t(2) @@ -65,7 +65,7 @@ subroutine test2 ! CHECK: fir.store %c3{{.*}} to %[[V_14]] : !fir.ref ! CHECK: %[[V_15:[0-9]+]] = fir.embox %{{.*}} : (!fir.ref>) -> !fir.box> ! CHECK: %[[V_16:[0-9]+]] = fir.convert %[[V_15]] : (!fir.box>) -> !fir.box - ! CHECK: %[[V_17:[0-9]+]] = fir.address_of(@default.nonTbpDefinedIoTable) : !fir.ref, !fir.ref, i32, i1>>>, i1>> + ! CHECK: %[[V_17:[0-9]+]] = fir.address_of(@_QQdefault.nonTbpDefinedIoTable) : !fir.ref, !fir.ref, i32, i1>>>, i1>> ! CHECK: %[[V_18:[0-9]+]] = fir.convert %[[V_17]] : (!fir.ref, !fir.ref, i32, i1>>>, i1>>) -> !fir.ref ! CHECK: %[[V_19:[0-9]+]] = fir.call @_FortranAioOutputDerivedType(%{{.*}}, %[[V_16]], %[[V_18]]) fastmath : (!fir.ref, !fir.box, !fir.ref) -> i1 @@ -131,6 +131,6 @@ program p ! CHECK: fir.global linkonce @_QQMmFtest1.nonTbpDefinedIoTable.list constant : !fir.array<1xtuple, !fir.ref, i32, i1>> ! CHECK: fir.global linkonce @_QQMmFtest1.nonTbpDefinedIoTable constant : tuple, !fir.ref, i32, i1>>>, i1> -! CHECK: fir.global linkonce @default.nonTbpDefinedIoTable constant : tuple, !fir.ref, i32, i1>>>, i1> +! CHECK: fir.global linkonce @_QQdefault.nonTbpDefinedIoTable constant : tuple, !fir.ref, i32, i1>>>, i1> ! CHECK: fir.global linkonce @_QQF.nonTbpDefinedIoTable.list constant : !fir.array<1xtuple, !fir.ref, i32, i1>> ! CHECK: fir.global linkonce @_QQF.nonTbpDefinedIoTable constant : tuple, !fir.ref, i32, i1>>>, i1> diff --git a/flang/test/Lower/namelist.f90 b/flang/test/Lower/namelist.f90 index a96bbbfad0cd6..ea97a0957c35b 100644 --- a/flang/test/Lower/namelist.f90 +++ b/flang/test/Lower/namelist.f90 @@ -42,7 +42,7 @@ program p ! CHECK: %[[V_42:[0-9]+]] = fir.insert_value %[[V_39]], %[[V_41]], [0 : index] : (tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref>, !fir.ref) -> tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref> ! CHECK: %[[V_43:[0-9]+]] = fir.insert_value %[[V_42]], %c2{{.*}}, [1 : index] : (tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref>, i64) -> tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref> ! CHECK: %[[V_44:[0-9]+]] = fir.insert_value %[[V_43]], %[[V_24]], [2 : index] : (tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref>, !fir.ref, !fir.ref>>>>) -> tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref> - ! CHECK: %[[V_45:[0-9]+]] = fir.address_of(@default.nonTbpDefinedIoTable) : !fir.ref, !fir.ref, i32, i1>>>, i1>> + ! CHECK: %[[V_45:[0-9]+]] = fir.address_of(@_QQdefault.nonTbpDefinedIoTable) : !fir.ref, !fir.ref, i32, i1>>>, i1>> ! CHECK: %[[V_46:[0-9]+]] = fir.convert %[[V_45]] : (!fir.ref, !fir.ref, i32, i1>>>, i1>>) -> !fir.ref ! CHECK: %[[V_47:[0-9]+]] = fir.insert_value %[[V_44]], %[[V_46]], [3 : index] : (tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref>, !fir.ref) -> tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref> ! CHECK: fir.store %[[V_47]] to %[[V_38]] : !fir.ref, i64, !fir.ref, !fir.ref>>>>, !fir.ref>> @@ -100,7 +100,7 @@ subroutine sss ! CHECK: %[[V_20:[0-9]+]] = fir.insert_value %[[V_17]], %[[V_19]], [0 : index] : (tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref>, !fir.ref) -> tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref> ! CHECK: %[[V_21:[0-9]+]] = fir.insert_value %[[V_20]], %c1{{.*}}, [1 : index] : (tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref>, i64) -> tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref> ! CHECK: %[[V_22:[0-9]+]] = fir.insert_value %[[V_21]], %[[V_8]], [2 : index] : (tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref>, !fir.ref, !fir.ref>>>>) -> tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref> - ! CHECK: %[[V_23:[0-9]+]] = fir.address_of(@default.nonTbpDefinedIoTable) : !fir.ref, !fir.ref, i32, i1>>>, i1>> + ! CHECK: %[[V_23:[0-9]+]] = fir.address_of(@_QQdefault.nonTbpDefinedIoTable) : !fir.ref, !fir.ref, i32, i1>>>, i1>> ! CHECK: %[[V_24:[0-9]+]] = fir.convert %[[V_23]] : (!fir.ref, !fir.ref, i32, i1>>>, i1>>) -> !fir.ref ! CHECK: %[[V_25:[0-9]+]] = fir.insert_value %[[V_22]], %[[V_24]], [3 : index] : (tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref>, !fir.ref) -> tuple, i64, !fir.ref, !fir.ref>>>>, !fir.ref> ! CHECK: fir.store %[[V_25]] to %[[V_16]] : !fir.ref, i64, !fir.ref, !fir.ref>>>>, !fir.ref>> diff --git a/flang/test/Transforms/loop-versioning.fir b/flang/test/Transforms/loop-versioning.fir index 7528d14b3670d..2f7c439ed3f4e 100644 --- a/flang/test/Transforms/loop-versioning.fir +++ b/flang/test/Transforms/loop-versioning.fir @@ -113,8 +113,10 @@ func.func @sum1dfixed(%arg0: !fir.ref> {fir.bindc_name = "a"}, // CHECK-LABEL: func.func @sum1dfixed( // CHECK-SAME: %[[ARG0:.*]]: !fir.ref> {{.*}}) // CHECK: fir.do_loop {{.*}} +// CHECK-NOT: fir.do_loop // CHECK: %[[COORD:.*]] = fir.coordinate_of %[[ARG0]], {{.*}} // CHECK: %{{.*}} = fir.load %[[COORD]] +// CHECK-NOT: fir.do_loop // ----- @@ -1641,4 +1643,355 @@ func.func @_QPtest_complex10(%arg0: !fir.box>> {fir. // CHECK: } else { // CHECK: fir.do_loop +// Test that the loop is not versioned with non-contiguous slices: +//subroutine test_step2_slice(x, y) +// real :: x(:,:), y(:,:) +// do i=1,10 +// x(::2,i) = y(::2,i) + 1.0 +// end do +//end subroutine +func.func @_QPtest_step2_slice(%arg0: !fir.box> {fir.bindc_name = "x"}, %arg1: !fir.box> {fir.bindc_name = "y"}) { + %c10 = arith.constant 10 : index + %cst = arith.constant 1.000000e+00 : f32 + %c2 = arith.constant 2 : index + %c0 = arith.constant 0 : index + %c1 = arith.constant 1 : index + %0 = fir.dummy_scope : !fir.dscope + %1 = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFtest_step2_sliceEi"} + %2 = fir.declare %1 {uniq_name = "_QFtest_step2_sliceEi"} : (!fir.ref) -> !fir.ref + %3 = fir.declare %arg0 dummy_scope %0 {uniq_name = "_QFtest_step2_sliceEx"} : (!fir.box>, !fir.dscope) -> !fir.box> + %4 = fir.rebox %3 : (!fir.box>) -> !fir.box> + %5 = fir.declare %arg1 dummy_scope %0 {uniq_name = "_QFtest_step2_sliceEy"} : (!fir.box>, !fir.dscope) -> !fir.box> + %6 = fir.rebox %5 : (!fir.box>) -> !fir.box> + %7 = fir.convert %c1 : (index) -> i32 + %8:2 = fir.do_loop %arg2 = %c1 to %c10 step %c1 iter_args(%arg3 = %7) -> (index, i32) { + fir.store %arg3 to %2 : !fir.ref + %9:3 = fir.box_dims %6, %c0 : (!fir.box>, index) -> (index, index, index) + %10 = arith.addi %9#1, %c1 : index + %11 = arith.divsi %10, %c2 : index + %12 = arith.cmpi sgt, %11, %c0 : index + %13 = arith.select %12, %11, %c0 : index + %14 = fir.load %2 : !fir.ref + %15 = fir.convert %14 : (i32) -> i64 + %16 = fir.undefined index + %17 = fir.slice %c1, %9#1, %c2, %15, %16, %16 : (index, index, index, i64, index, index) -> !fir.slice<2> + %18 = fir.rebox %6 [%17] : (!fir.box>, !fir.slice<2>) -> !fir.box> + %19:3 = fir.box_dims %4, %c0 : (!fir.box>, index) -> (index, index, index) + %20 = fir.slice %c1, %19#1, %c2, %15, %16, %16 : (index, index, index, i64, index, index) -> !fir.slice<2> + %21 = fir.rebox %4 [%20] : (!fir.box>, !fir.slice<2>) -> !fir.box> + fir.do_loop %arg4 = %c1 to %13 step %c1 unordered { + %25 = fir.array_coor %18 %arg4 : (!fir.box>, index) -> !fir.ref + %26 = fir.load %25 : !fir.ref + %27 = arith.addf %26, %cst fastmath : f32 + %28 = fir.array_coor %21 %arg4 : (!fir.box>, index) -> !fir.ref + fir.store %27 to %28 : !fir.ref + } + %22 = arith.addi %arg2, %c1 overflow : index + %23 = fir.load %2 : !fir.ref + %24 = arith.addi %23, %7 overflow : i32 + fir.result %22, %24 : index, i32 + } + fir.store %8#1 to %2 : !fir.ref + return +} +// CHECK-LABEL: func.func @_QPtest_step2_slice( +// CHECK-NOT: fir.if + +// Test that the loop is versioned with most probably +// contiguous slices: +//subroutine test_step1_slice(x, y) +// real :: x(:,:), y(:,:) +// do i=1,10 +// x(:,i) = y(:,i) + 1.0 +// end do +//end subroutine +func.func @_QPtest_step1_slice(%arg0: !fir.box> {fir.bindc_name = "x"}, %arg1: !fir.box> {fir.bindc_name = "y"}) { + %c10 = arith.constant 10 : index + %cst = arith.constant 1.000000e+00 : f32 + %c0 = arith.constant 0 : index + %c1 = arith.constant 1 : index + %0 = fir.dummy_scope : !fir.dscope + %1 = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFtest_step1_sliceEi"} + %2 = fir.declare %1 {uniq_name = "_QFtest_step1_sliceEi"} : (!fir.ref) -> !fir.ref + %3 = fir.declare %arg0 dummy_scope %0 {uniq_name = "_QFtest_step1_sliceEx"} : (!fir.box>, !fir.dscope) -> !fir.box> + %4 = fir.rebox %3 : (!fir.box>) -> !fir.box> + %5 = fir.declare %arg1 dummy_scope %0 {uniq_name = "_QFtest_step1_sliceEy"} : (!fir.box>, !fir.dscope) -> !fir.box> + %6 = fir.rebox %5 : (!fir.box>) -> !fir.box> + %7 = fir.convert %c1 : (index) -> i32 + %8:2 = fir.do_loop %arg2 = %c1 to %c10 step %c1 iter_args(%arg3 = %7) -> (index, i32) { + fir.store %arg3 to %2 : !fir.ref + %9:3 = fir.box_dims %6, %c0 : (!fir.box>, index) -> (index, index, index) + %10 = arith.cmpi sgt, %9#1, %c0 : index + %11 = arith.select %10, %9#1, %c0 : index + %12 = fir.load %2 : !fir.ref + %13 = fir.convert %12 : (i32) -> i64 + %14 = fir.undefined index + %15 = fir.slice %c1, %9#1, %c1, %13, %14, %14 : (index, index, index, i64, index, index) -> !fir.slice<2> + %16 = fir.rebox %6 [%15] : (!fir.box>, !fir.slice<2>) -> !fir.box> + %17:3 = fir.box_dims %4, %c0 : (!fir.box>, index) -> (index, index, index) + %18 = fir.slice %c1, %17#1, %c1, %13, %14, %14 : (index, index, index, i64, index, index) -> !fir.slice<2> + %19 = fir.rebox %4 [%18] : (!fir.box>, !fir.slice<2>) -> !fir.box> + fir.do_loop %arg4 = %c1 to %11 step %c1 unordered { + %23 = fir.array_coor %16 %arg4 : (!fir.box>, index) -> !fir.ref + %24 = fir.load %23 : !fir.ref + %25 = arith.addf %24, %cst fastmath : f32 + %26 = fir.array_coor %19 %arg4 : (!fir.box>, index) -> !fir.ref + fir.store %25 to %26 : !fir.ref + } + %20 = arith.addi %arg2, %c1 overflow : index + %21 = fir.load %2 : !fir.ref + %22 = arith.addi %21, %7 overflow : i32 + fir.result %20, %22 : index, i32 + } + fir.store %8#1 to %2 : !fir.ref + return +} +// CHECK-LABEL: func.func @_QPtest_step1_slice( +// CHECK: fir.do_loop +// CHECK: fir.if +// CHECK: fir.do_loop +// CHECK: } else { +// CHECK: fir.do_loop + +// Test that the loop is versioned with logical arrays: +//subroutine test_logical_slice(x, y) +// logical :: x(:,:), y(:,:) +// do i=1,10 +// x(:,i) = y(:,i) .or. y(i,:) +// end do +//end subroutine +func.func @_QPtest_logical_slice(%arg0: !fir.box>> {fir.bindc_name = "x"}, %arg1: !fir.box>> {fir.bindc_name = "y"}) { + %c10 = arith.constant 10 : index + %c0 = arith.constant 0 : index + %c1 = arith.constant 1 : index + %0 = fir.dummy_scope : !fir.dscope + %1 = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFtest_logical_sliceEi"} + %2 = fir.declare %1 {uniq_name = "_QFtest_logical_sliceEi"} : (!fir.ref) -> !fir.ref + %3 = fir.declare %arg0 dummy_scope %0 {uniq_name = "_QFtest_logical_sliceEx"} : (!fir.box>>, !fir.dscope) -> !fir.box>> + %4 = fir.rebox %3 : (!fir.box>>) -> !fir.box>> + %5 = fir.declare %arg1 dummy_scope %0 {uniq_name = "_QFtest_logical_sliceEy"} : (!fir.box>>, !fir.dscope) -> !fir.box>> + %6 = fir.rebox %5 : (!fir.box>>) -> !fir.box>> + %7 = fir.convert %c1 : (index) -> i32 + %8:2 = fir.do_loop %arg2 = %c1 to %c10 step %c1 iter_args(%arg3 = %7) -> (index, i32) { + fir.store %arg3 to %2 : !fir.ref + %9:3 = fir.box_dims %6, %c0 : (!fir.box>>, index) -> (index, index, index) + %10 = arith.cmpi sgt, %9#1, %c0 : index + %11 = arith.select %10, %9#1, %c0 : index + %12 = fir.load %2 : !fir.ref + %13 = fir.convert %12 : (i32) -> i64 + %14 = fir.undefined index + %15 = fir.slice %c1, %9#1, %c1, %13, %14, %14 : (index, index, index, i64, index, index) -> !fir.slice<2> + %16 = fir.rebox %6 [%15] : (!fir.box>>, !fir.slice<2>) -> !fir.box>> + %17:3 = fir.box_dims %6, %c1 : (!fir.box>>, index) -> (index, index, index) + %18 = fir.slice %13, %14, %14, %c1, %17#1, %c1 : (i64, index, index, index, index, index) -> !fir.slice<2> + %19 = fir.rebox %6 [%18] : (!fir.box>>, !fir.slice<2>) -> !fir.box>> + %20:3 = fir.box_dims %4, %c0 : (!fir.box>>, index) -> (index, index, index) + %21 = fir.slice %c1, %20#1, %c1, %13, %14, %14 : (index, index, index, i64, index, index) -> !fir.slice<2> + %22 = fir.rebox %4 [%21] : (!fir.box>>, !fir.slice<2>) -> !fir.box>> + fir.do_loop %arg4 = %c1 to %11 step %c1 unordered { + %26 = fir.array_coor %16 %arg4 : (!fir.box>>, index) -> !fir.ref> + %27 = fir.array_coor %19 %arg4 : (!fir.box>>, index) -> !fir.ref> + %28 = fir.load %26 : !fir.ref> + %29 = fir.load %27 : !fir.ref> + %30 = fir.convert %28 : (!fir.logical<4>) -> i1 + %31 = fir.convert %29 : (!fir.logical<4>) -> i1 + %32 = arith.ori %30, %31 : i1 + %33 = fir.convert %32 : (i1) -> !fir.logical<4> + %34 = fir.array_coor %22 %arg4 : (!fir.box>>, index) -> !fir.ref> + fir.store %33 to %34 : !fir.ref> + } + %23 = arith.addi %arg2, %c1 overflow : index + %24 = fir.load %2 : !fir.ref + %25 = arith.addi %24, %7 overflow : i32 + fir.result %23, %25 : index, i32 + } + fir.store %8#1 to %2 : !fir.ref + return +} +// CHECK-LABEL: func.func @_QPtest_logical_slice( +// CHECK: fir.do_loop +// CHECK: fir.if +// CHECK: fir.do_loop +// CHECK: } else { +// CHECK: fir.do_loop + +// Test that the loop is versioned when a most probably +// contiguous slices have known shape: +//subroutine test_known_shape_slice(x, y) +// integer :: x(:,:), y(:,:) +// do i=1,10 +// x(1:10,i) = y(1:10,i) + 1 +// end do +//end subroutine +func.func @_QPtest_known_shape_slice(%arg0: !fir.box> {fir.bindc_name = "x"}, %arg1: !fir.box> {fir.bindc_name = "y"}) { + %c10 = arith.constant 10 : index + %c1 = arith.constant 1 : index + %c1_i32 = arith.constant 1 : i32 + %0 = fir.dummy_scope : !fir.dscope + %1 = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFtest_known_shape_sliceEi"} + %2 = fir.declare %1 {uniq_name = "_QFtest_known_shape_sliceEi"} : (!fir.ref) -> !fir.ref + %3 = fir.declare %arg0 dummy_scope %0 {uniq_name = "_QFtest_known_shape_sliceEx"} : (!fir.box>, !fir.dscope) -> !fir.box> + %4 = fir.rebox %3 : (!fir.box>) -> !fir.box> + %5 = fir.declare %arg1 dummy_scope %0 {uniq_name = "_QFtest_known_shape_sliceEy"} : (!fir.box>, !fir.dscope) -> !fir.box> + %6 = fir.rebox %5 : (!fir.box>) -> !fir.box> + %7 = fir.convert %c1 : (index) -> i32 + %8:2 = fir.do_loop %arg2 = %c1 to %c10 step %c1 iter_args(%arg3 = %7) -> (index, i32) { + fir.store %arg3 to %2 : !fir.ref + %9 = fir.load %2 : !fir.ref + %10 = fir.convert %9 : (i32) -> i64 + %11 = fir.undefined index + %12 = fir.slice %c1, %c10, %c1, %10, %11, %11 : (index, index, index, i64, index, index) -> !fir.slice<2> + %13 = fir.rebox %6 [%12] : (!fir.box>, !fir.slice<2>) -> !fir.box> + %14 = fir.rebox %4 [%12] : (!fir.box>, !fir.slice<2>) -> !fir.box> + fir.do_loop %arg4 = %c1 to %c10 step %c1 unordered { + %18 = fir.array_coor %13 %arg4 : (!fir.box>, index) -> !fir.ref + %19 = fir.load %18 : !fir.ref + %20 = arith.addi %19, %c1_i32 : i32 + %21 = fir.array_coor %14 %arg4 : (!fir.box>, index) -> !fir.ref + fir.store %20 to %21 : !fir.ref + } + %15 = arith.addi %arg2, %c1 overflow : index + %16 = fir.load %2 : !fir.ref + %17 = arith.addi %16, %7 overflow : i32 + fir.result %15, %17 : index, i32 + } + fir.store %8#1 to %2 : !fir.ref + return +} +// CHECK-LABEL: func.func @_QPtest_known_shape_slice( +// CHECK: fir.do_loop +// CHECK: fir.if +// CHECK: fir.do_loop +// CHECK: } else { +// CHECK: fir.do_loop + +// Test that the loop is not versioned for most probably +// not-contiguous slices: +//subroutine test_maybe_noncontig_slice(x, y) +// real :: x(:,:), y(:,:) +// do i=1,10 +// x(i,:) = y(i,:) + 1.0 +// end do +//end subroutine +func.func @_QPtest_maybe_noncontig_slice(%arg0: !fir.box> {fir.bindc_name = "x"}, %arg1: !fir.box> {fir.bindc_name = "y"}) { + %c10 = arith.constant 10 : index + %cst = arith.constant 1.000000e+00 : f32 + %c0 = arith.constant 0 : index + %c1 = arith.constant 1 : index + %0 = fir.dummy_scope : !fir.dscope + %1 = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFtest_maybe_noncontig_sliceEi"} + %2 = fir.declare %1 {uniq_name = "_QFtest_maybe_noncontig_sliceEi"} : (!fir.ref) -> !fir.ref + %3 = fir.declare %arg0 dummy_scope %0 {uniq_name = "_QFtest_maybe_noncontig_sliceEx"} : (!fir.box>, !fir.dscope) -> !fir.box> + %4 = fir.rebox %3 : (!fir.box>) -> !fir.box> + %5 = fir.declare %arg1 dummy_scope %0 {uniq_name = "_QFtest_maybe_noncontig_sliceEy"} : (!fir.box>, !fir.dscope) -> !fir.box> + %6 = fir.rebox %5 : (!fir.box>) -> !fir.box> + %7 = fir.convert %c1 : (index) -> i32 + %8:2 = fir.do_loop %arg2 = %c1 to %c10 step %c1 iter_args(%arg3 = %7) -> (index, i32) { + fir.store %arg3 to %2 : !fir.ref + %9 = fir.load %2 : !fir.ref + %10 = fir.convert %9 : (i32) -> i64 + %11:3 = fir.box_dims %6, %c1 : (!fir.box>, index) -> (index, index, index) + %12 = arith.cmpi sgt, %11#1, %c0 : index + %13 = arith.select %12, %11#1, %c0 : index + %14 = fir.undefined index + %15 = fir.slice %10, %14, %14, %c1, %11#1, %c1 : (i64, index, index, index, index, index) -> !fir.slice<2> + %16 = fir.rebox %6 [%15] : (!fir.box>, !fir.slice<2>) -> !fir.box> + %17:3 = fir.box_dims %4, %c1 : (!fir.box>, index) -> (index, index, index) + %18 = fir.slice %10, %14, %14, %c1, %17#1, %c1 : (i64, index, index, index, index, index) -> !fir.slice<2> + %19 = fir.rebox %4 [%18] : (!fir.box>, !fir.slice<2>) -> !fir.box> + fir.do_loop %arg4 = %c1 to %13 step %c1 unordered { + %23 = fir.array_coor %16 %arg4 : (!fir.box>, index) -> !fir.ref + %24 = fir.load %23 : !fir.ref + %25 = arith.addf %24, %cst fastmath : f32 + %26 = fir.array_coor %19 %arg4 : (!fir.box>, index) -> !fir.ref + fir.store %25 to %26 : !fir.ref + } + %20 = arith.addi %arg2, %c1 overflow : index + %21 = fir.load %2 : !fir.ref + %22 = arith.addi %21, %7 overflow : i32 + fir.result %20, %22 : index, i32 + } + fir.store %8#1 to %2 : !fir.ref + return +} +// CHECK-LABEL: func.func @_QPtest_maybe_noncontig_slice( +// CHECK-NOT: fir.if + +// Regression test for facerec's GraphSimFct: +//real function test_graphsimfct(a1, a2) +// integer :: i +// real, intent(in) :: a1(:,:,:) +// real, intent(in) :: a2(:,:,:,:) +// graphsimfct = 0.0 +// do i=1,10 +// test_graphsimfct = test_graphsimfct + SUM(a1(:,:,i) * a2(:,:,i,i)) +// end do +//end function +func.func @_QPtest_graphsimfct(%arg0: !fir.box> {fir.bindc_name = "a1"}, %arg1: !fir.box> {fir.bindc_name = "a2"}) -> f32 { + %c10 = arith.constant 10 : index + %c0 = arith.constant 0 : index + %c1 = arith.constant 1 : index + %cst = arith.constant 0.000000e+00 : f32 + %0 = fir.dummy_scope : !fir.dscope + %1 = fir.declare %arg0 dummy_scope %0 {fortran_attrs = #fir.var_attrs, uniq_name = "_QFtest_graphsimfctEa1"} : (!fir.box>, !fir.dscope) -> !fir.box> + %2 = fir.rebox %1 : (!fir.box>) -> !fir.box> + %3 = fir.declare %arg1 dummy_scope %0 {fortran_attrs = #fir.var_attrs, uniq_name = "_QFtest_graphsimfctEa2"} : (!fir.box>, !fir.dscope) -> !fir.box> + %4 = fir.rebox %3 : (!fir.box>) -> !fir.box> + %5 = fir.alloca f32 {bindc_name = "graphsimfct", uniq_name = "_QFtest_graphsimfctEgraphsimfct"} + %6 = fir.declare %5 {uniq_name = "_QFtest_graphsimfctEgraphsimfct"} : (!fir.ref) -> !fir.ref + %7 = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFtest_graphsimfctEi"} + %8 = fir.declare %7 {uniq_name = "_QFtest_graphsimfctEi"} : (!fir.ref) -> !fir.ref + %9 = fir.alloca f32 {bindc_name = "test_graphsimfct", uniq_name = "_QFtest_graphsimfctEtest_graphsimfct"} + %10 = fir.declare %9 {uniq_name = "_QFtest_graphsimfctEtest_graphsimfct"} : (!fir.ref) -> !fir.ref + fir.store %cst to %6 : !fir.ref + %11 = fir.convert %c1 : (index) -> i32 + %12:2 = fir.do_loop %arg2 = %c1 to %c10 step %c1 iter_args(%arg3 = %11) -> (index, i32) { + fir.store %arg3 to %8 : !fir.ref + %14 = fir.load %10 : !fir.ref + %15:3 = fir.box_dims %2, %c0 : (!fir.box>, index) -> (index, index, index) + %16:3 = fir.box_dims %2, %c1 : (!fir.box>, index) -> (index, index, index) + %17 = arith.cmpi sgt, %15#1, %c0 : index + %18 = arith.select %17, %15#1, %c0 : index + %19 = arith.cmpi sgt, %16#1, %c0 : index + %20 = arith.select %19, %16#1, %c0 : index + %21 = fir.load %8 : !fir.ref + %22 = fir.convert %21 : (i32) -> i64 + %23 = fir.undefined index + %24 = fir.slice %c1, %15#1, %c1, %c1, %16#1, %c1, %22, %23, %23 : (index, index, index, index, index, index, i64, index, index) -> !fir.slice<3> + %25 = fir.rebox %2 [%24] : (!fir.box>, !fir.slice<3>) -> !fir.box> + %26:3 = fir.box_dims %4, %c0 : (!fir.box>, index) -> (index, index, index) + %27:3 = fir.box_dims %4, %c1 : (!fir.box>, index) -> (index, index, index) + %28 = fir.slice %c1, %26#1, %c1, %c1, %27#1, %c1, %22, %23, %23, %22, %23, %23 : (index, index, index, index, index, index, i64, index, index, i64, index, index) -> !fir.slice<4> + %29 = fir.rebox %4 [%28] : (!fir.box>, !fir.slice<4>) -> !fir.box> + %30 = fir.do_loop %arg4 = %c1 to %20 step %c1 unordered iter_args(%arg5 = %cst) -> (f32) { + %35 = fir.do_loop %arg6 = %c1 to %18 step %c1 unordered iter_args(%arg7 = %arg5) -> (f32) { + %36 = fir.array_coor %25 %arg6, %arg4 : (!fir.box>, index, index) -> !fir.ref + %37 = fir.array_coor %29 %arg6, %arg4 : (!fir.box>, index, index) -> !fir.ref + %38 = fir.load %36 : !fir.ref + %39 = fir.load %37 : !fir.ref + %40 = arith.mulf %38, %39 fastmath : f32 + %41 = arith.addf %arg7, %40 fastmath : f32 + fir.result %41 : f32 + } + fir.result %35 : f32 + } + %31 = arith.addf %14, %30 fastmath : f32 + fir.store %31 to %10 : !fir.ref + %32 = arith.addi %arg2, %c1 overflow : index + %33 = fir.load %8 : !fir.ref + %34 = arith.addi %33, %11 overflow : i32 + fir.result %32, %34 : index, i32 + } + fir.store %12#1 to %8 : !fir.ref + %13 = fir.load %10 : !fir.ref + return %13 : f32 +} +// CHECK-LABEL: func.func @_QPtest_graphsimfct( +// CHECK: fir.do_loop +// CHECK: fir.do_loop +// CHECK: fir.if +// CHECK: fir.do_loop +// CHECK: } else { +// CHECK: fir.do_loop + } // End module diff --git a/flang/unittests/Frontend/CodeGenActionTest.cpp b/flang/unittests/Frontend/CodeGenActionTest.cpp index 5d75de03d4e55..e9ff095973b97 100644 --- a/flang/unittests/Frontend/CodeGenActionTest.cpp +++ b/flang/unittests/Frontend/CodeGenActionTest.cpp @@ -72,8 +72,7 @@ class LLVMConversionFailureCodeGenAction : public CodeGenAction { mlirCtx->loadDialect(); mlir::Location loc(mlir::UnknownLoc::get(mlirCtx.get())); - mlirModule = - std::make_unique(mlir::ModuleOp::create(loc, "mod")); + mlirModule = mlir::ModuleOp::create(loc, "mod"); mlir::OpBuilder builder(mlirCtx.get()); builder.setInsertionPointToStart(&mlirModule->getRegion().front()); diff --git a/flang/unittests/Optimizer/Builder/CharacterTest.cpp b/flang/unittests/Optimizer/Builder/CharacterTest.cpp index c6defcd51095b..6d912b81d9541 100644 --- a/flang/unittests/Optimizer/Builder/CharacterTest.cpp +++ b/flang/unittests/Optimizer/Builder/CharacterTest.cpp @@ -26,19 +26,20 @@ struct CharacterTest : public testing::Test { // Set up a Module with a dummy function operation inside. // Set the insertion point in the function entry block. - mlir::ModuleOp mod = builder.create(loc); - mlir::func::FuncOp func = mlir::func::FuncOp::create( + moduleOp = builder.create(loc); + builder.setInsertionPointToStart(moduleOp->getBody()); + mlir::func::FuncOp func = builder.create( loc, "func1", builder.getFunctionType(std::nullopt, std::nullopt)); auto *entryBlock = func.addEntryBlock(); - mod.push_back(mod); builder.setInsertionPointToStart(entryBlock); - firBuilder = std::make_unique(mod, *kindMap); + firBuilder = std::make_unique(builder, *kindMap); } fir::FirOpBuilder &getBuilder() { return *firBuilder; } mlir::MLIRContext context; + mlir::OwningOpRef moduleOp; std::unique_ptr kindMap; std::unique_ptr firBuilder; }; diff --git a/flang/unittests/Optimizer/Builder/ComplexTest.cpp b/flang/unittests/Optimizer/Builder/ComplexTest.cpp index 6472a52f25ee5..eefab118e255a 100644 --- a/flang/unittests/Optimizer/Builder/ComplexTest.cpp +++ b/flang/unittests/Optimizer/Builder/ComplexTest.cpp @@ -22,15 +22,15 @@ struct ComplexTest : public testing::Test { // Set up a Module with a dummy function operation inside. // Set the insertion point in the function entry block. - mlir::ModuleOp mod = builder.create(loc); - mlir::func::FuncOp func = mlir::func::FuncOp::create( + moduleOp = builder.create(loc); + builder.setInsertionPointToStart(moduleOp->getBody()); + mlir::func::FuncOp func = builder.create( loc, "func1", builder.getFunctionType(std::nullopt, std::nullopt)); auto *entryBlock = func.addEntryBlock(); - mod.push_back(mod); builder.setInsertionPointToStart(entryBlock); kindMap = std::make_unique(&context); - firBuilder = std::make_unique(mod, *kindMap); + firBuilder = std::make_unique(builder, *kindMap); helper = std::make_unique(*firBuilder, loc); // Init commonly used types @@ -46,6 +46,7 @@ struct ComplexTest : public testing::Test { } mlir::MLIRContext context; + mlir::OwningOpRef moduleOp; std::unique_ptr kindMap; std::unique_ptr firBuilder; std::unique_ptr helper; diff --git a/flang/unittests/Optimizer/Builder/FIRBuilderTest.cpp b/flang/unittests/Optimizer/Builder/FIRBuilderTest.cpp index f63afe4137683..05407d96998a2 100644 --- a/flang/unittests/Optimizer/Builder/FIRBuilderTest.cpp +++ b/flang/unittests/Optimizer/Builder/FIRBuilderTest.cpp @@ -26,19 +26,20 @@ struct FIRBuilderTest : public testing::Test { // Set up a Module with a dummy function operation inside. // Set the insertion point in the function entry block. - mlir::ModuleOp mod = builder.create(loc); - mlir::func::FuncOp func = mlir::func::FuncOp::create( + moduleOp = builder.create(loc); + builder.setInsertionPointToStart(moduleOp->getBody()); + mlir::func::FuncOp func = builder.create( loc, "func1", builder.getFunctionType(std::nullopt, std::nullopt)); auto *entryBlock = func.addEntryBlock(); - mod.push_back(mod); builder.setInsertionPointToStart(entryBlock); - firBuilder = std::make_unique(mod, kindMap); + firBuilder = std::make_unique(builder, kindMap); } fir::FirOpBuilder &getBuilder() { return *firBuilder; } mlir::MLIRContext context; + mlir::OwningOpRef moduleOp; std::unique_ptr firBuilder; }; diff --git a/flang/unittests/Optimizer/Builder/HLFIRToolsTest.cpp b/flang/unittests/Optimizer/Builder/HLFIRToolsTest.cpp index 1858b276f1fc3..640b7ecc1e565 100644 --- a/flang/unittests/Optimizer/Builder/HLFIRToolsTest.cpp +++ b/flang/unittests/Optimizer/Builder/HLFIRToolsTest.cpp @@ -25,14 +25,14 @@ struct HLFIRToolsTest : public testing::Test { // Set up a Module with a dummy function operation inside. // Set the insertion point in the function entry block. - mlir::ModuleOp mod = builder.create(loc); - mlir::func::FuncOp func = mlir::func::FuncOp::create( + moduleOp = builder.create(loc); + builder.setInsertionPointToStart(moduleOp->getBody()); + mlir::func::FuncOp func = builder.create( loc, "func1", builder.getFunctionType(std::nullopt, std::nullopt)); auto *entryBlock = func.addEntryBlock(); - mod.push_back(mod); builder.setInsertionPointToStart(entryBlock); - firBuilder = std::make_unique(mod, kindMap); + firBuilder = std::make_unique(builder, kindMap); } mlir::Value createDeclare(fir::ExtendedValue exv) { @@ -52,6 +52,7 @@ struct HLFIRToolsTest : public testing::Test { int varCounter = 0; mlir::MLIRContext context; + mlir::OwningOpRef moduleOp; std::unique_ptr firBuilder; }; diff --git a/flang/unittests/Optimizer/Builder/Runtime/RuntimeCallTestBase.h b/flang/unittests/Optimizer/Builder/Runtime/RuntimeCallTestBase.h index d0ec97733e83d..40abf567400b3 100644 --- a/flang/unittests/Optimizer/Builder/Runtime/RuntimeCallTestBase.h +++ b/flang/unittests/Optimizer/Builder/Runtime/RuntimeCallTestBase.h @@ -24,16 +24,16 @@ struct RuntimeCallTest : public testing::Test { // Set up a Module with a dummy function operation inside. // Set the insertion point in the function entry block. - mlir::ModuleOp mod = builder.create(loc); + moduleOp = builder.create(loc); + builder.setInsertionPointToStart(moduleOp->getBody()); mlir::func::FuncOp func = - mlir::func::FuncOp::create(loc, "runtime_unit_tests_func", + builder.create(loc, "runtime_unit_tests_func", builder.getFunctionType(std::nullopt, std::nullopt)); auto *entryBlock = func.addEntryBlock(); - mod.push_back(mod); builder.setInsertionPointToStart(entryBlock); kindMap = std::make_unique(&context); - firBuilder = std::make_unique(mod, *kindMap); + firBuilder = std::make_unique(builder, *kindMap); i1Ty = firBuilder->getI1Type(); i8Ty = firBuilder->getI8Type(); @@ -66,6 +66,7 @@ struct RuntimeCallTest : public testing::Test { } mlir::MLIRContext context; + mlir::OwningOpRef moduleOp; std::unique_ptr kindMap; std::unique_ptr firBuilder; diff --git a/flang/unittests/Optimizer/FortranVariableTest.cpp b/flang/unittests/Optimizer/FortranVariableTest.cpp index 87efb624735cf..4ba9359a07e4d 100644 --- a/flang/unittests/Optimizer/FortranVariableTest.cpp +++ b/flang/unittests/Optimizer/FortranVariableTest.cpp @@ -19,12 +19,12 @@ struct FortranVariableTest : public testing::Test { // Set up a Module with a dummy function operation inside. // Set the insertion point in the function entry block. - mlir::ModuleOp mod = builder->create(loc); + moduleOp = builder->create(loc); + builder->setInsertionPointToStart(moduleOp->getBody()); mlir::func::FuncOp func = - mlir::func::FuncOp::create(loc, "fortran_variable_tests", + builder->create(loc, "fortran_variable_tests", builder->getFunctionType(std::nullopt, std::nullopt)); auto *entryBlock = func.addEntryBlock(); - mod.push_back(mod); builder->setInsertionPointToStart(entryBlock); } @@ -40,6 +40,7 @@ struct FortranVariableTest : public testing::Test { } mlir::MLIRContext context; std::unique_ptr builder; + mlir::OwningOpRef moduleOp; }; TEST_F(FortranVariableTest, SimpleScalar) { diff --git a/flang/unittests/Runtime/ArrayConstructor.cpp b/flang/unittests/Runtime/ArrayConstructor.cpp index 62e3b780a27e7..53774a0eea07d 100644 --- a/flang/unittests/Runtime/ArrayConstructor.cpp +++ b/flang/unittests/Runtime/ArrayConstructor.cpp @@ -127,6 +127,9 @@ TEST(ArrayConstructor, Character) { 0); result.Deallocate(); cookieAllocator.deallocate(acVector, 1); + x->Deallocate(); + y->Deallocate(); + c->Deallocate(); } TEST(ArrayConstructor, CharacterRuntimeCheck) { diff --git a/flang/unittests/Runtime/CUDA/AllocatorCUF.cpp b/flang/unittests/Runtime/CUDA/AllocatorCUF.cpp index b51ff0ac006cc..7cb25787e7797 100644 --- a/flang/unittests/Runtime/CUDA/AllocatorCUF.cpp +++ b/flang/unittests/Runtime/CUDA/AllocatorCUF.cpp @@ -66,7 +66,7 @@ TEST(AllocatableCUFTest, DescriptorAllocationTest) { // REAL(4), DEVICE, ALLOCATABLE :: a(:) auto a{createAllocatable(TypeCategory::Real, 4)}; Descriptor *desc = nullptr; - desc = RTNAME(CUFAllocDesciptor)(a->SizeInBytes()); + desc = RTNAME(CUFAllocDescriptor)(a->SizeInBytes()); EXPECT_TRUE(desc != nullptr); - RTNAME(CUFFreeDesciptor)(desc); + RTNAME(CUFFreeDescriptor)(desc); } diff --git a/flang/unittests/Runtime/CharacterTest.cpp b/flang/unittests/Runtime/CharacterTest.cpp index e54fd8a5075f6..d462c9120fd8c 100644 --- a/flang/unittests/Runtime/CharacterTest.cpp +++ b/flang/unittests/Runtime/CharacterTest.cpp @@ -259,6 +259,9 @@ void RunExtremumTests(const char *which, t.expect[i], t.expect[i] + std::strlen(t.expect[i])}; EXPECT_EQ(expect, got) << "inputs: '" << t.x[i] << "','" << t.y[i] << "'"; } + + x->Deallocate(); + y->Deallocate(); } } diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt index 00a07ea3c8ac7..6f1c180a3f192 100644 --- a/libc/CMakeLists.txt +++ b/libc/CMakeLists.txt @@ -64,8 +64,6 @@ if(LIBC_BUILD_GPU_LOADER OR ((NOT LLVM_RUNTIMES_BUILD) AND LLVM_LIBC_GPU_BUILD)) return() endif() -add_subdirectory(hdrgen) - option(LIBC_CMAKE_VERBOSE_LOGGING "Log details warnings and notifications during CMake configuration." OFF) diff --git a/libc/cmake/modules/CheckCompilerFeatures.cmake b/libc/cmake/modules/CheckCompilerFeatures.cmake index 862c7ecbd7fdf..a5ea66a5935b7 100644 --- a/libc/cmake/modules/CheckCompilerFeatures.cmake +++ b/libc/cmake/modules/CheckCompilerFeatures.cmake @@ -13,6 +13,8 @@ set( "float16_conversion" "float128" "fixed_point" + "cfloat16" + "cfloat128" ) # Making sure ALL_COMPILER_FEATURES is sorted. @@ -110,6 +112,10 @@ foreach(feature IN LISTS ALL_COMPILER_FEATURES) set(LIBC_TYPES_HAS_FLOAT128 TRUE) elseif(${feature} STREQUAL "fixed_point") set(LIBC_COMPILER_HAS_FIXED_POINT TRUE) + elseif(${feature} STREQUAL "cfloat16") + set(LIBC_TYPES_HAS_CFLOAT16 TRUE) + elseif(${feature} STREQUAL "cfloat128") + set(LIBC_TYPES_HAS_CFLOAT128 TRUE) elseif(${feature} STREQUAL "builtin_ceil_floor_rint_trunc") set(LIBC_COMPILER_HAS_BUILTIN_CEIL_FLOOR_RINT_TRUNC TRUE) elseif(${feature} STREQUAL "builtin_fmax_fmin") diff --git a/libc/cmake/modules/LLVMLibCHeaderRules.cmake b/libc/cmake/modules/LLVMLibCHeaderRules.cmake index 31a88f0ef93be..0de5e14359cfb 100644 --- a/libc/cmake/modules/LLVMLibCHeaderRules.cmake +++ b/libc/cmake/modules/LLVMLibCHeaderRules.cmake @@ -110,9 +110,10 @@ function(add_gen_header target_name) set(entry_points "${TARGET_ENTRYPOINT_NAME_LIST}") list(TRANSFORM entry_points PREPEND "--e=") + set(LIBC_HDRGEN "${LIBC_SOURCE_DIR}/utils/hdrgen/yaml_to_classes.py") add_custom_command( OUTPUT ${out_file} - COMMAND ${Python3_EXECUTABLE} ${LIBC_SOURCE_DIR}/hdrgen/yaml_to_classes.py + COMMAND ${Python3_EXECUTABLE} ${LIBC_HDRGEN} ${yaml_file} --h_def_file ${def_file} ${entry_points} @@ -126,7 +127,7 @@ function(add_gen_header target_name) set(decl_out_file ${LIBC_INCLUDE_DIR}/llvm-libc-decls/${relative_path}) add_custom_command( OUTPUT ${decl_out_file} - COMMAND ${Python3_EXECUTABLE} ${LIBC_SOURCE_DIR}/hdrgen/yaml_to_classes.py + COMMAND ${Python3_EXECUTABLE} ${LIBC_HDRGEN} ${yaml_file} --export-decls ${entry_points} diff --git a/libc/cmake/modules/compiler_features/check_cfloat128.cpp b/libc/cmake/modules/compiler_features/check_cfloat128.cpp new file mode 100644 index 0000000000000..a798ccb989689 --- /dev/null +++ b/libc/cmake/modules/compiler_features/check_cfloat128.cpp @@ -0,0 +1,5 @@ +#include "src/__support/macros/properties/complex_types.h" + +#ifndef LIBC_TYPES_HAS_CFLOAT128 +#error unsupported +#endif diff --git a/libc/cmake/modules/compiler_features/check_cfloat16.cpp b/libc/cmake/modules/compiler_features/check_cfloat16.cpp new file mode 100644 index 0000000000000..31416ff7c6aea --- /dev/null +++ b/libc/cmake/modules/compiler_features/check_cfloat16.cpp @@ -0,0 +1,5 @@ +#include "src/__support/macros/properties/complex_types.h" + +#ifndef LIBC_TYPES_HAS_CFLOAT16 +#error unsupported +#endif diff --git a/libc/config/baremetal/config.json b/libc/config/baremetal/config.json index dc4b0517d938d..85e80879d498e 100644 --- a/libc/config/baremetal/config.json +++ b/libc/config/baremetal/config.json @@ -25,5 +25,15 @@ "LIBC_CONF_QSORT_IMPL": { "value": "LIBC_QSORT_HEAP_SORT" } + }, + "math": { + "LIBC_CONF_MATH_OPTIMIZATIONS": { + "value": "(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" + } + }, + "codegen": { + "LIBC_CONF_KEEP_FRAME_POINTER": { + "value": false + } } } diff --git a/libc/config/gpu/entrypoints.txt b/libc/config/gpu/entrypoints.txt index 28317c656d4be..b008e0e6684fd 100644 --- a/libc/config/gpu/entrypoints.txt +++ b/libc/config/gpu/entrypoints.txt @@ -271,9 +271,6 @@ set(TARGET_LIBC_ENTRYPOINTS libc.src.locale.newlocale libc.src.locale.setlocale libc.src.locale.uselocale - - # gpu/rpc.h entrypoints - libc.src.gpu.rpc_host_call ) set(TARGET_LIBM_ENTRYPOINTS diff --git a/libc/config/gpu/headers.txt b/libc/config/gpu/headers.txt index adbd014fba6c1..fa8ad7c11ba8b 100644 --- a/libc/config/gpu/headers.txt +++ b/libc/config/gpu/headers.txt @@ -18,7 +18,4 @@ set(TARGET_PUBLIC_HEADERS libc.include.uchar libc.include.features libc.include.locale - - # Header for RPC extensions - libc.include.gpu_rpc ) diff --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt index b949e4b4f67ba..00f0c6a8bfb8e 100644 --- a/libc/config/linux/aarch64/entrypoints.txt +++ b/libc/config/linux/aarch64/entrypoints.txt @@ -619,14 +619,18 @@ set(TARGET_LIBM_ENTRYPOINTS libc.src.math.ufromfpxl ) -if(LIBC_TYPES_HAS_FLOAT16) +if(LIBC_TYPES_HAS_CFLOAT16) list(APPEND TARGET_LIBM_ENTRYPOINTS # complex.h C23 _Complex _Float16 entrypoints - # libc.src.complex.crealf16 - # libc.src.complex.cimagf16 - # libc.src.complex.conjf16 - # libc.src.complex.cprojf16 - + libc.src.complex.crealf16 + libc.src.complex.cimagf16 + libc.src.complex.conjf16 + libc.src.complex.cprojf16 + ) +endif() + +if(LIBC_TYPES_HAS_FLOAT16) + list(APPEND TARGET_LIBM_ENTRYPOINTS # math.h C23 _Float16 entrypoints libc.src.math.canonicalizef16 libc.src.math.ceilf16 @@ -726,14 +730,18 @@ if(LIBC_TYPES_HAS_FLOAT16) # endif() endif() -if(LIBC_TYPES_HAS_FLOAT128) +if(LIBC_TYPES_HAS_CFLOAT128) list(APPEND TARGET_LIBM_ENTRYPOINTS # complex.h C23 _Complex _Float128 entrypoints libc.src.complex.crealf128 libc.src.complex.cimagf128 libc.src.complex.conjf128 libc.src.complex.cprojf128 + ) +endif() +if(LIBC_TYPES_HAS_FLOAT128) + list(APPEND TARGET_LIBM_ENTRYPOINTS # math.h C23 _Float128 entrypoints libc.src.math.canonicalizef128 libc.src.math.ceilf128 diff --git a/libc/config/linux/riscv/entrypoints.txt b/libc/config/linux/riscv/entrypoints.txt index 19980f79e7be8..49a8d61b93802 100644 --- a/libc/config/linux/riscv/entrypoints.txt +++ b/libc/config/linux/riscv/entrypoints.txt @@ -620,14 +620,18 @@ set(TARGET_LIBM_ENTRYPOINTS libc.src.math.ufromfpxl ) -if(LIBC_TYPES_HAS_FLOAT128) +if(LIBC_TYPES_HAS_CFLOAT128) list(APPEND TARGET_LIBM_ENTRYPOINTS # complex.h C23 _Complex _Float128 entrypoints libc.src.complex.crealf128 libc.src.complex.cimagf128 libc.src.complex.conjf128 libc.src.complex.cprojf128 - + ) +endif() + +if(LIBC_TYPES_HAS_FLOAT128) + list(APPEND TARGET_LIBM_ENTRYPOINTS # math.h C23 _Float128 entrypoints libc.src.math.canonicalizef128 libc.src.math.ceilf128 diff --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt index 08d8559d8c81a..7e549607716c0 100644 --- a/libc/config/linux/x86_64/entrypoints.txt +++ b/libc/config/linux/x86_64/entrypoints.txt @@ -624,14 +624,18 @@ set(TARGET_LIBM_ENTRYPOINTS libc.src.math.ufromfpxl ) -if(LIBC_TYPES_HAS_FLOAT16) +if(LIBC_TYPES_HAS_CFLOAT16) list(APPEND TARGET_LIBM_ENTRYPOINTS # complex.h C23 _Complex _Float16 entrypoints libc.src.complex.crealf16 libc.src.complex.cimagf16 libc.src.complex.conjf16 libc.src.complex.cprojf16 + ) +endif() +if(LIBC_TYPES_HAS_FLOAT16) + list(APPEND TARGET_LIBM_ENTRYPOINTS # math.h C23 _Float16 entrypoints libc.src.math.canonicalizef16 libc.src.math.ceilf16 @@ -736,14 +740,18 @@ if(LIBC_TYPES_HAS_FLOAT16) endif() endif() -if(LIBC_TYPES_HAS_FLOAT128) +if(LIBC_TYPES_HAS_CFLOAT128) list(APPEND TARGET_LIBM_ENTRYPOINTS # complex.h C23 _Complex _Float128 entrypoints - # libc.src.complex.crealf128 - # libc.src.complex.cimagf128 - # libc.src.complex.conjf128 - # libc.src.complex.cprojf128 - + libc.src.complex.crealf128 + libc.src.complex.cimagf128 + libc.src.complex.conjf128 + libc.src.complex.cprojf128 + ) +endif() + +if(LIBC_TYPES_HAS_FLOAT128) + list(APPEND TARGET_LIBM_ENTRYPOINTS # math.h C23 _Float128 entrypoints libc.src.math.canonicalizef128 libc.src.math.ceilf128 diff --git a/libc/docs/dev/header_generation.rst b/libc/docs/dev/header_generation.rst index 2c586cc87b699..a946106fc7097 100644 --- a/libc/docs/dev/header_generation.rst +++ b/libc/docs/dev/header_generation.rst @@ -44,15 +44,15 @@ To add through the command line: .. code-block:: none - python3 libc/hdrgen/yaml_to_classes.py - libc/hdrgen/yaml/[yaml_file.yaml] --add_function "" "" + python3 libc/utils/hdrgen/yaml_to_classes.py + libc/include/[yaml_file.yaml] --add_function "" "" Example: .. code-block:: none - python3 libc/hdrgen/yaml_to_classes.py - libc/hdrgen/yaml/ctype.yaml --add_function "char" example_function + python3 libc/utils/hdrgen/yaml_to_classes.py + libc/include/ctype.yaml --add_function "char" example_function "int, void, const void" stdc example_float example_attribute Keep in mind only the return_type and arguments have quotes around them. If @@ -62,7 +62,8 @@ To add through the command line: generated header file with the new addition in the hdrgen directory to examine. -If you want to sort the functions alphabetically you can check out libc/hdrgen/yaml_functions_sorted.py. +If you want to sort the functions alphabetically you can check out +libc/utils/hdrgen/yaml_functions_sorted.py. Testing @@ -75,10 +76,10 @@ ensures the process of YAML to classes to generate headers works properly. If there are any new additions on formatting headers, make sure the test is updated with the specific addition. -Integration Test can be found in: ``libc/hdrgen/tests/test_integration.py`` +Integration Test can be found in: ``libc/utils/hdrgen/tests/test_integration.py`` File to modify if adding something to formatting: -``libc/hdrgen/tests/expected_output/test_header.h`` +``libc/utils/hdrgen/tests/expected_output/test_header.h`` Common Errors @@ -89,7 +90,7 @@ Common Errors .. code-block:: none - "/llvm-project/libc/hdrgen/yaml_to_classes.py", line 67, in yaml_to_classes function_data["return_type"] + "/llvm-project/libc/utils/hdrgen/yaml_to_classes.py", line 67, in yaml_to_classes function_data["return_type"] If you receive this error or any error pertaining to ``function_data[function_specific_component]`` while building the headers @@ -117,7 +118,7 @@ Common Errors missing. Ensure the correct style and required files are present: | ``[header_name]`` - | ``[../libc/hdrgen/yaml/[yaml_file.yaml]`` + | ``[../libc/include/[yaml_file.yaml]`` | ``[header_name.h.def]`` | ``[header_name.h]`` | ``DEPENDS`` @@ -147,13 +148,13 @@ Common Errors .. code-block:: none - File "/llvm-project/libc/hdrgen/header.py", line 60, in __str__ for + File "/llvm-project/libc/utils/hdrgen/header.py", line 60, in __str__ for function in self.functions: AttributeError: 'HeaderFile' object has no attribute 'functions' When running ``ninja libc`` in the build directory to generate headers you may receive the error above. Essentially this means that in - ``libc/hdrgen/header.py`` there is a missing attribute named functions. + ``libc/utils/hdrgen/header.py`` there is a missing attribute named functions. Make sure all function components are defined within this file and there are no missing functions to add these components. @@ -184,12 +185,12 @@ Common Errors Sometimes the integration test will fail but that still means the process is working unless the comparison between the output and expected_output is not showing. If that is the case make sure in - ``libc/hdrgen/tests/test_integration.py`` there are no missing arguments + ``libc/utils/hdrgen/tests/test_integration.py`` there are no missing arguments that run through the script. If the integration tests are failing due to mismatching of lines or small errors in spacing that is nothing to worry about. If this is happening while you are making a new change to the formatting of the headers, then ensure the expected output file - ``libc/hdrgen/tests/expected_output/test_header.h`` has the changes you + ``libc/utils/hdrgen/tests/expected_output/test_header.h`` has the changes you are applying. diff --git a/libc/docs/dev/source_tree_layout.rst b/libc/docs/dev/source_tree_layout.rst index bd9d6ca453e08..62c0434a0b2aa 100644 --- a/libc/docs/dev/source_tree_layout.rst +++ b/libc/docs/dev/source_tree_layout.rst @@ -15,7 +15,6 @@ directories:: - examples - fuzzing - hdr - - hdrgen - include - lib - src @@ -88,15 +87,6 @@ The ``lib`` directory This directory contains a ``CMakeLists.txt`` file listing the targets for the public libraries ``libc.a``, ``libm.a`` etc. -The ``hdrgen`` directory ---------------------------- - -This directory contains the sources and specifications for the types, macros -and entrypoint functions. These definitions are organized in the ``yaml`` -subdirectory and match the organization of the ``*.h.def`` files. This folder -also contains the python sources for headergen, which is what generates the -headers. - The ``src`` directory --------------------- diff --git a/libc/docs/full_cross_build.rst b/libc/docs/full_cross_build.rst index 5f57169d228ef..cd1ec89e5d5e9 100644 --- a/libc/docs/full_cross_build.rst +++ b/libc/docs/full_cross_build.rst @@ -8,7 +8,7 @@ Full Cross Build :depth: 1 :local: -.. note:: +.. note:: Fullbuild requires running headergen, which is a python program that depends on pyyaml. The minimum versions are listed on the :ref:`header_generation` page, as well as additional information. @@ -95,8 +95,8 @@ configure step. Bootstrap cross build ===================== -In this recipe, the clang compiler and the ``libc-hdrgen`` binary, both are -built automatically before building the libc for the target. +In this recipe, the clang compiler is built automatically before building +the libc for the target. CMake configure step -------------------- @@ -151,8 +151,8 @@ built using any of the three recipes described above. Building for the GPU ==================== -To build for a GPU architecture, it should only be necessary to specify the -target triple as one of the supported GPU targets. Currently, this is either -``nvptx64-nvidia-cuda`` for NVIDIA GPUs or ``amdgcn-amd-amdhsa`` for AMD GPUs. -More detailed information is provided in the :ref:`GPU +To build for a GPU architecture, it should only be necessary to specify the +target triple as one of the supported GPU targets. Currently, this is either +``nvptx64-nvidia-cuda`` for NVIDIA GPUs or ``amdgcn-amd-amdhsa`` for AMD GPUs. +More detailed information is provided in the :ref:`GPU documentation`. diff --git a/libc/hdrgen/yaml/gpu/rpc.yaml b/libc/hdrgen/yaml/gpu/rpc.yaml deleted file mode 100644 index da4f6afb7856d..0000000000000 --- a/libc/hdrgen/yaml/gpu/rpc.yaml +++ /dev/null @@ -1,23 +0,0 @@ -header: gpu-rpc.h -macros: [] -types: [] -enums: [] -objects: [] -functions: - - name: rpc_fprintf - standards: - - GPUExtensions - return_type: int - arguments: - - type: ::FILE *__restrict - - type: const char *__restrict - - type: void * - - type: size_t - - name: rpc_host_call - standards: - - GPUExtensions - return_type: unsigned long long - arguments: - - type: void * - - type: void * - - type: size_t diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt index 18ce8e22d1a0a..eb407183c99f5 100644 --- a/libc/include/CMakeLists.txt +++ b/libc/include/CMakeLists.txt @@ -32,7 +32,7 @@ endmacro() add_header_macro( ctype - ../libc/hdrgen/yaml/ctype.yaml + ../libc/include/ctype.yaml ctype.h.def ctype.h DEPENDS @@ -42,7 +42,7 @@ add_header_macro( add_header_macro( dirent - ../libc/hdrgen/yaml/dirent.yaml + ../libc/include/dirent.yaml dirent.h.def dirent.h DEPENDS @@ -54,7 +54,7 @@ add_header_macro( add_header_macro( fcntl - ../libc/hdrgen/yaml/fcntl.yaml + ../libc/include/fcntl.yaml fcntl.h.def fcntl.h DEPENDS @@ -70,7 +70,7 @@ add_header_macro( add_header_macro( dlfcn - ../libc/hdrgen/yaml/dlfcn.yaml + ../libc/include/dlfcn.yaml dlfcn.h.def dlfcn.h DEPENDS @@ -80,7 +80,7 @@ add_header_macro( add_header_macro( features - ../libc/hdrgen/yaml/features.yaml + ../libc/include/features.yaml features.h.def features.h DEPENDS @@ -90,7 +90,7 @@ add_header_macro( add_header_macro( fenv - ../libc/hdrgen/yaml/fenv.yaml + ../libc/include/fenv.yaml fenv.h.def fenv.h DEPENDS @@ -102,7 +102,7 @@ add_header_macro( add_header_macro( inttypes - ../libc/hdrgen/yaml/inttypes.yaml + ../libc/include/inttypes.yaml inttypes.h.def inttypes.h DEPENDS @@ -113,7 +113,7 @@ add_header_macro( add_header_macro( float - ../libc/hdrgen/yaml/float.yaml + ../libc/include/float.yaml float.h.def float.h DEPENDS @@ -122,7 +122,7 @@ add_header_macro( add_header_macro( stdint - ../libc/hdrgen/yaml/stdint.yaml + ../libc/include/stdint.yaml stdint.h.def stdint.h DEPENDS @@ -131,7 +131,7 @@ add_header_macro( add_header_macro( limits - ../libc/hdrgen/yaml/limits.yaml + ../libc/include/limits.yaml limits.h.def limits.h DEPENDS @@ -140,7 +140,7 @@ add_header_macro( add_header_macro( malloc - ../libc/hdrgen/yaml/malloc.yaml + ../libc/include/malloc.yaml malloc.h.def malloc.h DEPENDS @@ -150,7 +150,7 @@ add_header_macro( add_header_macro( math - ../libc/hdrgen/yaml/math.yaml + ../libc/include/math.yaml math.h.def math.h DEPENDS @@ -165,7 +165,7 @@ add_header_macro( add_header_macro( stdfix - ../libc/hdrgen/yaml/stdfix.yaml + ../libc/include/stdfix.yaml stdfix.h.def stdfix.h DEPENDS @@ -178,7 +178,7 @@ file(MAKE_DIRECTORY ${LIBC_INCLUDE_DIR}/arpa) add_header_macro( arpa_inet - ../libc/hdrgen/yaml/arpa/inet.yaml + ../libc/include/arpa/inet.yaml arpa/inet.h.def arpa/inet.h DEPENDS @@ -187,7 +187,7 @@ add_header_macro( add_header_macro( assert - ../libc/hdrgen/yaml/assert.yaml + ../libc/include/assert.yaml assert.h.def assert.h DEPENDS @@ -197,7 +197,7 @@ add_header_macro( add_header_macro( complex - ../libc/hdrgen/yaml/complex.yaml + ../libc/include/complex.yaml complex.h.def complex.h DEPENDS @@ -207,7 +207,7 @@ add_header_macro( add_header_macro( setjmp - ../libc/hdrgen/yaml/setjmp.yaml + ../libc/include/setjmp.yaml setjmp.h.def setjmp.h DEPENDS @@ -217,7 +217,7 @@ add_header_macro( add_header_macro( string - ../libc/hdrgen/yaml/string.yaml + ../libc/include/string.yaml string.h.def string.h DEPENDS @@ -228,7 +228,7 @@ add_header_macro( add_header_macro( strings - ../libc/hdrgen/yaml/strings.yaml + ../libc/include/strings.yaml strings.h.def strings.h DEPENDS @@ -238,7 +238,7 @@ add_header_macro( add_header_macro( search - ../libc/hdrgen/yaml/search.yaml + ../libc/include/search.yaml search.h.def search.h DEPENDS @@ -252,7 +252,7 @@ add_header_macro( add_header_macro( time - ../libc/hdrgen/yaml/time.yaml + ../libc/include/time.yaml time.h.def time.h DEPENDS @@ -268,7 +268,7 @@ add_header_macro( add_header_macro( threads - ../libc/hdrgen/yaml/threads.yaml + ../libc/include/threads.yaml threads.h.def threads.h DEPENDS @@ -285,7 +285,7 @@ add_header_macro( add_header_macro( errno - ../libc/hdrgen/yaml/errno.yaml + ../libc/include/errno.yaml errno.h.def errno.h DEPENDS @@ -295,7 +295,7 @@ add_header_macro( add_header_macro( signal - ../libc/hdrgen/yaml/signal.yaml + ../libc/include/signal.yaml signal.h.def signal.h DEPENDS @@ -311,7 +311,7 @@ add_header_macro( add_header_macro( stdbit - ../libc/hdrgen/yaml/stdbit.yaml + ../libc/include/stdbit.yaml stdbit.h.def stdbit.h DEPENDS @@ -321,7 +321,7 @@ add_header_macro( add_header_macro( stdckdint - ../libc/hdrgen/yaml/stdckdint.yaml + ../libc/include/stdckdint.yaml stdckdint.h.def stdckdint.h DEPENDS @@ -331,7 +331,7 @@ add_header_macro( add_header_macro( stdio - ../libc/hdrgen/yaml/stdio.yaml + ../libc/include/stdio.yaml stdio.h.def stdio.h DEPENDS @@ -347,7 +347,7 @@ add_header_macro( add_header_macro( stdlib - ../libc/hdrgen/yaml/stdlib.yaml + ../libc/include/stdlib.yaml stdlib.h.def stdlib.h DEPENDS @@ -366,7 +366,7 @@ add_header_macro( add_header_macro( unistd - ../libc/hdrgen/yaml/unistd.yaml + ../libc/include/unistd.yaml unistd.h.def unistd.h DEPENDS @@ -385,7 +385,7 @@ add_header_macro( add_header_macro( pthread - ../libc/hdrgen/yaml/pthread.yaml + ../libc/include/pthread.yaml pthread.h.def pthread.h DEPENDS @@ -409,7 +409,7 @@ add_header_macro( add_header_macro( sched - ../libc/hdrgen/yaml/sched.yaml + ../libc/include/sched.yaml sched.h.def sched.h DEPENDS @@ -426,7 +426,7 @@ add_header_macro( add_header_macro( spawn - ../libc/hdrgen/yaml/spawn.yaml + ../libc/include/spawn.yaml spawn.h.def spawn.h DEPENDS @@ -439,7 +439,7 @@ add_header_macro( add_header_macro( link - ../libc/hdrgen/yaml/link.yaml + ../libc/include/link.yaml link.h.def link.h DEPENDS @@ -449,7 +449,7 @@ add_header_macro( add_header_macro( elf - ../libc/hdrgen/yaml/elf.yaml + ../libc/include/elf.yaml elf.h.def elf.h DEPENDS @@ -463,7 +463,7 @@ file(MAKE_DIRECTORY ${LIBC_INCLUDE_DIR}/sys) add_header_macro( sys_auxv - ../libc/hdrgen/yaml/sys/auxv.yaml + ../libc/include/sys/auxv.yaml sys/auxv.h.def sys/auxv.h DEPENDS @@ -473,7 +473,7 @@ add_header_macro( add_header_macro( sys_epoll - ../libc/hdrgen/yaml/sys/epoll.yaml + ../libc/include/sys/epoll.yaml sys/epoll.h.def sys/epoll.h DEPENDS @@ -486,7 +486,7 @@ add_header_macro( add_header_macro( sys_ioctl - ../libc/hdrgen/yaml/sys/ioctl.yaml + ../libc/include/sys/ioctl.yaml sys/ioctl.h.def sys/ioctl.h DEPENDS @@ -496,7 +496,7 @@ add_header_macro( add_header_macro( sys_mman - ../libc/hdrgen/yaml/sys/mman.yaml + ../libc/include/sys/mman.yaml sys/mman.h.def sys/mman.h DEPENDS @@ -509,7 +509,7 @@ add_header_macro( add_header_macro( sys_prctl - ../libc/hdrgen/yaml/sys/prctl.yaml + ../libc/include/sys/prctl.yaml sys/prctl.h.def sys/prctl.h DEPENDS @@ -526,7 +526,7 @@ add_header( add_header_macro( sys_random - ../libc/hdrgen/yaml/sys/random.yaml + ../libc/include/sys/random.yaml sys/random.h.def sys/random.h DEPENDS @@ -538,7 +538,7 @@ add_header_macro( add_header_macro( sys_resource - ../libc/hdrgen/yaml/sys/resource.yaml + ../libc/include/sys/resource.yaml sys/resource.h.def sys/resource.h DEPENDS @@ -550,7 +550,7 @@ add_header_macro( add_header_macro( sys_stat - ../libc/hdrgen/yaml/sys/stat.yaml + ../libc/include/sys/stat.yaml sys/stat.h.def sys/stat.h DEPENDS @@ -572,7 +572,7 @@ add_header_macro( add_header_macro( sys_select - ../libc/hdrgen/yaml/sys/select.yaml + ../libc/include/sys/select.yaml sys/select.h.def sys/select.h DEPENDS @@ -588,7 +588,7 @@ add_header_macro( add_header_macro( sys_sendfile - ../libc/hdrgen/yaml/sys/sendfile.yaml + ../libc/include/sys/sendfile.yaml sys/sendfile.h.def sys/sendfile.h DEPENDS @@ -600,7 +600,7 @@ add_header_macro( add_header_macro( sys_socket - ../libc/hdrgen/yaml/sys/socket.yaml + ../libc/include/sys/socket.yaml sys/socket.h.def sys/socket.h DEPENDS @@ -616,7 +616,7 @@ add_header_macro( add_header_macro( sys_statvfs - ../libc/hdrgen/yaml/sys/statvfs.yaml + ../libc/include/sys/statvfs.yaml sys/statvfs.h.def sys/statvfs.h DEPENDS @@ -626,7 +626,7 @@ add_header_macro( add_header_macro( sys_syscall - ../libc/hdrgen/yaml/sys/syscall.yaml + ../libc/include/sys/syscall.yaml sys/syscall.h.def sys/syscall.h DEPENDS @@ -634,7 +634,7 @@ add_header_macro( add_header_macro( sys_time - ../libc/hdrgen/yaml/sys/time.yaml + ../libc/include/sys/time.yaml sys/time.h.def sys/time.h DEPENDS @@ -645,7 +645,7 @@ add_header_macro( add_header_macro( sys_types - ../libc/hdrgen/yaml/sys/types.yaml + ../libc/include/sys/types.yaml sys/types.h.def sys/types.h DEPENDS @@ -675,7 +675,7 @@ add_header_macro( add_header_macro( sys_utsname - ../libc/hdrgen/yaml/sys/utsname.yaml + ../libc/include/sys/utsname.yaml sys/utsname.h.def sys/utsname.h DEPENDS @@ -685,7 +685,7 @@ add_header_macro( add_header_macro( sys_wait - ../libc/hdrgen/yaml/sys/wait.yaml + ../libc/include/sys/wait.yaml sys/wait.h.def sys/wait.h DEPENDS @@ -698,7 +698,7 @@ add_header_macro( add_header_macro( termios - ../libc/hdrgen/yaml/termios.yaml + ../libc/include/termios.yaml termios.h.def termios.h DEPENDS @@ -713,7 +713,7 @@ add_header_macro( add_header_macro( uchar - ../libc/hdrgen/yaml/uchar.yaml + ../libc/include/uchar.yaml uchar.h.def uchar.h DEPENDS @@ -726,7 +726,7 @@ add_header_macro( add_header_macro( wchar - ../libc/hdrgen/yaml/wchar.yaml + ../libc/include/wchar.yaml wchar.h.def wchar.h DEPENDS @@ -740,7 +740,7 @@ add_header_macro( add_header_macro( locale - ../libc/hdrgen/yaml/locale.yaml + ../libc/include/locale.yaml locale.h.def locale.h DEPENDS @@ -750,19 +750,6 @@ add_header_macro( .llvm-libc-types.struct_lconv ) -if(LIBC_TARGET_OS_IS_GPU) - file(MAKE_DIRECTORY ${LIBC_INCLUDE_DIR}/gpu) - - add_header_macro( - gpu_rpc - ../libc/hdrgen/yaml/gpu/rpc.yaml - gpu/rpc.h.def - gpu/rpc.h - DEPENDS - .llvm_libc_common_h - ) -endif() - if(NOT LLVM_LIBC_FULL_BUILD) # We don't install headers in non-fullbuild mode. return() diff --git a/libc/hdrgen/yaml/arpa/inet.yaml b/libc/include/arpa/inet.yaml similarity index 100% rename from libc/hdrgen/yaml/arpa/inet.yaml rename to libc/include/arpa/inet.yaml diff --git a/libc/hdrgen/yaml/assert.yaml b/libc/include/assert.yaml similarity index 100% rename from libc/hdrgen/yaml/assert.yaml rename to libc/include/assert.yaml diff --git a/libc/hdrgen/yaml/complex.yaml b/libc/include/complex.yaml similarity index 100% rename from libc/hdrgen/yaml/complex.yaml rename to libc/include/complex.yaml diff --git a/libc/hdrgen/yaml/ctype.yaml b/libc/include/ctype.yaml similarity index 100% rename from libc/hdrgen/yaml/ctype.yaml rename to libc/include/ctype.yaml diff --git a/libc/hdrgen/yaml/dirent.yaml b/libc/include/dirent.yaml similarity index 100% rename from libc/hdrgen/yaml/dirent.yaml rename to libc/include/dirent.yaml diff --git a/libc/hdrgen/yaml/dlfcn.yaml b/libc/include/dlfcn.yaml similarity index 100% rename from libc/hdrgen/yaml/dlfcn.yaml rename to libc/include/dlfcn.yaml diff --git a/libc/hdrgen/yaml/elf.yaml b/libc/include/elf.yaml similarity index 100% rename from libc/hdrgen/yaml/elf.yaml rename to libc/include/elf.yaml diff --git a/libc/hdrgen/yaml/errno.yaml b/libc/include/errno.yaml similarity index 100% rename from libc/hdrgen/yaml/errno.yaml rename to libc/include/errno.yaml diff --git a/libc/hdrgen/yaml/fcntl.yaml b/libc/include/fcntl.yaml similarity index 100% rename from libc/hdrgen/yaml/fcntl.yaml rename to libc/include/fcntl.yaml diff --git a/libc/hdrgen/yaml/features.yaml b/libc/include/features.yaml similarity index 100% rename from libc/hdrgen/yaml/features.yaml rename to libc/include/features.yaml diff --git a/libc/hdrgen/yaml/fenv.yaml b/libc/include/fenv.yaml similarity index 100% rename from libc/hdrgen/yaml/fenv.yaml rename to libc/include/fenv.yaml diff --git a/libc/hdrgen/yaml/float.yaml b/libc/include/float.yaml similarity index 100% rename from libc/hdrgen/yaml/float.yaml rename to libc/include/float.yaml diff --git a/libc/hdrgen/yaml/inttypes.yaml b/libc/include/inttypes.yaml similarity index 100% rename from libc/hdrgen/yaml/inttypes.yaml rename to libc/include/inttypes.yaml diff --git a/libc/hdrgen/yaml/limits.yaml b/libc/include/limits.yaml similarity index 100% rename from libc/hdrgen/yaml/limits.yaml rename to libc/include/limits.yaml diff --git a/libc/hdrgen/yaml/link.yaml b/libc/include/link.yaml similarity index 100% rename from libc/hdrgen/yaml/link.yaml rename to libc/include/link.yaml diff --git a/libc/hdrgen/yaml/locale.yaml b/libc/include/locale.yaml similarity index 100% rename from libc/hdrgen/yaml/locale.yaml rename to libc/include/locale.yaml diff --git a/libc/hdrgen/yaml/malloc.yaml b/libc/include/malloc.yaml similarity index 100% rename from libc/hdrgen/yaml/malloc.yaml rename to libc/include/malloc.yaml diff --git a/libc/hdrgen/yaml/math.yaml b/libc/include/math.yaml similarity index 100% rename from libc/hdrgen/yaml/math.yaml rename to libc/include/math.yaml diff --git a/libc/hdrgen/yaml/pthread.yaml b/libc/include/pthread.yaml similarity index 100% rename from libc/hdrgen/yaml/pthread.yaml rename to libc/include/pthread.yaml diff --git a/libc/hdrgen/yaml/sched.yaml b/libc/include/sched.yaml similarity index 100% rename from libc/hdrgen/yaml/sched.yaml rename to libc/include/sched.yaml diff --git a/libc/hdrgen/yaml/search.yaml b/libc/include/search.yaml similarity index 100% rename from libc/hdrgen/yaml/search.yaml rename to libc/include/search.yaml diff --git a/libc/hdrgen/yaml/setjmp.yaml b/libc/include/setjmp.yaml similarity index 100% rename from libc/hdrgen/yaml/setjmp.yaml rename to libc/include/setjmp.yaml diff --git a/libc/hdrgen/yaml/signal.yaml b/libc/include/signal.yaml similarity index 100% rename from libc/hdrgen/yaml/signal.yaml rename to libc/include/signal.yaml diff --git a/libc/hdrgen/yaml/spawn.yaml b/libc/include/spawn.yaml similarity index 100% rename from libc/hdrgen/yaml/spawn.yaml rename to libc/include/spawn.yaml diff --git a/libc/hdrgen/yaml/stdbit.yaml b/libc/include/stdbit.yaml similarity index 100% rename from libc/hdrgen/yaml/stdbit.yaml rename to libc/include/stdbit.yaml diff --git a/libc/hdrgen/yaml/stdckdint.yaml b/libc/include/stdckdint.yaml similarity index 100% rename from libc/hdrgen/yaml/stdckdint.yaml rename to libc/include/stdckdint.yaml diff --git a/libc/hdrgen/yaml/stdfix.yaml b/libc/include/stdfix.yaml similarity index 100% rename from libc/hdrgen/yaml/stdfix.yaml rename to libc/include/stdfix.yaml diff --git a/libc/hdrgen/yaml/stdint.yaml b/libc/include/stdint.yaml similarity index 100% rename from libc/hdrgen/yaml/stdint.yaml rename to libc/include/stdint.yaml diff --git a/libc/hdrgen/yaml/stdio.yaml b/libc/include/stdio.yaml similarity index 100% rename from libc/hdrgen/yaml/stdio.yaml rename to libc/include/stdio.yaml diff --git a/libc/hdrgen/yaml/stdlib.yaml b/libc/include/stdlib.yaml similarity index 100% rename from libc/hdrgen/yaml/stdlib.yaml rename to libc/include/stdlib.yaml diff --git a/libc/hdrgen/yaml/string.yaml b/libc/include/string.yaml similarity index 100% rename from libc/hdrgen/yaml/string.yaml rename to libc/include/string.yaml diff --git a/libc/hdrgen/yaml/strings.yaml b/libc/include/strings.yaml similarity index 100% rename from libc/hdrgen/yaml/strings.yaml rename to libc/include/strings.yaml diff --git a/libc/hdrgen/yaml/sys/auxv.yaml b/libc/include/sys/auxv.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/auxv.yaml rename to libc/include/sys/auxv.yaml diff --git a/libc/hdrgen/yaml/sys/epoll.yaml b/libc/include/sys/epoll.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/epoll.yaml rename to libc/include/sys/epoll.yaml diff --git a/libc/hdrgen/yaml/sys/ioctl.yaml b/libc/include/sys/ioctl.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/ioctl.yaml rename to libc/include/sys/ioctl.yaml diff --git a/libc/hdrgen/yaml/sys/mman.yaml b/libc/include/sys/mman.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/mman.yaml rename to libc/include/sys/mman.yaml diff --git a/libc/hdrgen/yaml/sys/prctl.yaml b/libc/include/sys/prctl.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/prctl.yaml rename to libc/include/sys/prctl.yaml diff --git a/libc/hdrgen/yaml/sys/random.yaml b/libc/include/sys/random.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/random.yaml rename to libc/include/sys/random.yaml diff --git a/libc/hdrgen/yaml/sys/resource.yaml b/libc/include/sys/resource.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/resource.yaml rename to libc/include/sys/resource.yaml diff --git a/libc/hdrgen/yaml/sys/select.yaml b/libc/include/sys/select.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/select.yaml rename to libc/include/sys/select.yaml diff --git a/libc/hdrgen/yaml/sys/sendfile.yaml b/libc/include/sys/sendfile.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/sendfile.yaml rename to libc/include/sys/sendfile.yaml diff --git a/libc/hdrgen/yaml/sys/socket.yaml b/libc/include/sys/socket.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/socket.yaml rename to libc/include/sys/socket.yaml diff --git a/libc/hdrgen/yaml/sys/stat.yaml b/libc/include/sys/stat.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/stat.yaml rename to libc/include/sys/stat.yaml diff --git a/libc/hdrgen/yaml/sys/statvfs.yaml b/libc/include/sys/statvfs.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/statvfs.yaml rename to libc/include/sys/statvfs.yaml diff --git a/libc/hdrgen/yaml/sys/syscall.yaml b/libc/include/sys/syscall.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/syscall.yaml rename to libc/include/sys/syscall.yaml diff --git a/libc/hdrgen/yaml/sys/time.yaml b/libc/include/sys/time.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/time.yaml rename to libc/include/sys/time.yaml diff --git a/libc/hdrgen/yaml/sys/types.yaml b/libc/include/sys/types.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/types.yaml rename to libc/include/sys/types.yaml diff --git a/libc/hdrgen/yaml/sys/utsname.yaml b/libc/include/sys/utsname.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/utsname.yaml rename to libc/include/sys/utsname.yaml diff --git a/libc/hdrgen/yaml/sys/wait.yaml b/libc/include/sys/wait.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/wait.yaml rename to libc/include/sys/wait.yaml diff --git a/libc/hdrgen/yaml/termios.yaml b/libc/include/termios.yaml similarity index 100% rename from libc/hdrgen/yaml/termios.yaml rename to libc/include/termios.yaml diff --git a/libc/hdrgen/yaml/threads.yaml b/libc/include/threads.yaml similarity index 100% rename from libc/hdrgen/yaml/threads.yaml rename to libc/include/threads.yaml diff --git a/libc/hdrgen/yaml/time.yaml b/libc/include/time.yaml similarity index 100% rename from libc/hdrgen/yaml/time.yaml rename to libc/include/time.yaml diff --git a/libc/hdrgen/yaml/uchar.yaml b/libc/include/uchar.yaml similarity index 100% rename from libc/hdrgen/yaml/uchar.yaml rename to libc/include/uchar.yaml diff --git a/libc/hdrgen/yaml/unistd.yaml b/libc/include/unistd.yaml similarity index 100% rename from libc/hdrgen/yaml/unistd.yaml rename to libc/include/unistd.yaml diff --git a/libc/hdrgen/yaml/wchar.yaml b/libc/include/wchar.yaml similarity index 100% rename from libc/hdrgen/yaml/wchar.yaml rename to libc/include/wchar.yaml diff --git a/libc/src/__support/RPC/CMakeLists.txt b/libc/src/__support/RPC/CMakeLists.txt index 0a7141fb60bf0..cac9c4e05e369 100644 --- a/libc/src/__support/RPC/CMakeLists.txt +++ b/libc/src/__support/RPC/CMakeLists.txt @@ -9,6 +9,5 @@ add_object_library( HDRS rpc_client.h DEPENDS - libc.include.gpu_rpc libc.src.__support.GPU.utils ) diff --git a/libc/src/compiler/generic/__stack_chk_fail.cpp b/libc/src/compiler/generic/__stack_chk_fail.cpp index c76ec1407ad35..00e976ad8bc2a 100644 --- a/libc/src/compiler/generic/__stack_chk_fail.cpp +++ b/libc/src/compiler/generic/__stack_chk_fail.cpp @@ -9,9 +9,12 @@ #include "src/compiler/__stack_chk_fail.h" #include "src/__support/OSUtil/io.h" #include "src/stdlib/abort.h" +#include // For uintptr_t extern "C" { +uintptr_t __stack_chk_guard = static_cast(0xa9fff01234); + void __stack_chk_fail(void) { LIBC_NAMESPACE::write_to_stderr("stack smashing detected\n"); LIBC_NAMESPACE::abort(); diff --git a/libc/src/complex/cimagf128.h b/libc/src/complex/cimagf128.h index ab8f9ac7da58c..aaf52cfc54eff 100644 --- a/libc/src/complex/cimagf128.h +++ b/libc/src/complex/cimagf128.h @@ -6,15 +6,12 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/macros/properties/complex_types.h" -#include "src/__support/macros/properties/types.h" - -#if defined(LIBC_TYPES_HAS_CFLOAT128) - #ifndef LLVM_LIBC_SRC_COMPLEX_CIMAGF128_H #define LLVM_LIBC_SRC_COMPLEX_CIMAGF128_H #include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" +#include "src/__support/macros/properties/types.h" namespace LIBC_NAMESPACE_DECL { @@ -23,5 +20,3 @@ float128 cimagf128(cfloat128 x); } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_COMPLEX_CIMAGF128_H - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/src/complex/cimagf16.h b/libc/src/complex/cimagf16.h index 5c5de2eb1bcf2..81ed4d2ce567e 100644 --- a/libc/src/complex/cimagf16.h +++ b/libc/src/complex/cimagf16.h @@ -6,15 +6,12 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/macros/properties/complex_types.h" -#include "src/__support/macros/properties/types.h" - -#if defined(LIBC_TYPES_HAS_CFLOAT16) - #ifndef LLVM_LIBC_SRC_COMPLEX_CIMAGF16_H #define LLVM_LIBC_SRC_COMPLEX_CIMAGF16_H #include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" +#include "src/__support/macros/properties/types.h" namespace LIBC_NAMESPACE_DECL { @@ -23,5 +20,3 @@ float16 cimagf16(cfloat16 x); } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_COMPLEX_CIMAGF16_H - -#endif // LIBC_TYPES_HAS_CFLOAT16 diff --git a/libc/src/complex/conjf128.h b/libc/src/complex/conjf128.h index c1ae0b03d067a..cae01d3f00694 100644 --- a/libc/src/complex/conjf128.h +++ b/libc/src/complex/conjf128.h @@ -6,14 +6,11 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/macros/properties/complex_types.h" - -#if defined(LIBC_TYPES_HAS_CFLOAT128) - #ifndef LLVM_LIBC_SRC_COMPLEX_CONJF128_H #define LLVM_LIBC_SRC_COMPLEX_CONJF128_H #include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" namespace LIBC_NAMESPACE_DECL { @@ -22,5 +19,3 @@ cfloat128 conjf128(cfloat128 x); } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_COMPLEX_CONJF128_H - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/src/complex/conjf16.h b/libc/src/complex/conjf16.h index 685ac8ac5c858..dde1221473e40 100644 --- a/libc/src/complex/conjf16.h +++ b/libc/src/complex/conjf16.h @@ -6,14 +6,11 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/macros/properties/complex_types.h" - -#if defined(LIBC_TYPES_HAS_CFLOAT16) - #ifndef LLVM_LIBC_SRC_COMPLEX_CONJF16_H #define LLVM_LIBC_SRC_COMPLEX_CONJF16_H #include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" namespace LIBC_NAMESPACE_DECL { @@ -22,5 +19,3 @@ cfloat16 conjf16(cfloat16 x); } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_COMPLEX_CONJF16_H - -#endif // LIBC_TYPES_HAS_CFLOAT16 diff --git a/libc/src/complex/cprojf128.h b/libc/src/complex/cprojf128.h index 5f7fe992ef30b..71c1bbec2218a 100644 --- a/libc/src/complex/cprojf128.h +++ b/libc/src/complex/cprojf128.h @@ -6,14 +6,11 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/macros/properties/complex_types.h" - -#if defined(LIBC_TYPES_HAS_CFLOAT128) - #ifndef LLVM_LIBC_SRC_COMPLEX_CPROJF128_H #define LLVM_LIBC_SRC_COMPLEX_CPROJF128_H #include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" namespace LIBC_NAMESPACE_DECL { @@ -22,5 +19,3 @@ cfloat128 cprojf128(cfloat128 x); } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_COMPLEX_CPROJF128_H - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/src/complex/cprojf16.h b/libc/src/complex/cprojf16.h index 8cce5f0bcef2b..f12a46df9e175 100644 --- a/libc/src/complex/cprojf16.h +++ b/libc/src/complex/cprojf16.h @@ -6,14 +6,11 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/macros/properties/complex_types.h" - -#if defined(LIBC_TYPES_HAS_CFLOAT16) - #ifndef LLVM_LIBC_SRC_COMPLEX_CPROJF16_H #define LLVM_LIBC_SRC_COMPLEX_CPROJF16_H #include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" namespace LIBC_NAMESPACE_DECL { @@ -22,5 +19,3 @@ cfloat16 cprojf16(cfloat16 x); } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_COMPLEX_CPROJF16_H - -#endif // LIBC_TYPES_HAS_CFLOAT16 diff --git a/libc/src/complex/crealf128.h b/libc/src/complex/crealf128.h index 4922ae78cb238..b90c3e7c8548e 100644 --- a/libc/src/complex/crealf128.h +++ b/libc/src/complex/crealf128.h @@ -6,15 +6,12 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/macros/properties/complex_types.h" -#include "src/__support/macros/properties/types.h" - -#if defined(LIBC_TYPES_HAS_CFLOAT128) - #ifndef LLVM_LIBC_SRC_COMPLEX_CREALF128_H #define LLVM_LIBC_SRC_COMPLEX_CREALF128_H #include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" +#include "src/__support/macros/properties/types.h" namespace LIBC_NAMESPACE_DECL { @@ -23,5 +20,3 @@ float128 crealf128(cfloat128 x); } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_COMPLEX_CREALF128_H - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/src/complex/crealf16.h b/libc/src/complex/crealf16.h index e6098a218d092..09d66649fa272 100644 --- a/libc/src/complex/crealf16.h +++ b/libc/src/complex/crealf16.h @@ -6,15 +6,12 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/macros/properties/complex_types.h" -#include "src/__support/macros/properties/types.h" - -#if defined(LIBC_TYPES_HAS_CFLOAT16) - #ifndef LLVM_LIBC_SRC_COMPLEX_CREALF16_H #define LLVM_LIBC_SRC_COMPLEX_CREALF16_H #include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" +#include "src/__support/macros/properties/types.h" namespace LIBC_NAMESPACE_DECL { @@ -23,5 +20,3 @@ float16 crealf16(cfloat16 x); } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_COMPLEX_CREALF16_H - -#endif // LIBC_TYPES_HAS_CFLOAT16 diff --git a/libc/src/complex/generic/cimagf128.cpp b/libc/src/complex/generic/cimagf128.cpp index c21bd7f4602cc..78dbb8eddd3eb 100644 --- a/libc/src/complex/generic/cimagf128.cpp +++ b/libc/src/complex/generic/cimagf128.cpp @@ -7,8 +7,6 @@ //===----------------------------------------------------------------------===// #include "src/complex/cimagf128.h" -#if defined(LIBC_TYPES_HAS_CFLOAT128) - #include "src/__support/CPP/bit.h" #include "src/__support/common.h" #include "src/__support/complex_type.h" @@ -21,5 +19,3 @@ LLVM_LIBC_FUNCTION(float128, cimagf128, (cfloat128 x)) { } } // namespace LIBC_NAMESPACE_DECL - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/src/complex/generic/cimagf16.cpp b/libc/src/complex/generic/cimagf16.cpp index 361687984067b..25d9b3ddf3b6b 100644 --- a/libc/src/complex/generic/cimagf16.cpp +++ b/libc/src/complex/generic/cimagf16.cpp @@ -7,8 +7,6 @@ //===----------------------------------------------------------------------===// #include "src/complex/cimagf16.h" -#if defined(LIBC_TYPES_HAS_CFLOAT16) - #include "src/__support/CPP/bit.h" #include "src/__support/common.h" #include "src/__support/complex_type.h" @@ -21,5 +19,3 @@ LLVM_LIBC_FUNCTION(float16, cimagf16, (cfloat16 x)) { } } // namespace LIBC_NAMESPACE_DECL - -#endif // LIBC_TYPES_HAS_CFLOAT16 diff --git a/libc/src/complex/generic/conjf128.cpp b/libc/src/complex/generic/conjf128.cpp index c65b54849f52e..a63809a66e25a 100644 --- a/libc/src/complex/generic/conjf128.cpp +++ b/libc/src/complex/generic/conjf128.cpp @@ -7,8 +7,6 @@ //===----------------------------------------------------------------------===// #include "src/complex/conjf128.h" -#if defined(LIBC_TYPES_HAS_CFLOAT128) - #include "src/__support/common.h" #include "src/__support/complex_type.h" @@ -19,5 +17,3 @@ LLVM_LIBC_FUNCTION(cfloat128, conjf128, (cfloat128 x)) { } } // namespace LIBC_NAMESPACE_DECL - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/src/complex/generic/conjf16.cpp b/libc/src/complex/generic/conjf16.cpp index dac11e27b30a2..cd1ab67ed1cd9 100644 --- a/libc/src/complex/generic/conjf16.cpp +++ b/libc/src/complex/generic/conjf16.cpp @@ -7,8 +7,6 @@ //===----------------------------------------------------------------------===// #include "src/complex/conjf16.h" -#if defined(LIBC_TYPES_HAS_CFLOAT16) - #include "src/__support/common.h" #include "src/__support/complex_type.h" @@ -19,5 +17,3 @@ LLVM_LIBC_FUNCTION(cfloat16, conjf16, (cfloat16 x)) { } } // namespace LIBC_NAMESPACE_DECL - -#endif // LIBC_TYPES_HAS_CFLOAT16 diff --git a/libc/src/complex/generic/cprojf128.cpp b/libc/src/complex/generic/cprojf128.cpp index 97134b5523a56..eb2cd08dfc117 100644 --- a/libc/src/complex/generic/cprojf128.cpp +++ b/libc/src/complex/generic/cprojf128.cpp @@ -7,8 +7,6 @@ //===----------------------------------------------------------------------===// #include "src/complex/cprojf128.h" -#if defined(LIBC_TYPES_HAS_CFLOAT128) - #include "src/__support/common.h" #include "src/__support/complex_type.h" @@ -19,5 +17,3 @@ LLVM_LIBC_FUNCTION(cfloat128, cprojf128, (cfloat128 x)) { } } // namespace LIBC_NAMESPACE_DECL - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/src/complex/generic/cprojf16.cpp b/libc/src/complex/generic/cprojf16.cpp index bd0425ffb5fe5..8d2d64a439e02 100644 --- a/libc/src/complex/generic/cprojf16.cpp +++ b/libc/src/complex/generic/cprojf16.cpp @@ -7,8 +7,6 @@ //===----------------------------------------------------------------------===// #include "src/complex/cprojf16.h" -#if defined(LIBC_TYPES_HAS_CFLOAT16) - #include "src/__support/common.h" #include "src/__support/complex_type.h" @@ -19,5 +17,3 @@ LLVM_LIBC_FUNCTION(cfloat16, cprojf16, (cfloat16 x)) { } } // namespace LIBC_NAMESPACE_DECL - -#endif // LIBC_TYPES_HAS_CFLOAT16 diff --git a/libc/src/complex/generic/crealf128.cpp b/libc/src/complex/generic/crealf128.cpp index e72a778216010..e7554989e14aa 100644 --- a/libc/src/complex/generic/crealf128.cpp +++ b/libc/src/complex/generic/crealf128.cpp @@ -7,8 +7,6 @@ //===----------------------------------------------------------------------===// #include "src/complex/crealf128.h" -#if defined(LIBC_TYPES_HAS_CFLOAT128) - #include "src/__support/CPP/bit.h" #include "src/__support/common.h" #include "src/__support/complex_type.h" @@ -21,5 +19,3 @@ LLVM_LIBC_FUNCTION(float128, crealf128, (cfloat128 x)) { } } // namespace LIBC_NAMESPACE_DECL - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/src/complex/generic/crealf16.cpp b/libc/src/complex/generic/crealf16.cpp index 35142071f0536..c9e8626bfda9d 100644 --- a/libc/src/complex/generic/crealf16.cpp +++ b/libc/src/complex/generic/crealf16.cpp @@ -7,8 +7,6 @@ //===----------------------------------------------------------------------===// #include "src/complex/crealf16.h" -#if defined(LIBC_TYPES_HAS_CFLOAT16) - #include "src/__support/CPP/bit.h" #include "src/__support/common.h" #include "src/__support/complex_type.h" @@ -21,5 +19,3 @@ LLVM_LIBC_FUNCTION(float16, crealf16, (cfloat16 x)) { } } // namespace LIBC_NAMESPACE_DECL - -#endif // LIBC_TYPES_HAS_CFLOAT16 diff --git a/libc/src/math/docs/add_math_function.md b/libc/src/math/docs/add_math_function.md index f02d502399e2b..daaf1a3ec5639 100644 --- a/libc/src/math/docs/add_math_function.md +++ b/libc/src/math/docs/add_math_function.md @@ -18,7 +18,7 @@ together with its specifications: ``` - Add function specs to the file: ``` - libc/hdrgen/yaml/math.yaml + libc/include/math.yaml ``` ## Implementation diff --git a/libc/test/UnitTest/FPMatcher.h b/libc/test/UnitTest/FPMatcher.h index 9f2bae3279208..b8e240bf328ce 100644 --- a/libc/test/UnitTest/FPMatcher.h +++ b/libc/test/UnitTest/FPMatcher.h @@ -131,11 +131,11 @@ template class CFPMatcher : public Matcher { else if constexpr (cpp::is_complex_type_same()) return matchComplex(); #ifdef LIBC_TYPES_HAS_CFLOAT16 - else if constexpr (cpp::is_complex_type_same) + else if constexpr (cpp::is_complex_type_same()) return matchComplex(); #endif #ifdef LIBC_TYPES_HAS_CFLOAT128 - else if constexpr (cpp::is_complex_type_same) + else if constexpr (cpp::is_complex_type_same()) return matchComplex(); #endif } @@ -148,11 +148,11 @@ template class CFPMatcher : public Matcher { else if constexpr (cpp::is_complex_type_same()) return explainErrorComplex(); #ifdef LIBC_TYPES_HAS_CFLOAT16 - else if constexpr (cpp::is_complex_type_same) + else if constexpr (cpp::is_complex_type_same()) return explainErrorComplex(); #endif #ifdef LIBC_TYPES_HAS_CFLOAT128 - else if constexpr (cpp::is_complex_type_same) + else if constexpr (cpp::is_complex_type_same()) return explainErrorComplex(); #endif } diff --git a/libc/test/src/complex/cimagf128_test.cpp b/libc/test/src/complex/cimagf128_test.cpp index 50ddc0ab06166..70ad0de3d38fb 100644 --- a/libc/test/src/complex/cimagf128_test.cpp +++ b/libc/test/src/complex/cimagf128_test.cpp @@ -10,8 +10,4 @@ #include "src/complex/cimagf128.h" -#if defined(LIBC_TYPES_HAS_CFLOAT128) - LIST_CIMAG_TESTS(cfloat128, float128, LIBC_NAMESPACE::cimagf128) - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/test/src/complex/cimagf16_test.cpp b/libc/test/src/complex/cimagf16_test.cpp index 65a69787ddbd6..3842381351abe 100644 --- a/libc/test/src/complex/cimagf16_test.cpp +++ b/libc/test/src/complex/cimagf16_test.cpp @@ -10,8 +10,4 @@ #include "src/complex/cimagf16.h" -#if defined(LIBC_TYPES_HAS_CFLOAT16) - LIST_CIMAG_TESTS(cfloat16, float16, LIBC_NAMESPACE::cimagf16) - -#endif // LIBC_TYPES_HAS_CFLOAT16 diff --git a/libc/test/src/complex/conjf128_test.cpp b/libc/test/src/complex/conjf128_test.cpp index a1feb9ff31fdc..4c2a72c6d39d6 100644 --- a/libc/test/src/complex/conjf128_test.cpp +++ b/libc/test/src/complex/conjf128_test.cpp @@ -10,8 +10,4 @@ #include "src/complex/conjf128.h" -#if defined(LIBC_TYPES_HAS_CFLOAT128) - LIST_CONJ_TESTS(cfloat128, float128, LIBC_NAMESPACE::conjf128) - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/test/src/complex/conjf16_test.cpp b/libc/test/src/complex/conjf16_test.cpp index 0de9f448e8681..374f9ec3e6243 100644 --- a/libc/test/src/complex/conjf16_test.cpp +++ b/libc/test/src/complex/conjf16_test.cpp @@ -10,8 +10,4 @@ #include "src/complex/conjf16.h" -#if defined(LIBC_TYPES_HAS_CFLOAT16) - LIST_CONJ_TESTS(cfloat16, float16, LIBC_NAMESPACE::conjf16) - -#endif // LIBC_TYPES_HAS_CFLOAT16 diff --git a/libc/test/src/complex/cprojf128_test.cpp b/libc/test/src/complex/cprojf128_test.cpp index 75708122260d6..7b41eb5cf5f93 100644 --- a/libc/test/src/complex/cprojf128_test.cpp +++ b/libc/test/src/complex/cprojf128_test.cpp @@ -10,8 +10,4 @@ #include "src/complex/cprojf128.h" -#if defined(LIBC_TYPES_HAS_CFLOAT128) - LIST_CPROJ_TESTS(cfloat128, float128, LIBC_NAMESPACE::cprojf128) - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/test/src/complex/cprojf16_test.cpp b/libc/test/src/complex/cprojf16_test.cpp index 628cec0dc5d96..db9b7b9316bca 100644 --- a/libc/test/src/complex/cprojf16_test.cpp +++ b/libc/test/src/complex/cprojf16_test.cpp @@ -10,8 +10,4 @@ #include "src/complex/cprojf16.h" -#if defined(LIBC_TYPES_HAS_CFLOAT16) - LIST_CPROJ_TESTS(cfloat16, float16, LIBC_NAMESPACE::cprojf16) - -#endif // LIBC_TYPES_HAS_CFLOAT16 diff --git a/libc/test/src/complex/crealf128_test.cpp b/libc/test/src/complex/crealf128_test.cpp index 7626eeebca278..0d1c26df77371 100644 --- a/libc/test/src/complex/crealf128_test.cpp +++ b/libc/test/src/complex/crealf128_test.cpp @@ -10,8 +10,4 @@ #include "src/complex/crealf128.h" -#if defined(LIBC_TYPES_HAS_CFLOAT128) - LIST_CREAL_TESTS(cfloat128, float128, LIBC_NAMESPACE::crealf128) - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/test/src/complex/crealf16_test.cpp b/libc/test/src/complex/crealf16_test.cpp index 97346aad615f7..b8560d74d35b5 100644 --- a/libc/test/src/complex/crealf16_test.cpp +++ b/libc/test/src/complex/crealf16_test.cpp @@ -10,8 +10,4 @@ #include "src/complex/crealf16.h" -#if defined(LIBC_TYPES_HAS_CFLOAT16) - LIST_CREAL_TESTS(cfloat16, float16, LIBC_NAMESPACE::crealf16) - -#endif // LIBC_TYPES_HAS_CFLOAT16 diff --git a/libc/test/src/math/smoke/CanonicalizeTest.h b/libc/test/src/math/smoke/CanonicalizeTest.h index ef75f568b8275..e500bc38f9852 100644 --- a/libc/test/src/math/smoke/CanonicalizeTest.h +++ b/libc/test/src/math/smoke/CanonicalizeTest.h @@ -19,6 +19,7 @@ #include "hdr/math_macros.h" #define TEST_SPECIAL(x, y, expected, expected_exception) \ + LIBC_NAMESPACE::fputil::clear_except(FE_ALL_EXCEPT); \ EXPECT_EQ(expected, f(&x, &y)); \ EXPECT_FP_EXCEPTION(expected_exception); \ LIBC_NAMESPACE::fputil::clear_except(FE_ALL_EXCEPT) diff --git a/libc/test/src/math/smoke/FModTest.h b/libc/test/src/math/smoke/FModTest.h index ad9688fc01e7c..8fbcc2a276542 100644 --- a/libc/test/src/math/smoke/FModTest.h +++ b/libc/test/src/math/smoke/FModTest.h @@ -18,6 +18,7 @@ #include "hdr/fenv_macros.h" #define TEST_SPECIAL(x, y, expected, dom_err, expected_exception) \ + LIBC_NAMESPACE::fputil::clear_except(FE_ALL_EXCEPT); \ EXPECT_FP_EQ(expected, f(x, y)); \ EXPECT_MATH_ERRNO((dom_err) ? EDOM : 0); \ EXPECT_FP_EXCEPTION(expected_exception); \ diff --git a/libc/utils/CMakeLists.txt b/libc/utils/CMakeLists.txt index 11f25503cc13e..a33c13a045a8a 100644 --- a/libc/utils/CMakeLists.txt +++ b/libc/utils/CMakeLists.txt @@ -1,3 +1,5 @@ +add_subdirectory(hdrgen) + if(LLVM_INCLUDE_TESTS) add_subdirectory(MPFRWrapper) endif() diff --git a/libc/hdrgen/CMakeLists.txt b/libc/utils/hdrgen/CMakeLists.txt similarity index 68% rename from libc/hdrgen/CMakeLists.txt rename to libc/utils/hdrgen/CMakeLists.txt index 8ebde4e3e4588..c6827da215055 100644 --- a/libc/hdrgen/CMakeLists.txt +++ b/libc/utils/hdrgen/CMakeLists.txt @@ -1,12 +1,12 @@ if(LLVM_LIBC_FULL_BUILD) enable_testing() - set(NEWHDGEN_TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests) + set(HDRGEN_TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests) set(TEST_OUTPUT_DIR ${CMAKE_BINARY_DIR}/hdrgen/output) add_test( NAME hdrgen_integration_test - COMMAND python3 ${NEWHDGEN_TESTS_DIR}/test_integration.py --output_dir ${TEST_OUTPUT_DIR} + COMMAND python3 ${HDRGEN_TESTS_DIR}/test_integration.py --output_dir ${TEST_OUTPUT_DIR} ) add_custom_target(check-hdrgen diff --git a/libc/utils/hdrgen/README.rst b/libc/utils/hdrgen/README.rst new file mode 100644 index 0000000000000..d16e6c5ccaec1 --- /dev/null +++ b/libc/utils/hdrgen/README.rst @@ -0,0 +1,5 @@ +This directory contains the sources and specifications for the types, +macros and entrypoint functions. These definitions are organized in the +``yaml`` subdirectory and match the organization of the ``*.h.def`` +files. This directory also contains the Python sources for hdrgen, which is +what generates the headers. diff --git a/libc/hdrgen/class_implementation/classes/enumeration.py b/libc/utils/hdrgen/enumeration.py similarity index 100% rename from libc/hdrgen/class_implementation/classes/enumeration.py rename to libc/utils/hdrgen/enumeration.py diff --git a/libc/hdrgen/class_implementation/classes/function.py b/libc/utils/hdrgen/function.py similarity index 100% rename from libc/hdrgen/class_implementation/classes/function.py rename to libc/utils/hdrgen/function.py diff --git a/libc/hdrgen/gpu_headers.py b/libc/utils/hdrgen/gpu_headers.py similarity index 75% rename from libc/hdrgen/gpu_headers.py rename to libc/utils/hdrgen/gpu_headers.py index b26b3a88557b4..8c4ff6e08b112 100644 --- a/libc/hdrgen/gpu_headers.py +++ b/libc/utils/hdrgen/gpu_headers.py @@ -6,31 +6,9 @@ # # ==-------------------------------------------------------------------------==# +from header import HeaderFile -class GpuHeaderFile: - def __init__(self, name): - self.name = name - self.macros = [] - self.types = [] - self.enumerations = [] - self.objects = [] - self.functions = [] - - def add_macro(self, macro): - self.macros.append(macro) - - def add_type(self, type_): - self.types.append(type_) - - def add_enumeration(self, enumeration): - self.enumerations.append(enumeration) - - def add_object(self, object): - self.objects.append(object) - - def add_function(self, function): - self.functions.append(function) - +class GpuHeaderFile(HeaderFile): def __str__(self): content = [] diff --git a/libc/hdrgen/header.py b/libc/utils/hdrgen/header.py similarity index 100% rename from libc/hdrgen/header.py rename to libc/utils/hdrgen/header.py diff --git a/libc/hdrgen/class_implementation/classes/macro.py b/libc/utils/hdrgen/macro.py similarity index 100% rename from libc/hdrgen/class_implementation/classes/macro.py rename to libc/utils/hdrgen/macro.py diff --git a/libc/hdrgen/class_implementation/classes/object.py b/libc/utils/hdrgen/object.py similarity index 100% rename from libc/hdrgen/class_implementation/classes/object.py rename to libc/utils/hdrgen/object.py diff --git a/libc/hdrgen/tests/expected_output/test_header.h b/libc/utils/hdrgen/tests/expected_output/test_header.h similarity index 100% rename from libc/hdrgen/tests/expected_output/test_header.h rename to libc/utils/hdrgen/tests/expected_output/test_header.h diff --git a/libc/hdrgen/tests/input/test_small.h.def b/libc/utils/hdrgen/tests/input/test_small.h.def similarity index 100% rename from libc/hdrgen/tests/input/test_small.h.def rename to libc/utils/hdrgen/tests/input/test_small.h.def diff --git a/libc/hdrgen/tests/input/test_small.yaml b/libc/utils/hdrgen/tests/input/test_small.yaml similarity index 100% rename from libc/hdrgen/tests/input/test_small.yaml rename to libc/utils/hdrgen/tests/input/test_small.yaml diff --git a/libc/hdrgen/tests/test_integration.py b/libc/utils/hdrgen/tests/test_integration.py similarity index 84% rename from libc/hdrgen/tests/test_integration.py rename to libc/utils/hdrgen/tests/test_integration.py index 8ea6d8a708073..ce80026e7bccd 100644 --- a/libc/hdrgen/tests/test_integration.py +++ b/libc/utils/hdrgen/tests/test_integration.py @@ -9,19 +9,19 @@ class TestHeaderGenIntegration(unittest.TestCase): def setUp(self): self.output_dir = Path( - args.output_dir if args.output_dir else "libc/hdrgen/tests/output" + args.output_dir if args.output_dir else "libc/utils/hdrgen/tests/output" ) self.maxDiff = None - self.source_dir = Path(__file__).resolve().parent.parent.parent.parent + self.source_dir = Path(__file__).resolve().parent.parent.parent.parent.parent def run_script(self, yaml_file, h_def_file, output_dir, entry_points): yaml_file = self.source_dir / yaml_file h_def_file = self.source_dir / h_def_file command = [ "python3", - str(self.source_dir / "libc/hdrgen/yaml_to_classes.py"), + str(self.source_dir / "libc/utils/hdrgen/yaml_to_classes.py"), str(yaml_file), "--h_def_file", str(h_def_file), @@ -51,10 +51,10 @@ def compare_files(self, generated_file, expected_file): self.assertEqual(gen_content, exp_content) def test_generate_header(self): - yaml_file = "libc/hdrgen/tests/input/test_small.yaml" - h_def_file = "libc/hdrgen/tests/input/test_small.h.def" + yaml_file = "libc/utils/hdrgen/tests/input/test_small.yaml" + h_def_file = "libc/utils/hdrgen/tests/input/test_small.h.def" expected_output_file = ( - self.source_dir / "libc/hdrgen/tests/expected_output/test_header.h" + self.source_dir / "libc/utils/hdrgen/tests/expected_output/test_header.h" ) output_file = self.output_dir / "test_small.h" entry_points = {"func_b", "func_a", "func_c", "func_d", "func_e"} diff --git a/libc/hdrgen/class_implementation/classes/type.py b/libc/utils/hdrgen/type.py similarity index 100% rename from libc/hdrgen/class_implementation/classes/type.py rename to libc/utils/hdrgen/type.py diff --git a/libc/hdrgen/yaml_functions_sorted.py b/libc/utils/hdrgen/yaml_functions_sorted.py similarity index 100% rename from libc/hdrgen/yaml_functions_sorted.py rename to libc/utils/hdrgen/yaml_functions_sorted.py diff --git a/libc/hdrgen/yaml_to_classes.py b/libc/utils/hdrgen/yaml_to_classes.py similarity index 97% rename from libc/hdrgen/yaml_to_classes.py rename to libc/utils/hdrgen/yaml_to_classes.py index 0e8ca2d8a82b0..ec2441b78aee5 100644 --- a/libc/hdrgen/yaml_to_classes.py +++ b/libc/utils/hdrgen/yaml_to_classes.py @@ -11,13 +11,14 @@ import yaml import argparse from pathlib import Path -from header import HeaderFile + +from enumeration import Enumeration +from function import Function from gpu_headers import GpuHeaderFile as GpuHeader -from class_implementation.classes.macro import Macro -from class_implementation.classes.type import Type -from class_implementation.classes.function import Function -from class_implementation.classes.enumeration import Enumeration -from class_implementation.classes.object import Object +from header import HeaderFile +from macro import Macro +from object import Object +from type import Type def yaml_to_classes(yaml_data, header_class, entry_points=None): diff --git a/libcxx/cmake/caches/Generic-cxx03-frozen.cmake b/libcxx/cmake/caches/Generic-cxx03-frozen.cmake new file mode 100644 index 0000000000000..dfd158bf6edbe --- /dev/null +++ b/libcxx/cmake/caches/Generic-cxx03-frozen.cmake @@ -0,0 +1,2 @@ +set(LIBCXX_TEST_PARAMS "std=c++03;test_frozen_cxx03_headers=True" CACHE STRING "") +set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "") diff --git a/libcxx/docs/Hardening.rst b/libcxx/docs/Hardening.rst index 42aacfdcfb41a..4002f40e1dad3 100644 --- a/libcxx/docs/Hardening.rst +++ b/libcxx/docs/Hardening.rst @@ -458,7 +458,7 @@ Hardened containers status - Partial - N/A * - ``bitset`` - - ❌ + - ✅ - N/A Note: for ``vector`` and ``string``, the iterator does not check for diff --git a/libcxx/docs/Status/Cxx17Papers.csv b/libcxx/docs/Status/Cxx17Papers.csv index a589207085d36..fbcac452adb8b 100644 --- a/libcxx/docs/Status/Cxx17Papers.csv +++ b/libcxx/docs/Status/Cxx17Papers.csv @@ -1,6 +1,6 @@ "Paper #","Paper Name","Meeting","Status","First released version","Notes" "`N3911 `__","TransformationTrait Alias ``void_t``\ .","2014-11 (Urbana)","|Complete|","3.6","" -"`N4089 `__","Safe conversions in ``unique_ptr``\ .","2014-11 (Urbana)","|In Progress|","3.9","" +"`N4089 `__","Safe conversions in ``unique_ptr``\ .","2014-11 (Urbana)","|Complete|","5","" "`N4169 `__","A proposal to add invoke function template","2014-11 (Urbana)","|Complete|","3.7","" "`N4190 `__","Removing auto_ptr, random_shuffle(), And Old Stuff.","2014-11 (Urbana)","|Complete|","15","" "`N4258 `__","Cleaning-up noexcept in the Library.","2014-11 (Urbana)","|In Progress|","3.7","" @@ -51,7 +51,7 @@ "`P0137R1 `__","Core Issue 1776: Replacement of class objects containing reference members","2016-06 (Oulu)","|Complete|","6","" "`P0163R0 `__","shared_ptr::weak_type","2016-06 (Oulu)","|Complete|","3.9","" "`P0174R2 `__","Deprecating Vestigial Library Parts in C++17","2016-06 (Oulu)","|Complete|","15","" -"`P0175R1 `__","Synopses for the C library","2016-06 (Oulu)","","","" +"`P0175R1 `__","Synopses for the C library","2016-06 (Oulu)","|Nothing To Do|","n/a","" "`P0180R2 `__","Reserve a New Library Namespace for Future Standardization","2016-06 (Oulu)","|Nothing To Do|","n/a","" "`P0181R1 `__","Ordered by Default","2016-06 (Oulu)","|Nothing To Do|","n/a","Pulled at the 2017-01 meeting in Kona" "`P0209R2 `__","make_from_tuple: apply for construction","2016-06 (Oulu)","|Complete|","3.9","" @@ -90,7 +90,7 @@ "`P0521R0 `__","Proposed Resolution for CA 14 (shared_ptr use_count/unique)","2016-11 (Issaquah)","|Complete|","18","" "","","","","","" "`P0156R2 `__","Variadic Lock guard(rev 5)","2017-02 (Kona)","|Complete|","5","" -"`P0270R3 `__","Removing C dependencies from signal handler wording","2017-02 (Kona)","","","" +"`P0270R3 `__","Removing C dependencies from signal handler wording","2017-02 (Kona)","|Nothing To Do|","","" "`P0298R3 `__","A byte type definition","2017-02 (Kona)","|Complete|","5","" "`P0317R1 `__","Directory Entry Caching for Filesystem","2017-02 (Kona)","|Complete|","7","" "`P0430R2 `__","File system library on non-POSIX-like operating systems","2017-02 (Kona)","|Complete|","7","" diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt index b5bbfbe7d3a23..0b484ebe5e87c 100644 --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -1054,6 +1054,1026 @@ set(files version wchar.h wctype.h + +# C++03 frozen headers + __cxx03/__algorithm/adjacent_find.h + __cxx03/__algorithm/all_of.h + __cxx03/__algorithm/any_of.h + __cxx03/__algorithm/binary_search.h + __cxx03/__algorithm/clamp.h + __cxx03/__algorithm/comp.h + __cxx03/__algorithm/comp_ref_type.h + __cxx03/__algorithm/copy.h + __cxx03/__algorithm/copy_backward.h + __cxx03/__algorithm/copy_if.h + __cxx03/__algorithm/copy_move_common.h + __cxx03/__algorithm/copy_n.h + __cxx03/__algorithm/count.h + __cxx03/__algorithm/count_if.h + __cxx03/__algorithm/equal.h + __cxx03/__algorithm/equal_range.h + __cxx03/__algorithm/fill.h + __cxx03/__algorithm/fill_n.h + __cxx03/__algorithm/find.h + __cxx03/__algorithm/find_end.h + __cxx03/__algorithm/find_first_of.h + __cxx03/__algorithm/find_if.h + __cxx03/__algorithm/find_if_not.h + __cxx03/__algorithm/find_segment_if.h + __cxx03/__algorithm/fold.h + __cxx03/__algorithm/for_each.h + __cxx03/__algorithm/for_each_n.h + __cxx03/__algorithm/for_each_segment.h + __cxx03/__algorithm/generate.h + __cxx03/__algorithm/generate_n.h + __cxx03/__algorithm/half_positive.h + __cxx03/__algorithm/in_found_result.h + __cxx03/__algorithm/in_fun_result.h + __cxx03/__algorithm/in_in_out_result.h + __cxx03/__algorithm/in_in_result.h + __cxx03/__algorithm/in_out_out_result.h + __cxx03/__algorithm/in_out_result.h + __cxx03/__algorithm/includes.h + __cxx03/__algorithm/inplace_merge.h + __cxx03/__algorithm/is_heap.h + __cxx03/__algorithm/is_heap_until.h + __cxx03/__algorithm/is_partitioned.h + __cxx03/__algorithm/is_permutation.h + __cxx03/__algorithm/is_sorted.h + __cxx03/__algorithm/is_sorted_until.h + __cxx03/__algorithm/iter_swap.h + __cxx03/__algorithm/iterator_operations.h + __cxx03/__algorithm/lexicographical_compare.h + __cxx03/__algorithm/lexicographical_compare_three_way.h + __cxx03/__algorithm/lower_bound.h + __cxx03/__algorithm/make_heap.h + __cxx03/__algorithm/make_projected.h + __cxx03/__algorithm/max.h + __cxx03/__algorithm/max_element.h + __cxx03/__algorithm/merge.h + __cxx03/__algorithm/min.h + __cxx03/__algorithm/min_element.h + __cxx03/__algorithm/min_max_result.h + __cxx03/__algorithm/minmax.h + __cxx03/__algorithm/minmax_element.h + __cxx03/__algorithm/mismatch.h + __cxx03/__algorithm/move.h + __cxx03/__algorithm/move_backward.h + __cxx03/__algorithm/next_permutation.h + __cxx03/__algorithm/none_of.h + __cxx03/__algorithm/nth_element.h + __cxx03/__algorithm/partial_sort.h + __cxx03/__algorithm/partial_sort_copy.h + __cxx03/__algorithm/partition.h + __cxx03/__algorithm/partition_copy.h + __cxx03/__algorithm/partition_point.h + __cxx03/__algorithm/pop_heap.h + __cxx03/__algorithm/prev_permutation.h + __cxx03/__algorithm/pstl.h + __cxx03/__algorithm/push_heap.h + __cxx03/__algorithm/ranges_adjacent_find.h + __cxx03/__algorithm/ranges_all_of.h + __cxx03/__algorithm/ranges_any_of.h + __cxx03/__algorithm/ranges_binary_search.h + __cxx03/__algorithm/ranges_clamp.h + __cxx03/__algorithm/ranges_contains.h + __cxx03/__algorithm/ranges_contains_subrange.h + __cxx03/__algorithm/ranges_copy.h + __cxx03/__algorithm/ranges_copy_backward.h + __cxx03/__algorithm/ranges_copy_if.h + __cxx03/__algorithm/ranges_copy_n.h + __cxx03/__algorithm/ranges_count.h + __cxx03/__algorithm/ranges_count_if.h + __cxx03/__algorithm/ranges_ends_with.h + __cxx03/__algorithm/ranges_equal.h + __cxx03/__algorithm/ranges_equal_range.h + __cxx03/__algorithm/ranges_fill.h + __cxx03/__algorithm/ranges_fill_n.h + __cxx03/__algorithm/ranges_find.h + __cxx03/__algorithm/ranges_find_end.h + __cxx03/__algorithm/ranges_find_first_of.h + __cxx03/__algorithm/ranges_find_if.h + __cxx03/__algorithm/ranges_find_if_not.h + __cxx03/__algorithm/ranges_find_last.h + __cxx03/__algorithm/ranges_for_each.h + __cxx03/__algorithm/ranges_for_each_n.h + __cxx03/__algorithm/ranges_generate.h + __cxx03/__algorithm/ranges_generate_n.h + __cxx03/__algorithm/ranges_includes.h + __cxx03/__algorithm/ranges_inplace_merge.h + __cxx03/__algorithm/ranges_is_heap.h + __cxx03/__algorithm/ranges_is_heap_until.h + __cxx03/__algorithm/ranges_is_partitioned.h + __cxx03/__algorithm/ranges_is_permutation.h + __cxx03/__algorithm/ranges_is_sorted.h + __cxx03/__algorithm/ranges_is_sorted_until.h + __cxx03/__algorithm/ranges_iterator_concept.h + __cxx03/__algorithm/ranges_lexicographical_compare.h + __cxx03/__algorithm/ranges_lower_bound.h + __cxx03/__algorithm/ranges_make_heap.h + __cxx03/__algorithm/ranges_max.h + __cxx03/__algorithm/ranges_max_element.h + __cxx03/__algorithm/ranges_merge.h + __cxx03/__algorithm/ranges_min.h + __cxx03/__algorithm/ranges_min_element.h + __cxx03/__algorithm/ranges_minmax.h + __cxx03/__algorithm/ranges_minmax_element.h + __cxx03/__algorithm/ranges_mismatch.h + __cxx03/__algorithm/ranges_move.h + __cxx03/__algorithm/ranges_move_backward.h + __cxx03/__algorithm/ranges_next_permutation.h + __cxx03/__algorithm/ranges_none_of.h + __cxx03/__algorithm/ranges_nth_element.h + __cxx03/__algorithm/ranges_partial_sort.h + __cxx03/__algorithm/ranges_partial_sort_copy.h + __cxx03/__algorithm/ranges_partition.h + __cxx03/__algorithm/ranges_partition_copy.h + __cxx03/__algorithm/ranges_partition_point.h + __cxx03/__algorithm/ranges_pop_heap.h + __cxx03/__algorithm/ranges_prev_permutation.h + __cxx03/__algorithm/ranges_push_heap.h + __cxx03/__algorithm/ranges_remove.h + __cxx03/__algorithm/ranges_remove_copy.h + __cxx03/__algorithm/ranges_remove_copy_if.h + __cxx03/__algorithm/ranges_remove_if.h + __cxx03/__algorithm/ranges_replace.h + __cxx03/__algorithm/ranges_replace_copy.h + __cxx03/__algorithm/ranges_replace_copy_if.h + __cxx03/__algorithm/ranges_replace_if.h + __cxx03/__algorithm/ranges_reverse.h + __cxx03/__algorithm/ranges_reverse_copy.h + __cxx03/__algorithm/ranges_rotate.h + __cxx03/__algorithm/ranges_rotate_copy.h + __cxx03/__algorithm/ranges_sample.h + __cxx03/__algorithm/ranges_search.h + __cxx03/__algorithm/ranges_search_n.h + __cxx03/__algorithm/ranges_set_difference.h + __cxx03/__algorithm/ranges_set_intersection.h + __cxx03/__algorithm/ranges_set_symmetric_difference.h + __cxx03/__algorithm/ranges_set_union.h + __cxx03/__algorithm/ranges_shuffle.h + __cxx03/__algorithm/ranges_sort.h + __cxx03/__algorithm/ranges_sort_heap.h + __cxx03/__algorithm/ranges_stable_partition.h + __cxx03/__algorithm/ranges_stable_sort.h + __cxx03/__algorithm/ranges_starts_with.h + __cxx03/__algorithm/ranges_swap_ranges.h + __cxx03/__algorithm/ranges_transform.h + __cxx03/__algorithm/ranges_unique.h + __cxx03/__algorithm/ranges_unique_copy.h + __cxx03/__algorithm/ranges_upper_bound.h + __cxx03/__algorithm/remove.h + __cxx03/__algorithm/remove_copy.h + __cxx03/__algorithm/remove_copy_if.h + __cxx03/__algorithm/remove_if.h + __cxx03/__algorithm/replace.h + __cxx03/__algorithm/replace_copy.h + __cxx03/__algorithm/replace_copy_if.h + __cxx03/__algorithm/replace_if.h + __cxx03/__algorithm/reverse.h + __cxx03/__algorithm/reverse_copy.h + __cxx03/__algorithm/rotate.h + __cxx03/__algorithm/rotate_copy.h + __cxx03/__algorithm/sample.h + __cxx03/__algorithm/search.h + __cxx03/__algorithm/search_n.h + __cxx03/__algorithm/set_difference.h + __cxx03/__algorithm/set_intersection.h + __cxx03/__algorithm/set_symmetric_difference.h + __cxx03/__algorithm/set_union.h + __cxx03/__algorithm/shift_left.h + __cxx03/__algorithm/shift_right.h + __cxx03/__algorithm/shuffle.h + __cxx03/__algorithm/sift_down.h + __cxx03/__algorithm/simd_utils.h + __cxx03/__algorithm/sort.h + __cxx03/__algorithm/sort_heap.h + __cxx03/__algorithm/stable_partition.h + __cxx03/__algorithm/stable_sort.h + __cxx03/__algorithm/swap_ranges.h + __cxx03/__algorithm/three_way_comp_ref_type.h + __cxx03/__algorithm/transform.h + __cxx03/__algorithm/uniform_random_bit_generator_adaptor.h + __cxx03/__algorithm/unique.h + __cxx03/__algorithm/unique_copy.h + __cxx03/__algorithm/unwrap_iter.h + __cxx03/__algorithm/unwrap_range.h + __cxx03/__algorithm/upper_bound.h + __cxx03/__assert + __cxx03/__atomic/aliases.h + __cxx03/__atomic/atomic.h + __cxx03/__atomic/atomic_base.h + __cxx03/__atomic/atomic_flag.h + __cxx03/__atomic/atomic_init.h + __cxx03/__atomic/atomic_lock_free.h + __cxx03/__atomic/atomic_ref.h + __cxx03/__atomic/atomic_sync.h + __cxx03/__atomic/check_memory_order.h + __cxx03/__atomic/contention_t.h + __cxx03/__atomic/cxx_atomic_impl.h + __cxx03/__atomic/fence.h + __cxx03/__atomic/is_always_lock_free.h + __cxx03/__atomic/kill_dependency.h + __cxx03/__atomic/memory_order.h + __cxx03/__atomic/to_gcc_order.h + __cxx03/__bit/bit_cast.h + __cxx03/__bit/bit_ceil.h + __cxx03/__bit/bit_floor.h + __cxx03/__bit/bit_log2.h + __cxx03/__bit/bit_width.h + __cxx03/__bit/blsr.h + __cxx03/__bit/byteswap.h + __cxx03/__bit/countl.h + __cxx03/__bit/countr.h + __cxx03/__bit/endian.h + __cxx03/__bit/has_single_bit.h + __cxx03/__bit/invert_if.h + __cxx03/__bit/popcount.h + __cxx03/__bit/rotate.h + __cxx03/__bit_reference + __cxx03/__charconv/chars_format.h + __cxx03/__charconv/from_chars_integral.h + __cxx03/__charconv/from_chars_result.h + __cxx03/__charconv/tables.h + __cxx03/__charconv/to_chars.h + __cxx03/__charconv/to_chars_base_10.h + __cxx03/__charconv/to_chars_floating_point.h + __cxx03/__charconv/to_chars_integral.h + __cxx03/__charconv/to_chars_result.h + __cxx03/__charconv/traits.h + __cxx03/__chrono/calendar.h + __cxx03/__chrono/concepts.h + __cxx03/__chrono/convert_to_timespec.h + __cxx03/__chrono/convert_to_tm.h + __cxx03/__chrono/day.h + __cxx03/__chrono/duration.h + __cxx03/__chrono/exception.h + __cxx03/__chrono/file_clock.h + __cxx03/__chrono/formatter.h + __cxx03/__chrono/hh_mm_ss.h + __cxx03/__chrono/high_resolution_clock.h + __cxx03/__chrono/leap_second.h + __cxx03/__chrono/literals.h + __cxx03/__chrono/local_info.h + __cxx03/__chrono/month.h + __cxx03/__chrono/month_weekday.h + __cxx03/__chrono/monthday.h + __cxx03/__chrono/ostream.h + __cxx03/__chrono/parser_std_format_spec.h + __cxx03/__chrono/statically_widen.h + __cxx03/__chrono/steady_clock.h + __cxx03/__chrono/sys_info.h + __cxx03/__chrono/system_clock.h + __cxx03/__chrono/time_point.h + __cxx03/__chrono/time_zone.h + __cxx03/__chrono/time_zone_link.h + __cxx03/__chrono/tzdb.h + __cxx03/__chrono/tzdb_list.h + __cxx03/__chrono/weekday.h + __cxx03/__chrono/year.h + __cxx03/__chrono/year_month.h + __cxx03/__chrono/year_month_day.h + __cxx03/__chrono/year_month_weekday.h + __cxx03/__chrono/zoned_time.h + __cxx03/__compare/common_comparison_category.h + __cxx03/__compare/compare_partial_order_fallback.h + __cxx03/__compare/compare_strong_order_fallback.h + __cxx03/__compare/compare_three_way.h + __cxx03/__compare/compare_three_way_result.h + __cxx03/__compare/compare_weak_order_fallback.h + __cxx03/__compare/is_eq.h + __cxx03/__compare/ordering.h + __cxx03/__compare/partial_order.h + __cxx03/__compare/strong_order.h + __cxx03/__compare/synth_three_way.h + __cxx03/__compare/three_way_comparable.h + __cxx03/__compare/weak_order.h + __cxx03/__concepts/arithmetic.h + __cxx03/__concepts/assignable.h + __cxx03/__concepts/boolean_testable.h + __cxx03/__concepts/class_or_enum.h + __cxx03/__concepts/common_reference_with.h + __cxx03/__concepts/common_with.h + __cxx03/__concepts/constructible.h + __cxx03/__concepts/convertible_to.h + __cxx03/__concepts/copyable.h + __cxx03/__concepts/derived_from.h + __cxx03/__concepts/destructible.h + __cxx03/__concepts/different_from.h + __cxx03/__concepts/equality_comparable.h + __cxx03/__concepts/invocable.h + __cxx03/__concepts/movable.h + __cxx03/__concepts/predicate.h + __cxx03/__concepts/regular.h + __cxx03/__concepts/relation.h + __cxx03/__concepts/same_as.h + __cxx03/__concepts/semiregular.h + __cxx03/__concepts/swappable.h + __cxx03/__concepts/totally_ordered.h + __cxx03/__condition_variable/condition_variable.h + __cxx03/__config + __cxx03/__configuration/abi.h + __cxx03/__configuration/availability.h + __cxx03/__configuration/compiler.h + __cxx03/__configuration/config_site_shim.h + __cxx03/__configuration/language.h + __cxx03/__configuration/platform.h + __cxx03/__coroutine/coroutine_handle.h + __cxx03/__coroutine/coroutine_traits.h + __cxx03/__coroutine/noop_coroutine_handle.h + __cxx03/__coroutine/trivial_awaitables.h + __cxx03/__debug_utils/randomize_range.h + __cxx03/__debug_utils/sanitizers.h + __cxx03/__debug_utils/strict_weak_ordering_check.h + __cxx03/__exception/exception.h + __cxx03/__exception/exception_ptr.h + __cxx03/__exception/nested_exception.h + __cxx03/__exception/operations.h + __cxx03/__exception/terminate.h + __cxx03/__expected/bad_expected_access.h + __cxx03/__expected/expected.h + __cxx03/__expected/unexpect.h + __cxx03/__expected/unexpected.h + __cxx03/__filesystem/copy_options.h + __cxx03/__filesystem/directory_entry.h + __cxx03/__filesystem/directory_iterator.h + __cxx03/__filesystem/directory_options.h + __cxx03/__filesystem/file_status.h + __cxx03/__filesystem/file_time_type.h + __cxx03/__filesystem/file_type.h + __cxx03/__filesystem/filesystem_error.h + __cxx03/__filesystem/operations.h + __cxx03/__filesystem/path.h + __cxx03/__filesystem/path_iterator.h + __cxx03/__filesystem/perm_options.h + __cxx03/__filesystem/perms.h + __cxx03/__filesystem/recursive_directory_iterator.h + __cxx03/__filesystem/space_info.h + __cxx03/__filesystem/u8path.h + __cxx03/__format/buffer.h + __cxx03/__format/concepts.h + __cxx03/__format/container_adaptor.h + __cxx03/__format/enable_insertable.h + __cxx03/__format/escaped_output_table.h + __cxx03/__format/extended_grapheme_cluster_table.h + __cxx03/__format/format_arg.h + __cxx03/__format/format_arg_store.h + __cxx03/__format/format_args.h + __cxx03/__format/format_context.h + __cxx03/__format/format_error.h + __cxx03/__format/format_functions.h + __cxx03/__format/format_parse_context.h + __cxx03/__format/format_string.h + __cxx03/__format/format_to_n_result.h + __cxx03/__format/formatter.h + __cxx03/__format/formatter_bool.h + __cxx03/__format/formatter_char.h + __cxx03/__format/formatter_floating_point.h + __cxx03/__format/formatter_integer.h + __cxx03/__format/formatter_integral.h + __cxx03/__format/formatter_output.h + __cxx03/__format/formatter_pointer.h + __cxx03/__format/formatter_string.h + __cxx03/__format/formatter_tuple.h + __cxx03/__format/indic_conjunct_break_table.h + __cxx03/__format/parser_std_format_spec.h + __cxx03/__format/range_default_formatter.h + __cxx03/__format/range_formatter.h + __cxx03/__format/unicode.h + __cxx03/__format/width_estimation_table.h + __cxx03/__format/write_escaped.h + __cxx03/__functional/binary_function.h + __cxx03/__functional/binary_negate.h + __cxx03/__functional/bind.h + __cxx03/__functional/bind_back.h + __cxx03/__functional/bind_front.h + __cxx03/__functional/binder1st.h + __cxx03/__functional/binder2nd.h + __cxx03/__functional/boyer_moore_searcher.h + __cxx03/__functional/compose.h + __cxx03/__functional/default_searcher.h + __cxx03/__functional/function.h + __cxx03/__functional/hash.h + __cxx03/__functional/identity.h + __cxx03/__functional/invoke.h + __cxx03/__functional/is_transparent.h + __cxx03/__functional/mem_fn.h + __cxx03/__functional/mem_fun_ref.h + __cxx03/__functional/not_fn.h + __cxx03/__functional/operations.h + __cxx03/__functional/perfect_forward.h + __cxx03/__functional/pointer_to_binary_function.h + __cxx03/__functional/pointer_to_unary_function.h + __cxx03/__functional/ranges_operations.h + __cxx03/__functional/reference_wrapper.h + __cxx03/__functional/unary_function.h + __cxx03/__functional/unary_negate.h + __cxx03/__functional/weak_result_type.h + __cxx03/__fwd/array.h + __cxx03/__fwd/bit_reference.h + __cxx03/__fwd/complex.h + __cxx03/__fwd/deque.h + __cxx03/__fwd/format.h + __cxx03/__fwd/fstream.h + __cxx03/__fwd/functional.h + __cxx03/__fwd/ios.h + __cxx03/__fwd/istream.h + __cxx03/__fwd/mdspan.h + __cxx03/__fwd/memory.h + __cxx03/__fwd/memory_resource.h + __cxx03/__fwd/ostream.h + __cxx03/__fwd/pair.h + __cxx03/__fwd/queue.h + __cxx03/__fwd/span.h + __cxx03/__fwd/sstream.h + __cxx03/__fwd/stack.h + __cxx03/__fwd/streambuf.h + __cxx03/__fwd/string.h + __cxx03/__fwd/string_view.h + __cxx03/__fwd/subrange.h + __cxx03/__fwd/tuple.h + __cxx03/__fwd/vector.h + __cxx03/__hash_table + __cxx03/__ios/fpos.h + __cxx03/__iterator/access.h + __cxx03/__iterator/advance.h + __cxx03/__iterator/aliasing_iterator.h + __cxx03/__iterator/back_insert_iterator.h + __cxx03/__iterator/bounded_iter.h + __cxx03/__iterator/common_iterator.h + __cxx03/__iterator/concepts.h + __cxx03/__iterator/counted_iterator.h + __cxx03/__iterator/cpp17_iterator_concepts.h + __cxx03/__iterator/data.h + __cxx03/__iterator/default_sentinel.h + __cxx03/__iterator/distance.h + __cxx03/__iterator/empty.h + __cxx03/__iterator/erase_if_container.h + __cxx03/__iterator/front_insert_iterator.h + __cxx03/__iterator/incrementable_traits.h + __cxx03/__iterator/indirectly_comparable.h + __cxx03/__iterator/insert_iterator.h + __cxx03/__iterator/istream_iterator.h + __cxx03/__iterator/istreambuf_iterator.h + __cxx03/__iterator/iter_move.h + __cxx03/__iterator/iter_swap.h + __cxx03/__iterator/iterator.h + __cxx03/__iterator/iterator_traits.h + __cxx03/__iterator/iterator_with_data.h + __cxx03/__iterator/mergeable.h + __cxx03/__iterator/move_iterator.h + __cxx03/__iterator/move_sentinel.h + __cxx03/__iterator/next.h + __cxx03/__iterator/ostream_iterator.h + __cxx03/__iterator/ostreambuf_iterator.h + __cxx03/__iterator/permutable.h + __cxx03/__iterator/prev.h + __cxx03/__iterator/projected.h + __cxx03/__iterator/ranges_iterator_traits.h + __cxx03/__iterator/readable_traits.h + __cxx03/__iterator/reverse_access.h + __cxx03/__iterator/reverse_iterator.h + __cxx03/__iterator/segmented_iterator.h + __cxx03/__iterator/size.h + __cxx03/__iterator/sortable.h + __cxx03/__iterator/unreachable_sentinel.h + __cxx03/__iterator/wrap_iter.h + __cxx03/__locale + __cxx03/__locale_dir/locale_base_api.h + __cxx03/__locale_dir/locale_base_api/android.h + __cxx03/__locale_dir/locale_base_api/bsd_locale_defaults.h + __cxx03/__locale_dir/locale_base_api/bsd_locale_fallbacks.h + __cxx03/__locale_dir/locale_base_api/fuchsia.h + __cxx03/__locale_dir/locale_base_api/ibm.h + __cxx03/__locale_dir/locale_base_api/locale_guard.h + __cxx03/__locale_dir/locale_base_api/musl.h + __cxx03/__locale_dir/locale_base_api/newlib.h + __cxx03/__locale_dir/locale_base_api/openbsd.h + __cxx03/__locale_dir/locale_base_api/win32.h + __cxx03/__math/abs.h + __cxx03/__math/copysign.h + __cxx03/__math/error_functions.h + __cxx03/__math/exponential_functions.h + __cxx03/__math/fdim.h + __cxx03/__math/fma.h + __cxx03/__math/gamma.h + __cxx03/__math/hyperbolic_functions.h + __cxx03/__math/hypot.h + __cxx03/__math/inverse_hyperbolic_functions.h + __cxx03/__math/inverse_trigonometric_functions.h + __cxx03/__math/logarithms.h + __cxx03/__math/min_max.h + __cxx03/__math/modulo.h + __cxx03/__math/remainder.h + __cxx03/__math/roots.h + __cxx03/__math/rounding_functions.h + __cxx03/__math/special_functions.h + __cxx03/__math/traits.h + __cxx03/__math/trigonometric_functions.h + __cxx03/__mbstate_t.h + __cxx03/__mdspan/default_accessor.h + __cxx03/__mdspan/extents.h + __cxx03/__mdspan/layout_left.h + __cxx03/__mdspan/layout_right.h + __cxx03/__mdspan/layout_stride.h + __cxx03/__mdspan/mdspan.h + __cxx03/__memory/addressof.h + __cxx03/__memory/align.h + __cxx03/__memory/aligned_alloc.h + __cxx03/__memory/allocate_at_least.h + __cxx03/__memory/allocation_guard.h + __cxx03/__memory/allocator.h + __cxx03/__memory/allocator_arg_t.h + __cxx03/__memory/allocator_destructor.h + __cxx03/__memory/allocator_traits.h + __cxx03/__memory/assume_aligned.h + __cxx03/__memory/auto_ptr.h + __cxx03/__memory/builtin_new_allocator.h + __cxx03/__memory/compressed_pair.h + __cxx03/__memory/concepts.h + __cxx03/__memory/construct_at.h + __cxx03/__memory/destruct_n.h + __cxx03/__memory/inout_ptr.h + __cxx03/__memory/out_ptr.h + __cxx03/__memory/pointer_traits.h + __cxx03/__memory/ranges_construct_at.h + __cxx03/__memory/ranges_uninitialized_algorithms.h + __cxx03/__memory/raw_storage_iterator.h + __cxx03/__memory/shared_ptr.h + __cxx03/__memory/swap_allocator.h + __cxx03/__memory/temp_value.h + __cxx03/__memory/temporary_buffer.h + __cxx03/__memory/uninitialized_algorithms.h + __cxx03/__memory/unique_ptr.h + __cxx03/__memory/uses_allocator.h + __cxx03/__memory/uses_allocator_construction.h + __cxx03/__memory/voidify.h + __cxx03/__memory_resource/memory_resource.h + __cxx03/__memory_resource/monotonic_buffer_resource.h + __cxx03/__memory_resource/polymorphic_allocator.h + __cxx03/__memory_resource/pool_options.h + __cxx03/__memory_resource/synchronized_pool_resource.h + __cxx03/__memory_resource/unsynchronized_pool_resource.h + __cxx03/__mutex/lock_guard.h + __cxx03/__mutex/mutex.h + __cxx03/__mutex/once_flag.h + __cxx03/__mutex/tag_types.h + __cxx03/__mutex/unique_lock.h + __cxx03/__node_handle + __cxx03/__numeric/accumulate.h + __cxx03/__numeric/adjacent_difference.h + __cxx03/__numeric/exclusive_scan.h + __cxx03/__numeric/gcd_lcm.h + __cxx03/__numeric/inclusive_scan.h + __cxx03/__numeric/inner_product.h + __cxx03/__numeric/iota.h + __cxx03/__numeric/midpoint.h + __cxx03/__numeric/partial_sum.h + __cxx03/__numeric/pstl.h + __cxx03/__numeric/reduce.h + __cxx03/__numeric/saturation_arithmetic.h + __cxx03/__numeric/transform_exclusive_scan.h + __cxx03/__numeric/transform_inclusive_scan.h + __cxx03/__numeric/transform_reduce.h + __cxx03/__ostream/basic_ostream.h + __cxx03/__ostream/print.h + __cxx03/__pstl/backend.h + __cxx03/__pstl/backend_fwd.h + __cxx03/__pstl/backends/default.h + __cxx03/__pstl/backends/libdispatch.h + __cxx03/__pstl/backends/serial.h + __cxx03/__pstl/backends/std_thread.h + __cxx03/__pstl/cpu_algos/any_of.h + __cxx03/__pstl/cpu_algos/cpu_traits.h + __cxx03/__pstl/cpu_algos/fill.h + __cxx03/__pstl/cpu_algos/find_if.h + __cxx03/__pstl/cpu_algos/for_each.h + __cxx03/__pstl/cpu_algos/merge.h + __cxx03/__pstl/cpu_algos/stable_sort.h + __cxx03/__pstl/cpu_algos/transform.h + __cxx03/__pstl/cpu_algos/transform_reduce.h + __cxx03/__pstl/dispatch.h + __cxx03/__pstl/handle_exception.h + __cxx03/__random/bernoulli_distribution.h + __cxx03/__random/binomial_distribution.h + __cxx03/__random/cauchy_distribution.h + __cxx03/__random/chi_squared_distribution.h + __cxx03/__random/clamp_to_integral.h + __cxx03/__random/default_random_engine.h + __cxx03/__random/discard_block_engine.h + __cxx03/__random/discrete_distribution.h + __cxx03/__random/exponential_distribution.h + __cxx03/__random/extreme_value_distribution.h + __cxx03/__random/fisher_f_distribution.h + __cxx03/__random/gamma_distribution.h + __cxx03/__random/generate_canonical.h + __cxx03/__random/geometric_distribution.h + __cxx03/__random/independent_bits_engine.h + __cxx03/__random/is_seed_sequence.h + __cxx03/__random/is_valid.h + __cxx03/__random/knuth_b.h + __cxx03/__random/linear_congruential_engine.h + __cxx03/__random/log2.h + __cxx03/__random/lognormal_distribution.h + __cxx03/__random/mersenne_twister_engine.h + __cxx03/__random/negative_binomial_distribution.h + __cxx03/__random/normal_distribution.h + __cxx03/__random/piecewise_constant_distribution.h + __cxx03/__random/piecewise_linear_distribution.h + __cxx03/__random/poisson_distribution.h + __cxx03/__random/random_device.h + __cxx03/__random/ranlux.h + __cxx03/__random/seed_seq.h + __cxx03/__random/shuffle_order_engine.h + __cxx03/__random/student_t_distribution.h + __cxx03/__random/subtract_with_carry_engine.h + __cxx03/__random/uniform_int_distribution.h + __cxx03/__random/uniform_random_bit_generator.h + __cxx03/__random/uniform_real_distribution.h + __cxx03/__random/weibull_distribution.h + __cxx03/__ranges/access.h + __cxx03/__ranges/all.h + __cxx03/__ranges/as_rvalue_view.h + __cxx03/__ranges/chunk_by_view.h + __cxx03/__ranges/common_view.h + __cxx03/__ranges/concepts.h + __cxx03/__ranges/container_compatible_range.h + __cxx03/__ranges/counted.h + __cxx03/__ranges/dangling.h + __cxx03/__ranges/data.h + __cxx03/__ranges/drop_view.h + __cxx03/__ranges/drop_while_view.h + __cxx03/__ranges/elements_view.h + __cxx03/__ranges/empty.h + __cxx03/__ranges/empty_view.h + __cxx03/__ranges/enable_borrowed_range.h + __cxx03/__ranges/enable_view.h + __cxx03/__ranges/filter_view.h + __cxx03/__ranges/from_range.h + __cxx03/__ranges/iota_view.h + __cxx03/__ranges/istream_view.h + __cxx03/__ranges/join_view.h + __cxx03/__ranges/lazy_split_view.h + __cxx03/__ranges/movable_box.h + __cxx03/__ranges/non_propagating_cache.h + __cxx03/__ranges/owning_view.h + __cxx03/__ranges/range_adaptor.h + __cxx03/__ranges/rbegin.h + __cxx03/__ranges/ref_view.h + __cxx03/__ranges/rend.h + __cxx03/__ranges/repeat_view.h + __cxx03/__ranges/reverse_view.h + __cxx03/__ranges/single_view.h + __cxx03/__ranges/size.h + __cxx03/__ranges/split_view.h + __cxx03/__ranges/subrange.h + __cxx03/__ranges/take_view.h + __cxx03/__ranges/take_while_view.h + __cxx03/__ranges/to.h + __cxx03/__ranges/transform_view.h + __cxx03/__ranges/view_interface.h + __cxx03/__ranges/views.h + __cxx03/__ranges/zip_view.h + __cxx03/__split_buffer + __cxx03/__std_clang_module + __cxx03/__std_mbstate_t.h + __cxx03/__stop_token/atomic_unique_lock.h + __cxx03/__stop_token/intrusive_list_view.h + __cxx03/__stop_token/intrusive_shared_ptr.h + __cxx03/__stop_token/stop_callback.h + __cxx03/__stop_token/stop_source.h + __cxx03/__stop_token/stop_state.h + __cxx03/__stop_token/stop_token.h + __cxx03/__string/char_traits.h + __cxx03/__string/constexpr_c_functions.h + __cxx03/__string/extern_template_lists.h + __cxx03/__support/ibm/gettod_zos.h + __cxx03/__support/ibm/locale_mgmt_zos.h + __cxx03/__support/ibm/nanosleep.h + __cxx03/__support/xlocale/__nop_locale_mgmt.h + __cxx03/__support/xlocale/__posix_l_fallback.h + __cxx03/__support/xlocale/__strtonum_fallback.h + __cxx03/__system_error/errc.h + __cxx03/__system_error/error_category.h + __cxx03/__system_error/error_code.h + __cxx03/__system_error/error_condition.h + __cxx03/__system_error/system_error.h + __cxx03/__thread/formatter.h + __cxx03/__thread/id.h + __cxx03/__thread/jthread.h + __cxx03/__thread/poll_with_backoff.h + __cxx03/__thread/support.h + __cxx03/__thread/support/c11.h + __cxx03/__thread/support/external.h + __cxx03/__thread/support/pthread.h + __cxx03/__thread/support/windows.h + __cxx03/__thread/this_thread.h + __cxx03/__thread/thread.h + __cxx03/__thread/timed_backoff_policy.h + __cxx03/__tree + __cxx03/__tuple/find_index.h + __cxx03/__tuple/ignore.h + __cxx03/__tuple/make_tuple_types.h + __cxx03/__tuple/sfinae_helpers.h + __cxx03/__tuple/tuple_element.h + __cxx03/__tuple/tuple_indices.h + __cxx03/__tuple/tuple_like.h + __cxx03/__tuple/tuple_like_ext.h + __cxx03/__tuple/tuple_like_no_subrange.h + __cxx03/__tuple/tuple_size.h + __cxx03/__tuple/tuple_types.h + __cxx03/__type_traits/add_const.h + __cxx03/__type_traits/add_cv.h + __cxx03/__type_traits/add_lvalue_reference.h + __cxx03/__type_traits/add_pointer.h + __cxx03/__type_traits/add_rvalue_reference.h + __cxx03/__type_traits/add_volatile.h + __cxx03/__type_traits/aligned_storage.h + __cxx03/__type_traits/aligned_union.h + __cxx03/__type_traits/alignment_of.h + __cxx03/__type_traits/can_extract_key.h + __cxx03/__type_traits/common_reference.h + __cxx03/__type_traits/common_type.h + __cxx03/__type_traits/conditional.h + __cxx03/__type_traits/conjunction.h + __cxx03/__type_traits/copy_cv.h + __cxx03/__type_traits/copy_cvref.h + __cxx03/__type_traits/datasizeof.h + __cxx03/__type_traits/decay.h + __cxx03/__type_traits/dependent_type.h + __cxx03/__type_traits/desugars_to.h + __cxx03/__type_traits/disjunction.h + __cxx03/__type_traits/enable_if.h + __cxx03/__type_traits/extent.h + __cxx03/__type_traits/has_unique_object_representation.h + __cxx03/__type_traits/has_virtual_destructor.h + __cxx03/__type_traits/integral_constant.h + __cxx03/__type_traits/invoke.h + __cxx03/__type_traits/is_abstract.h + __cxx03/__type_traits/is_aggregate.h + __cxx03/__type_traits/is_allocator.h + __cxx03/__type_traits/is_always_bitcastable.h + __cxx03/__type_traits/is_arithmetic.h + __cxx03/__type_traits/is_array.h + __cxx03/__type_traits/is_assignable.h + __cxx03/__type_traits/is_base_of.h + __cxx03/__type_traits/is_bounded_array.h + __cxx03/__type_traits/is_callable.h + __cxx03/__type_traits/is_char_like_type.h + __cxx03/__type_traits/is_class.h + __cxx03/__type_traits/is_compound.h + __cxx03/__type_traits/is_const.h + __cxx03/__type_traits/is_constant_evaluated.h + __cxx03/__type_traits/is_constructible.h + __cxx03/__type_traits/is_convertible.h + __cxx03/__type_traits/is_core_convertible.h + __cxx03/__type_traits/is_destructible.h + __cxx03/__type_traits/is_empty.h + __cxx03/__type_traits/is_enum.h + __cxx03/__type_traits/is_equality_comparable.h + __cxx03/__type_traits/is_execution_policy.h + __cxx03/__type_traits/is_final.h + __cxx03/__type_traits/is_floating_point.h + __cxx03/__type_traits/is_function.h + __cxx03/__type_traits/is_fundamental.h + __cxx03/__type_traits/is_implicitly_default_constructible.h + __cxx03/__type_traits/is_integral.h + __cxx03/__type_traits/is_literal_type.h + __cxx03/__type_traits/is_member_pointer.h + __cxx03/__type_traits/is_nothrow_assignable.h + __cxx03/__type_traits/is_nothrow_constructible.h + __cxx03/__type_traits/is_nothrow_convertible.h + __cxx03/__type_traits/is_nothrow_destructible.h + __cxx03/__type_traits/is_null_pointer.h + __cxx03/__type_traits/is_object.h + __cxx03/__type_traits/is_pod.h + __cxx03/__type_traits/is_pointer.h + __cxx03/__type_traits/is_polymorphic.h + __cxx03/__type_traits/is_primary_template.h + __cxx03/__type_traits/is_reference.h + __cxx03/__type_traits/is_reference_wrapper.h + __cxx03/__type_traits/is_referenceable.h + __cxx03/__type_traits/is_same.h + __cxx03/__type_traits/is_scalar.h + __cxx03/__type_traits/is_signed.h + __cxx03/__type_traits/is_signed_integer.h + __cxx03/__type_traits/is_specialization.h + __cxx03/__type_traits/is_standard_layout.h + __cxx03/__type_traits/is_swappable.h + __cxx03/__type_traits/is_trivial.h + __cxx03/__type_traits/is_trivially_assignable.h + __cxx03/__type_traits/is_trivially_constructible.h + __cxx03/__type_traits/is_trivially_copyable.h + __cxx03/__type_traits/is_trivially_destructible.h + __cxx03/__type_traits/is_trivially_lexicographically_comparable.h + __cxx03/__type_traits/is_trivially_relocatable.h + __cxx03/__type_traits/is_unbounded_array.h + __cxx03/__type_traits/is_union.h + __cxx03/__type_traits/is_unsigned.h + __cxx03/__type_traits/is_unsigned_integer.h + __cxx03/__type_traits/is_valid_expansion.h + __cxx03/__type_traits/is_void.h + __cxx03/__type_traits/is_volatile.h + __cxx03/__type_traits/lazy.h + __cxx03/__type_traits/make_32_64_or_128_bit.h + __cxx03/__type_traits/make_const_lvalue_ref.h + __cxx03/__type_traits/make_signed.h + __cxx03/__type_traits/make_unsigned.h + __cxx03/__type_traits/maybe_const.h + __cxx03/__type_traits/nat.h + __cxx03/__type_traits/negation.h + __cxx03/__type_traits/noexcept_move_assign_container.h + __cxx03/__type_traits/promote.h + __cxx03/__type_traits/rank.h + __cxx03/__type_traits/remove_all_extents.h + __cxx03/__type_traits/remove_const.h + __cxx03/__type_traits/remove_const_ref.h + __cxx03/__type_traits/remove_cv.h + __cxx03/__type_traits/remove_cvref.h + __cxx03/__type_traits/remove_extent.h + __cxx03/__type_traits/remove_pointer.h + __cxx03/__type_traits/remove_reference.h + __cxx03/__type_traits/remove_volatile.h + __cxx03/__type_traits/result_of.h + __cxx03/__type_traits/strip_signature.h + __cxx03/__type_traits/type_identity.h + __cxx03/__type_traits/type_list.h + __cxx03/__type_traits/underlying_type.h + __cxx03/__type_traits/unwrap_ref.h + __cxx03/__type_traits/void_t.h + __cxx03/__undef_macros + __cxx03/__utility/as_const.h + __cxx03/__utility/as_lvalue.h + __cxx03/__utility/auto_cast.h + __cxx03/__utility/cmp.h + __cxx03/__utility/convert_to_integral.h + __cxx03/__utility/declval.h + __cxx03/__utility/empty.h + __cxx03/__utility/exception_guard.h + __cxx03/__utility/exchange.h + __cxx03/__utility/forward.h + __cxx03/__utility/forward_like.h + __cxx03/__utility/in_place.h + __cxx03/__utility/integer_sequence.h + __cxx03/__utility/is_pointer_in_range.h + __cxx03/__utility/is_valid_range.h + __cxx03/__utility/move.h + __cxx03/__utility/no_destroy.h + __cxx03/__utility/pair.h + __cxx03/__utility/piecewise_construct.h + __cxx03/__utility/priority_tag.h + __cxx03/__utility/private_constructor_tag.h + __cxx03/__utility/rel_ops.h + __cxx03/__utility/small_buffer.h + __cxx03/__utility/swap.h + __cxx03/__utility/to_underlying.h + __cxx03/__utility/unreachable.h + __cxx03/__variant/monostate.h + __cxx03/__verbose_abort + __cxx03/algorithm + __cxx03/any + __cxx03/array + __cxx03/atomic + __cxx03/barrier + __cxx03/bit + __cxx03/bitset + __cxx03/cassert + __cxx03/ccomplex + __cxx03/cctype + __cxx03/cerrno + __cxx03/cfenv + __cxx03/cfloat + __cxx03/charconv + __cxx03/chrono + __cxx03/cinttypes + __cxx03/ciso646 + __cxx03/climits + __cxx03/clocale + __cxx03/cmath + __cxx03/codecvt + __cxx03/compare + __cxx03/complex + __cxx03/complex.h + __cxx03/concepts + __cxx03/condition_variable + __cxx03/coroutine + __cxx03/csetjmp + __cxx03/csignal + __cxx03/cstdarg + __cxx03/cstdbool + __cxx03/cstddef + __cxx03/cstdint + __cxx03/cstdio + __cxx03/cstdlib + __cxx03/cstring + __cxx03/ctgmath + __cxx03/ctime + __cxx03/ctype.h + __cxx03/cuchar + __cxx03/cwchar + __cxx03/cwctype + __cxx03/deque + __cxx03/errno.h + __cxx03/exception + __cxx03/execution + __cxx03/expected + __cxx03/experimental/__config + __cxx03/experimental/__simd/aligned_tag.h + __cxx03/experimental/__simd/declaration.h + __cxx03/experimental/__simd/reference.h + __cxx03/experimental/__simd/scalar.h + __cxx03/experimental/__simd/simd.h + __cxx03/experimental/__simd/simd_mask.h + __cxx03/experimental/__simd/traits.h + __cxx03/experimental/__simd/utility.h + __cxx03/experimental/__simd/vec_ext.h + __cxx03/experimental/iterator + __cxx03/experimental/memory + __cxx03/experimental/propagate_const + __cxx03/experimental/simd + __cxx03/experimental/type_traits + __cxx03/experimental/utility + __cxx03/ext/__hash + __cxx03/ext/hash_map + __cxx03/ext/hash_set + __cxx03/fenv.h + __cxx03/filesystem + __cxx03/float.h + __cxx03/format + __cxx03/forward_list + __cxx03/fstream + __cxx03/functional + __cxx03/future + __cxx03/initializer_list + __cxx03/inttypes.h + __cxx03/iomanip + __cxx03/ios + __cxx03/iosfwd + __cxx03/iostream + __cxx03/istream + __cxx03/iterator + __cxx03/latch + __cxx03/limits + __cxx03/list + __cxx03/locale + __cxx03/locale.h + __cxx03/map + __cxx03/math.h + __cxx03/mdspan + __cxx03/memory + __cxx03/memory_resource + __cxx03/module.modulemap + __cxx03/mutex + __cxx03/new + __cxx03/numbers + __cxx03/numeric + __cxx03/optional + __cxx03/ostream + __cxx03/print + __cxx03/queue + __cxx03/random + __cxx03/ranges + __cxx03/ratio + __cxx03/regex + __cxx03/scoped_allocator + __cxx03/semaphore + __cxx03/set + __cxx03/shared_mutex + __cxx03/source_location + __cxx03/span + __cxx03/sstream + __cxx03/stack + __cxx03/stdatomic.h + __cxx03/stdbool.h + __cxx03/stddef.h + __cxx03/stdexcept + __cxx03/stdint.h + __cxx03/stdio.h + __cxx03/stdlib.h + __cxx03/stop_token + __cxx03/streambuf + __cxx03/string + __cxx03/string.h + __cxx03/string_view + __cxx03/strstream + __cxx03/syncstream + __cxx03/system_error + __cxx03/tgmath.h + __cxx03/thread + __cxx03/tuple + __cxx03/type_traits + __cxx03/typeindex + __cxx03/typeinfo + __cxx03/uchar.h + __cxx03/unordered_map + __cxx03/unordered_set + __cxx03/utility + __cxx03/valarray + __cxx03/variant + __cxx03/vector + __cxx03/version + __cxx03/wchar.h + __cxx03/wctype.h ) configure_file("__config_site.in" "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site" @ONLY) diff --git a/libcxx/include/__algorithm/mismatch.h b/libcxx/include/__algorithm/mismatch.h index a6836792c0581..f5855379f6878 100644 --- a/libcxx/include/__algorithm/mismatch.h +++ b/libcxx/include/__algorithm/mismatch.h @@ -78,7 +78,7 @@ __mismatch_vectorized(_Iter __first1, _Iter __last1, _Iter __first2) { } for (size_t __i = 0; __i != __unroll_count; ++__i) { - if (auto __cmp_res = __lhs[__i] == __rhs[__i]; !std::__all_of(__cmp_res)) { + if (auto __cmp_res = std::__as_mask(__lhs[__i] == __rhs[__i]); !std::__all_of(__cmp_res)) { auto __offset = __i * __vec_size + std::__find_first_not_set(__cmp_res); return {__first1 + __offset, __first2 + __offset}; } @@ -90,7 +90,7 @@ __mismatch_vectorized(_Iter __first1, _Iter __last1, _Iter __first2) { // check the remaining 0-3 vectors while (static_cast(__last1 - __first1) >= __vec_size) { - if (auto __cmp_res = std::__load_vector<__vec>(__first1) == std::__load_vector<__vec>(__first2); + if (auto __cmp_res = std::__as_mask(std::__load_vector<__vec>(__first1) == std::__load_vector<__vec>(__first2)); !std::__all_of(__cmp_res)) { auto __offset = std::__find_first_not_set(__cmp_res); return {__first1 + __offset, __first2 + __offset}; @@ -107,8 +107,8 @@ __mismatch_vectorized(_Iter __first1, _Iter __last1, _Iter __first2) { if (static_cast(__first1 - __orig_first1) >= __vec_size) { __first1 = __last1 - __vec_size; __first2 = __last2 - __vec_size; - auto __offset = - std::__find_first_not_set(std::__load_vector<__vec>(__first1) == std::__load_vector<__vec>(__first2)); + auto __offset = std::__find_first_not_set( + std::__as_mask(std::__load_vector<__vec>(__first1) == std::__load_vector<__vec>(__first2))); return {__first1 + __offset, __first2 + __offset}; } // else loop over the elements individually } diff --git a/libcxx/include/__algorithm/simd_utils.h b/libcxx/include/__algorithm/simd_utils.h index 4e3e4f2b9404e..3ca79247bbd03 100644 --- a/libcxx/include/__algorithm/simd_utils.h +++ b/libcxx/include/__algorithm/simd_utils.h @@ -116,42 +116,65 @@ template }(make_index_sequence<__simd_vector_size_v<_VecT>>{}); } -template -[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool __all_of(__simd_vector<_Tp, _Np> __vec) noexcept { - return __builtin_reduce_and(__builtin_convertvector(__vec, __simd_vector)); +template +[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool __all_of(__simd_vector __vec) noexcept { + return __builtin_reduce_and(__vec); } template -[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t __find_first_set(__simd_vector<_Tp, _Np> __vec) noexcept { - using __mask_vec = __simd_vector; +[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI auto __as_mask(__simd_vector<_Tp, _Np> __vec) noexcept { + static_assert(!is_same<_Tp, bool>::value, "vector type should not be a bool!"); + return __builtin_convertvector(__vec, __simd_vector); +} - // This has MSan disabled du to https://github.com/llvm/llvm-project/issues/85876 - auto __impl = [&](_MaskT) _LIBCPP_NO_SANITIZE("memory") noexcept { -# if defined(_LIBCPP_BIG_ENDIAN) - return std::min( - _Np, std::__countl_zero(__builtin_bit_cast(_MaskT, __builtin_convertvector(__vec, __mask_vec)))); -# else - return std::min( - _Np, std::__countr_zero(__builtin_bit_cast(_MaskT, __builtin_convertvector(__vec, __mask_vec)))); -# endif - }; - - if constexpr (sizeof(__mask_vec) == sizeof(uint8_t)) { - return __impl(uint8_t{}); - } else if constexpr (sizeof(__mask_vec) == sizeof(uint16_t)) { - return __impl(uint16_t{}); - } else if constexpr (sizeof(__mask_vec) == sizeof(uint32_t)) { - return __impl(uint32_t{}); - } else if constexpr (sizeof(__mask_vec) == sizeof(uint64_t)) { - return __impl(uint64_t{}); +// This uses __builtin_convertvector around the __builtin_shufflevector to work around #107981. +template +[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI __simd_vector +__extend_vector(__simd_vector __vec) noexcept { + using _VecT = __simd_vector; + if constexpr (_Np == 4) { + return __builtin_convertvector( + __builtin_shufflevector(__vec, _VecT{}, 0, 1, 2, 3, 4, 5, 6, 7), __simd_vector); + } else if constexpr (_Np == 2) { + return std::__extend_vector( + __builtin_convertvector(__builtin_shufflevector(__vec, _VecT{}, 0, 1, 2, 3), __simd_vector)); + } else if constexpr (_Np == 1) { + return std::__extend_vector( + __builtin_convertvector(__builtin_shufflevector(__vec, _VecT{}, 0, 1), __simd_vector)); } else { - static_assert(sizeof(__mask_vec) == 0, "unexpected required size for mask integer type"); + static_assert(sizeof(_VecT) == 0, "Unexpected vector size"); + } +} + +template +[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI auto __to_int_mask(__simd_vector __vec) { + if constexpr (_Np < 8) { + return std::__bit_cast(std::__extend_vector(__vec)); + } else if constexpr (_Np == 8) { + return std::__bit_cast(__vec); + } else if constexpr (_Np == 16) { + return std::__bit_cast(__vec); + } else if constexpr (_Np == 32) { + return std::__bit_cast(__vec); + } else if constexpr (_Np == 64) { + return std::__bit_cast(__vec); + } else { + static_assert(sizeof(__simd_vector) == 0, "Unexpected vector size"); return 0; } } -template -[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t __find_first_not_set(__simd_vector<_Tp, _Np> __vec) noexcept { +template +[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t __find_first_set(__simd_vector __vec) noexcept { +# if defined(_LIBCPP_BIG_ENDIAN) + return std::min(_Np, std::__countl_zero(std::__to_int_mask(__vec))); +# else + return std::min(_Np, std::__countr_zero(std::__to_int_mask(__vec))); +# endif +} + +template +[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t __find_first_not_set(__simd_vector __vec) noexcept { return std::__find_first_set(~__vec); } diff --git a/libcxx/include/__config b/libcxx/include/__config index fe01b58b8e627..ace6e1cd73e3e 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -1170,11 +1170,7 @@ typedef __char32_t char32_t; # define _LIBCPP_NOESCAPE # endif -# if __has_attribute(__nodebug__) -# define _LIBCPP_NODEBUG __attribute__((__nodebug__)) -# else -# define _LIBCPP_NODEBUG -# endif +# define _LIBCPP_NODEBUG [[__gnu__::__nodebug__]] # if __has_attribute(__standalone_debug__) # define _LIBCPP_STANDALONE_DEBUG __attribute__((__standalone_debug__)) diff --git a/libcxx/include/__cxx03/CMakeLists.txt b/libcxx/include/__cxx03/CMakeLists.txt deleted file mode 100644 index b61442da89d4b..0000000000000 --- a/libcxx/include/__cxx03/CMakeLists.txt +++ /dev/null @@ -1,1092 +0,0 @@ -set(files - __algorithm/adjacent_find.h - __algorithm/all_of.h - __algorithm/any_of.h - __algorithm/binary_search.h - __algorithm/clamp.h - __algorithm/comp.h - __algorithm/comp_ref_type.h - __algorithm/copy.h - __algorithm/copy_backward.h - __algorithm/copy_if.h - __algorithm/copy_move_common.h - __algorithm/copy_n.h - __algorithm/count.h - __algorithm/count_if.h - __algorithm/equal.h - __algorithm/equal_range.h - __algorithm/fill.h - __algorithm/fill_n.h - __algorithm/find.h - __algorithm/find_end.h - __algorithm/find_first_of.h - __algorithm/find_if.h - __algorithm/find_if_not.h - __algorithm/find_segment_if.h - __algorithm/fold.h - __algorithm/for_each.h - __algorithm/for_each_n.h - __algorithm/for_each_segment.h - __algorithm/generate.h - __algorithm/generate_n.h - __algorithm/half_positive.h - __algorithm/in_found_result.h - __algorithm/in_fun_result.h - __algorithm/in_in_out_result.h - __algorithm/in_in_result.h - __algorithm/in_out_out_result.h - __algorithm/in_out_result.h - __algorithm/includes.h - __algorithm/inplace_merge.h - __algorithm/is_heap.h - __algorithm/is_heap_until.h - __algorithm/is_partitioned.h - __algorithm/is_permutation.h - __algorithm/is_sorted.h - __algorithm/is_sorted_until.h - __algorithm/iter_swap.h - __algorithm/iterator_operations.h - __algorithm/lexicographical_compare.h - __algorithm/lexicographical_compare_three_way.h - __algorithm/lower_bound.h - __algorithm/make_heap.h - __algorithm/make_projected.h - __algorithm/max.h - __algorithm/max_element.h - __algorithm/merge.h - __algorithm/min.h - __algorithm/min_element.h - __algorithm/min_max_result.h - __algorithm/minmax.h - __algorithm/minmax_element.h - __algorithm/mismatch.h - __algorithm/move.h - __algorithm/move_backward.h - __algorithm/next_permutation.h - __algorithm/none_of.h - __algorithm/nth_element.h - __algorithm/partial_sort.h - __algorithm/partial_sort_copy.h - __algorithm/partition.h - __algorithm/partition_copy.h - __algorithm/partition_point.h - __algorithm/pop_heap.h - __algorithm/prev_permutation.h - __algorithm/pstl.h - __algorithm/push_heap.h - __algorithm/ranges_adjacent_find.h - __algorithm/ranges_all_of.h - __algorithm/ranges_any_of.h - __algorithm/ranges_binary_search.h - __algorithm/ranges_clamp.h - __algorithm/ranges_contains.h - __algorithm/ranges_contains_subrange.h - __algorithm/ranges_copy.h - __algorithm/ranges_copy_backward.h - __algorithm/ranges_copy_if.h - __algorithm/ranges_copy_n.h - __algorithm/ranges_count.h - __algorithm/ranges_count_if.h - __algorithm/ranges_ends_with.h - __algorithm/ranges_equal.h - __algorithm/ranges_equal_range.h - __algorithm/ranges_fill.h - __algorithm/ranges_fill_n.h - __algorithm/ranges_find.h - __algorithm/ranges_find_end.h - __algorithm/ranges_find_first_of.h - __algorithm/ranges_find_if.h - __algorithm/ranges_find_if_not.h - __algorithm/ranges_find_last.h - __algorithm/ranges_for_each.h - __algorithm/ranges_for_each_n.h - __algorithm/ranges_generate.h - __algorithm/ranges_generate_n.h - __algorithm/ranges_includes.h - __algorithm/ranges_inplace_merge.h - __algorithm/ranges_is_heap.h - __algorithm/ranges_is_heap_until.h - __algorithm/ranges_is_partitioned.h - __algorithm/ranges_is_permutation.h - __algorithm/ranges_is_sorted.h - __algorithm/ranges_is_sorted_until.h - __algorithm/ranges_iterator_concept.h - __algorithm/ranges_lexicographical_compare.h - __algorithm/ranges_lower_bound.h - __algorithm/ranges_make_heap.h - __algorithm/ranges_max.h - __algorithm/ranges_max_element.h - __algorithm/ranges_merge.h - __algorithm/ranges_min.h - __algorithm/ranges_min_element.h - __algorithm/ranges_minmax.h - __algorithm/ranges_minmax_element.h - __algorithm/ranges_mismatch.h - __algorithm/ranges_move.h - __algorithm/ranges_move_backward.h - __algorithm/ranges_next_permutation.h - __algorithm/ranges_none_of.h - __algorithm/ranges_nth_element.h - __algorithm/ranges_partial_sort.h - __algorithm/ranges_partial_sort_copy.h - __algorithm/ranges_partition.h - __algorithm/ranges_partition_copy.h - __algorithm/ranges_partition_point.h - __algorithm/ranges_pop_heap.h - __algorithm/ranges_prev_permutation.h - __algorithm/ranges_push_heap.h - __algorithm/ranges_remove.h - __algorithm/ranges_remove_copy.h - __algorithm/ranges_remove_copy_if.h - __algorithm/ranges_remove_if.h - __algorithm/ranges_replace.h - __algorithm/ranges_replace_copy.h - __algorithm/ranges_replace_copy_if.h - __algorithm/ranges_replace_if.h - __algorithm/ranges_reverse.h - __algorithm/ranges_reverse_copy.h - __algorithm/ranges_rotate.h - __algorithm/ranges_rotate_copy.h - __algorithm/ranges_sample.h - __algorithm/ranges_search.h - __algorithm/ranges_search_n.h - __algorithm/ranges_set_difference.h - __algorithm/ranges_set_intersection.h - __algorithm/ranges_set_symmetric_difference.h - __algorithm/ranges_set_union.h - __algorithm/ranges_shuffle.h - __algorithm/ranges_sort.h - __algorithm/ranges_sort_heap.h - __algorithm/ranges_stable_partition.h - __algorithm/ranges_stable_sort.h - __algorithm/ranges_starts_with.h - __algorithm/ranges_swap_ranges.h - __algorithm/ranges_transform.h - __algorithm/ranges_unique.h - __algorithm/ranges_unique_copy.h - __algorithm/ranges_upper_bound.h - __algorithm/remove.h - __algorithm/remove_copy.h - __algorithm/remove_copy_if.h - __algorithm/remove_if.h - __algorithm/replace.h - __algorithm/replace_copy.h - __algorithm/replace_copy_if.h - __algorithm/replace_if.h - __algorithm/reverse.h - __algorithm/reverse_copy.h - __algorithm/rotate.h - __algorithm/rotate_copy.h - __algorithm/sample.h - __algorithm/search.h - __algorithm/search_n.h - __algorithm/set_difference.h - __algorithm/set_intersection.h - __algorithm/set_symmetric_difference.h - __algorithm/set_union.h - __algorithm/shift_left.h - __algorithm/shift_right.h - __algorithm/shuffle.h - __algorithm/sift_down.h - __algorithm/simd_utils.h - __algorithm/sort.h - __algorithm/sort_heap.h - __algorithm/stable_partition.h - __algorithm/stable_sort.h - __algorithm/swap_ranges.h - __algorithm/three_way_comp_ref_type.h - __algorithm/transform.h - __algorithm/uniform_random_bit_generator_adaptor.h - __algorithm/unique.h - __algorithm/unique_copy.h - __algorithm/unwrap_iter.h - __algorithm/unwrap_range.h - __algorithm/upper_bound.h - __assert - __atomic/aliases.h - __atomic/atomic.h - __atomic/atomic_base.h - __atomic/atomic_flag.h - __atomic/atomic_init.h - __atomic/atomic_lock_free.h - __atomic/atomic_ref.h - __atomic/atomic_sync.h - __atomic/check_memory_order.h - __atomic/contention_t.h - __atomic/cxx_atomic_impl.h - __atomic/fence.h - __atomic/is_always_lock_free.h - __atomic/kill_dependency.h - __atomic/memory_order.h - __atomic/to_gcc_order.h - __bit/bit_cast.h - __bit/bit_ceil.h - __bit/bit_floor.h - __bit/bit_log2.h - __bit/bit_width.h - __bit/blsr.h - __bit/byteswap.h - __bit/countl.h - __bit/countr.h - __bit/endian.h - __bit/has_single_bit.h - __bit/invert_if.h - __bit/popcount.h - __bit/rotate.h - __bit_reference - __charconv/chars_format.h - __charconv/from_chars_integral.h - __charconv/from_chars_result.h - __charconv/tables.h - __charconv/to_chars.h - __charconv/to_chars_base_10.h - __charconv/to_chars_floating_point.h - __charconv/to_chars_integral.h - __charconv/to_chars_result.h - __charconv/traits.h - __chrono/calendar.h - __chrono/concepts.h - __chrono/convert_to_timespec.h - __chrono/convert_to_tm.h - __chrono/day.h - __chrono/duration.h - __chrono/exception.h - __chrono/file_clock.h - __chrono/formatter.h - __chrono/hh_mm_ss.h - __chrono/high_resolution_clock.h - __chrono/leap_second.h - __chrono/literals.h - __chrono/local_info.h - __chrono/month.h - __chrono/month_weekday.h - __chrono/monthday.h - __chrono/ostream.h - __chrono/parser_std_format_spec.h - __chrono/statically_widen.h - __chrono/steady_clock.h - __chrono/sys_info.h - __chrono/system_clock.h - __chrono/time_point.h - __chrono/time_zone.h - __chrono/time_zone_link.h - __chrono/tzdb.h - __chrono/tzdb_list.h - __chrono/weekday.h - __chrono/year.h - __chrono/year_month.h - __chrono/year_month_day.h - __chrono/year_month_weekday.h - __chrono/zoned_time.h - __compare/common_comparison_category.h - __compare/compare_partial_order_fallback.h - __compare/compare_strong_order_fallback.h - __compare/compare_three_way.h - __compare/compare_three_way_result.h - __compare/compare_weak_order_fallback.h - __compare/is_eq.h - __compare/ordering.h - __compare/partial_order.h - __compare/strong_order.h - __compare/synth_three_way.h - __compare/three_way_comparable.h - __compare/weak_order.h - __concepts/arithmetic.h - __concepts/assignable.h - __concepts/boolean_testable.h - __concepts/class_or_enum.h - __concepts/common_reference_with.h - __concepts/common_with.h - __concepts/constructible.h - __concepts/convertible_to.h - __concepts/copyable.h - __concepts/derived_from.h - __concepts/destructible.h - __concepts/different_from.h - __concepts/equality_comparable.h - __concepts/invocable.h - __concepts/movable.h - __concepts/predicate.h - __concepts/regular.h - __concepts/relation.h - __concepts/same_as.h - __concepts/semiregular.h - __concepts/swappable.h - __concepts/totally_ordered.h - __condition_variable/condition_variable.h - __config - __configuration/abi.h - __configuration/availability.h - __configuration/compiler.h - __configuration/language.h - __configuration/platform.h - __coroutine/coroutine_handle.h - __coroutine/coroutine_traits.h - __coroutine/noop_coroutine_handle.h - __coroutine/trivial_awaitables.h - __debug_utils/randomize_range.h - __debug_utils/sanitizers.h - __debug_utils/strict_weak_ordering_check.h - __exception/exception.h - __exception/exception_ptr.h - __exception/nested_exception.h - __exception/operations.h - __exception/terminate.h - __expected/bad_expected_access.h - __expected/expected.h - __expected/unexpect.h - __expected/unexpected.h - __filesystem/copy_options.h - __filesystem/directory_entry.h - __filesystem/directory_iterator.h - __filesystem/directory_options.h - __filesystem/file_status.h - __filesystem/file_time_type.h - __filesystem/file_type.h - __filesystem/filesystem_error.h - __filesystem/operations.h - __filesystem/path.h - __filesystem/path_iterator.h - __filesystem/perm_options.h - __filesystem/perms.h - __filesystem/recursive_directory_iterator.h - __filesystem/space_info.h - __filesystem/u8path.h - __format/buffer.h - __format/concepts.h - __format/container_adaptor.h - __format/enable_insertable.h - __format/escaped_output_table.h - __format/extended_grapheme_cluster_table.h - __format/format_arg.h - __format/format_arg_store.h - __format/format_args.h - __format/format_context.h - __format/format_error.h - __format/format_functions.h - __format/format_parse_context.h - __format/format_string.h - __format/format_to_n_result.h - __format/formatter.h - __format/formatter_bool.h - __format/formatter_char.h - __format/formatter_floating_point.h - __format/formatter_integer.h - __format/formatter_integral.h - __format/formatter_output.h - __format/formatter_pointer.h - __format/formatter_string.h - __format/formatter_tuple.h - __format/indic_conjunct_break_table.h - __format/parser_std_format_spec.h - __format/range_default_formatter.h - __format/range_formatter.h - __format/unicode.h - __format/width_estimation_table.h - __format/write_escaped.h - __functional/binary_function.h - __functional/binary_negate.h - __functional/bind.h - __functional/bind_back.h - __functional/bind_front.h - __functional/binder1st.h - __functional/binder2nd.h - __functional/boyer_moore_searcher.h - __functional/compose.h - __functional/default_searcher.h - __functional/function.h - __functional/hash.h - __functional/identity.h - __functional/invoke.h - __functional/is_transparent.h - __functional/mem_fn.h - __functional/mem_fun_ref.h - __functional/not_fn.h - __functional/operations.h - __functional/perfect_forward.h - __functional/pointer_to_binary_function.h - __functional/pointer_to_unary_function.h - __functional/ranges_operations.h - __functional/reference_wrapper.h - __functional/unary_function.h - __functional/unary_negate.h - __functional/weak_result_type.h - __fwd/array.h - __fwd/bit_reference.h - __fwd/complex.h - __fwd/deque.h - __fwd/format.h - __fwd/fstream.h - __fwd/functional.h - __fwd/ios.h - __fwd/istream.h - __fwd/mdspan.h - __fwd/memory.h - __fwd/memory_resource.h - __fwd/ostream.h - __fwd/pair.h - __fwd/queue.h - __fwd/span.h - __fwd/sstream.h - __fwd/stack.h - __fwd/streambuf.h - __fwd/string.h - __fwd/string_view.h - __fwd/subrange.h - __fwd/tuple.h - __fwd/vector.h - __hash_table - __ios/fpos.h - __iterator/access.h - __iterator/advance.h - __iterator/aliasing_iterator.h - __iterator/back_insert_iterator.h - __iterator/bounded_iter.h - __iterator/common_iterator.h - __iterator/concepts.h - __iterator/counted_iterator.h - __iterator/cpp17_iterator_concepts.h - __iterator/data.h - __iterator/default_sentinel.h - __iterator/distance.h - __iterator/empty.h - __iterator/erase_if_container.h - __iterator/front_insert_iterator.h - __iterator/incrementable_traits.h - __iterator/indirectly_comparable.h - __iterator/insert_iterator.h - __iterator/istream_iterator.h - __iterator/istreambuf_iterator.h - __iterator/iter_move.h - __iterator/iter_swap.h - __iterator/iterator.h - __iterator/iterator_traits.h - __iterator/iterator_with_data.h - __iterator/mergeable.h - __iterator/move_iterator.h - __iterator/move_sentinel.h - __iterator/next.h - __iterator/ostream_iterator.h - __iterator/ostreambuf_iterator.h - __iterator/permutable.h - __iterator/prev.h - __iterator/projected.h - __iterator/ranges_iterator_traits.h - __iterator/readable_traits.h - __iterator/reverse_access.h - __iterator/reverse_iterator.h - __iterator/segmented_iterator.h - __iterator/size.h - __iterator/sortable.h - __iterator/unreachable_sentinel.h - __iterator/wrap_iter.h - __locale - __locale_dir/locale_base_api.h - __locale_dir/locale_base_api/android.h - __locale_dir/locale_base_api/bsd_locale_defaults.h - __locale_dir/locale_base_api/bsd_locale_fallbacks.h - __locale_dir/locale_base_api/fuchsia.h - __locale_dir/locale_base_api/ibm.h - __locale_dir/locale_base_api/locale_guard.h - __locale_dir/locale_base_api/musl.h - __locale_dir/locale_base_api/newlib.h - __locale_dir/locale_base_api/openbsd.h - __locale_dir/locale_base_api/win32.h - __math/abs.h - __math/copysign.h - __math/error_functions.h - __math/exponential_functions.h - __math/fdim.h - __math/fma.h - __math/gamma.h - __math/hyperbolic_functions.h - __math/hypot.h - __math/inverse_hyperbolic_functions.h - __math/inverse_trigonometric_functions.h - __math/logarithms.h - __math/min_max.h - __math/modulo.h - __math/remainder.h - __math/roots.h - __math/rounding_functions.h - __math/special_functions.h - __math/traits.h - __math/trigonometric_functions.h - __mbstate_t.h - __mdspan/default_accessor.h - __mdspan/extents.h - __mdspan/layout_left.h - __mdspan/layout_right.h - __mdspan/layout_stride.h - __mdspan/mdspan.h - __memory/addressof.h - __memory/align.h - __memory/aligned_alloc.h - __memory/allocate_at_least.h - __memory/allocation_guard.h - __memory/allocator.h - __memory/allocator_arg_t.h - __memory/allocator_destructor.h - __memory/allocator_traits.h - __memory/assume_aligned.h - __memory/auto_ptr.h - __memory/builtin_new_allocator.h - __memory/compressed_pair.h - __memory/concepts.h - __memory/construct_at.h - __memory/destruct_n.h - __memory/inout_ptr.h - __memory/out_ptr.h - __memory/pointer_traits.h - __memory/ranges_construct_at.h - __memory/ranges_uninitialized_algorithms.h - __memory/raw_storage_iterator.h - __memory/shared_ptr.h - __memory/swap_allocator.h - __memory/temp_value.h - __memory/temporary_buffer.h - __memory/uninitialized_algorithms.h - __memory/unique_ptr.h - __memory/uses_allocator.h - __memory/uses_allocator_construction.h - __memory/voidify.h - __memory_resource/memory_resource.h - __memory_resource/monotonic_buffer_resource.h - __memory_resource/polymorphic_allocator.h - __memory_resource/pool_options.h - __memory_resource/synchronized_pool_resource.h - __memory_resource/unsynchronized_pool_resource.h - __mutex/lock_guard.h - __mutex/mutex.h - __mutex/once_flag.h - __mutex/tag_types.h - __mutex/unique_lock.h - __node_handle - __numeric/accumulate.h - __numeric/adjacent_difference.h - __numeric/exclusive_scan.h - __numeric/gcd_lcm.h - __numeric/inclusive_scan.h - __numeric/inner_product.h - __numeric/iota.h - __numeric/midpoint.h - __numeric/partial_sum.h - __numeric/pstl.h - __numeric/reduce.h - __numeric/saturation_arithmetic.h - __numeric/transform_exclusive_scan.h - __numeric/transform_inclusive_scan.h - __numeric/transform_reduce.h - __ostream/basic_ostream.h - __ostream/print.h - __pstl/backend.h - __pstl/backend_fwd.h - __pstl/backends/default.h - __pstl/backends/libdispatch.h - __pstl/backends/serial.h - __pstl/backends/std_thread.h - __pstl/cpu_algos/any_of.h - __pstl/cpu_algos/cpu_traits.h - __pstl/cpu_algos/fill.h - __pstl/cpu_algos/find_if.h - __pstl/cpu_algos/for_each.h - __pstl/cpu_algos/merge.h - __pstl/cpu_algos/stable_sort.h - __pstl/cpu_algos/transform.h - __pstl/cpu_algos/transform_reduce.h - __pstl/dispatch.h - __pstl/handle_exception.h - __random/bernoulli_distribution.h - __random/binomial_distribution.h - __random/cauchy_distribution.h - __random/chi_squared_distribution.h - __random/clamp_to_integral.h - __random/default_random_engine.h - __random/discard_block_engine.h - __random/discrete_distribution.h - __random/exponential_distribution.h - __random/extreme_value_distribution.h - __random/fisher_f_distribution.h - __random/gamma_distribution.h - __random/generate_canonical.h - __random/geometric_distribution.h - __random/independent_bits_engine.h - __random/is_seed_sequence.h - __random/is_valid.h - __random/knuth_b.h - __random/linear_congruential_engine.h - __random/log2.h - __random/lognormal_distribution.h - __random/mersenne_twister_engine.h - __random/negative_binomial_distribution.h - __random/normal_distribution.h - __random/piecewise_constant_distribution.h - __random/piecewise_linear_distribution.h - __random/poisson_distribution.h - __random/random_device.h - __random/ranlux.h - __random/seed_seq.h - __random/shuffle_order_engine.h - __random/student_t_distribution.h - __random/subtract_with_carry_engine.h - __random/uniform_int_distribution.h - __random/uniform_random_bit_generator.h - __random/uniform_real_distribution.h - __random/weibull_distribution.h - __ranges/access.h - __ranges/all.h - __ranges/as_rvalue_view.h - __ranges/chunk_by_view.h - __ranges/common_view.h - __ranges/concepts.h - __ranges/container_compatible_range.h - __ranges/counted.h - __ranges/dangling.h - __ranges/data.h - __ranges/drop_view.h - __ranges/drop_while_view.h - __ranges/elements_view.h - __ranges/empty.h - __ranges/empty_view.h - __ranges/enable_borrowed_range.h - __ranges/enable_view.h - __ranges/filter_view.h - __ranges/from_range.h - __ranges/iota_view.h - __ranges/istream_view.h - __ranges/join_view.h - __ranges/lazy_split_view.h - __ranges/movable_box.h - __ranges/non_propagating_cache.h - __ranges/owning_view.h - __ranges/range_adaptor.h - __ranges/rbegin.h - __ranges/ref_view.h - __ranges/rend.h - __ranges/repeat_view.h - __ranges/reverse_view.h - __ranges/single_view.h - __ranges/size.h - __ranges/split_view.h - __ranges/subrange.h - __ranges/take_view.h - __ranges/take_while_view.h - __ranges/to.h - __ranges/transform_view.h - __ranges/view_interface.h - __ranges/views.h - __ranges/zip_view.h - __split_buffer - __std_clang_module - __std_mbstate_t.h - __stop_token/atomic_unique_lock.h - __stop_token/intrusive_list_view.h - __stop_token/intrusive_shared_ptr.h - __stop_token/stop_callback.h - __stop_token/stop_source.h - __stop_token/stop_state.h - __stop_token/stop_token.h - __string/char_traits.h - __string/constexpr_c_functions.h - __string/extern_template_lists.h - __support/ibm/gettod_zos.h - __support/ibm/locale_mgmt_zos.h - __support/ibm/nanosleep.h - __support/xlocale/__nop_locale_mgmt.h - __support/xlocale/__posix_l_fallback.h - __support/xlocale/__strtonum_fallback.h - __system_error/errc.h - __system_error/error_category.h - __system_error/error_code.h - __system_error/error_condition.h - __system_error/system_error.h - __thread/formatter.h - __thread/id.h - __thread/jthread.h - __thread/poll_with_backoff.h - __thread/support.h - __thread/support/c11.h - __thread/support/external.h - __thread/support/pthread.h - __thread/support/windows.h - __thread/this_thread.h - __thread/thread.h - __thread/timed_backoff_policy.h - __tree - __tuple/find_index.h - __tuple/ignore.h - __tuple/make_tuple_types.h - __tuple/sfinae_helpers.h - __tuple/tuple_element.h - __tuple/tuple_indices.h - __tuple/tuple_like.h - __tuple/tuple_like_ext.h - __tuple/tuple_like_no_subrange.h - __tuple/tuple_size.h - __tuple/tuple_types.h - __type_traits/add_const.h - __type_traits/add_cv.h - __type_traits/add_lvalue_reference.h - __type_traits/add_pointer.h - __type_traits/add_rvalue_reference.h - __type_traits/add_volatile.h - __type_traits/aligned_storage.h - __type_traits/aligned_union.h - __type_traits/alignment_of.h - __type_traits/can_extract_key.h - __type_traits/common_reference.h - __type_traits/common_type.h - __type_traits/conditional.h - __type_traits/conjunction.h - __type_traits/copy_cv.h - __type_traits/copy_cvref.h - __type_traits/datasizeof.h - __type_traits/decay.h - __type_traits/dependent_type.h - __type_traits/desugars_to.h - __type_traits/disjunction.h - __type_traits/enable_if.h - __type_traits/extent.h - __type_traits/has_unique_object_representation.h - __type_traits/has_virtual_destructor.h - __type_traits/integral_constant.h - __type_traits/invoke.h - __type_traits/is_abstract.h - __type_traits/is_aggregate.h - __type_traits/is_allocator.h - __type_traits/is_always_bitcastable.h - __type_traits/is_arithmetic.h - __type_traits/is_array.h - __type_traits/is_assignable.h - __type_traits/is_base_of.h - __type_traits/is_bounded_array.h - __type_traits/is_callable.h - __type_traits/is_char_like_type.h - __type_traits/is_class.h - __type_traits/is_compound.h - __type_traits/is_const.h - __type_traits/is_constant_evaluated.h - __type_traits/is_constructible.h - __type_traits/is_convertible.h - __type_traits/is_core_convertible.h - __type_traits/is_destructible.h - __type_traits/is_empty.h - __type_traits/is_enum.h - __type_traits/is_equality_comparable.h - __type_traits/is_execution_policy.h - __type_traits/is_final.h - __type_traits/is_floating_point.h - __type_traits/is_function.h - __type_traits/is_fundamental.h - __type_traits/is_implicitly_default_constructible.h - __type_traits/is_integral.h - __type_traits/is_literal_type.h - __type_traits/is_member_pointer.h - __type_traits/is_nothrow_assignable.h - __type_traits/is_nothrow_constructible.h - __type_traits/is_nothrow_convertible.h - __type_traits/is_nothrow_destructible.h - __type_traits/is_null_pointer.h - __type_traits/is_object.h - __type_traits/is_pod.h - __type_traits/is_pointer.h - __type_traits/is_polymorphic.h - __type_traits/is_primary_template.h - __type_traits/is_reference.h - __type_traits/is_reference_wrapper.h - __type_traits/is_referenceable.h - __type_traits/is_same.h - __type_traits/is_scalar.h - __type_traits/is_signed.h - __type_traits/is_signed_integer.h - __type_traits/is_specialization.h - __type_traits/is_standard_layout.h - __type_traits/is_swappable.h - __type_traits/is_trivial.h - __type_traits/is_trivially_assignable.h - __type_traits/is_trivially_constructible.h - __type_traits/is_trivially_copyable.h - __type_traits/is_trivially_destructible.h - __type_traits/is_trivially_lexicographically_comparable.h - __type_traits/is_trivially_relocatable.h - __type_traits/is_unbounded_array.h - __type_traits/is_union.h - __type_traits/is_unsigned.h - __type_traits/is_unsigned_integer.h - __type_traits/is_valid_expansion.h - __type_traits/is_void.h - __type_traits/is_volatile.h - __type_traits/lazy.h - __type_traits/make_32_64_or_128_bit.h - __type_traits/make_const_lvalue_ref.h - __type_traits/make_signed.h - __type_traits/make_unsigned.h - __type_traits/maybe_const.h - __type_traits/nat.h - __type_traits/negation.h - __type_traits/noexcept_move_assign_container.h - __type_traits/promote.h - __type_traits/rank.h - __type_traits/remove_all_extents.h - __type_traits/remove_const.h - __type_traits/remove_const_ref.h - __type_traits/remove_cv.h - __type_traits/remove_cvref.h - __type_traits/remove_extent.h - __type_traits/remove_pointer.h - __type_traits/remove_reference.h - __type_traits/remove_volatile.h - __type_traits/result_of.h - __type_traits/strip_signature.h - __type_traits/type_identity.h - __type_traits/type_list.h - __type_traits/underlying_type.h - __type_traits/unwrap_ref.h - __type_traits/void_t.h - __undef_macros - __utility/as_const.h - __utility/as_lvalue.h - __utility/auto_cast.h - __utility/cmp.h - __utility/convert_to_integral.h - __utility/declval.h - __utility/empty.h - __utility/exception_guard.h - __utility/exchange.h - __utility/forward.h - __utility/forward_like.h - __utility/in_place.h - __utility/integer_sequence.h - __utility/is_pointer_in_range.h - __utility/is_valid_range.h - __utility/move.h - __utility/no_destroy.h - __utility/pair.h - __utility/piecewise_construct.h - __utility/priority_tag.h - __utility/private_constructor_tag.h - __utility/rel_ops.h - __utility/small_buffer.h - __utility/swap.h - __utility/to_underlying.h - __utility/unreachable.h - __variant/monostate.h - __verbose_abort - algorithm - any - array - atomic - barrier - bit - bitset - cassert - ccomplex - cctype - cerrno - cfenv - cfloat - charconv - chrono - cinttypes - ciso646 - climits - clocale - cmath - codecvt - compare - complex - complex.h - concepts - condition_variable - coroutine - csetjmp - csignal - cstdarg - cstdbool - cstddef - cstdint - cstdio - cstdlib - cstring - ctgmath - ctime - ctype.h - cuchar - cwchar - cwctype - deque - errno.h - exception - execution - expected - experimental/__config - experimental/__simd/aligned_tag.h - experimental/__simd/declaration.h - experimental/__simd/reference.h - experimental/__simd/scalar.h - experimental/__simd/simd.h - experimental/__simd/simd_mask.h - experimental/__simd/traits.h - experimental/__simd/utility.h - experimental/__simd/vec_ext.h - experimental/iterator - experimental/memory - experimental/propagate_const - experimental/simd - experimental/type_traits - experimental/utility - ext/__hash - ext/hash_map - ext/hash_set - fenv.h - filesystem - float.h - format - forward_list - fstream - functional - future - initializer_list - inttypes.h - iomanip - ios - iosfwd - iostream - istream - iterator - latch - limits - list - locale - locale.h - map - math.h - mdspan - memory - memory_resource - module.modulemap - mutex - new - numbers - numeric - optional - ostream - print - queue - random - ranges - ratio - regex - scoped_allocator - semaphore - set - shared_mutex - source_location - span - sstream - stack - stdatomic.h - stdbool.h - stddef.h - stdexcept - stdint.h - stdio.h - stdlib.h - stop_token - streambuf - string - string.h - string_view - strstream - syncstream - system_error - tgmath.h - thread - tuple - type_traits - typeindex - typeinfo - uchar.h - unordered_map - unordered_set - utility - valarray - variant - vector - version - wchar.h - wctype.h - ) - -configure_file("__config_site.in" "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site" @ONLY) -configure_file("${LIBCXX_ASSERTION_HANDLER_FILE}" "${LIBCXX_GENERATED_INCLUDE_DIR}/__assertion_handler" COPYONLY) - -set(_all_includes "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site" - "${LIBCXX_GENERATED_INCLUDE_DIR}/__assertion_handler") -foreach(f ${files}) - set(src "${CMAKE_CURRENT_SOURCE_DIR}/${f}") - set(dst "${LIBCXX_GENERATED_INCLUDE_DIR}/${f}") - add_custom_command(OUTPUT ${dst} - DEPENDS ${src} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} - COMMENT "Copying CXX header ${f}") - list(APPEND _all_includes "${dst}") -endforeach() - -# Generate the IWYU mapping. This depends on all header files but it's also considered as an -# "include" for dependency tracking. -add_custom_command(OUTPUT "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp" - COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/generate_iwyu_mapping.py" "-o" "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp" - DEPENDS "${LIBCXX_SOURCE_DIR}/utils/libcxx/header_information.py" - COMMENT "Generate the mapping file for include-what-you-use" -) -list(APPEND _all_includes "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp") - -add_custom_target(generate-cxx-headers ALL DEPENDS ${_all_includes}) - -add_library(cxx-headers INTERFACE) -target_link_libraries(cxx-headers INTERFACE libcxx-libc-headers libcxx-abi-headers) -add_dependencies(cxx-headers generate-cxx-headers) -# It's important that the arch directory be included first so that its header files -# which interpose on the default include dir be included instead of the default ones. -target_include_directories(cxx-headers INTERFACE ${LIBCXX_GENERATED_INCLUDE_TARGET_DIR} - ${LIBCXX_GENERATED_INCLUDE_DIR}) - -if (LIBCXX_INSTALL_HEADERS) - foreach(file ${files}) - get_filename_component(dir ${file} DIRECTORY) - install(FILES ${file} - DESTINATION "${LIBCXX_INSTALL_INCLUDE_DIR}/${dir}" - COMPONENT cxx-headers - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - ) - endforeach() - - # Install the generated __config_site file to the per-target include dir. - install(FILES "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site" - DESTINATION "${LIBCXX_INSTALL_INCLUDE_TARGET_DIR}" - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - COMPONENT cxx-headers) - - # Install the generated __assertion_handler file to the generic include dir. - install(FILES "${LIBCXX_GENERATED_INCLUDE_DIR}/__assertion_handler" - DESTINATION "${LIBCXX_INSTALL_INCLUDE_DIR}" - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - COMPONENT cxx-headers) - - # Install the generated IWYU file to the generic include dir. - install(FILES "${LIBCXX_GENERATED_INCLUDE_DIR}/libcxx.imp" - DESTINATION "${LIBCXX_INSTALL_INCLUDE_DIR}" - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - COMPONENT cxx-headers) - - if (NOT CMAKE_CONFIGURATION_TYPES) - add_custom_target(install-cxx-headers - DEPENDS cxx-headers - COMMAND "${CMAKE_COMMAND}" - -DCMAKE_INSTALL_COMPONENT=cxx-headers - -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") - # Stripping is a no-op for headers - add_custom_target(install-cxx-headers-stripped DEPENDS install-cxx-headers) - endif() -endif() diff --git a/libcxx/include/__cxx03/__config b/libcxx/include/__cxx03/__config index 935fa4cc404f4..3e8f181664c97 100644 --- a/libcxx/include/__cxx03/__config +++ b/libcxx/include/__cxx03/__config @@ -10,10 +10,10 @@ #ifndef _LIBCPP___CXX03___CONFIG #define _LIBCPP___CXX03___CONFIG -#include <__config_site> #include <__cxx03/__configuration/abi.h> #include <__cxx03/__configuration/availability.h> #include <__cxx03/__configuration/compiler.h> +#include <__cxx03/__configuration/config_site_shim.h> #include <__cxx03/__configuration/platform.h> #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER diff --git a/libcxx/include/__cxx03/__configuration/abi.h b/libcxx/include/__cxx03/__configuration/abi.h index 9e7f7313c8834..740aec39a3487 100644 --- a/libcxx/include/__cxx03/__configuration/abi.h +++ b/libcxx/include/__cxx03/__configuration/abi.h @@ -10,8 +10,8 @@ #ifndef _LIBCPP___CXX03___CONFIGURATION_ABI_H #define _LIBCPP___CXX03___CONFIGURATION_ABI_H -#include <__config_site> #include <__cxx03/__configuration/compiler.h> +#include <__cxx03/__configuration/config_site_shim.h> #include <__cxx03/__configuration/platform.h> #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER diff --git a/libcxx/include/__cxx03/__configuration/compiler.h b/libcxx/include/__cxx03/__configuration/compiler.h index 2f33fb1f6ef4d..4d53a2144a501 100644 --- a/libcxx/include/__cxx03/__configuration/compiler.h +++ b/libcxx/include/__cxx03/__configuration/compiler.h @@ -10,7 +10,7 @@ #ifndef _LIBCPP___CXX03___CONFIGURATION_COMPILER_H #define _LIBCPP___CXX03___CONFIGURATION_COMPILER_H -#include <__config_site> +#include <__cxx03/__configuration/config_site_shim.h> #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER # pragma GCC system_header diff --git a/libcxx/include/__cxx03/__configuration/config_site_shim.h b/libcxx/include/__cxx03/__configuration/config_site_shim.h new file mode 100644 index 0000000000000..974a17af495cd --- /dev/null +++ b/libcxx/include/__cxx03/__configuration/config_site_shim.h @@ -0,0 +1,80 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CXX03___CONFIGURATION_CONFIG_SITE_SHIM_H +#define _LIBCPP___CXX03___CONFIGURATION_CONFIG_SITE_SHIM_H + +#include <__config_site> + +#if !_LIBCPP_ABI_FORCE_ITANIUM +# undef _LIBCPP_ABI_FORCE_ITANIUM +#endif + +#if !_LIBCPP_ABI_FORCE_MICROSOFT +# undef _LIBCPP_ABI_FORCE_MICROSOFT +#endif + +#if !_LIBCPP_HAS_THREADS +# define _LIBCPP_HAS_NO_THREADS +#endif + +#if !_LIBCPP_HAS_MONOTONIC_CLOCK +# define _LIBCPP_HAS_NO_MONOTONIC_CLOCK +#endif + +#if !_LIBCPP_HAS_MUSL_LIBC +# undef _LIBCPP_HAS_MUSL_LIBC +#endif + +#if !_LIBCPP_HAS_THREAD_API_PTHREAD +# undef _LIBCPP_HAS_THREAD_API_PTHREAD +#endif + +#if !_LIBCPP_HAS_THREAD_API_EXTERNAL +# undef _LIBCPP_HAS_THREAD_API_EXTERNAL +#endif + +#if !_LIBCPP_HAS_THREAD_API_WIN32 +# undef _LIBCPP_HAS_THREAD_API_WIN32 +#endif + +#undef _LIBCPP_HAS_THREAD_API_C11 + +#if !_LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS +# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS +#endif + +#if !_LIBCPP_HAS_FILESYSTEM +# define _LIBCPP_HAS_NO_FILESYSTEM +#endif + +#if !_LIBCPP_HAS_RANDOM_DEVICE +# define _LIBCPP_HAS_NO_RANDOM_DEVICE +#endif + +#if !_LIBCPP_HAS_LOCALIZATION +# define _LIBCPP_HAS_NO_LOCALIZATION +#endif + +#if !_LIBCPP_HAS_UNICODE +# define _LIBCPP_HAS_NO_UNICODE +#endif + +#if !_LIBCPP_HAS_WIDE_CHARACTERS +# define _LIBCPP_HAS_NO_WIDE_CHARACTERS +#endif + +#if !_LIBCPP_HAS_TIME_ZONE_DATABASE +# define _LIBCPP_HAS_NO_TIME_ZONE_DATABASE +#endif + +#if !_LIBCPP_INSTRUMENTED_WITH_ASAN +# undef _LIBCPP_INSTRUMENTED_WITH_ASAN +#endif + +#endif // _LIBCPP___CXX03___CONFIGURATION_CONFIG_SITE_SHIM_H diff --git a/libcxx/include/__cxx03/__configuration/language.h b/libcxx/include/__cxx03/__configuration/language.h index 604f2d2cd532a..8fd09f4b22554 100644 --- a/libcxx/include/__cxx03/__configuration/language.h +++ b/libcxx/include/__cxx03/__configuration/language.h @@ -10,7 +10,7 @@ #ifndef _LIBCPP___CXX03___CONFIGURATION_LANGUAGE_H #define _LIBCPP___CXX03___CONFIGURATION_LANGUAGE_H -#include <__config_site> +#include <__cxx03/__configuration/config_site_shim.h> #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER # pragma GCC system_header diff --git a/libcxx/include/__cxx03/__configuration/platform.h b/libcxx/include/__cxx03/__configuration/platform.h index b4718986ad10d..24590503693ae 100644 --- a/libcxx/include/__cxx03/__configuration/platform.h +++ b/libcxx/include/__cxx03/__configuration/platform.h @@ -10,7 +10,7 @@ #ifndef _LIBCPP___CXX03___CONFIGURATION_PLATFORM_H #define _LIBCPP___CXX03___CONFIGURATION_PLATFORM_H -#include <__config_site> +#include <__cxx03/__configuration/config_site_shim.h> #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER # pragma GCC system_header diff --git a/libcxx/include/__cxx03/__locale_dir/locale_base_api/bsd_locale_fallbacks.h b/libcxx/include/__cxx03/__locale_dir/locale_base_api/bsd_locale_fallbacks.h index e61e950a42c77..a73b724df6c19 100644 --- a/libcxx/include/__cxx03/__locale_dir/locale_base_api/bsd_locale_fallbacks.h +++ b/libcxx/include/__cxx03/__locale_dir/locale_base_api/bsd_locale_fallbacks.h @@ -15,8 +15,8 @@ #include <__cxx03/__locale_dir/locale_base_api/locale_guard.h> #include <__cxx03/cstdio> -#include <__cxx03/stdarg.h> #include <__cxx03/stdlib.h> +#include #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS # include <__cxx03/cwchar> diff --git a/libcxx/include/__cxx03/__thread/support/pthread.h b/libcxx/include/__cxx03/__thread/support/pthread.h index a4d7c874e6830..4dc7a4980de2b 100644 --- a/libcxx/include/__cxx03/__thread/support/pthread.h +++ b/libcxx/include/__cxx03/__thread/support/pthread.h @@ -15,8 +15,8 @@ #include <__cxx03/__config> #include <__cxx03/ctime> #include <__cxx03/errno.h> -#include <__cxx03/pthread.h> -#include <__cxx03/sched.h> +#include +#include #ifdef __MVS__ # include <__cxx03/__support/ibm/nanosleep.h> diff --git a/libcxx/include/__cxx03/climits b/libcxx/include/__cxx03/climits index 37d8c41a0c6de..2c6fe5ab95b4b 100644 --- a/libcxx/include/__cxx03/climits +++ b/libcxx/include/__cxx03/climits @@ -39,7 +39,7 @@ Macros: #include <__cxx03/__config> -#include <__cxx03/limits.h> +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header diff --git a/libcxx/include/__cxx03/locale b/libcxx/include/__cxx03/locale index 78c0fd7763af2..6360bbc2f6b60 100644 --- a/libcxx/include/__cxx03/locale +++ b/libcxx/include/__cxx03/locale @@ -222,7 +222,7 @@ template class messages_byname; // Most unix variants have catopen. These are the specific ones that don't. # if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__) # define _LIBCPP_HAS_CATOPEN 1 -# include <__cxx03/nl_types.h> +# include # endif # endif diff --git a/libcxx/include/__cxx03/module.modulemap b/libcxx/include/__cxx03/module.modulemap index 13d0dce34d97e..34a2d0f25fc45 100644 --- a/libcxx/include/__cxx03/module.modulemap +++ b/libcxx/include/__cxx03/module.modulemap @@ -1,462 +1,462 @@ // Main C++ standard library interfaces -module std_algorithm [system] { +module cxx03_std_algorithm [system] { header "algorithm" export * } -module std_any [system] { +module cxx03_std_any [system] { header "any" export * } -module std_array [system] { +module cxx03_std_array [system] { header "array" export * } -module std_atomic [system] { +module cxx03_std_atomic [system] { header "atomic" export * } -module std_barrier [system] { +module cxx03_std_barrier [system] { header "barrier" export * } -module std_bit [system] { +module cxx03_std_bit [system] { header "bit" export * } -module std_bitset [system] { +module cxx03_std_bitset [system] { header "bitset" export * } -module std_charconv [system] { +module cxx03_std_charconv [system] { header "charconv" export * } -module std_chrono [system] { +module cxx03_std_chrono [system] { header "chrono" export * } -module std_codecvt [system] { +module cxx03_std_codecvt [system] { header "codecvt" export * } -module std_compare [system] { +module cxx03_std_compare [system] { header "compare" export * } -module std_complex [system] { +module cxx03_std_complex [system] { header "complex" export * } -module std_concepts [system] { +module cxx03_std_concepts [system] { header "concepts" export * } -module std_condition_variable [system] { +module cxx03_std_condition_variable [system] { header "condition_variable" export * } -module std_coroutine [system] { +module cxx03_std_coroutine [system] { header "coroutine" export * } -module std_deque [system] { +module cxx03_std_deque [system] { header "deque" export * } -module std_exception [system] { +module cxx03_std_exception [system] { header "exception" export * } -module std_execution [system] { +module cxx03_std_execution [system] { header "execution" export * } -module std_expected [system] { +module cxx03_std_expected [system] { header "expected" export * } -module std_filesystem [system] { +module cxx03_std_filesystem [system] { header "filesystem" export * } -module std_format [system] { +module cxx03_std_format [system] { header "format" export * } -module std_forward_list [system] { +module cxx03_std_forward_list [system] { header "forward_list" export * } -module std_fstream [system] { +module cxx03_std_fstream [system] { header "fstream" export * } -module std_functional [system] { +module cxx03_std_functional [system] { header "functional" export * } -module std_future [system] { +module cxx03_std_future [system] { header "future" export * } -module std_initializer_list [system] { +module cxx03_std_initializer_list [system] { header "initializer_list" export * } -module std_iomanip [system] { +module cxx03_std_iomanip [system] { header "iomanip" export * } -module std_ios [system] { +module cxx03_std_ios [system] { header "ios" export * } -module std_iosfwd [system] { +module cxx03_std_iosfwd [system] { header "iosfwd" export * } -module std_iostream [system] { +module cxx03_std_iostream [system] { header "iostream" export * } -module std_istream [system] { +module cxx03_std_istream [system] { header "istream" export * } -module std_iterator [system] { +module cxx03_std_iterator [system] { header "iterator" export * } -module std_latch [system] { +module cxx03_std_latch [system] { header "latch" export * } -module std_limits [system] { +module cxx03_std_limits [system] { header "limits" export * } -module std_list [system] { +module cxx03_std_list [system] { header "list" export * } -module std_locale [system] { +module cxx03_std_locale [system] { header "locale" export * } -module std_map [system] { +module cxx03_std_map [system] { header "map" export * } -module std_mdspan [system] { +module cxx03_std_mdspan [system] { header "mdspan" export * } -module std_memory [system] { +module cxx03_std_memory [system] { header "memory" export * } -module std_memory_resource [system] { +module cxx03_std_memory_resource [system] { header "memory_resource" export * } -module std_mutex [system] { +module cxx03_std_mutex [system] { header "mutex" export * } -module std_new [system] { +module cxx03_std_new [system] { header "new" export * } -module std_numbers [system] { +module cxx03_std_numbers [system] { header "numbers" export * } -module std_numeric [system] { +module cxx03_std_numeric [system] { header "numeric" export * } -module std_optional [system] { +module cxx03_std_optional [system] { header "optional" export * } -module std_ostream [system] { +module cxx03_std_ostream [system] { header "ostream" export * } -module std_print [system] { +module cxx03_std_print [system] { header "print" export * } -module std_queue [system] { +module cxx03_std_queue [system] { header "queue" export * } -module std_random [system] { +module cxx03_std_random [system] { header "random" export * } -module std_ranges [system] { +module cxx03_std_ranges [system] { header "ranges" export * } -module std_ratio [system] { +module cxx03_std_ratio [system] { header "ratio" export * } -module std_regex [system] { +module cxx03_std_regex [system] { header "regex" export * } -module std_scoped_allocator [system] { +module cxx03_std_scoped_allocator [system] { header "scoped_allocator" export * } -module std_semaphore [system] { +module cxx03_std_semaphore [system] { header "semaphore" export * } -module std_set [system] { +module cxx03_std_set [system] { header "set" export * } -module std_shared_mutex [system] { +module cxx03_std_shared_mutex [system] { header "shared_mutex" export std_version } -module std_source_location [system] { +module cxx03_std_source_location [system] { header "source_location" export * } -module std_span [system] { +module cxx03_std_span [system] { header "span" export std_private_ranges_enable_borrowed_range export std_version export std_private_span_span_fwd } -module std_sstream [system] { +module cxx03_std_sstream [system] { header "sstream" export * } -module std_stack [system] { +module cxx03_std_stack [system] { header "stack" export * } -module std_stdexcept [system] { +module cxx03_std_stdexcept [system] { header "stdexcept" export * } -module std_stop_token { +module cxx03_std_stop_token { header "stop_token" export * } -module std_streambuf [system] { +module cxx03_std_streambuf [system] { header "streambuf" export * } -module std_string [system] { +module cxx03_std_string [system] { header "string" export * } -module std_string_view [system] { +module cxx03_std_string_view [system] { header "string_view" export * } -module std_strstream [system] { +module cxx03_std_strstream [system] { header "strstream" export * } -module std_syncstream [system] { +module cxx03_std_syncstream [system] { header "syncstream" export * } -module std_system_error [system] { +module cxx03_std_system_error [system] { header "system_error" export * } -module std_thread [system] { +module cxx03_std_thread [system] { header "thread" export * } -module std_tuple [system] { +module cxx03_std_tuple [system] { header "tuple" export * } -module std_type_traits [system] { +module cxx03_std_type_traits [system] { header "type_traits" export * } -module std_typeindex [system] { +module cxx03_std_typeindex [system] { header "typeindex" export * } -module std_typeinfo [system] { +module cxx03_std_typeinfo [system] { header "typeinfo" export * } -module std_unordered_map [system] { +module cxx03_std_unordered_map [system] { header "unordered_map" export * } -module std_unordered_set [system] { +module cxx03_std_unordered_set [system] { header "unordered_set" export * } -module std_utility [system] { +module cxx03_std_utility [system] { header "utility" export * } -module std_valarray [system] { +module cxx03_std_valarray [system] { header "valarray" export * } -module std_variant [system] { +module cxx03_std_variant [system] { header "variant" export * } -module std_vector [system] { +module cxx03_std_vector [system] { header "vector" export * } -module std_version [system] { +module cxx03_std_version [system] { header "version" export * } // C standard library interface wrappers -module std_cassert [system] { +module cxx03_std_cassert [system] { // 's use of NDEBUG requires textual inclusion. textual header "cassert" } -module std_ccomplex [system] { +module cxx03_std_ccomplex [system] { header "ccomplex" export * } -module std_cctype [system] { +module cxx03_std_cctype [system] { header "cctype" export * } -module std_cerrno [system] { +module cxx03_std_cerrno [system] { header "cerrno" export * } -module std_cfenv [system] { +module cxx03_std_cfenv [system] { header "cfenv" export * } -module std_cfloat [system] { +module cxx03_std_cfloat [system] { header "cfloat" export * } -module std_cinttypes [system] { +module cxx03_std_cinttypes [system] { header "cinttypes" export * } -module std_ciso646 [system] { +module cxx03_std_ciso646 [system] { header "ciso646" export * } -module std_climits [system] { +module cxx03_std_climits [system] { header "climits" export * } -module std_clocale [system] { +module cxx03_std_clocale [system] { header "clocale" export * } -module std_cmath [system] { +module cxx03_std_cmath [system] { header "cmath" export * } -module std_csetjmp [system] { +module cxx03_std_csetjmp [system] { header "csetjmp" export * } -module std_csignal [system] { +module cxx03_std_csignal [system] { header "csignal" export * } // FIXME: is missing. -module std_cstdarg [system] { +module cxx03_std_cstdarg [system] { header "cstdarg" export * } -module std_cstdbool [system] { +module cxx03_std_cstdbool [system] { header "cstdbool" export * } -module std_cstddef [system] { +module cxx03_std_cstddef [system] { header "cstddef" export * } -module std_cstdint [system] { +module cxx03_std_cstdint [system] { header "cstdint" export * } -module std_cstdio [system] { +module cxx03_std_cstdio [system] { header "cstdio" export * } -module std_cstdlib [system] { +module cxx03_std_cstdlib [system] { header "cstdlib" export * } -module std_cstring [system] { +module cxx03_std_cstring [system] { header "cstring" export * } -module std_ctgmath [system] { +module cxx03_std_ctgmath [system] { header "ctgmath" export * } -module std_ctime [system] { +module cxx03_std_ctime [system] { header "ctime" export * } -module std_cuchar [system] { +module cxx03_std_cuchar [system] { header "cuchar" export * } -module std_cwchar [system] { +module cxx03_std_cwchar [system] { header "cwchar" export * } -module std_cwctype [system] { +module cxx03_std_cwctype [system] { header "cwctype" export * } // C standard library interfaces augmented/replaced in C++ // provided by C library. -module std_complex_h [system] { +module cxx03_std_complex_h [system] { header "complex.h" export * } -module std_ctype_h [system] { +module cxx03_std_ctype_h [system] { header "ctype.h" export * } -module std_errno_h [system] { +module cxx03_std_errno_h [system] { header "errno.h" export * } -module std_fenv_h [system] { +module cxx03_std_fenv_h [system] { header "fenv.h" export * } -module std_float_h [system] { +module cxx03_std_float_h [system] { header "float.h" export * } -module std_inttypes_h [system] { +module cxx03_std_inttypes_h [system] { header "inttypes.h" export * } // provided by compiler. -module std_locale_h [system] { +module cxx03_std_locale_h [system] { header "locale.h" export * } -module std_math_h [system] { +module cxx03_std_math_h [system] { header "math.h" export * } @@ -464,59 +464,59 @@ module std_math_h [system] { // provided by C library. // FIXME: is missing. // provided by compiler. -module std_stdatomic_h [system] { +module cxx03_std_stdatomic_h [system] { header "stdatomic.h" export * } -module std_stdbool_h [system] { +module cxx03_std_stdbool_h [system] { // 's __bool_true_false_are_defined macro requires textual inclusion. textual header "stdbool.h" export * } -module std_stddef_h [system] { +module cxx03_std_stddef_h [system] { // 's __need_* macros require textual inclusion. textual header "stddef.h" export * } -module std_stdint_h [system] { +module cxx03_std_stdint_h [system] { header "stdint.h" export * } -module std_stdio_h [system] { +module cxx03_std_stdio_h [system] { // 's __need_* macros require textual inclusion. textual header "stdio.h" export * } -module std_stdlib_h [system] { +module cxx03_std_stdlib_h [system] { // 's __need_* macros require textual inclusion. textual header "stdlib.h" export * } -module std_string_h [system] { +module cxx03_std_string_h [system] { header "string.h" export * } -module std_tgmath_h [system] { +module cxx03_std_tgmath_h [system] { header "tgmath.h" export * } -module std_uchar_h [system] { +module cxx03_std_uchar_h [system] { header "uchar.h" export * } // provided by C library. -module std_wchar_h [system] { +module cxx03_std_wchar_h [system] { // 's __need_* macros require textual inclusion. textual header "wchar.h" export * } -module std_wctype_h [system] { +module cxx03_std_wctype_h [system] { header "wctype.h" export * } // Experimental C++ standard library interfaces -module std_experimental [system] { +module cxx03_std_experimental [system] { module iterator { header "experimental/iterator" export * @@ -559,25 +559,25 @@ module std_experimental [system] { // Convenience method to get all of the above modules in a single import statement. // Importing only the needed modules is likely to be more performant. -module std [system] { +module cxx03_std [system] { header "__std_clang_module" export * } // Implementation detail headers that are private to libc++. These modules // must not be directly imported. -module std_private_assert [system] { +module cxx03_std_private_assert [system] { header "__assert" export * } -module std_private_bit_reference [system] { +module cxx03_std_private_bit_reference [system] { header "__bit_reference" export * } -module std_private_fwd_bit_reference [system] { +module cxx03_std_private_fwd_bit_reference [system] { header "__fwd/bit_reference.h" } -module std_private_config [system] { +module cxx03_std_private_config [system] { textual header "__config" textual header "__configuration/abi.h" textual header "__configuration/availability.h" @@ -586,813 +586,813 @@ module std_private_config [system] { textual header "__configuration/platform.h" export * } -module std_private_hash_table [system] { +module cxx03_std_private_hash_table [system] { header "__hash_table" export * } -module std_private_locale [system] { +module cxx03_std_private_locale [system] { header "__locale" export * } -module std_private_mbstate_t [system] { +module cxx03_std_private_mbstate_t [system] { header "__mbstate_t.h" export * } -module std_private_node_handle [system] { +module cxx03_std_private_node_handle [system] { header "__node_handle" export * } -module std_private_split_buffer [system] { +module cxx03_std_private_split_buffer [system] { header "__split_buffer" export * } -module std_private_std_mbstate_t [system] { +module cxx03_std_private_std_mbstate_t [system] { header "__std_mbstate_t.h" export * } -module std_private_tree [system] { +module cxx03_std_private_tree [system] { header "__tree" export * } -module std_private_undef_macros [system] { +module cxx03_std_private_undef_macros [system] { textual header "__undef_macros" export * } -module std_private_verbose_abort [system] { +module cxx03_std_private_verbose_abort [system] { header "__verbose_abort" export * } -module std_private_algorithm_adjacent_find [system] { header "__algorithm/adjacent_find.h" } -module std_private_algorithm_all_of [system] { header "__algorithm/all_of.h" } -module std_private_algorithm_any_of [system] { header "__algorithm/any_of.h" } -module std_private_algorithm_binary_search [system] { header "__algorithm/binary_search.h" } -module std_private_algorithm_clamp [system] { header "__algorithm/clamp.h" } -module std_private_algorithm_comp [system] { header "__algorithm/comp.h" } -module std_private_algorithm_comp_ref_type [system] { header "__algorithm/comp_ref_type.h" } -module std_private_algorithm_copy [system] { +module cxx03_std_private_algorithm_adjacent_find [system] { header "__algorithm/adjacent_find.h" } +module cxx03_std_private_algorithm_all_of [system] { header "__algorithm/all_of.h" } +module cxx03_std_private_algorithm_any_of [system] { header "__algorithm/any_of.h" } +module cxx03_std_private_algorithm_binary_search [system] { header "__algorithm/binary_search.h" } +module cxx03_std_private_algorithm_clamp [system] { header "__algorithm/clamp.h" } +module cxx03_std_private_algorithm_comp [system] { header "__algorithm/comp.h" } +module cxx03_std_private_algorithm_comp_ref_type [system] { header "__algorithm/comp_ref_type.h" } +module cxx03_std_private_algorithm_copy [system] { header "__algorithm/copy.h" export std_private_algorithm_copy_move_common } -module std_private_algorithm_copy_backward [system] { header "__algorithm/copy_backward.h" } -module std_private_algorithm_copy_if [system] { header "__algorithm/copy_if.h" } -module std_private_algorithm_copy_move_common [system] { +module cxx03_std_private_algorithm_copy_backward [system] { header "__algorithm/copy_backward.h" } +module cxx03_std_private_algorithm_copy_if [system] { header "__algorithm/copy_if.h" } +module cxx03_std_private_algorithm_copy_move_common [system] { header "__algorithm/copy_move_common.h" export std_private_type_traits_is_trivially_copyable } -module std_private_algorithm_copy_n [system] { header "__algorithm/copy_n.h" } -module std_private_algorithm_count [system] { header "__algorithm/count.h" } -module std_private_algorithm_count_if [system] { header "__algorithm/count_if.h" } -module std_private_algorithm_equal [system] { header "__algorithm/equal.h" } -module std_private_algorithm_equal_range [system] { header "__algorithm/equal_range.h" } -module std_private_algorithm_fill [system] { header "__algorithm/fill.h" } -module std_private_algorithm_fill_n [system] { header "__algorithm/fill_n.h" } -module std_private_algorithm_find [system] { +module cxx03_std_private_algorithm_copy_n [system] { header "__algorithm/copy_n.h" } +module cxx03_std_private_algorithm_count [system] { header "__algorithm/count.h" } +module cxx03_std_private_algorithm_count_if [system] { header "__algorithm/count_if.h" } +module cxx03_std_private_algorithm_equal [system] { header "__algorithm/equal.h" } +module cxx03_std_private_algorithm_equal_range [system] { header "__algorithm/equal_range.h" } +module cxx03_std_private_algorithm_fill [system] { header "__algorithm/fill.h" } +module cxx03_std_private_algorithm_fill_n [system] { header "__algorithm/fill_n.h" } +module cxx03_std_private_algorithm_find [system] { header "__algorithm/find.h" export std_private_algorithm_unwrap_iter } -module std_private_algorithm_find_end [system] { header "__algorithm/find_end.h" } -module std_private_algorithm_find_first_of [system] { header "__algorithm/find_first_of.h" } -module std_private_algorithm_find_if [system] { header "__algorithm/find_if.h" } -module std_private_algorithm_find_if_not [system] { header "__algorithm/find_if_not.h" } -module std_private_algorithm_find_segment_if [system] { header "__algorithm/find_segment_if.h" } -module std_private_algorithm_fold [system] { header "__algorithm/fold.h" } -module std_private_algorithm_for_each [system] { header "__algorithm/for_each.h" } -module std_private_algorithm_for_each_n [system] { header "__algorithm/for_each_n.h" } -module std_private_algorithm_for_each_segment [system] { header "__algorithm/for_each_segment.h" } -module std_private_algorithm_generate [system] { header "__algorithm/generate.h" } -module std_private_algorithm_generate_n [system] { header "__algorithm/generate_n.h" } -module std_private_algorithm_half_positive [system] { header "__algorithm/half_positive.h" } -module std_private_algorithm_in_found_result [system] { header "__algorithm/in_found_result.h" } -module std_private_algorithm_in_fun_result [system] { header "__algorithm/in_fun_result.h" } -module std_private_algorithm_in_in_out_result [system] { header "__algorithm/in_in_out_result.h" } -module std_private_algorithm_in_in_result [system] { header "__algorithm/in_in_result.h" } -module std_private_algorithm_in_out_out_result [system] { header "__algorithm/in_out_out_result.h" } -module std_private_algorithm_in_out_result [system] { header "__algorithm/in_out_result.h" } -module std_private_algorithm_includes [system] { header "__algorithm/includes.h" } -module std_private_algorithm_inplace_merge [system] { header "__algorithm/inplace_merge.h" } -module std_private_algorithm_is_heap [system] { header "__algorithm/is_heap.h" } -module std_private_algorithm_is_heap_until [system] { header "__algorithm/is_heap_until.h" } -module std_private_algorithm_is_partitioned [system] { header "__algorithm/is_partitioned.h" } -module std_private_algorithm_is_permutation [system] { header "__algorithm/is_permutation.h" } -module std_private_algorithm_is_sorted [system] { header "__algorithm/is_sorted.h" } -module std_private_algorithm_is_sorted_until [system] { header "__algorithm/is_sorted_until.h" } -module std_private_algorithm_iter_swap [system] { header "__algorithm/iter_swap.h" } -module std_private_algorithm_iterator_operations [system] { +module cxx03_std_private_algorithm_find_end [system] { header "__algorithm/find_end.h" } +module cxx03_std_private_algorithm_find_first_of [system] { header "__algorithm/find_first_of.h" } +module cxx03_std_private_algorithm_find_if [system] { header "__algorithm/find_if.h" } +module cxx03_std_private_algorithm_find_if_not [system] { header "__algorithm/find_if_not.h" } +module cxx03_std_private_algorithm_find_segment_if [system] { header "__algorithm/find_segment_if.h" } +module cxx03_std_private_algorithm_fold [system] { header "__algorithm/fold.h" } +module cxx03_std_private_algorithm_for_each [system] { header "__algorithm/for_each.h" } +module cxx03_std_private_algorithm_for_each_n [system] { header "__algorithm/for_each_n.h" } +module cxx03_std_private_algorithm_for_each_segment [system] { header "__algorithm/for_each_segment.h" } +module cxx03_std_private_algorithm_generate [system] { header "__algorithm/generate.h" } +module cxx03_std_private_algorithm_generate_n [system] { header "__algorithm/generate_n.h" } +module cxx03_std_private_algorithm_half_positive [system] { header "__algorithm/half_positive.h" } +module cxx03_std_private_algorithm_in_found_result [system] { header "__algorithm/in_found_result.h" } +module cxx03_std_private_algorithm_in_fun_result [system] { header "__algorithm/in_fun_result.h" } +module cxx03_std_private_algorithm_in_in_out_result [system] { header "__algorithm/in_in_out_result.h" } +module cxx03_std_private_algorithm_in_in_result [system] { header "__algorithm/in_in_result.h" } +module cxx03_std_private_algorithm_in_out_out_result [system] { header "__algorithm/in_out_out_result.h" } +module cxx03_std_private_algorithm_in_out_result [system] { header "__algorithm/in_out_result.h" } +module cxx03_std_private_algorithm_includes [system] { header "__algorithm/includes.h" } +module cxx03_std_private_algorithm_inplace_merge [system] { header "__algorithm/inplace_merge.h" } +module cxx03_std_private_algorithm_is_heap [system] { header "__algorithm/is_heap.h" } +module cxx03_std_private_algorithm_is_heap_until [system] { header "__algorithm/is_heap_until.h" } +module cxx03_std_private_algorithm_is_partitioned [system] { header "__algorithm/is_partitioned.h" } +module cxx03_std_private_algorithm_is_permutation [system] { header "__algorithm/is_permutation.h" } +module cxx03_std_private_algorithm_is_sorted [system] { header "__algorithm/is_sorted.h" } +module cxx03_std_private_algorithm_is_sorted_until [system] { header "__algorithm/is_sorted_until.h" } +module cxx03_std_private_algorithm_iter_swap [system] { header "__algorithm/iter_swap.h" } +module cxx03_std_private_algorithm_iterator_operations [system] { header "__algorithm/iterator_operations.h" export * } -module std_private_algorithm_lexicographical_compare [system] { header "__algorithm/lexicographical_compare.h" } -module std_private_algorithm_lexicographical_compare_three_way [system] { header "__algorithm/lexicographical_compare_three_way.h" } -module std_private_algorithm_lower_bound [system] { header "__algorithm/lower_bound.h" } -module std_private_algorithm_make_heap [system] { header "__algorithm/make_heap.h" } -module std_private_algorithm_make_projected [system] { header "__algorithm/make_projected.h" } -module std_private_algorithm_max [system] { header "__algorithm/max.h" } -module std_private_algorithm_max_element [system] { header "__algorithm/max_element.h" } -module std_private_algorithm_merge [system] { header "__algorithm/merge.h" } -module std_private_algorithm_min [system] { header "__algorithm/min.h" } -module std_private_algorithm_min_element [system] { header "__algorithm/min_element.h" } -module std_private_algorithm_min_max_result [system] { header "__algorithm/min_max_result.h" } -module std_private_algorithm_minmax [system] { +module cxx03_std_private_algorithm_lexicographical_compare [system] { header "__algorithm/lexicographical_compare.h" } +module cxx03_std_private_algorithm_lexicographical_compare_three_way [system] { header "__algorithm/lexicographical_compare_three_way.h" } +module cxx03_std_private_algorithm_lower_bound [system] { header "__algorithm/lower_bound.h" } +module cxx03_std_private_algorithm_make_heap [system] { header "__algorithm/make_heap.h" } +module cxx03_std_private_algorithm_make_projected [system] { header "__algorithm/make_projected.h" } +module cxx03_std_private_algorithm_max [system] { header "__algorithm/max.h" } +module cxx03_std_private_algorithm_max_element [system] { header "__algorithm/max_element.h" } +module cxx03_std_private_algorithm_merge [system] { header "__algorithm/merge.h" } +module cxx03_std_private_algorithm_min [system] { header "__algorithm/min.h" } +module cxx03_std_private_algorithm_min_element [system] { header "__algorithm/min_element.h" } +module cxx03_std_private_algorithm_min_max_result [system] { header "__algorithm/min_max_result.h" } +module cxx03_std_private_algorithm_minmax [system] { header "__algorithm/minmax.h" export * } -module std_private_algorithm_minmax_element [system] { header "__algorithm/minmax_element.h" } -module std_private_algorithm_mismatch [system] { +module cxx03_std_private_algorithm_minmax_element [system] { header "__algorithm/minmax_element.h" } +module cxx03_std_private_algorithm_mismatch [system] { header "__algorithm/mismatch.h" export std_private_algorithm_simd_utils export std_private_iterator_aliasing_iterator } -module std_private_algorithm_move [system] { header "__algorithm/move.h" } -module std_private_algorithm_move_backward [system] { header "__algorithm/move_backward.h" } -module std_private_algorithm_next_permutation [system] { header "__algorithm/next_permutation.h" } -module std_private_algorithm_none_of [system] { header "__algorithm/none_of.h" } -module std_private_algorithm_nth_element [system] { header "__algorithm/nth_element.h" } -module std_private_algorithm_partial_sort [system] { header "__algorithm/partial_sort.h" } -module std_private_algorithm_partial_sort_copy [system] { header "__algorithm/partial_sort_copy.h" } -module std_private_algorithm_partition [system] { header "__algorithm/partition.h" } -module std_private_algorithm_partition_copy [system] { header "__algorithm/partition_copy.h" } -module std_private_algorithm_partition_point [system] { header "__algorithm/partition_point.h" } -module std_private_algorithm_pop_heap [system] { header "__algorithm/pop_heap.h" } -module std_private_algorithm_prev_permutation [system] { header "__algorithm/prev_permutation.h" } -module std_private_algorithm_pstl [system] { +module cxx03_std_private_algorithm_move [system] { header "__algorithm/move.h" } +module cxx03_std_private_algorithm_move_backward [system] { header "__algorithm/move_backward.h" } +module cxx03_std_private_algorithm_next_permutation [system] { header "__algorithm/next_permutation.h" } +module cxx03_std_private_algorithm_none_of [system] { header "__algorithm/none_of.h" } +module cxx03_std_private_algorithm_nth_element [system] { header "__algorithm/nth_element.h" } +module cxx03_std_private_algorithm_partial_sort [system] { header "__algorithm/partial_sort.h" } +module cxx03_std_private_algorithm_partial_sort_copy [system] { header "__algorithm/partial_sort_copy.h" } +module cxx03_std_private_algorithm_partition [system] { header "__algorithm/partition.h" } +module cxx03_std_private_algorithm_partition_copy [system] { header "__algorithm/partition_copy.h" } +module cxx03_std_private_algorithm_partition_point [system] { header "__algorithm/partition_point.h" } +module cxx03_std_private_algorithm_pop_heap [system] { header "__algorithm/pop_heap.h" } +module cxx03_std_private_algorithm_prev_permutation [system] { header "__algorithm/prev_permutation.h" } +module cxx03_std_private_algorithm_pstl [system] { header "__algorithm/pstl.h" export * } -module std_private_algorithm_push_heap [system] { header "__algorithm/push_heap.h" } -module std_private_algorithm_ranges_adjacent_find [system] { header "__algorithm/ranges_adjacent_find.h" } -module std_private_algorithm_ranges_all_of [system] { header "__algorithm/ranges_all_of.h" } -module std_private_algorithm_ranges_any_of [system] { header "__algorithm/ranges_any_of.h" } -module std_private_algorithm_ranges_binary_search [system] { +module cxx03_std_private_algorithm_push_heap [system] { header "__algorithm/push_heap.h" } +module cxx03_std_private_algorithm_ranges_adjacent_find [system] { header "__algorithm/ranges_adjacent_find.h" } +module cxx03_std_private_algorithm_ranges_all_of [system] { header "__algorithm/ranges_all_of.h" } +module cxx03_std_private_algorithm_ranges_any_of [system] { header "__algorithm/ranges_any_of.h" } +module cxx03_std_private_algorithm_ranges_binary_search [system] { header "__algorithm/ranges_binary_search.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_clamp [system] { +module cxx03_std_private_algorithm_ranges_clamp [system] { header "__algorithm/ranges_clamp.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_contains [system] { header "__algorithm/ranges_contains.h" } -module std_private_algorithm_ranges_contains_subrange [system] { header "__algorithm/ranges_contains_subrange.h" } -module std_private_algorithm_ranges_copy [system] { +module cxx03_std_private_algorithm_ranges_contains [system] { header "__algorithm/ranges_contains.h" } +module cxx03_std_private_algorithm_ranges_contains_subrange [system] { header "__algorithm/ranges_contains_subrange.h" } +module cxx03_std_private_algorithm_ranges_copy [system] { header "__algorithm/ranges_copy.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_copy_backward [system] { +module cxx03_std_private_algorithm_ranges_copy_backward [system] { header "__algorithm/ranges_copy_backward.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_copy_if [system] { +module cxx03_std_private_algorithm_ranges_copy_if [system] { header "__algorithm/ranges_copy_if.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_copy_n [system] { +module cxx03_std_private_algorithm_ranges_copy_n [system] { header "__algorithm/ranges_copy_n.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_count [system] { header "__algorithm/ranges_count.h" } -module std_private_algorithm_ranges_count_if [system] { header "__algorithm/ranges_count_if.h" } -module std_private_algorithm_ranges_ends_with [system] { header "__algorithm/ranges_ends_with.h" } -module std_private_algorithm_ranges_equal [system] { header "__algorithm/ranges_equal.h" } -module std_private_algorithm_ranges_equal_range [system] { +module cxx03_std_private_algorithm_ranges_count [system] { header "__algorithm/ranges_count.h" } +module cxx03_std_private_algorithm_ranges_count_if [system] { header "__algorithm/ranges_count_if.h" } +module cxx03_std_private_algorithm_ranges_ends_with [system] { header "__algorithm/ranges_ends_with.h" } +module cxx03_std_private_algorithm_ranges_equal [system] { header "__algorithm/ranges_equal.h" } +module cxx03_std_private_algorithm_ranges_equal_range [system] { header "__algorithm/ranges_equal_range.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_fill [system] { header "__algorithm/ranges_fill.h" } -module std_private_algorithm_ranges_fill_n [system] { header "__algorithm/ranges_fill_n.h" } -module std_private_algorithm_ranges_find [system] { header "__algorithm/ranges_find.h" } -module std_private_algorithm_ranges_find_end [system] { header "__algorithm/ranges_find_end.h" } -module std_private_algorithm_ranges_find_first_of [system] { header "__algorithm/ranges_find_first_of.h" } -module std_private_algorithm_ranges_find_if [system] { header "__algorithm/ranges_find_if.h" } -module std_private_algorithm_ranges_find_if_not [system] { header "__algorithm/ranges_find_if_not.h" } -module std_private_algorithm_ranges_find_last [system] { header "__algorithm/ranges_find_last.h" } -module std_private_algorithm_ranges_for_each [system] { +module cxx03_std_private_algorithm_ranges_fill [system] { header "__algorithm/ranges_fill.h" } +module cxx03_std_private_algorithm_ranges_fill_n [system] { header "__algorithm/ranges_fill_n.h" } +module cxx03_std_private_algorithm_ranges_find [system] { header "__algorithm/ranges_find.h" } +module cxx03_std_private_algorithm_ranges_find_end [system] { header "__algorithm/ranges_find_end.h" } +module cxx03_std_private_algorithm_ranges_find_first_of [system] { header "__algorithm/ranges_find_first_of.h" } +module cxx03_std_private_algorithm_ranges_find_if [system] { header "__algorithm/ranges_find_if.h" } +module cxx03_std_private_algorithm_ranges_find_if_not [system] { header "__algorithm/ranges_find_if_not.h" } +module cxx03_std_private_algorithm_ranges_find_last [system] { header "__algorithm/ranges_find_last.h" } +module cxx03_std_private_algorithm_ranges_for_each [system] { header "__algorithm/ranges_for_each.h" export std_private_algorithm_in_fun_result } -module std_private_algorithm_ranges_for_each_n [system] { +module cxx03_std_private_algorithm_ranges_for_each_n [system] { header "__algorithm/ranges_for_each_n.h" export std_private_algorithm_in_fun_result } -module std_private_algorithm_ranges_generate [system] { header "__algorithm/ranges_generate.h" } -module std_private_algorithm_ranges_generate_n [system] { header "__algorithm/ranges_generate_n.h" } -module std_private_algorithm_ranges_includes [system] { +module cxx03_std_private_algorithm_ranges_generate [system] { header "__algorithm/ranges_generate.h" } +module cxx03_std_private_algorithm_ranges_generate_n [system] { header "__algorithm/ranges_generate_n.h" } +module cxx03_std_private_algorithm_ranges_includes [system] { header "__algorithm/ranges_includes.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_inplace_merge [system] { +module cxx03_std_private_algorithm_ranges_inplace_merge [system] { header "__algorithm/ranges_inplace_merge.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_is_heap [system] { +module cxx03_std_private_algorithm_ranges_is_heap [system] { header "__algorithm/ranges_is_heap.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_is_heap_until [system] { +module cxx03_std_private_algorithm_ranges_is_heap_until [system] { header "__algorithm/ranges_is_heap_until.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_is_partitioned [system] { header "__algorithm/ranges_is_partitioned.h" } -module std_private_algorithm_ranges_is_permutation [system] { header "__algorithm/ranges_is_permutation.h" } -module std_private_algorithm_ranges_is_sorted [system] { +module cxx03_std_private_algorithm_ranges_is_partitioned [system] { header "__algorithm/ranges_is_partitioned.h" } +module cxx03_std_private_algorithm_ranges_is_permutation [system] { header "__algorithm/ranges_is_permutation.h" } +module cxx03_std_private_algorithm_ranges_is_sorted [system] { header "__algorithm/ranges_is_sorted.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_is_sorted_until [system] { +module cxx03_std_private_algorithm_ranges_is_sorted_until [system] { header "__algorithm/ranges_is_sorted_until.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_iterator_concept [system] { header "__algorithm/ranges_iterator_concept.h" } -module std_private_algorithm_ranges_lexicographical_compare [system] { +module cxx03_std_private_algorithm_ranges_iterator_concept [system] { header "__algorithm/ranges_iterator_concept.h" } +module cxx03_std_private_algorithm_ranges_lexicographical_compare [system] { header "__algorithm/ranges_lexicographical_compare.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_lower_bound [system] { +module cxx03_std_private_algorithm_ranges_lower_bound [system] { header "__algorithm/ranges_lower_bound.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_make_heap [system] { +module cxx03_std_private_algorithm_ranges_make_heap [system] { header "__algorithm/ranges_make_heap.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_max [system] { +module cxx03_std_private_algorithm_ranges_max [system] { header "__algorithm/ranges_max.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_max_element [system] { +module cxx03_std_private_algorithm_ranges_max_element [system] { header "__algorithm/ranges_max_element.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_merge [system] { +module cxx03_std_private_algorithm_ranges_merge [system] { header "__algorithm/ranges_merge.h" export std_private_algorithm_in_in_out_result } -module std_private_algorithm_ranges_min [system] { +module cxx03_std_private_algorithm_ranges_min [system] { header "__algorithm/ranges_min.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_min_element [system] { +module cxx03_std_private_algorithm_ranges_min_element [system] { header "__algorithm/ranges_min_element.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_minmax [system] { +module cxx03_std_private_algorithm_ranges_minmax [system] { header "__algorithm/ranges_minmax.h" export std_private_functional_ranges_operations export std_private_algorithm_min_max_result } -module std_private_algorithm_ranges_minmax_element [system] { +module cxx03_std_private_algorithm_ranges_minmax_element [system] { header "__algorithm/ranges_minmax_element.h" export std_private_functional_ranges_operations export std_private_algorithm_min_max_result } -module std_private_algorithm_ranges_mismatch [system] { +module cxx03_std_private_algorithm_ranges_mismatch [system] { header "__algorithm/ranges_mismatch.h" export std_private_algorithm_in_in_result } -module std_private_algorithm_ranges_move [system] { +module cxx03_std_private_algorithm_ranges_move [system] { header "__algorithm/ranges_move.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_move_backward [system] { +module cxx03_std_private_algorithm_ranges_move_backward [system] { header "__algorithm/ranges_move_backward.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_next_permutation [system] { +module cxx03_std_private_algorithm_ranges_next_permutation [system] { header "__algorithm/ranges_next_permutation.h" export std_private_algorithm_in_found_result export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_none_of [system] { header "__algorithm/ranges_none_of.h" } -module std_private_algorithm_ranges_nth_element [system] { +module cxx03_std_private_algorithm_ranges_none_of [system] { header "__algorithm/ranges_none_of.h" } +module cxx03_std_private_algorithm_ranges_nth_element [system] { header "__algorithm/ranges_nth_element.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_partial_sort [system] { +module cxx03_std_private_algorithm_ranges_partial_sort [system] { header "__algorithm/ranges_partial_sort.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_partial_sort_copy [system] { +module cxx03_std_private_algorithm_ranges_partial_sort_copy [system] { header "__algorithm/ranges_partial_sort_copy.h" export std_private_algorithm_in_out_result export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_partition [system] { header "__algorithm/ranges_partition.h" } -module std_private_algorithm_ranges_partition_copy [system] { header "__algorithm/ranges_partition_copy.h" } -module std_private_algorithm_ranges_partition_point [system] { header "__algorithm/ranges_partition_point.h" } -module std_private_algorithm_ranges_pop_heap [system] { +module cxx03_std_private_algorithm_ranges_partition [system] { header "__algorithm/ranges_partition.h" } +module cxx03_std_private_algorithm_ranges_partition_copy [system] { header "__algorithm/ranges_partition_copy.h" } +module cxx03_std_private_algorithm_ranges_partition_point [system] { header "__algorithm/ranges_partition_point.h" } +module cxx03_std_private_algorithm_ranges_pop_heap [system] { header "__algorithm/ranges_pop_heap.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_prev_permutation [system] { +module cxx03_std_private_algorithm_ranges_prev_permutation [system] { header "__algorithm/ranges_prev_permutation.h" export std_private_algorithm_in_found_result export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_push_heap [system] { +module cxx03_std_private_algorithm_ranges_push_heap [system] { header "__algorithm/ranges_push_heap.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_remove [system] { header "__algorithm/ranges_remove.h" } -module std_private_algorithm_ranges_remove_copy [system] { +module cxx03_std_private_algorithm_ranges_remove [system] { header "__algorithm/ranges_remove.h" } +module cxx03_std_private_algorithm_ranges_remove_copy [system] { header "__algorithm/ranges_remove_copy.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_remove_copy_if [system] { +module cxx03_std_private_algorithm_ranges_remove_copy_if [system] { header "__algorithm/ranges_remove_copy_if.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_remove_if [system] { header "__algorithm/ranges_remove_if.h" } -module std_private_algorithm_ranges_replace [system] { header "__algorithm/ranges_replace.h" } -module std_private_algorithm_ranges_replace_copy [system] { +module cxx03_std_private_algorithm_ranges_remove_if [system] { header "__algorithm/ranges_remove_if.h" } +module cxx03_std_private_algorithm_ranges_replace [system] { header "__algorithm/ranges_replace.h" } +module cxx03_std_private_algorithm_ranges_replace_copy [system] { header "__algorithm/ranges_replace_copy.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_replace_copy_if [system] { +module cxx03_std_private_algorithm_ranges_replace_copy_if [system] { header "__algorithm/ranges_replace_copy_if.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_replace_if [system] { header "__algorithm/ranges_replace_if.h" } -module std_private_algorithm_ranges_reverse [system] { header "__algorithm/ranges_reverse.h" } -module std_private_algorithm_ranges_reverse_copy [system] { +module cxx03_std_private_algorithm_ranges_replace_if [system] { header "__algorithm/ranges_replace_if.h" } +module cxx03_std_private_algorithm_ranges_reverse [system] { header "__algorithm/ranges_reverse.h" } +module cxx03_std_private_algorithm_ranges_reverse_copy [system] { header "__algorithm/ranges_reverse_copy.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_rotate [system] { header "__algorithm/ranges_rotate.h" } -module std_private_algorithm_ranges_rotate_copy [system] { +module cxx03_std_private_algorithm_ranges_rotate [system] { header "__algorithm/ranges_rotate.h" } +module cxx03_std_private_algorithm_ranges_rotate_copy [system] { header "__algorithm/ranges_rotate_copy.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_sample [system] { header "__algorithm/ranges_sample.h" } -module std_private_algorithm_ranges_search [system] { header "__algorithm/ranges_search.h" } -module std_private_algorithm_ranges_search_n [system] { header "__algorithm/ranges_search_n.h" } -module std_private_algorithm_ranges_set_difference [system] { +module cxx03_std_private_algorithm_ranges_sample [system] { header "__algorithm/ranges_sample.h" } +module cxx03_std_private_algorithm_ranges_search [system] { header "__algorithm/ranges_search.h" } +module cxx03_std_private_algorithm_ranges_search_n [system] { header "__algorithm/ranges_search_n.h" } +module cxx03_std_private_algorithm_ranges_set_difference [system] { header "__algorithm/ranges_set_difference.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_set_intersection [system] { +module cxx03_std_private_algorithm_ranges_set_intersection [system] { header "__algorithm/ranges_set_intersection.h" export std_private_algorithm_in_in_out_result } -module std_private_algorithm_ranges_set_symmetric_difference [system] { +module cxx03_std_private_algorithm_ranges_set_symmetric_difference [system] { header "__algorithm/ranges_set_symmetric_difference.h" export std_private_algorithm_in_in_out_result export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_set_union [system] { +module cxx03_std_private_algorithm_ranges_set_union [system] { header "__algorithm/ranges_set_union.h" export std_private_algorithm_in_in_out_result export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_shuffle [system] { header "__algorithm/ranges_shuffle.h" } -module std_private_algorithm_ranges_sort [system] { +module cxx03_std_private_algorithm_ranges_shuffle [system] { header "__algorithm/ranges_shuffle.h" } +module cxx03_std_private_algorithm_ranges_sort [system] { header "__algorithm/ranges_sort.h" export std_private_algorithm_make_projected export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_sort_heap [system] { +module cxx03_std_private_algorithm_ranges_sort_heap [system] { header "__algorithm/ranges_sort_heap.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_stable_partition [system] { header "__algorithm/ranges_stable_partition.h" } -module std_private_algorithm_ranges_stable_sort [system] { +module cxx03_std_private_algorithm_ranges_stable_partition [system] { header "__algorithm/ranges_stable_partition.h" } +module cxx03_std_private_algorithm_ranges_stable_sort [system] { header "__algorithm/ranges_stable_sort.h" export std_private_functional_ranges_operations } -module std_private_algorithm_ranges_starts_with [system] { header "__algorithm/ranges_starts_with.h" } -module std_private_algorithm_ranges_swap_ranges [system] { +module cxx03_std_private_algorithm_ranges_starts_with [system] { header "__algorithm/ranges_starts_with.h" } +module cxx03_std_private_algorithm_ranges_swap_ranges [system] { header "__algorithm/ranges_swap_ranges.h" export std_private_algorithm_in_in_result } -module std_private_algorithm_ranges_transform [system] { +module cxx03_std_private_algorithm_ranges_transform [system] { header "__algorithm/ranges_transform.h" export std_private_algorithm_in_in_out_result export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_unique [system] { header "__algorithm/ranges_unique.h" } -module std_private_algorithm_ranges_unique_copy [system] { +module cxx03_std_private_algorithm_ranges_unique [system] { header "__algorithm/ranges_unique.h" } +module cxx03_std_private_algorithm_ranges_unique_copy [system] { header "__algorithm/ranges_unique_copy.h" export std_private_algorithm_in_out_result } -module std_private_algorithm_ranges_upper_bound [system] { +module cxx03_std_private_algorithm_ranges_upper_bound [system] { header "__algorithm/ranges_upper_bound.h" export std_private_functional_ranges_operations } -module std_private_algorithm_remove [system] { header "__algorithm/remove.h" } -module std_private_algorithm_remove_copy [system] { header "__algorithm/remove_copy.h" } -module std_private_algorithm_remove_copy_if [system] { header "__algorithm/remove_copy_if.h" } -module std_private_algorithm_remove_if [system] { header "__algorithm/remove_if.h" } -module std_private_algorithm_replace [system] { header "__algorithm/replace.h" } -module std_private_algorithm_replace_copy [system] { header "__algorithm/replace_copy.h" } -module std_private_algorithm_replace_copy_if [system] { header "__algorithm/replace_copy_if.h" } -module std_private_algorithm_replace_if [system] { header "__algorithm/replace_if.h" } -module std_private_algorithm_reverse [system] { header "__algorithm/reverse.h" } -module std_private_algorithm_reverse_copy [system] { header "__algorithm/reverse_copy.h" } -module std_private_algorithm_rotate [system] { header "__algorithm/rotate.h" } -module std_private_algorithm_rotate_copy [system] { header "__algorithm/rotate_copy.h" } -module std_private_algorithm_sample [system] { header "__algorithm/sample.h" } -module std_private_algorithm_search [system] { header "__algorithm/search.h" } -module std_private_algorithm_search_n [system] { header "__algorithm/search_n.h" } -module std_private_algorithm_set_difference [system] { header "__algorithm/set_difference.h" } -module std_private_algorithm_set_intersection [system] { header "__algorithm/set_intersection.h" } -module std_private_algorithm_set_symmetric_difference [system] { header "__algorithm/set_symmetric_difference.h" } -module std_private_algorithm_set_union [system] { header "__algorithm/set_union.h" } -module std_private_algorithm_shift_left [system] { header "__algorithm/shift_left.h" } -module std_private_algorithm_shift_right [system] { header "__algorithm/shift_right.h" } -module std_private_algorithm_shuffle [system] { header "__algorithm/shuffle.h" } -module std_private_algorithm_sift_down [system] { header "__algorithm/sift_down.h" } -module std_private_algorithm_sort [system] { +module cxx03_std_private_algorithm_remove [system] { header "__algorithm/remove.h" } +module cxx03_std_private_algorithm_remove_copy [system] { header "__algorithm/remove_copy.h" } +module cxx03_std_private_algorithm_remove_copy_if [system] { header "__algorithm/remove_copy_if.h" } +module cxx03_std_private_algorithm_remove_if [system] { header "__algorithm/remove_if.h" } +module cxx03_std_private_algorithm_replace [system] { header "__algorithm/replace.h" } +module cxx03_std_private_algorithm_replace_copy [system] { header "__algorithm/replace_copy.h" } +module cxx03_std_private_algorithm_replace_copy_if [system] { header "__algorithm/replace_copy_if.h" } +module cxx03_std_private_algorithm_replace_if [system] { header "__algorithm/replace_if.h" } +module cxx03_std_private_algorithm_reverse [system] { header "__algorithm/reverse.h" } +module cxx03_std_private_algorithm_reverse_copy [system] { header "__algorithm/reverse_copy.h" } +module cxx03_std_private_algorithm_rotate [system] { header "__algorithm/rotate.h" } +module cxx03_std_private_algorithm_rotate_copy [system] { header "__algorithm/rotate_copy.h" } +module cxx03_std_private_algorithm_sample [system] { header "__algorithm/sample.h" } +module cxx03_std_private_algorithm_search [system] { header "__algorithm/search.h" } +module cxx03_std_private_algorithm_search_n [system] { header "__algorithm/search_n.h" } +module cxx03_std_private_algorithm_set_difference [system] { header "__algorithm/set_difference.h" } +module cxx03_std_private_algorithm_set_intersection [system] { header "__algorithm/set_intersection.h" } +module cxx03_std_private_algorithm_set_symmetric_difference [system] { header "__algorithm/set_symmetric_difference.h" } +module cxx03_std_private_algorithm_set_union [system] { header "__algorithm/set_union.h" } +module cxx03_std_private_algorithm_shift_left [system] { header "__algorithm/shift_left.h" } +module cxx03_std_private_algorithm_shift_right [system] { header "__algorithm/shift_right.h" } +module cxx03_std_private_algorithm_shuffle [system] { header "__algorithm/shuffle.h" } +module cxx03_std_private_algorithm_sift_down [system] { header "__algorithm/sift_down.h" } +module cxx03_std_private_algorithm_sort [system] { header "__algorithm/sort.h" export std_private_debug_utils_strict_weak_ordering_check } -module std_private_algorithm_simd_utils [system] { header "__algorithm/simd_utils.h" } -module std_private_algorithm_sort_heap [system] { header "__algorithm/sort_heap.h" } -module std_private_algorithm_stable_partition [system] { header "__algorithm/stable_partition.h" } -module std_private_algorithm_stable_sort [system] { header "__algorithm/stable_sort.h" } -module std_private_algorithm_swap_ranges [system] { +module cxx03_std_private_algorithm_simd_utils [system] { header "__algorithm/simd_utils.h" } +module cxx03_std_private_algorithm_sort_heap [system] { header "__algorithm/sort_heap.h" } +module cxx03_std_private_algorithm_stable_partition [system] { header "__algorithm/stable_partition.h" } +module cxx03_std_private_algorithm_stable_sort [system] { header "__algorithm/stable_sort.h" } +module cxx03_std_private_algorithm_swap_ranges [system] { header "__algorithm/swap_ranges.h" export std_private_algorithm_iterator_operations } -module std_private_algorithm_three_way_comp_ref_type [system] { header "__algorithm/three_way_comp_ref_type.h" } -module std_private_algorithm_transform [system] { header "__algorithm/transform.h" } -module std_private_algorithm_uniform_random_bit_generator_adaptor [system] { header "__algorithm/uniform_random_bit_generator_adaptor.h" } -module std_private_algorithm_unique [system] { header "__algorithm/unique.h" } -module std_private_algorithm_unique_copy [system] { header "__algorithm/unique_copy.h" } -module std_private_algorithm_unwrap_iter [system] { +module cxx03_std_private_algorithm_three_way_comp_ref_type [system] { header "__algorithm/three_way_comp_ref_type.h" } +module cxx03_std_private_algorithm_transform [system] { header "__algorithm/transform.h" } +module cxx03_std_private_algorithm_uniform_random_bit_generator_adaptor [system] { header "__algorithm/uniform_random_bit_generator_adaptor.h" } +module cxx03_std_private_algorithm_unique [system] { header "__algorithm/unique.h" } +module cxx03_std_private_algorithm_unique_copy [system] { header "__algorithm/unique_copy.h" } +module cxx03_std_private_algorithm_unwrap_iter [system] { header "__algorithm/unwrap_iter.h" export std_private_iterator_iterator_traits } -module std_private_algorithm_unwrap_range [system] { +module cxx03_std_private_algorithm_unwrap_range [system] { header "__algorithm/unwrap_range.h" export std_private_utility_pair } -module std_private_algorithm_upper_bound [system] { header "__algorithm/upper_bound.h" } +module cxx03_std_private_algorithm_upper_bound [system] { header "__algorithm/upper_bound.h" } -module std_private_array_array_fwd [system] { header "__fwd/array.h" } +module cxx03_std_private_array_array_fwd [system] { header "__fwd/array.h" } -module std_private_atomic_aliases [system] { +module cxx03_std_private_atomic_aliases [system] { header "__atomic/aliases.h" export std_private_atomic_atomic } -module std_private_atomic_atomic [system] { +module cxx03_std_private_atomic_atomic [system] { header "__atomic/atomic.h" export std_private_atomic_atomic_base } -module std_private_atomic_atomic_base [system] { header "__atomic/atomic_base.h" } -module std_private_atomic_atomic_flag [system] { +module cxx03_std_private_atomic_atomic_base [system] { header "__atomic/atomic_base.h" } +module cxx03_std_private_atomic_atomic_flag [system] { header "__atomic/atomic_flag.h" export * } -module std_private_atomic_atomic_init [system] { header "__atomic/atomic_init.h" } -module std_private_atomic_atomic_lock_free [system] { header "__atomic/atomic_lock_free.h" } -module std_private_atomic_atomic_ref [system] { header "__atomic/atomic_ref.h" } -module std_private_atomic_atomic_sync [system] { +module cxx03_std_private_atomic_atomic_init [system] { header "__atomic/atomic_init.h" } +module cxx03_std_private_atomic_atomic_lock_free [system] { header "__atomic/atomic_lock_free.h" } +module cxx03_std_private_atomic_atomic_ref [system] { header "__atomic/atomic_ref.h" } +module cxx03_std_private_atomic_atomic_sync [system] { header "__atomic/atomic_sync.h" export std_private_atomic_to_gcc_order } -module std_private_atomic_check_memory_order [system] { header "__atomic/check_memory_order.h" } -module std_private_atomic_contention_t [system] { header "__atomic/contention_t.h" } -module std_private_atomic_cxx_atomic_impl [system] { header "__atomic/cxx_atomic_impl.h" } -module std_private_atomic_fence [system] { header "__atomic/fence.h" } -module std_private_atomic_is_always_lock_free [system] { header "__atomic/is_always_lock_free.h" } -module std_private_atomic_kill_dependency [system] { header "__atomic/kill_dependency.h" } -module std_private_atomic_memory_order [system] { header "__atomic/memory_order.h" } -module std_private_atomic_to_gcc_order [system] { +module cxx03_std_private_atomic_check_memory_order [system] { header "__atomic/check_memory_order.h" } +module cxx03_std_private_atomic_contention_t [system] { header "__atomic/contention_t.h" } +module cxx03_std_private_atomic_cxx_atomic_impl [system] { header "__atomic/cxx_atomic_impl.h" } +module cxx03_std_private_atomic_fence [system] { header "__atomic/fence.h" } +module cxx03_std_private_atomic_is_always_lock_free [system] { header "__atomic/is_always_lock_free.h" } +module cxx03_std_private_atomic_kill_dependency [system] { header "__atomic/kill_dependency.h" } +module cxx03_std_private_atomic_memory_order [system] { header "__atomic/memory_order.h" } +module cxx03_std_private_atomic_to_gcc_order [system] { header "__atomic/to_gcc_order.h" export std_private_atomic_memory_order } -module std_private_bit_bit_cast [system] { header "__bit/bit_cast.h" } -module std_private_bit_bit_ceil [system] { header "__bit/bit_ceil.h" } -module std_private_bit_bit_floor [system] { header "__bit/bit_floor.h" } -module std_private_bit_bit_log2 [system] { header "__bit/bit_log2.h" } -module std_private_bit_bit_width [system] { header "__bit/bit_width.h" } -module std_private_bit_blsr [system] { header "__bit/blsr.h" } -module std_private_bit_byteswap [system] { header "__bit/byteswap.h" } -module std_private_bit_countl [system] { header "__bit/countl.h" } -module std_private_bit_countr [system] { header "__bit/countr.h" } -module std_private_bit_endian [system] { header "__bit/endian.h" } -module std_private_bit_has_single_bit [system] { header "__bit/has_single_bit.h" } -module std_private_bit_invert_if [system] { header "__bit/invert_if.h" } -module std_private_bit_popcount [system] { header "__bit/popcount.h" } -module std_private_bit_rotate [system] { header "__bit/rotate.h" } +module cxx03_std_private_bit_bit_cast [system] { header "__bit/bit_cast.h" } +module cxx03_std_private_bit_bit_ceil [system] { header "__bit/bit_ceil.h" } +module cxx03_std_private_bit_bit_floor [system] { header "__bit/bit_floor.h" } +module cxx03_std_private_bit_bit_log2 [system] { header "__bit/bit_log2.h" } +module cxx03_std_private_bit_bit_width [system] { header "__bit/bit_width.h" } +module cxx03_std_private_bit_blsr [system] { header "__bit/blsr.h" } +module cxx03_std_private_bit_byteswap [system] { header "__bit/byteswap.h" } +module cxx03_std_private_bit_countl [system] { header "__bit/countl.h" } +module cxx03_std_private_bit_countr [system] { header "__bit/countr.h" } +module cxx03_std_private_bit_endian [system] { header "__bit/endian.h" } +module cxx03_std_private_bit_has_single_bit [system] { header "__bit/has_single_bit.h" } +module cxx03_std_private_bit_invert_if [system] { header "__bit/invert_if.h" } +module cxx03_std_private_bit_popcount [system] { header "__bit/popcount.h" } +module cxx03_std_private_bit_rotate [system] { header "__bit/rotate.h" } -module std_private_charconv_chars_format [system] { header "__charconv/chars_format.h" } -module std_private_charconv_from_chars_integral [system] { header "__charconv/from_chars_integral.h" } -module std_private_charconv_from_chars_result [system] { header "__charconv/from_chars_result.h" } -module std_private_charconv_tables [system] { header "__charconv/tables.h" } -module std_private_charconv_to_chars [system] { header "__charconv/to_chars.h" } -module std_private_charconv_to_chars_base_10 [system] { header "__charconv/to_chars_base_10.h" } -module std_private_charconv_to_chars_floating_point [system] { header "__charconv/to_chars_floating_point.h" } -module std_private_charconv_to_chars_integral [system] { +module cxx03_std_private_charconv_chars_format [system] { header "__charconv/chars_format.h" } +module cxx03_std_private_charconv_from_chars_integral [system] { header "__charconv/from_chars_integral.h" } +module cxx03_std_private_charconv_from_chars_result [system] { header "__charconv/from_chars_result.h" } +module cxx03_std_private_charconv_tables [system] { header "__charconv/tables.h" } +module cxx03_std_private_charconv_to_chars [system] { header "__charconv/to_chars.h" } +module cxx03_std_private_charconv_to_chars_base_10 [system] { header "__charconv/to_chars_base_10.h" } +module cxx03_std_private_charconv_to_chars_floating_point [system] { header "__charconv/to_chars_floating_point.h" } +module cxx03_std_private_charconv_to_chars_integral [system] { header "__charconv/to_chars_integral.h" export std_private_charconv_traits } -module std_private_charconv_to_chars_result [system] { +module cxx03_std_private_charconv_to_chars_result [system] { header "__charconv/to_chars_result.h" export * } -module std_private_charconv_traits [system] { header "__charconv/traits.h" } +module cxx03_std_private_charconv_traits [system] { header "__charconv/traits.h" } -module std_private_chrono_calendar [system] { header "__chrono/calendar.h" } -module std_private_chrono_concepts [system] { header "__chrono/concepts.h" } -module std_private_chrono_convert_to_timespec [system] { header "__chrono/convert_to_timespec.h" } -module std_private_chrono_convert_to_tm [system] { header "__chrono/convert_to_tm.h" } -module std_private_chrono_day [system] { header "__chrono/day.h" } -module std_private_chrono_duration [system] { +module cxx03_std_private_chrono_calendar [system] { header "__chrono/calendar.h" } +module cxx03_std_private_chrono_concepts [system] { header "__chrono/concepts.h" } +module cxx03_std_private_chrono_convert_to_timespec [system] { header "__chrono/convert_to_timespec.h" } +module cxx03_std_private_chrono_convert_to_tm [system] { header "__chrono/convert_to_tm.h" } +module cxx03_std_private_chrono_day [system] { header "__chrono/day.h" } +module cxx03_std_private_chrono_duration [system] { header "__chrono/duration.h" export std_private_type_traits_is_convertible } -module std_private_chrono_exception [system] { header "__chrono/exception.h" } -module std_private_chrono_file_clock [system] { header "__chrono/file_clock.h" } -module std_private_chrono_formatter [system] { +module cxx03_std_private_chrono_exception [system] { header "__chrono/exception.h" } +module cxx03_std_private_chrono_file_clock [system] { header "__chrono/file_clock.h" } +module cxx03_std_private_chrono_formatter [system] { header "__chrono/formatter.h" } -module std_private_chrono_hh_mm_ss [system] { header "__chrono/hh_mm_ss.h" } -module std_private_chrono_high_resolution_clock [system] { +module cxx03_std_private_chrono_hh_mm_ss [system] { header "__chrono/hh_mm_ss.h" } +module cxx03_std_private_chrono_high_resolution_clock [system] { header "__chrono/high_resolution_clock.h" export std_private_chrono_steady_clock export std_private_chrono_system_clock } -module std_private_chrono_leap_second [system] { header "__chrono/leap_second.h" } -module std_private_chrono_literals [system] { header "__chrono/literals.h" } -module std_private_chrono_local_info [system] { +module cxx03_std_private_chrono_leap_second [system] { header "__chrono/leap_second.h" } +module cxx03_std_private_chrono_literals [system] { header "__chrono/literals.h" } +module cxx03_std_private_chrono_local_info [system] { header "__chrono/local_info.h" export std_private_chrono_sys_info } -module std_private_chrono_month [system] { header "__chrono/month.h" } -module std_private_chrono_month_weekday [system] { header "__chrono/month_weekday.h" } -module std_private_chrono_monthday [system] { header "__chrono/monthday.h" } -module std_private_chrono_ostream [system] { +module cxx03_std_private_chrono_month [system] { header "__chrono/month.h" } +module cxx03_std_private_chrono_month_weekday [system] { header "__chrono/month_weekday.h" } +module cxx03_std_private_chrono_monthday [system] { header "__chrono/monthday.h" } +module cxx03_std_private_chrono_ostream [system] { header "__chrono/ostream.h" } -module std_private_chrono_parser_std_format_spec [system] { +module cxx03_std_private_chrono_parser_std_format_spec [system] { header "__chrono/parser_std_format_spec.h" } -module std_private_chrono_statically_widen [system] { header "__chrono/statically_widen.h" } -module std_private_chrono_steady_clock [system] { +module cxx03_std_private_chrono_statically_widen [system] { header "__chrono/statically_widen.h" } +module cxx03_std_private_chrono_steady_clock [system] { header "__chrono/steady_clock.h" export std_private_chrono_time_point } -module std_private_chrono_time_zone [system] { +module cxx03_std_private_chrono_time_zone [system] { header "__chrono/time_zone.h" export std_private_memory_unique_ptr } -module std_private_chrono_time_zone_link [system] { +module cxx03_std_private_chrono_time_zone_link [system] { header "__chrono/time_zone_link.h" } -module std_private_chrono_sys_info [system] { +module cxx03_std_private_chrono_sys_info [system] { header "__chrono/sys_info.h" } -module std_private_chrono_system_clock [system] { +module cxx03_std_private_chrono_system_clock [system] { header "__chrono/system_clock.h" export std_private_chrono_time_point } -module std_private_chrono_tzdb [system] { +module cxx03_std_private_chrono_tzdb [system] { header "__chrono/tzdb.h" export * } -module std_private_chrono_tzdb_list [system] { +module cxx03_std_private_chrono_tzdb_list [system] { header "__chrono/tzdb_list.h" export * } -module std_private_chrono_time_point [system] { header "__chrono/time_point.h" } -module std_private_chrono_weekday [system] { header "__chrono/weekday.h" } -module std_private_chrono_year [system] { header "__chrono/year.h" } -module std_private_chrono_year_month [system] { header "__chrono/year_month.h" } -module std_private_chrono_year_month_day [system] { header "__chrono/year_month_day.h" } -module std_private_chrono_year_month_weekday [system] { header "__chrono/year_month_weekday.h" } -module std_private_chrono_zoned_time [system] { header "__chrono/zoned_time.h" } +module cxx03_std_private_chrono_time_point [system] { header "__chrono/time_point.h" } +module cxx03_std_private_chrono_weekday [system] { header "__chrono/weekday.h" } +module cxx03_std_private_chrono_year [system] { header "__chrono/year.h" } +module cxx03_std_private_chrono_year_month [system] { header "__chrono/year_month.h" } +module cxx03_std_private_chrono_year_month_day [system] { header "__chrono/year_month_day.h" } +module cxx03_std_private_chrono_year_month_weekday [system] { header "__chrono/year_month_weekday.h" } +module cxx03_std_private_chrono_zoned_time [system] { header "__chrono/zoned_time.h" } -module std_private_compare_common_comparison_category [system] { header "__compare/common_comparison_category.h" } -module std_private_compare_compare_partial_order_fallback [system] { header "__compare/compare_partial_order_fallback.h" } -module std_private_compare_compare_strong_order_fallback [system] { header "__compare/compare_strong_order_fallback.h" } -module std_private_compare_compare_three_way [system] { header "__compare/compare_three_way.h" } -module std_private_compare_compare_three_way_result [system] { header "__compare/compare_three_way_result.h" } -module std_private_compare_compare_weak_order_fallback [system] { header "__compare/compare_weak_order_fallback.h" } -module std_private_compare_is_eq [system] { header "__compare/is_eq.h" } -module std_private_compare_ordering [system] { header "__compare/ordering.h" } -module std_private_compare_partial_order [system] { header "__compare/partial_order.h" } -module std_private_compare_strong_order [system] { header "__compare/strong_order.h" } -module std_private_compare_synth_three_way [system] { header "__compare/synth_three_way.h" } -module std_private_compare_three_way_comparable [system] { header "__compare/three_way_comparable.h" } -module std_private_compare_weak_order [system] { header "__compare/weak_order.h" } +module cxx03_std_private_compare_common_comparison_category [system] { header "__compare/common_comparison_category.h" } +module cxx03_std_private_compare_compare_partial_order_fallback [system] { header "__compare/compare_partial_order_fallback.h" } +module cxx03_std_private_compare_compare_strong_order_fallback [system] { header "__compare/compare_strong_order_fallback.h" } +module cxx03_std_private_compare_compare_three_way [system] { header "__compare/compare_three_way.h" } +module cxx03_std_private_compare_compare_three_way_result [system] { header "__compare/compare_three_way_result.h" } +module cxx03_std_private_compare_compare_weak_order_fallback [system] { header "__compare/compare_weak_order_fallback.h" } +module cxx03_std_private_compare_is_eq [system] { header "__compare/is_eq.h" } +module cxx03_std_private_compare_ordering [system] { header "__compare/ordering.h" } +module cxx03_std_private_compare_partial_order [system] { header "__compare/partial_order.h" } +module cxx03_std_private_compare_strong_order [system] { header "__compare/strong_order.h" } +module cxx03_std_private_compare_synth_three_way [system] { header "__compare/synth_three_way.h" } +module cxx03_std_private_compare_three_way_comparable [system] { header "__compare/three_way_comparable.h" } +module cxx03_std_private_compare_weak_order [system] { header "__compare/weak_order.h" } -module std_private_complex_complex_fwd [system] { header "__fwd/complex.h" } +module cxx03_std_private_complex_complex_fwd [system] { header "__fwd/complex.h" } -module std_private_concepts_arithmetic [system] { header "__concepts/arithmetic.h" } -module std_private_concepts_assignable [system] { header "__concepts/assignable.h" } -module std_private_concepts_boolean_testable [system] { header "__concepts/boolean_testable.h" } -module std_private_concepts_class_or_enum [system] { header "__concepts/class_or_enum.h" } -module std_private_concepts_common_reference_with [system] { header "__concepts/common_reference_with.h" } -module std_private_concepts_common_with [system] { header "__concepts/common_with.h" } -module std_private_concepts_constructible [system] { +module cxx03_std_private_concepts_arithmetic [system] { header "__concepts/arithmetic.h" } +module cxx03_std_private_concepts_assignable [system] { header "__concepts/assignable.h" } +module cxx03_std_private_concepts_boolean_testable [system] { header "__concepts/boolean_testable.h" } +module cxx03_std_private_concepts_class_or_enum [system] { header "__concepts/class_or_enum.h" } +module cxx03_std_private_concepts_common_reference_with [system] { header "__concepts/common_reference_with.h" } +module cxx03_std_private_concepts_common_with [system] { header "__concepts/common_with.h" } +module cxx03_std_private_concepts_constructible [system] { header "__concepts/constructible.h" export std_private_concepts_destructible } -module std_private_concepts_convertible_to [system] { header "__concepts/convertible_to.h" } -module std_private_concepts_copyable [system] { header "__concepts/copyable.h" } -module std_private_concepts_derived_from [system] { header "__concepts/derived_from.h" } -module std_private_concepts_destructible [system] { +module cxx03_std_private_concepts_convertible_to [system] { header "__concepts/convertible_to.h" } +module cxx03_std_private_concepts_copyable [system] { header "__concepts/copyable.h" } +module cxx03_std_private_concepts_derived_from [system] { header "__concepts/derived_from.h" } +module cxx03_std_private_concepts_destructible [system] { header "__concepts/destructible.h" export std_private_type_traits_is_nothrow_destructible } -module std_private_concepts_different_from [system] { header "__concepts/different_from.h" } -module std_private_concepts_equality_comparable [system] { +module cxx03_std_private_concepts_different_from [system] { header "__concepts/different_from.h" } +module cxx03_std_private_concepts_equality_comparable [system] { header "__concepts/equality_comparable.h" export std_private_type_traits_common_reference } -module std_private_concepts_invocable [system] { header "__concepts/invocable.h" } -module std_private_concepts_movable [system] { +module cxx03_std_private_concepts_invocable [system] { header "__concepts/invocable.h" } +module cxx03_std_private_concepts_movable [system] { header "__concepts/movable.h" export std_private_type_traits_is_object } -module std_private_concepts_predicate [system] { header "__concepts/predicate.h" } -module std_private_concepts_regular [system] { header "__concepts/regular.h" } -module std_private_concepts_relation [system] { header "__concepts/relation.h" } -module std_private_concepts_same_as [system] { +module cxx03_std_private_concepts_predicate [system] { header "__concepts/predicate.h" } +module cxx03_std_private_concepts_regular [system] { header "__concepts/regular.h" } +module cxx03_std_private_concepts_relation [system] { header "__concepts/relation.h" } +module cxx03_std_private_concepts_same_as [system] { header "__concepts/same_as.h" export std_private_type_traits_is_same } -module std_private_concepts_semiregular [system] { header "__concepts/semiregular.h" } -module std_private_concepts_swappable [system] { header "__concepts/swappable.h" } -module std_private_concepts_totally_ordered [system] { header "__concepts/totally_ordered.h" } +module cxx03_std_private_concepts_semiregular [system] { header "__concepts/semiregular.h" } +module cxx03_std_private_concepts_swappable [system] { header "__concepts/swappable.h" } +module cxx03_std_private_concepts_totally_ordered [system] { header "__concepts/totally_ordered.h" } -module std_private_condition_variable_condition_variable [system] { +module cxx03_std_private_condition_variable_condition_variable [system] { header "__condition_variable/condition_variable.h" export * } -module std_private_coroutine_coroutine_handle [system] { header "__coroutine/coroutine_handle.h" } -module std_private_coroutine_coroutine_traits [system] { header "__coroutine/coroutine_traits.h" } -module std_private_coroutine_noop_coroutine_handle [system] { header "__coroutine/noop_coroutine_handle.h" } -module std_private_coroutine_trivial_awaitables [system] { header "__coroutine/trivial_awaitables.h" } +module cxx03_std_private_coroutine_coroutine_handle [system] { header "__coroutine/coroutine_handle.h" } +module cxx03_std_private_coroutine_coroutine_traits [system] { header "__coroutine/coroutine_traits.h" } +module cxx03_std_private_coroutine_noop_coroutine_handle [system] { header "__coroutine/noop_coroutine_handle.h" } +module cxx03_std_private_coroutine_trivial_awaitables [system] { header "__coroutine/trivial_awaitables.h" } -module std_private_debug_utils_randomize_range [system] { header "__debug_utils/randomize_range.h" } -module std_private_debug_utils_sanitizers [system] { header "__debug_utils/sanitizers.h" } -module std_private_debug_utils_strict_weak_ordering_check [system] { +module cxx03_std_private_debug_utils_randomize_range [system] { header "__debug_utils/randomize_range.h" } +module cxx03_std_private_debug_utils_sanitizers [system] { header "__debug_utils/sanitizers.h" } +module cxx03_std_private_debug_utils_strict_weak_ordering_check [system] { header "__debug_utils/strict_weak_ordering_check.h" export std_private_type_traits_is_constant_evaluated } -module std_private_deque_fwd [system] { header "__fwd/deque.h" } +module cxx03_std_private_deque_fwd [system] { header "__fwd/deque.h" } -module std_private_exception_exception [system] { header "__exception/exception.h" } -module std_private_exception_exception_ptr [system] { +module cxx03_std_private_exception_exception [system] { header "__exception/exception.h" } +module cxx03_std_private_exception_exception_ptr [system] { header "__exception/exception_ptr.h" export std_private_exception_operations } -module std_private_exception_nested_exception [system] { header "__exception/nested_exception.h" } -module std_private_exception_operations [system] { header "__exception/operations.h" } -module std_private_exception_terminate [system] { header "__exception/terminate.h" } +module cxx03_std_private_exception_nested_exception [system] { header "__exception/nested_exception.h" } +module cxx03_std_private_exception_operations [system] { header "__exception/operations.h" } +module cxx03_std_private_exception_terminate [system] { header "__exception/terminate.h" } -module std_private_expected_bad_expected_access [system] { header "__expected/bad_expected_access.h" } -module std_private_expected_expected [system] { header "__expected/expected.h" } -module std_private_expected_unexpect [system] { header "__expected/unexpect.h" } -module std_private_expected_unexpected [system] { header "__expected/unexpected.h" } +module cxx03_std_private_expected_bad_expected_access [system] { header "__expected/bad_expected_access.h" } +module cxx03_std_private_expected_expected [system] { header "__expected/expected.h" } +module cxx03_std_private_expected_unexpect [system] { header "__expected/unexpect.h" } +module cxx03_std_private_expected_unexpected [system] { header "__expected/unexpected.h" } -module std_private_filesystem_copy_options [system] { header "__filesystem/copy_options.h" } -module std_private_filesystem_directory_entry [system] { +module cxx03_std_private_filesystem_copy_options [system] { header "__filesystem/copy_options.h" } +module cxx03_std_private_filesystem_directory_entry [system] { header "__filesystem/directory_entry.h" export * } -module std_private_filesystem_directory_iterator [system] { +module cxx03_std_private_filesystem_directory_iterator [system] { header "__filesystem/directory_iterator.h" export * } -module std_private_filesystem_directory_options [system] { header "__filesystem/directory_options.h" } -module std_private_filesystem_file_status [system] { header "__filesystem/file_status.h" } -module std_private_filesystem_file_time_type [system] { header "__filesystem/file_time_type.h" } -module std_private_filesystem_file_type [system] { header "__filesystem/file_type.h" } -module std_private_filesystem_filesystem_error [system] { +module cxx03_std_private_filesystem_directory_options [system] { header "__filesystem/directory_options.h" } +module cxx03_std_private_filesystem_file_status [system] { header "__filesystem/file_status.h" } +module cxx03_std_private_filesystem_file_time_type [system] { header "__filesystem/file_time_type.h" } +module cxx03_std_private_filesystem_file_type [system] { header "__filesystem/file_type.h" } +module cxx03_std_private_filesystem_filesystem_error [system] { header "__filesystem/filesystem_error.h" export * } -module std_private_filesystem_operations [system] { header "__filesystem/operations.h" } -module std_private_filesystem_path [system] { +module cxx03_std_private_filesystem_operations [system] { header "__filesystem/operations.h" } +module cxx03_std_private_filesystem_path [system] { header "__filesystem/path.h" export * } -module std_private_filesystem_path_iterator [system] { header "__filesystem/path_iterator.h" } -module std_private_filesystem_perm_options [system] { header "__filesystem/perm_options.h" } -module std_private_filesystem_perms [system] { header "__filesystem/perms.h" } -module std_private_filesystem_recursive_directory_iterator [system] { +module cxx03_std_private_filesystem_path_iterator [system] { header "__filesystem/path_iterator.h" } +module cxx03_std_private_filesystem_perm_options [system] { header "__filesystem/perm_options.h" } +module cxx03_std_private_filesystem_perms [system] { header "__filesystem/perms.h" } +module cxx03_std_private_filesystem_recursive_directory_iterator [system] { header "__filesystem/recursive_directory_iterator.h" export * } -module std_private_filesystem_space_info [system] { header "__filesystem/space_info.h" } -module std_private_filesystem_u8path [system] { header "__filesystem/u8path.h" } +module cxx03_std_private_filesystem_space_info [system] { header "__filesystem/space_info.h" } +module cxx03_std_private_filesystem_u8path [system] { header "__filesystem/u8path.h" } -module std_private_format_buffer [system] { header "__format/buffer.h" } -module std_private_format_concepts [system] { header "__format/concepts.h" } -module std_private_format_container_adaptor [system] { header "__format/container_adaptor.h" } -module std_private_format_enable_insertable [system] { header "__format/enable_insertable.h" } -module std_private_format_escaped_output_table [system] { header "__format/escaped_output_table.h" } -module std_private_format_extended_grapheme_cluster_table [system] { header "__format/extended_grapheme_cluster_table.h" } -module std_private_format_format_arg [system] { header "__format/format_arg.h" } -module std_private_format_format_arg_store [system] { header "__format/format_arg_store.h" } -module std_private_format_format_args [system] { header "__format/format_args.h" } -module std_private_format_format_context [system] { +module cxx03_std_private_format_buffer [system] { header "__format/buffer.h" } +module cxx03_std_private_format_concepts [system] { header "__format/concepts.h" } +module cxx03_std_private_format_container_adaptor [system] { header "__format/container_adaptor.h" } +module cxx03_std_private_format_enable_insertable [system] { header "__format/enable_insertable.h" } +module cxx03_std_private_format_escaped_output_table [system] { header "__format/escaped_output_table.h" } +module cxx03_std_private_format_extended_grapheme_cluster_table [system] { header "__format/extended_grapheme_cluster_table.h" } +module cxx03_std_private_format_format_arg [system] { header "__format/format_arg.h" } +module cxx03_std_private_format_format_arg_store [system] { header "__format/format_arg_store.h" } +module cxx03_std_private_format_format_args [system] { header "__format/format_args.h" } +module cxx03_std_private_format_format_context [system] { header "__format/format_context.h" export * } -module std_private_format_format_error [system] { header "__format/format_error.h" } -module std_private_format_format_functions [system] { +module cxx03_std_private_format_format_error [system] { header "__format/format_error.h" } +module cxx03_std_private_format_format_functions [system] { header "__format/format_functions.h" export std_string } -module std_private_format_fwd [system] { header "__fwd/format.h" } -module std_private_format_format_parse_context [system] { header "__format/format_parse_context.h" } -module std_private_format_format_string [system] { header "__format/format_string.h" } -module std_private_format_format_to_n_result [system] { +module cxx03_std_private_format_fwd [system] { header "__fwd/format.h" } +module cxx03_std_private_format_format_parse_context [system] { header "__format/format_parse_context.h" } +module cxx03_std_private_format_format_string [system] { header "__format/format_string.h" } +module cxx03_std_private_format_format_to_n_result [system] { header "__format/format_to_n_result.h" export std_private_iterator_incrementable_traits } -module std_private_format_formatter [system] { header "__format/formatter.h" } -module std_private_format_formatter_bool [system] { header "__format/formatter_bool.h" } -module std_private_format_formatter_char [system] { header "__format/formatter_char.h" } -module std_private_format_formatter_floating_point [system] { header "__format/formatter_floating_point.h" } -module std_private_format_formatter_integer [system] { header "__format/formatter_integer.h" } -module std_private_format_formatter_integral [system] { header "__format/formatter_integral.h" } -module std_private_format_formatter_output [system] { header "__format/formatter_output.h" } -module std_private_format_formatter_pointer [system] { header "__format/formatter_pointer.h" } -module std_private_format_formatter_string [system] { header "__format/formatter_string.h" } -module std_private_format_formatter_tuple [system] { header "__format/formatter_tuple.h" } -module std_private_format_indic_conjunct_break_table [system] { header "__format/indic_conjunct_break_table.h" } -module std_private_format_parser_std_format_spec [system] { header "__format/parser_std_format_spec.h" } -module std_private_format_range_default_formatter [system] { header "__format/range_default_formatter.h" } -module std_private_format_range_formatter [system] { header "__format/range_formatter.h" } -module std_private_format_unicode [system] { +module cxx03_std_private_format_formatter [system] { header "__format/formatter.h" } +module cxx03_std_private_format_formatter_bool [system] { header "__format/formatter_bool.h" } +module cxx03_std_private_format_formatter_char [system] { header "__format/formatter_char.h" } +module cxx03_std_private_format_formatter_floating_point [system] { header "__format/formatter_floating_point.h" } +module cxx03_std_private_format_formatter_integer [system] { header "__format/formatter_integer.h" } +module cxx03_std_private_format_formatter_integral [system] { header "__format/formatter_integral.h" } +module cxx03_std_private_format_formatter_output [system] { header "__format/formatter_output.h" } +module cxx03_std_private_format_formatter_pointer [system] { header "__format/formatter_pointer.h" } +module cxx03_std_private_format_formatter_string [system] { header "__format/formatter_string.h" } +module cxx03_std_private_format_formatter_tuple [system] { header "__format/formatter_tuple.h" } +module cxx03_std_private_format_indic_conjunct_break_table [system] { header "__format/indic_conjunct_break_table.h" } +module cxx03_std_private_format_parser_std_format_spec [system] { header "__format/parser_std_format_spec.h" } +module cxx03_std_private_format_range_default_formatter [system] { header "__format/range_default_formatter.h" } +module cxx03_std_private_format_range_formatter [system] { header "__format/range_formatter.h" } +module cxx03_std_private_format_unicode [system] { header "__format/unicode.h" export std_private_format_extended_grapheme_cluster_table export std_private_format_indic_conjunct_break_table } -module std_private_format_width_estimation_table [system] { header "__format/width_estimation_table.h" } -module std_private_format_write_escaped [system] { header "__format/write_escaped.h" } +module cxx03_std_private_format_width_estimation_table [system] { header "__format/width_estimation_table.h" } +module cxx03_std_private_format_write_escaped [system] { header "__format/write_escaped.h" } -module std_private_functional_binary_function [system] { header "__functional/binary_function.h" } -module std_private_functional_binary_negate [system] { header "__functional/binary_negate.h" } -module std_private_functional_bind [system] { header "__functional/bind.h" } -module std_private_functional_bind_back [system] { header "__functional/bind_back.h" } -module std_private_functional_bind_front [system] { header "__functional/bind_front.h" } -module std_private_functional_binder1st [system] { header "__functional/binder1st.h" } -module std_private_functional_binder2nd [system] { header "__functional/binder2nd.h" } -module std_private_functional_boyer_moore_searcher [system] { +module cxx03_std_private_functional_binary_function [system] { header "__functional/binary_function.h" } +module cxx03_std_private_functional_binary_negate [system] { header "__functional/binary_negate.h" } +module cxx03_std_private_functional_bind [system] { header "__functional/bind.h" } +module cxx03_std_private_functional_bind_back [system] { header "__functional/bind_back.h" } +module cxx03_std_private_functional_bind_front [system] { header "__functional/bind_front.h" } +module cxx03_std_private_functional_binder1st [system] { header "__functional/binder1st.h" } +module cxx03_std_private_functional_binder2nd [system] { header "__functional/binder2nd.h" } +module cxx03_std_private_functional_boyer_moore_searcher [system] { header "__functional/boyer_moore_searcher.h" export std_private_memory_shared_ptr } -module std_private_functional_compose [system] { +module cxx03_std_private_functional_compose [system] { header "__functional/compose.h" export std_private_functional_perfect_forward } -module std_private_functional_default_searcher [system] { header "__functional/default_searcher.h" } -module std_private_functional_function [system] { header "__functional/function.h" } -module std_private_functional_hash [system] { +module cxx03_std_private_functional_default_searcher [system] { header "__functional/default_searcher.h" } +module cxx03_std_private_functional_function [system] { header "__functional/function.h" } +module cxx03_std_private_functional_hash [system] { header "__functional/hash.h" export std_cstdint export std_private_type_traits_underlying_type export std_private_utility_pair } -module std_private_functional_fwd [system] { header "__fwd/functional.h" } -module std_private_functional_identity [system] { header "__functional/identity.h" } -module std_private_functional_invoke [system] { +module cxx03_std_private_functional_fwd [system] { header "__fwd/functional.h" } +module cxx03_std_private_functional_identity [system] { header "__functional/identity.h" } +module cxx03_std_private_functional_invoke [system] { header "__functional/invoke.h" export * } -module std_private_functional_is_transparent [system] { header "__functional/is_transparent.h" } -module std_private_functional_mem_fn [system] { header "__functional/mem_fn.h" } -module std_private_functional_mem_fun_ref [system] { header "__functional/mem_fun_ref.h" } -module std_private_functional_not_fn [system] { +module cxx03_std_private_functional_is_transparent [system] { header "__functional/is_transparent.h" } +module cxx03_std_private_functional_mem_fn [system] { header "__functional/mem_fn.h" } +module cxx03_std_private_functional_mem_fun_ref [system] { header "__functional/mem_fun_ref.h" } +module cxx03_std_private_functional_not_fn [system] { header "__functional/not_fn.h" export std_private_functional_perfect_forward } -module std_private_functional_operations [system] { header "__functional/operations.h" } -module std_private_functional_perfect_forward [system] { +module cxx03_std_private_functional_operations [system] { header "__functional/operations.h" } +module cxx03_std_private_functional_perfect_forward [system] { header "__functional/perfect_forward.h" export * } -module std_private_functional_pointer_to_binary_function [system] { header "__functional/pointer_to_binary_function.h" } -module std_private_functional_pointer_to_unary_function [system] { header "__functional/pointer_to_unary_function.h" } -module std_private_functional_ranges_operations [system] { header "__functional/ranges_operations.h" } -module std_private_functional_reference_wrapper [system] { header "__functional/reference_wrapper.h" } -module std_private_functional_unary_function [system] { header "__functional/unary_function.h" } -module std_private_functional_unary_negate [system] { header "__functional/unary_negate.h" } -module std_private_functional_weak_result_type [system] { header "__functional/weak_result_type.h" } +module cxx03_std_private_functional_pointer_to_binary_function [system] { header "__functional/pointer_to_binary_function.h" } +module cxx03_std_private_functional_pointer_to_unary_function [system] { header "__functional/pointer_to_unary_function.h" } +module cxx03_std_private_functional_ranges_operations [system] { header "__functional/ranges_operations.h" } +module cxx03_std_private_functional_reference_wrapper [system] { header "__functional/reference_wrapper.h" } +module cxx03_std_private_functional_unary_function [system] { header "__functional/unary_function.h" } +module cxx03_std_private_functional_unary_negate [system] { header "__functional/unary_negate.h" } +module cxx03_std_private_functional_weak_result_type [system] { header "__functional/weak_result_type.h" } -module std_private_ios_fpos [system] { header "__ios/fpos.h" } +module cxx03_std_private_ios_fpos [system] { header "__ios/fpos.h" } -module std_private_iosfwd_fstream_fwd [system] { header "__fwd/fstream.h" } -module std_private_iosfwd_ios_fwd [system] { header "__fwd/ios.h" } -module std_private_iosfwd_istream_fwd [system] { header "__fwd/istream.h" } -module std_private_iosfwd_ostream_fwd [system] { header "__fwd/ostream.h" } -module std_private_iosfwd_sstream_fwd [system] { header "__fwd/sstream.h" } -module std_private_iosfwd_streambuf_fwd [system] { header "__fwd/streambuf.h" } +module cxx03_std_private_iosfwd_fstream_fwd [system] { header "__fwd/fstream.h" } +module cxx03_std_private_iosfwd_ios_fwd [system] { header "__fwd/ios.h" } +module cxx03_std_private_iosfwd_istream_fwd [system] { header "__fwd/istream.h" } +module cxx03_std_private_iosfwd_ostream_fwd [system] { header "__fwd/ostream.h" } +module cxx03_std_private_iosfwd_sstream_fwd [system] { header "__fwd/sstream.h" } +module cxx03_std_private_iosfwd_streambuf_fwd [system] { header "__fwd/streambuf.h" } -module std_private_iterator_access [system] { header "__iterator/access.h" } -module std_private_iterator_advance [system] { header "__iterator/advance.h" } -module std_private_iterator_aliasing_iterator [system] { header "__iterator/aliasing_iterator.h" } -module std_private_iterator_back_insert_iterator [system] { header "__iterator/back_insert_iterator.h" } -module std_private_iterator_bounded_iter [system] { header "__iterator/bounded_iter.h" } -module std_private_iterator_common_iterator [system] { header "__iterator/common_iterator.h" } -module std_private_iterator_concepts [system] { +module cxx03_std_private_iterator_access [system] { header "__iterator/access.h" } +module cxx03_std_private_iterator_advance [system] { header "__iterator/advance.h" } +module cxx03_std_private_iterator_aliasing_iterator [system] { header "__iterator/aliasing_iterator.h" } +module cxx03_std_private_iterator_back_insert_iterator [system] { header "__iterator/back_insert_iterator.h" } +module cxx03_std_private_iterator_bounded_iter [system] { header "__iterator/bounded_iter.h" } +module cxx03_std_private_iterator_common_iterator [system] { header "__iterator/common_iterator.h" } +module cxx03_std_private_iterator_concepts [system] { header "__iterator/concepts.h" export std_private_concepts_constructible export std_private_concepts_equality_comparable @@ -1401,509 +1401,509 @@ module std_private_iterator_concepts [system] { export std_private_type_traits_is_reference export std_private_type_traits_remove_cvref } -module std_private_iterator_counted_iterator [system] { header "__iterator/counted_iterator.h" } -module std_private_iterator_cpp17_iterator_concepts [system] { header "__iterator/cpp17_iterator_concepts.h" } -module std_private_iterator_data [system] { header "__iterator/data.h" } -module std_private_iterator_default_sentinel [system] { header "__iterator/default_sentinel.h" } -module std_private_iterator_distance [system] { +module cxx03_std_private_iterator_counted_iterator [system] { header "__iterator/counted_iterator.h" } +module cxx03_std_private_iterator_cpp17_iterator_concepts [system] { header "__iterator/cpp17_iterator_concepts.h" } +module cxx03_std_private_iterator_data [system] { header "__iterator/data.h" } +module cxx03_std_private_iterator_default_sentinel [system] { header "__iterator/default_sentinel.h" } +module cxx03_std_private_iterator_distance [system] { header "__iterator/distance.h" export std_private_ranges_size } -module std_private_iterator_empty [system] { header "__iterator/empty.h" } -module std_private_iterator_erase_if_container [system] { header "__iterator/erase_if_container.h" } -module std_private_iterator_front_insert_iterator [system] { header "__iterator/front_insert_iterator.h" } -module std_private_iterator_incrementable_traits [system] { header "__iterator/incrementable_traits.h" } -module std_private_iterator_indirectly_comparable [system] { header "__iterator/indirectly_comparable.h" } -module std_private_iterator_insert_iterator [system] { header "__iterator/insert_iterator.h" } -module std_private_iterator_istream_iterator [system] { header "__iterator/istream_iterator.h" } -module std_private_iterator_istreambuf_iterator [system] { header "__iterator/istreambuf_iterator.h" } -module std_private_iterator_iter_move [system] { header "__iterator/iter_move.h" } -module std_private_iterator_iter_swap [system] { header "__iterator/iter_swap.h" } -module std_private_iterator_iterator [system] { header "__iterator/iterator.h" } -module std_private_iterator_iterator_traits [system] { +module cxx03_std_private_iterator_empty [system] { header "__iterator/empty.h" } +module cxx03_std_private_iterator_erase_if_container [system] { header "__iterator/erase_if_container.h" } +module cxx03_std_private_iterator_front_insert_iterator [system] { header "__iterator/front_insert_iterator.h" } +module cxx03_std_private_iterator_incrementable_traits [system] { header "__iterator/incrementable_traits.h" } +module cxx03_std_private_iterator_indirectly_comparable [system] { header "__iterator/indirectly_comparable.h" } +module cxx03_std_private_iterator_insert_iterator [system] { header "__iterator/insert_iterator.h" } +module cxx03_std_private_iterator_istream_iterator [system] { header "__iterator/istream_iterator.h" } +module cxx03_std_private_iterator_istreambuf_iterator [system] { header "__iterator/istreambuf_iterator.h" } +module cxx03_std_private_iterator_iter_move [system] { header "__iterator/iter_move.h" } +module cxx03_std_private_iterator_iter_swap [system] { header "__iterator/iter_swap.h" } +module cxx03_std_private_iterator_iterator [system] { header "__iterator/iterator.h" } +module cxx03_std_private_iterator_iterator_traits [system] { header "__iterator/iterator_traits.h" export std_private_type_traits_is_primary_template } -module std_private_iterator_iterator_with_data [system] { header "__iterator/iterator_with_data.h" } -module std_private_iterator_mergeable [system] { +module cxx03_std_private_iterator_iterator_with_data [system] { header "__iterator/iterator_with_data.h" } +module cxx03_std_private_iterator_mergeable [system] { header "__iterator/mergeable.h" export std_private_functional_ranges_operations } -module std_private_iterator_move_iterator [system] { header "__iterator/move_iterator.h" } -module std_private_iterator_move_sentinel [system] { header "__iterator/move_sentinel.h" } -module std_private_iterator_next [system] { header "__iterator/next.h" } -module std_private_iterator_ostream_iterator [system] { header "__iterator/ostream_iterator.h" } -module std_private_iterator_ostreambuf_iterator [system] { +module cxx03_std_private_iterator_move_iterator [system] { header "__iterator/move_iterator.h" } +module cxx03_std_private_iterator_move_sentinel [system] { header "__iterator/move_sentinel.h" } +module cxx03_std_private_iterator_next [system] { header "__iterator/next.h" } +module cxx03_std_private_iterator_ostream_iterator [system] { header "__iterator/ostream_iterator.h" } +module cxx03_std_private_iterator_ostreambuf_iterator [system] { header "__iterator/ostreambuf_iterator.h" export * } -module std_private_iterator_permutable [system] { header "__iterator/permutable.h" } -module std_private_iterator_prev [system] { header "__iterator/prev.h" } -module std_private_iterator_projected [system] { header "__iterator/projected.h" } -module std_private_iterator_ranges_iterator_traits [system] { header "__iterator/ranges_iterator_traits.h" } -module std_private_iterator_readable_traits [system] { header "__iterator/readable_traits.h" } -module std_private_iterator_reverse_access [system] { header "__iterator/reverse_access.h" } -module std_private_iterator_reverse_iterator [system] { header "__iterator/reverse_iterator.h" } -module std_private_iterator_segmented_iterator [system] { header "__iterator/segmented_iterator.h" } -module std_private_iterator_size [system] { header "__iterator/size.h" } -module std_private_iterator_sortable [system] { +module cxx03_std_private_iterator_permutable [system] { header "__iterator/permutable.h" } +module cxx03_std_private_iterator_prev [system] { header "__iterator/prev.h" } +module cxx03_std_private_iterator_projected [system] { header "__iterator/projected.h" } +module cxx03_std_private_iterator_ranges_iterator_traits [system] { header "__iterator/ranges_iterator_traits.h" } +module cxx03_std_private_iterator_readable_traits [system] { header "__iterator/readable_traits.h" } +module cxx03_std_private_iterator_reverse_access [system] { header "__iterator/reverse_access.h" } +module cxx03_std_private_iterator_reverse_iterator [system] { header "__iterator/reverse_iterator.h" } +module cxx03_std_private_iterator_segmented_iterator [system] { header "__iterator/segmented_iterator.h" } +module cxx03_std_private_iterator_size [system] { header "__iterator/size.h" } +module cxx03_std_private_iterator_sortable [system] { header "__iterator/sortable.h" export std_private_functional_ranges_operations } -module std_private_iterator_unreachable_sentinel [system] { header "__iterator/unreachable_sentinel.h" } -module std_private_iterator_wrap_iter [system] { header "__iterator/wrap_iter.h" } +module cxx03_std_private_iterator_unreachable_sentinel [system] { header "__iterator/unreachable_sentinel.h" } +module cxx03_std_private_iterator_wrap_iter [system] { header "__iterator/wrap_iter.h" } -module std_private_locale_locale_base_api_android [system] { textual header "__locale_dir/locale_base_api/android.h" } -module std_private_locale_locale_base_api_bsd_locale_defaults [system] { textual header "__locale_dir/locale_base_api/bsd_locale_defaults.h" } -module std_private_locale_locale_base_api_bsd_locale_fallbacks [system] { textual header "__locale_dir/locale_base_api/bsd_locale_fallbacks.h" } -module std_private_locale_locale_base_api_fuchsia [system] { textual header "__locale_dir/locale_base_api/fuchsia.h" } -module std_private_locale_locale_base_api_ibm [system] { textual header "__locale_dir/locale_base_api/ibm.h" } -module std_private_locale_locale_base_api_locale_guard [system] { header "__locale_dir/locale_base_api/locale_guard.h" } -module std_private_locale_locale_base_api_musl [system] { textual header "__locale_dir/locale_base_api/musl.h" } -module std_private_locale_locale_base_api_newlib [system] { textual header "__locale_dir/locale_base_api/newlib.h" } -module std_private_locale_locale_base_api_openbsd [system] { textual header "__locale_dir/locale_base_api/openbsd.h" } -module std_private_locale_locale_base_api_win32 [system] { textual header "__locale_dir/locale_base_api/win32.h" } -module std_private_locale_locale_base_api [system] { +module cxx03_std_private_locale_locale_base_api_android [system] { textual header "__locale_dir/locale_base_api/android.h" } +module cxx03_std_private_locale_locale_base_api_bsd_locale_defaults [system] { textual header "__locale_dir/locale_base_api/bsd_locale_defaults.h" } +module cxx03_std_private_locale_locale_base_api_bsd_locale_fallbacks [system] { textual header "__locale_dir/locale_base_api/bsd_locale_fallbacks.h" } +module cxx03_std_private_locale_locale_base_api_fuchsia [system] { textual header "__locale_dir/locale_base_api/fuchsia.h" } +module cxx03_std_private_locale_locale_base_api_ibm [system] { textual header "__locale_dir/locale_base_api/ibm.h" } +module cxx03_std_private_locale_locale_base_api_locale_guard [system] { header "__locale_dir/locale_base_api/locale_guard.h" } +module cxx03_std_private_locale_locale_base_api_musl [system] { textual header "__locale_dir/locale_base_api/musl.h" } +module cxx03_std_private_locale_locale_base_api_newlib [system] { textual header "__locale_dir/locale_base_api/newlib.h" } +module cxx03_std_private_locale_locale_base_api_openbsd [system] { textual header "__locale_dir/locale_base_api/openbsd.h" } +module cxx03_std_private_locale_locale_base_api_win32 [system] { textual header "__locale_dir/locale_base_api/win32.h" } +module cxx03_std_private_locale_locale_base_api [system] { header "__locale_dir/locale_base_api.h" export * } -module std_private_math_abs [system] { header "__math/abs.h" } -module std_private_math_copysign [system] { header "__math/copysign.h" } -module std_private_math_error_functions [system] { header "__math/error_functions.h" } -module std_private_math_exponential_functions [system] { header "__math/exponential_functions.h" } -module std_private_math_fdim [system] { header "__math/fdim.h" } -module std_private_math_fma [system] { header "__math/fma.h" } -module std_private_math_gamma [system] { header "__math/gamma.h" } -module std_private_math_hyperbolic_functions [system] { header "__math/hyperbolic_functions.h" } -module std_private_math_hypot [system] { header "__math/hypot.h" } -module std_private_math_inverse_hyperbolic_functions [system] { header "__math/inverse_hyperbolic_functions.h" } -module std_private_math_inverse_trigonometric_functions [system] { header "__math/inverse_trigonometric_functions.h" } -module std_private_math_logarithms [system] { header "__math/logarithms.h" } -module std_private_math_min_max [system] { header "__math/min_max.h" } -module std_private_math_modulo [system] { header "__math/modulo.h" } -module std_private_math_remainder [system] { header "__math/remainder.h" } -module std_private_math_roots [system] { header "__math/roots.h" } -module std_private_math_rounding_functions [system] { header "__math/rounding_functions.h" } -module std_private_math_special_functions [system] { header "__math/special_functions.h" } -module std_private_math_traits [system] { header "__math/traits.h" } -module std_private_math_trigonometric_functions [system] { header "__math/trigonometric_functions.h" } +module cxx03_std_private_math_abs [system] { header "__math/abs.h" } +module cxx03_std_private_math_copysign [system] { header "__math/copysign.h" } +module cxx03_std_private_math_error_functions [system] { header "__math/error_functions.h" } +module cxx03_std_private_math_exponential_functions [system] { header "__math/exponential_functions.h" } +module cxx03_std_private_math_fdim [system] { header "__math/fdim.h" } +module cxx03_std_private_math_fma [system] { header "__math/fma.h" } +module cxx03_std_private_math_gamma [system] { header "__math/gamma.h" } +module cxx03_std_private_math_hyperbolic_functions [system] { header "__math/hyperbolic_functions.h" } +module cxx03_std_private_math_hypot [system] { header "__math/hypot.h" } +module cxx03_std_private_math_inverse_hyperbolic_functions [system] { header "__math/inverse_hyperbolic_functions.h" } +module cxx03_std_private_math_inverse_trigonometric_functions [system] { header "__math/inverse_trigonometric_functions.h" } +module cxx03_std_private_math_logarithms [system] { header "__math/logarithms.h" } +module cxx03_std_private_math_min_max [system] { header "__math/min_max.h" } +module cxx03_std_private_math_modulo [system] { header "__math/modulo.h" } +module cxx03_std_private_math_remainder [system] { header "__math/remainder.h" } +module cxx03_std_private_math_roots [system] { header "__math/roots.h" } +module cxx03_std_private_math_rounding_functions [system] { header "__math/rounding_functions.h" } +module cxx03_std_private_math_special_functions [system] { header "__math/special_functions.h" } +module cxx03_std_private_math_traits [system] { header "__math/traits.h" } +module cxx03_std_private_math_trigonometric_functions [system] { header "__math/trigonometric_functions.h" } -module std_private_mdspan_default_accessor [system] { header "__mdspan/default_accessor.h" } -module std_private_mdspan_extents [system] { +module cxx03_std_private_mdspan_default_accessor [system] { header "__mdspan/default_accessor.h" } +module cxx03_std_private_mdspan_extents [system] { header "__mdspan/extents.h" export * } -module std_private_mdspan_layout_left [system] { header "__mdspan/layout_left.h" } -module std_private_mdspan_layout_right [system] { header "__mdspan/layout_right.h" } -module std_private_mdspan_layout_stride [system] { header "__mdspan/layout_stride.h" } -module std_private_mdspan_mdspan [system] { header "__mdspan/mdspan.h" } -module std_private_mdspan_mdspan_fwd [system] { header "__fwd/mdspan.h" } +module cxx03_std_private_mdspan_layout_left [system] { header "__mdspan/layout_left.h" } +module cxx03_std_private_mdspan_layout_right [system] { header "__mdspan/layout_right.h" } +module cxx03_std_private_mdspan_layout_stride [system] { header "__mdspan/layout_stride.h" } +module cxx03_std_private_mdspan_mdspan [system] { header "__mdspan/mdspan.h" } +module cxx03_std_private_mdspan_mdspan_fwd [system] { header "__fwd/mdspan.h" } -module std_private_memory_addressof [system] { header "__memory/addressof.h" } -module std_private_memory_align [system] { header "__memory/align.h" } -module std_private_memory_aligned_alloc [system] { header "__memory/aligned_alloc.h" } -module std_private_memory_allocate_at_least [system] { header "__memory/allocate_at_least.h" } -module std_private_memory_allocation_guard [system] { header "__memory/allocation_guard.h" } -module std_private_memory_allocator [system] { header "__memory/allocator.h" } -module std_private_memory_allocator_arg_t [system] { header "__memory/allocator_arg_t.h" } -module std_private_memory_allocator_destructor [system] { header "__memory/allocator_destructor.h" } -module std_private_memory_allocator_traits [system] { header "__memory/allocator_traits.h" } -module std_private_memory_assume_aligned [system] { header "__memory/assume_aligned.h" } -module std_private_memory_auto_ptr [system] { header "__memory/auto_ptr.h" } -module std_private_memory_builtin_new_allocator [system] { +module cxx03_std_private_memory_addressof [system] { header "__memory/addressof.h" } +module cxx03_std_private_memory_align [system] { header "__memory/align.h" } +module cxx03_std_private_memory_aligned_alloc [system] { header "__memory/aligned_alloc.h" } +module cxx03_std_private_memory_allocate_at_least [system] { header "__memory/allocate_at_least.h" } +module cxx03_std_private_memory_allocation_guard [system] { header "__memory/allocation_guard.h" } +module cxx03_std_private_memory_allocator [system] { header "__memory/allocator.h" } +module cxx03_std_private_memory_allocator_arg_t [system] { header "__memory/allocator_arg_t.h" } +module cxx03_std_private_memory_allocator_destructor [system] { header "__memory/allocator_destructor.h" } +module cxx03_std_private_memory_allocator_traits [system] { header "__memory/allocator_traits.h" } +module cxx03_std_private_memory_assume_aligned [system] { header "__memory/assume_aligned.h" } +module cxx03_std_private_memory_auto_ptr [system] { header "__memory/auto_ptr.h" } +module cxx03_std_private_memory_builtin_new_allocator [system] { header "__memory/builtin_new_allocator.h" export * } -module std_private_memory_compressed_pair [system] { header "__memory/compressed_pair.h" } -module std_private_memory_concepts [system] { +module cxx03_std_private_memory_compressed_pair [system] { header "__memory/compressed_pair.h" } +module cxx03_std_private_memory_concepts [system] { header "__memory/concepts.h" export std_private_type_traits_remove_reference } -module std_private_memory_construct_at [system] { header "__memory/construct_at.h" } -module std_private_memory_destruct_n [system] { header "__memory/destruct_n.h" } -module std_private_memory_fwd [system] { header "__fwd/memory.h" } -module std_private_memory_inout_ptr [system] { header "__memory/inout_ptr.h" } -module std_private_memory_out_ptr [system] { header "__memory/out_ptr.h" } -module std_private_memory_pointer_traits [system] { header "__memory/pointer_traits.h" } -module std_private_memory_ranges_construct_at [system] { header "__memory/ranges_construct_at.h" } -module std_private_memory_ranges_uninitialized_algorithms [system] { +module cxx03_std_private_memory_construct_at [system] { header "__memory/construct_at.h" } +module cxx03_std_private_memory_destruct_n [system] { header "__memory/destruct_n.h" } +module cxx03_std_private_memory_fwd [system] { header "__fwd/memory.h" } +module cxx03_std_private_memory_inout_ptr [system] { header "__memory/inout_ptr.h" } +module cxx03_std_private_memory_out_ptr [system] { header "__memory/out_ptr.h" } +module cxx03_std_private_memory_pointer_traits [system] { header "__memory/pointer_traits.h" } +module cxx03_std_private_memory_ranges_construct_at [system] { header "__memory/ranges_construct_at.h" } +module cxx03_std_private_memory_ranges_uninitialized_algorithms [system] { header "__memory/ranges_uninitialized_algorithms.h" export std_private_algorithm_in_out_result } -module std_private_memory_raw_storage_iterator [system] { header "__memory/raw_storage_iterator.h" } -module std_private_memory_shared_ptr [system] { +module cxx03_std_private_memory_raw_storage_iterator [system] { header "__memory/raw_storage_iterator.h" } +module cxx03_std_private_memory_shared_ptr [system] { header "__memory/shared_ptr.h" export std_private_memory_uninitialized_algorithms } -module std_private_memory_swap_allocator [system] { header "__memory/swap_allocator.h" } -module std_private_memory_temp_value [system] { header "__memory/temp_value.h" } -module std_private_memory_temporary_buffer [system] { +module cxx03_std_private_memory_swap_allocator [system] { header "__memory/swap_allocator.h" } +module cxx03_std_private_memory_temp_value [system] { header "__memory/temp_value.h" } +module cxx03_std_private_memory_temporary_buffer [system] { header "__memory/temporary_buffer.h" export std_private_utility_pair } -module std_private_memory_uninitialized_algorithms [system] { +module cxx03_std_private_memory_uninitialized_algorithms [system] { header "__memory/uninitialized_algorithms.h" export std_private_algorithm_copy } -module std_private_memory_unique_ptr [system] { +module cxx03_std_private_memory_unique_ptr [system] { header "__memory/unique_ptr.h" export std_private_type_traits_add_lvalue_reference export std_private_type_traits_is_pointer export std_private_type_traits_type_identity } -module std_private_memory_uses_allocator [system] { header "__memory/uses_allocator.h" } -module std_private_memory_uses_allocator_construction [system] { header "__memory/uses_allocator_construction.h" } -module std_private_memory_voidify [system] { header "__memory/voidify.h" } +module cxx03_std_private_memory_uses_allocator [system] { header "__memory/uses_allocator.h" } +module cxx03_std_private_memory_uses_allocator_construction [system] { header "__memory/uses_allocator_construction.h" } +module cxx03_std_private_memory_voidify [system] { header "__memory/voidify.h" } -module std_private_memory_resource_memory_resource [system] { header "__memory_resource/memory_resource.h" } -module std_private_memory_resource_memory_resource_fwd [system] { header "__fwd/memory_resource.h" } -module std_private_memory_resource_monotonic_buffer_resource [system] { header "__memory_resource/monotonic_buffer_resource.h" } -module std_private_memory_resource_polymorphic_allocator [system] { header "__memory_resource/polymorphic_allocator.h" } -module std_private_memory_resource_pool_options [system] { header "__memory_resource/pool_options.h" } -module std_private_memory_resource_synchronized_pool_resource [system] { +module cxx03_std_private_memory_resource_memory_resource [system] { header "__memory_resource/memory_resource.h" } +module cxx03_std_private_memory_resource_memory_resource_fwd [system] { header "__fwd/memory_resource.h" } +module cxx03_std_private_memory_resource_monotonic_buffer_resource [system] { header "__memory_resource/monotonic_buffer_resource.h" } +module cxx03_std_private_memory_resource_polymorphic_allocator [system] { header "__memory_resource/polymorphic_allocator.h" } +module cxx03_std_private_memory_resource_pool_options [system] { header "__memory_resource/pool_options.h" } +module cxx03_std_private_memory_resource_synchronized_pool_resource [system] { header "__memory_resource/synchronized_pool_resource.h" export * } -module std_private_memory_resource_unsynchronized_pool_resource [system] { header "__memory_resource/unsynchronized_pool_resource.h" } +module cxx03_std_private_memory_resource_unsynchronized_pool_resource [system] { header "__memory_resource/unsynchronized_pool_resource.h" } -module std_private_mutex_lock_guard [system] { header "__mutex/lock_guard.h" } -module std_private_mutex_mutex [system] { header "__mutex/mutex.h" } -module std_private_mutex_once_flag [system] { header "__mutex/once_flag.h" } -module std_private_mutex_tag_types [system] { header "__mutex/tag_types.h" } -module std_private_mutex_unique_lock [system] { header "__mutex/unique_lock.h" } +module cxx03_std_private_mutex_lock_guard [system] { header "__mutex/lock_guard.h" } +module cxx03_std_private_mutex_mutex [system] { header "__mutex/mutex.h" } +module cxx03_std_private_mutex_once_flag [system] { header "__mutex/once_flag.h" } +module cxx03_std_private_mutex_tag_types [system] { header "__mutex/tag_types.h" } +module cxx03_std_private_mutex_unique_lock [system] { header "__mutex/unique_lock.h" } -module std_private_numeric_accumulate [system] { header "__numeric/accumulate.h" } -module std_private_numeric_adjacent_difference [system] { header "__numeric/adjacent_difference.h" } -module std_private_numeric_exclusive_scan [system] { header "__numeric/exclusive_scan.h" } -module std_private_numeric_gcd_lcm [system] { header "__numeric/gcd_lcm.h" } -module std_private_numeric_inclusive_scan [system] { header "__numeric/inclusive_scan.h" } -module std_private_numeric_inner_product [system] { header "__numeric/inner_product.h" } -module std_private_numeric_iota [system] { header "__numeric/iota.h" } -module std_private_numeric_midpoint [system] { header "__numeric/midpoint.h" } -module std_private_numeric_partial_sum [system] { header "__numeric/partial_sum.h" } -module std_private_numeric_pstl [system] { +module cxx03_std_private_numeric_accumulate [system] { header "__numeric/accumulate.h" } +module cxx03_std_private_numeric_adjacent_difference [system] { header "__numeric/adjacent_difference.h" } +module cxx03_std_private_numeric_exclusive_scan [system] { header "__numeric/exclusive_scan.h" } +module cxx03_std_private_numeric_gcd_lcm [system] { header "__numeric/gcd_lcm.h" } +module cxx03_std_private_numeric_inclusive_scan [system] { header "__numeric/inclusive_scan.h" } +module cxx03_std_private_numeric_inner_product [system] { header "__numeric/inner_product.h" } +module cxx03_std_private_numeric_iota [system] { header "__numeric/iota.h" } +module cxx03_std_private_numeric_midpoint [system] { header "__numeric/midpoint.h" } +module cxx03_std_private_numeric_partial_sum [system] { header "__numeric/partial_sum.h" } +module cxx03_std_private_numeric_pstl [system] { header "__numeric/pstl.h" export * } -module std_private_numeric_reduce [system] { header "__numeric/reduce.h" } -module std_private_numeric_saturation_arithmetic [system] { header "__numeric/saturation_arithmetic.h" } -module std_private_numeric_transform_exclusive_scan [system] { header "__numeric/transform_exclusive_scan.h" } -module std_private_numeric_transform_inclusive_scan [system] { header "__numeric/transform_inclusive_scan.h" } -module std_private_numeric_transform_reduce [system] { header "__numeric/transform_reduce.h" } +module cxx03_std_private_numeric_reduce [system] { header "__numeric/reduce.h" } +module cxx03_std_private_numeric_saturation_arithmetic [system] { header "__numeric/saturation_arithmetic.h" } +module cxx03_std_private_numeric_transform_exclusive_scan [system] { header "__numeric/transform_exclusive_scan.h" } +module cxx03_std_private_numeric_transform_inclusive_scan [system] { header "__numeric/transform_inclusive_scan.h" } +module cxx03_std_private_numeric_transform_reduce [system] { header "__numeric/transform_reduce.h" } -module std_private_pstl_backend [system] { +module cxx03_std_private_pstl_backend [system] { header "__pstl/backend.h" export * } -module std_private_pstl_backend_fwd [system] { +module cxx03_std_private_pstl_backend_fwd [system] { header "__pstl/backend_fwd.h" export * } -module std_private_pstl_backends_default [system] { +module cxx03_std_private_pstl_backends_default [system] { header "__pstl/backends/default.h" export * } -module std_private_pstl_backends_libdispatch [system] { +module cxx03_std_private_pstl_backends_libdispatch [system] { header "__pstl/backends/libdispatch.h" export * } -module std_private_pstl_backends_serial [system] { +module cxx03_std_private_pstl_backends_serial [system] { header "__pstl/backends/serial.h" export * } -module std_private_pstl_backends_std_thread [system] { +module cxx03_std_private_pstl_backends_std_thread [system] { header "__pstl/backends/std_thread.h" export * } -module std_private_pstl_cpu_algos_any_of [system] { header "__pstl/cpu_algos/any_of.h" } -module std_private_pstl_cpu_algos_cpu_traits [system] { header "__pstl/cpu_algos/cpu_traits.h" } -module std_private_pstl_cpu_algos_fill [system] { header "__pstl/cpu_algos/fill.h" } -module std_private_pstl_cpu_algos_find_if [system] { header "__pstl/cpu_algos/find_if.h" } -module std_private_pstl_cpu_algos_for_each [system] { header "__pstl/cpu_algos/for_each.h" } -module std_private_pstl_cpu_algos_merge [system] { header "__pstl/cpu_algos/merge.h" } -module std_private_pstl_cpu_algos_stable_sort [system] { header "__pstl/cpu_algos/stable_sort.h" } -module std_private_pstl_cpu_algos_transform [system] { header "__pstl/cpu_algos/transform.h" } -module std_private_pstl_cpu_algos_transform_reduce [system] { header "__pstl/cpu_algos/transform_reduce.h" } -module std_private_pstl_dispatch [system] { header "__pstl/dispatch.h" } -module std_private_pstl_handle_exception [system] { header "__pstl/handle_exception.h" } +module cxx03_std_private_pstl_cpu_algos_any_of [system] { header "__pstl/cpu_algos/any_of.h" } +module cxx03_std_private_pstl_cpu_algos_cpu_traits [system] { header "__pstl/cpu_algos/cpu_traits.h" } +module cxx03_std_private_pstl_cpu_algos_fill [system] { header "__pstl/cpu_algos/fill.h" } +module cxx03_std_private_pstl_cpu_algos_find_if [system] { header "__pstl/cpu_algos/find_if.h" } +module cxx03_std_private_pstl_cpu_algos_for_each [system] { header "__pstl/cpu_algos/for_each.h" } +module cxx03_std_private_pstl_cpu_algos_merge [system] { header "__pstl/cpu_algos/merge.h" } +module cxx03_std_private_pstl_cpu_algos_stable_sort [system] { header "__pstl/cpu_algos/stable_sort.h" } +module cxx03_std_private_pstl_cpu_algos_transform [system] { header "__pstl/cpu_algos/transform.h" } +module cxx03_std_private_pstl_cpu_algos_transform_reduce [system] { header "__pstl/cpu_algos/transform_reduce.h" } +module cxx03_std_private_pstl_dispatch [system] { header "__pstl/dispatch.h" } +module cxx03_std_private_pstl_handle_exception [system] { header "__pstl/handle_exception.h" } -module std_private_queue_fwd [system] { header "__fwd/queue.h" } +module cxx03_std_private_queue_fwd [system] { header "__fwd/queue.h" } -module std_private_ostream_basic_ostream [system] { +module cxx03_std_private_ostream_basic_ostream [system] { header "__ostream/basic_ostream.h" export std_streambuf } -module std_private_ostream_print [system] { +module cxx03_std_private_ostream_print [system] { header "__ostream/print.h" export std_print } -module std_private_random_bernoulli_distribution [system] { header "__random/bernoulli_distribution.h" } -module std_private_random_binomial_distribution [system] { header "__random/binomial_distribution.h" } -module std_private_random_cauchy_distribution [system] { header "__random/cauchy_distribution.h" } -module std_private_random_chi_squared_distribution [system] { header "__random/chi_squared_distribution.h" } -module std_private_random_clamp_to_integral [system] { header "__random/clamp_to_integral.h" } -module std_private_random_default_random_engine [system] { header "__random/default_random_engine.h" } -module std_private_random_discard_block_engine [system] { header "__random/discard_block_engine.h" } -module std_private_random_discrete_distribution [system] { +module cxx03_std_private_random_bernoulli_distribution [system] { header "__random/bernoulli_distribution.h" } +module cxx03_std_private_random_binomial_distribution [system] { header "__random/binomial_distribution.h" } +module cxx03_std_private_random_cauchy_distribution [system] { header "__random/cauchy_distribution.h" } +module cxx03_std_private_random_chi_squared_distribution [system] { header "__random/chi_squared_distribution.h" } +module cxx03_std_private_random_clamp_to_integral [system] { header "__random/clamp_to_integral.h" } +module cxx03_std_private_random_default_random_engine [system] { header "__random/default_random_engine.h" } +module cxx03_std_private_random_discard_block_engine [system] { header "__random/discard_block_engine.h" } +module cxx03_std_private_random_discrete_distribution [system] { header "__random/discrete_distribution.h" export * } -module std_private_random_exponential_distribution [system] { header "__random/exponential_distribution.h" } -module std_private_random_extreme_value_distribution [system] { header "__random/extreme_value_distribution.h" } -module std_private_random_fisher_f_distribution [system] { header "__random/fisher_f_distribution.h" } -module std_private_random_gamma_distribution [system] { header "__random/gamma_distribution.h" } -module std_private_random_generate_canonical [system] { header "__random/generate_canonical.h" } -module std_private_random_geometric_distribution [system] { header "__random/geometric_distribution.h" } -module std_private_random_independent_bits_engine [system] { header "__random/independent_bits_engine.h" } -module std_private_random_is_seed_sequence [system] { header "__random/is_seed_sequence.h" } -module std_private_random_is_valid [system] { header "__random/is_valid.h" } -module std_private_random_knuth_b [system] { header "__random/knuth_b.h" } -module std_private_random_linear_congruential_engine [system] { header "__random/linear_congruential_engine.h" } -module std_private_random_log2 [system] { header "__random/log2.h" } -module std_private_random_lognormal_distribution [system] { header "__random/lognormal_distribution.h" } -module std_private_random_mersenne_twister_engine [system] { header "__random/mersenne_twister_engine.h" } -module std_private_random_negative_binomial_distribution [system] { header "__random/negative_binomial_distribution.h" } -module std_private_random_normal_distribution [system] { header "__random/normal_distribution.h" } -module std_private_random_piecewise_constant_distribution [system] { +module cxx03_std_private_random_exponential_distribution [system] { header "__random/exponential_distribution.h" } +module cxx03_std_private_random_extreme_value_distribution [system] { header "__random/extreme_value_distribution.h" } +module cxx03_std_private_random_fisher_f_distribution [system] { header "__random/fisher_f_distribution.h" } +module cxx03_std_private_random_gamma_distribution [system] { header "__random/gamma_distribution.h" } +module cxx03_std_private_random_generate_canonical [system] { header "__random/generate_canonical.h" } +module cxx03_std_private_random_geometric_distribution [system] { header "__random/geometric_distribution.h" } +module cxx03_std_private_random_independent_bits_engine [system] { header "__random/independent_bits_engine.h" } +module cxx03_std_private_random_is_seed_sequence [system] { header "__random/is_seed_sequence.h" } +module cxx03_std_private_random_is_valid [system] { header "__random/is_valid.h" } +module cxx03_std_private_random_knuth_b [system] { header "__random/knuth_b.h" } +module cxx03_std_private_random_linear_congruential_engine [system] { header "__random/linear_congruential_engine.h" } +module cxx03_std_private_random_log2 [system] { header "__random/log2.h" } +module cxx03_std_private_random_lognormal_distribution [system] { header "__random/lognormal_distribution.h" } +module cxx03_std_private_random_mersenne_twister_engine [system] { header "__random/mersenne_twister_engine.h" } +module cxx03_std_private_random_negative_binomial_distribution [system] { header "__random/negative_binomial_distribution.h" } +module cxx03_std_private_random_normal_distribution [system] { header "__random/normal_distribution.h" } +module cxx03_std_private_random_piecewise_constant_distribution [system] { header "__random/piecewise_constant_distribution.h" export * } -module std_private_random_piecewise_linear_distribution [system] { +module cxx03_std_private_random_piecewise_linear_distribution [system] { header "__random/piecewise_linear_distribution.h" export * } -module std_private_random_poisson_distribution [system] { header "__random/poisson_distribution.h" } -module std_private_random_random_device [system] { +module cxx03_std_private_random_poisson_distribution [system] { header "__random/poisson_distribution.h" } +module cxx03_std_private_random_random_device [system] { header "__random/random_device.h" export * } -module std_private_random_ranlux [system] { header "__random/ranlux.h" } -module std_private_random_seed_seq [system] { +module cxx03_std_private_random_ranlux [system] { header "__random/ranlux.h" } +module cxx03_std_private_random_seed_seq [system] { header "__random/seed_seq.h" export * } -module std_private_random_shuffle_order_engine [system] { header "__random/shuffle_order_engine.h" } -module std_private_random_student_t_distribution [system] { header "__random/student_t_distribution.h" } -module std_private_random_subtract_with_carry_engine [system] { header "__random/subtract_with_carry_engine.h" } -module std_private_random_uniform_int_distribution [system] { header "__random/uniform_int_distribution.h" } -module std_private_random_uniform_random_bit_generator [system] { header "__random/uniform_random_bit_generator.h" } -module std_private_random_uniform_real_distribution [system] { header "__random/uniform_real_distribution.h" } -module std_private_random_weibull_distribution [system] { header "__random/weibull_distribution.h" } +module cxx03_std_private_random_shuffle_order_engine [system] { header "__random/shuffle_order_engine.h" } +module cxx03_std_private_random_student_t_distribution [system] { header "__random/student_t_distribution.h" } +module cxx03_std_private_random_subtract_with_carry_engine [system] { header "__random/subtract_with_carry_engine.h" } +module cxx03_std_private_random_uniform_int_distribution [system] { header "__random/uniform_int_distribution.h" } +module cxx03_std_private_random_uniform_random_bit_generator [system] { header "__random/uniform_random_bit_generator.h" } +module cxx03_std_private_random_uniform_real_distribution [system] { header "__random/uniform_real_distribution.h" } +module cxx03_std_private_random_weibull_distribution [system] { header "__random/weibull_distribution.h" } -module std_private_ranges_access [system] { header "__ranges/access.h" } -module std_private_ranges_all [system] { +module cxx03_std_private_ranges_access [system] { header "__ranges/access.h" } +module cxx03_std_private_ranges_all [system] { header "__ranges/all.h" export std_private_functional_compose export std_private_functional_perfect_forward export std_private_ranges_owning_view } -module std_private_ranges_as_rvalue_view [system] { header "__ranges/as_rvalue_view.h" } -module std_private_ranges_chunk_by_view [system] { header "__ranges/chunk_by_view.h" } -module std_private_ranges_common_view [system] { header "__ranges/common_view.h" } -module std_private_ranges_concepts [system] { +module cxx03_std_private_ranges_as_rvalue_view [system] { header "__ranges/as_rvalue_view.h" } +module cxx03_std_private_ranges_chunk_by_view [system] { header "__ranges/chunk_by_view.h" } +module cxx03_std_private_ranges_common_view [system] { header "__ranges/common_view.h" } +module cxx03_std_private_ranges_concepts [system] { header "__ranges/concepts.h" export std_private_iterator_concepts } -module std_private_ranges_container_compatible_range [system] { header "__ranges/container_compatible_range.h" } -module std_private_ranges_counted [system] { +module cxx03_std_private_ranges_container_compatible_range [system] { header "__ranges/container_compatible_range.h" } +module cxx03_std_private_ranges_counted [system] { header "__ranges/counted.h" export std_span } -module std_private_ranges_dangling [system] { header "__ranges/dangling.h" } -module std_private_ranges_data [system] { header "__ranges/data.h" } -module std_private_ranges_drop_view [system] { header "__ranges/drop_view.h" } -module std_private_ranges_drop_while_view [system] { header "__ranges/drop_while_view.h" } -module std_private_ranges_elements_view [system] { header "__ranges/elements_view.h" } -module std_private_ranges_empty [system] { header "__ranges/empty.h" } -module std_private_ranges_empty_view [system] { header "__ranges/empty_view.h" } -module std_private_ranges_enable_borrowed_range [system] { header "__ranges/enable_borrowed_range.h" } -module std_private_ranges_enable_view [system] { header "__ranges/enable_view.h" } -module std_private_ranges_filter_view [system] { +module cxx03_std_private_ranges_dangling [system] { header "__ranges/dangling.h" } +module cxx03_std_private_ranges_data [system] { header "__ranges/data.h" } +module cxx03_std_private_ranges_drop_view [system] { header "__ranges/drop_view.h" } +module cxx03_std_private_ranges_drop_while_view [system] { header "__ranges/drop_while_view.h" } +module cxx03_std_private_ranges_elements_view [system] { header "__ranges/elements_view.h" } +module cxx03_std_private_ranges_empty [system] { header "__ranges/empty.h" } +module cxx03_std_private_ranges_empty_view [system] { header "__ranges/empty_view.h" } +module cxx03_std_private_ranges_enable_borrowed_range [system] { header "__ranges/enable_borrowed_range.h" } +module cxx03_std_private_ranges_enable_view [system] { header "__ranges/enable_view.h" } +module cxx03_std_private_ranges_filter_view [system] { header "__ranges/filter_view.h" export std_private_ranges_range_adaptor } -module std_private_ranges_from_range [system] { header "__ranges/from_range.h" } -module std_private_ranges_iota_view [system] { header "__ranges/iota_view.h" } -module std_private_ranges_istream_view [system] { +module cxx03_std_private_ranges_from_range [system] { header "__ranges/from_range.h" } +module cxx03_std_private_ranges_iota_view [system] { header "__ranges/iota_view.h" } +module cxx03_std_private_ranges_istream_view [system] { header "__ranges/istream_view.h" } -module std_private_ranges_join_view [system] { +module cxx03_std_private_ranges_join_view [system] { header "__ranges/join_view.h" export std_private_iterator_iterator_with_data export std_private_iterator_segmented_iterator } -module std_private_ranges_lazy_split_view [system] { +module cxx03_std_private_ranges_lazy_split_view [system] { header "__ranges/lazy_split_view.h" export std_private_ranges_non_propagating_cache } -module std_private_ranges_movable_box [system] { header "__ranges/movable_box.h" } -module std_private_ranges_non_propagating_cache [system] { header "__ranges/non_propagating_cache.h" } -module std_private_ranges_owning_view [system] { header "__ranges/owning_view.h" } -module std_private_ranges_range_adaptor [system] { header "__ranges/range_adaptor.h" } -module std_private_ranges_rbegin [system] { header "__ranges/rbegin.h" } -module std_private_ranges_ref_view [system] { header "__ranges/ref_view.h" } -module std_private_ranges_rend [system] { header "__ranges/rend.h" } -module std_private_ranges_repeat_view [system] { header "__ranges/repeat_view.h" } -module std_private_ranges_reverse_view [system] { header "__ranges/reverse_view.h" } -module std_private_ranges_single_view [system] { header "__ranges/single_view.h" } -module std_private_ranges_size [system] { +module cxx03_std_private_ranges_movable_box [system] { header "__ranges/movable_box.h" } +module cxx03_std_private_ranges_non_propagating_cache [system] { header "__ranges/non_propagating_cache.h" } +module cxx03_std_private_ranges_owning_view [system] { header "__ranges/owning_view.h" } +module cxx03_std_private_ranges_range_adaptor [system] { header "__ranges/range_adaptor.h" } +module cxx03_std_private_ranges_rbegin [system] { header "__ranges/rbegin.h" } +module cxx03_std_private_ranges_ref_view [system] { header "__ranges/ref_view.h" } +module cxx03_std_private_ranges_rend [system] { header "__ranges/rend.h" } +module cxx03_std_private_ranges_repeat_view [system] { header "__ranges/repeat_view.h" } +module cxx03_std_private_ranges_reverse_view [system] { header "__ranges/reverse_view.h" } +module cxx03_std_private_ranges_single_view [system] { header "__ranges/single_view.h" } +module cxx03_std_private_ranges_size [system] { header "__ranges/size.h" export std_private_type_traits_make_unsigned } -module std_private_ranges_split_view [system] { header "__ranges/split_view.h" } -module std_private_ranges_subrange [system] { +module cxx03_std_private_ranges_split_view [system] { header "__ranges/split_view.h" } +module cxx03_std_private_ranges_subrange [system] { header "__ranges/subrange.h" export std_private_ranges_subrange_fwd } -module std_private_ranges_subrange_fwd [system] { +module cxx03_std_private_ranges_subrange_fwd [system] { header "__fwd/subrange.h" export std_private_iterator_concepts } -module std_private_ranges_take_view [system] { header "__ranges/take_view.h" } -module std_private_ranges_take_while_view [system] { header "__ranges/take_while_view.h" } -module std_private_ranges_to [system] { header "__ranges/to.h" } -module std_private_ranges_transform_view [system] { +module cxx03_std_private_ranges_take_view [system] { header "__ranges/take_view.h" } +module cxx03_std_private_ranges_take_while_view [system] { header "__ranges/take_while_view.h" } +module cxx03_std_private_ranges_to [system] { header "__ranges/to.h" } +module cxx03_std_private_ranges_transform_view [system] { header "__ranges/transform_view.h" export std_private_functional_bind_back export std_private_functional_perfect_forward export std_private_ranges_movable_box } -module std_private_ranges_view_interface [system] { header "__ranges/view_interface.h" } -module std_private_ranges_views [system] { header "__ranges/views.h" } -module std_private_ranges_zip_view [system] { +module cxx03_std_private_ranges_view_interface [system] { header "__ranges/view_interface.h" } +module cxx03_std_private_ranges_views [system] { header "__ranges/views.h" } +module cxx03_std_private_ranges_zip_view [system] { header "__ranges/zip_view.h" export std_private_utility_pair } -module std_private_span_span_fwd [system] { header "__fwd/span.h" } +module cxx03_std_private_span_span_fwd [system] { header "__fwd/span.h" } -module std_private_stack_fwd [system] { header "__fwd/stack.h" } +module cxx03_std_private_stack_fwd [system] { header "__fwd/stack.h" } -module std_private_stop_token_atomic_unique_lock [system] { header "__stop_token/atomic_unique_lock.h" } -module std_private_stop_token_intrusive_list_view [system] { header "__stop_token/intrusive_list_view.h" } -module std_private_stop_token_intrusive_shared_ptr [system] { header "__stop_token/intrusive_shared_ptr.h" } -module std_private_stop_token_stop_callback [system] { header "__stop_token/stop_callback.h" } -module std_private_stop_token_stop_source [system] { +module cxx03_std_private_stop_token_atomic_unique_lock [system] { header "__stop_token/atomic_unique_lock.h" } +module cxx03_std_private_stop_token_intrusive_list_view [system] { header "__stop_token/intrusive_list_view.h" } +module cxx03_std_private_stop_token_intrusive_shared_ptr [system] { header "__stop_token/intrusive_shared_ptr.h" } +module cxx03_std_private_stop_token_stop_callback [system] { header "__stop_token/stop_callback.h" } +module cxx03_std_private_stop_token_stop_source [system] { header "__stop_token/stop_source.h" export * } -module std_private_stop_token_stop_state [system] { +module cxx03_std_private_stop_token_stop_state [system] { header "__stop_token/stop_state.h" export * } -module std_private_stop_token_stop_token [system] { +module cxx03_std_private_stop_token_stop_token [system] { header "__stop_token/stop_token.h" export * } -module std_private_string_char_traits [system] { +module cxx03_std_private_string_char_traits [system] { header "__string/char_traits.h" export * } -module std_private_string_constexpr_c_functions [system] { +module cxx03_std_private_string_constexpr_c_functions [system] { header "__string/constexpr_c_functions.h" export std_private_type_traits_is_equality_comparable } -module std_private_string_extern_template_lists [system] { header "__string/extern_template_lists.h" } -module std_private_string_string_fwd [system] { header "__fwd/string.h" } +module cxx03_std_private_string_extern_template_lists [system] { header "__string/extern_template_lists.h" } +module cxx03_std_private_string_string_fwd [system] { header "__fwd/string.h" } -module std_private_string_view_string_view_fwd [system] { header "__fwd/string_view.h" } +module cxx03_std_private_string_view_string_view_fwd [system] { header "__fwd/string_view.h" } -module std_private_system_error_errc [system] { header "__system_error/errc.h" } -module std_private_system_error_error_category [system] { header "__system_error/error_category.h" } -module std_private_system_error_error_code [system] { +module cxx03_std_private_system_error_errc [system] { header "__system_error/errc.h" } +module cxx03_std_private_system_error_error_category [system] { header "__system_error/error_category.h" } +module cxx03_std_private_system_error_error_code [system] { header "__system_error/error_code.h" export std_private_functional_hash export std_private_functional_unary_function } -module std_private_system_error_error_condition [system] { +module cxx03_std_private_system_error_error_condition [system] { header "__system_error/error_condition.h" export std_private_functional_hash export std_private_functional_unary_function } -module std_private_system_error_system_error [system] { header "__system_error/system_error.h" } +module cxx03_std_private_system_error_system_error [system] { header "__system_error/system_error.h" } -module std_private_thread_formatter [system] { header "__thread/formatter.h" } -module std_private_thread_id [system] { header "__thread/id.h" } -module std_private_thread_jthread [system] { +module cxx03_std_private_thread_formatter [system] { header "__thread/formatter.h" } +module cxx03_std_private_thread_id [system] { header "__thread/id.h" } +module cxx03_std_private_thread_jthread [system] { header "__thread/jthread.h" export * } -module std_private_thread_poll_with_backoff [system] { header "__thread/poll_with_backoff.h" } -module std_private_thread_support [system] { +module cxx03_std_private_thread_poll_with_backoff [system] { header "__thread/poll_with_backoff.h" } +module cxx03_std_private_thread_support [system] { header "__thread/support.h" export * } -module std_private_thread_support_c11 [system] { textual header "__thread/support/c11.h" } -module std_private_thread_support_external [system] { textual header "__thread/support/external.h" } -module std_private_thread_support_pthread [system] { textual header "__thread/support/pthread.h" } -module std_private_thread_support_windows [system] { textual header "__thread/support/windows.h" } -module std_private_thread_this_thread [system] { header "__thread/this_thread.h" } -module std_private_thread_thread [system] { +module cxx03_std_private_thread_support_c11 [system] { textual header "__thread/support/c11.h" } +module cxx03_std_private_thread_support_external [system] { textual header "__thread/support/external.h" } +module cxx03_std_private_thread_support_pthread [system] { textual header "__thread/support/pthread.h" } +module cxx03_std_private_thread_support_windows [system] { textual header "__thread/support/windows.h" } +module cxx03_std_private_thread_this_thread [system] { header "__thread/this_thread.h" } +module cxx03_std_private_thread_thread [system] { header "__thread/thread.h" export * } -module std_private_thread_timed_backoff_policy [system] { header "__thread/timed_backoff_policy.h" } +module cxx03_std_private_thread_timed_backoff_policy [system] { header "__thread/timed_backoff_policy.h" } -module std_private_tuple_find_index [system] { header "__tuple/find_index.h" } -module std_private_tuple_ignore [system] { header "__tuple/ignore.h" } -module std_private_tuple_make_tuple_types [system] { header "__tuple/make_tuple_types.h" } -module std_private_tuple_tuple_like_no_subrange [system] { +module cxx03_std_private_tuple_find_index [system] { header "__tuple/find_index.h" } +module cxx03_std_private_tuple_ignore [system] { header "__tuple/ignore.h" } +module cxx03_std_private_tuple_make_tuple_types [system] { header "__tuple/make_tuple_types.h" } +module cxx03_std_private_tuple_tuple_like_no_subrange [system] { header "__tuple/tuple_like_no_subrange.h" } -module std_private_tuple_sfinae_helpers [system] { header "__tuple/sfinae_helpers.h" } -module std_private_tuple_tuple_element [system] { header "__tuple/tuple_element.h" } -module std_private_tuple_tuple_fwd [system] { header "__fwd/tuple.h" } -module std_private_tuple_tuple_indices [system] { header "__tuple/tuple_indices.h" } -module std_private_tuple_tuple_like [system] { +module cxx03_std_private_tuple_sfinae_helpers [system] { header "__tuple/sfinae_helpers.h" } +module cxx03_std_private_tuple_tuple_element [system] { header "__tuple/tuple_element.h" } +module cxx03_std_private_tuple_tuple_fwd [system] { header "__fwd/tuple.h" } +module cxx03_std_private_tuple_tuple_indices [system] { header "__tuple/tuple_indices.h" } +module cxx03_std_private_tuple_tuple_like [system] { header "__tuple/tuple_like.h" export * } -module std_private_tuple_tuple_like_ext [system] { header "__tuple/tuple_like_ext.h" } -module std_private_tuple_tuple_size [system] { header "__tuple/tuple_size.h" } -module std_private_tuple_tuple_types [system] { header "__tuple/tuple_types.h" } +module cxx03_std_private_tuple_tuple_like_ext [system] { header "__tuple/tuple_like_ext.h" } +module cxx03_std_private_tuple_tuple_size [system] { header "__tuple/tuple_size.h" } +module cxx03_std_private_tuple_tuple_types [system] { header "__tuple/tuple_types.h" } -module std_private_type_traits_add_const [system] { header "__type_traits/add_const.h" } -module std_private_type_traits_add_cv [system] { header "__type_traits/add_cv.h" } -module std_private_type_traits_add_lvalue_reference [system] { +module cxx03_std_private_type_traits_add_const [system] { header "__type_traits/add_const.h" } +module cxx03_std_private_type_traits_add_cv [system] { header "__type_traits/add_cv.h" } +module cxx03_std_private_type_traits_add_lvalue_reference [system] { header "__type_traits/add_lvalue_reference.h" export std_private_type_traits_is_referenceable } -module std_private_type_traits_add_pointer [system] { header "__type_traits/add_pointer.h" } -module std_private_type_traits_add_rvalue_reference [system] { header "__type_traits/add_rvalue_reference.h" } -module std_private_type_traits_add_volatile [system] { header "__type_traits/add_volatile.h" } -module std_private_type_traits_aligned_storage [system] { header "__type_traits/aligned_storage.h" } -module std_private_type_traits_aligned_union [system] { header "__type_traits/aligned_union.h" } -module std_private_type_traits_alignment_of [system] { header "__type_traits/alignment_of.h" } -module std_private_type_traits_can_extract_key [system] { header "__type_traits/can_extract_key.h" } -module std_private_type_traits_common_reference [system] { +module cxx03_std_private_type_traits_add_pointer [system] { header "__type_traits/add_pointer.h" } +module cxx03_std_private_type_traits_add_rvalue_reference [system] { header "__type_traits/add_rvalue_reference.h" } +module cxx03_std_private_type_traits_add_volatile [system] { header "__type_traits/add_volatile.h" } +module cxx03_std_private_type_traits_aligned_storage [system] { header "__type_traits/aligned_storage.h" } +module cxx03_std_private_type_traits_aligned_union [system] { header "__type_traits/aligned_union.h" } +module cxx03_std_private_type_traits_alignment_of [system] { header "__type_traits/alignment_of.h" } +module cxx03_std_private_type_traits_can_extract_key [system] { header "__type_traits/can_extract_key.h" } +module cxx03_std_private_type_traits_common_reference [system] { header "__type_traits/common_reference.h" export std_private_type_traits_remove_cvref } -module std_private_type_traits_common_type [system] { +module cxx03_std_private_type_traits_common_type [system] { header "__type_traits/common_type.h" export std_private_utility_declval } -module std_private_type_traits_conditional [system] { header "__type_traits/conditional.h" } -module std_private_type_traits_conjunction [system] { header "__type_traits/conjunction.h" } -module std_private_type_traits_copy_cv [system] { header "__type_traits/copy_cv.h" } -module std_private_type_traits_copy_cvref [system] { header "__type_traits/copy_cvref.h" } -module std_private_type_traits_datasizeof [system] { header "__type_traits/datasizeof.h" } -module std_private_type_traits_decay [system] { +module cxx03_std_private_type_traits_conditional [system] { header "__type_traits/conditional.h" } +module cxx03_std_private_type_traits_conjunction [system] { header "__type_traits/conjunction.h" } +module cxx03_std_private_type_traits_copy_cv [system] { header "__type_traits/copy_cv.h" } +module cxx03_std_private_type_traits_copy_cvref [system] { header "__type_traits/copy_cvref.h" } +module cxx03_std_private_type_traits_datasizeof [system] { header "__type_traits/datasizeof.h" } +module cxx03_std_private_type_traits_decay [system] { header "__type_traits/decay.h" export std_private_type_traits_add_pointer } -module std_private_type_traits_dependent_type [system] { header "__type_traits/dependent_type.h" } -module std_private_type_traits_desugars_to [system] { header "__type_traits/desugars_to.h" } -module std_private_type_traits_disjunction [system] { header "__type_traits/disjunction.h" } -module std_private_type_traits_enable_if [system] { header "__type_traits/enable_if.h" } -module std_private_type_traits_extent [system] { header "__type_traits/extent.h" } -module std_private_type_traits_has_unique_object_representation [system] { header "__type_traits/has_unique_object_representation.h" } -module std_private_type_traits_has_virtual_destructor [system] { header "__type_traits/has_virtual_destructor.h" } -module std_private_type_traits_integral_constant [system] { header "__type_traits/integral_constant.h" } -module std_private_type_traits_invoke [system] { +module cxx03_std_private_type_traits_dependent_type [system] { header "__type_traits/dependent_type.h" } +module cxx03_std_private_type_traits_desugars_to [system] { header "__type_traits/desugars_to.h" } +module cxx03_std_private_type_traits_disjunction [system] { header "__type_traits/disjunction.h" } +module cxx03_std_private_type_traits_enable_if [system] { header "__type_traits/enable_if.h" } +module cxx03_std_private_type_traits_extent [system] { header "__type_traits/extent.h" } +module cxx03_std_private_type_traits_has_unique_object_representation [system] { header "__type_traits/has_unique_object_representation.h" } +module cxx03_std_private_type_traits_has_virtual_destructor [system] { header "__type_traits/has_virtual_destructor.h" } +module cxx03_std_private_type_traits_integral_constant [system] { header "__type_traits/integral_constant.h" } +module cxx03_std_private_type_traits_invoke [system] { header "__type_traits/invoke.h" export std_private_type_traits_conditional export std_private_type_traits_decay @@ -1917,194 +1917,194 @@ module std_private_type_traits_invoke [system export std_private_type_traits_nat export std_private_type_traits_remove_cv } -module std_private_type_traits_is_abstract [system] { header "__type_traits/is_abstract.h" } -module std_private_type_traits_is_aggregate [system] { header "__type_traits/is_aggregate.h" } -module std_private_type_traits_is_allocator [system] { header "__type_traits/is_allocator.h" } -module std_private_type_traits_is_always_bitcastable [system] { header "__type_traits/is_always_bitcastable.h" } -module std_private_type_traits_is_arithmetic [system] { +module cxx03_std_private_type_traits_is_abstract [system] { header "__type_traits/is_abstract.h" } +module cxx03_std_private_type_traits_is_aggregate [system] { header "__type_traits/is_aggregate.h" } +module cxx03_std_private_type_traits_is_allocator [system] { header "__type_traits/is_allocator.h" } +module cxx03_std_private_type_traits_is_always_bitcastable [system] { header "__type_traits/is_always_bitcastable.h" } +module cxx03_std_private_type_traits_is_arithmetic [system] { header "__type_traits/is_arithmetic.h" export std_private_type_traits_integral_constant } -module std_private_type_traits_is_array [system] { +module cxx03_std_private_type_traits_is_array [system] { header "__type_traits/is_array.h" export std_private_type_traits_integral_constant } -module std_private_type_traits_is_assignable [system] { header "__type_traits/is_assignable.h" } -module std_private_type_traits_is_base_of [system] { header "__type_traits/is_base_of.h" } -module std_private_type_traits_is_bounded_array [system] { header "__type_traits/is_bounded_array.h" } -module std_private_type_traits_is_callable [system] { +module cxx03_std_private_type_traits_is_assignable [system] { header "__type_traits/is_assignable.h" } +module cxx03_std_private_type_traits_is_base_of [system] { header "__type_traits/is_base_of.h" } +module cxx03_std_private_type_traits_is_bounded_array [system] { header "__type_traits/is_bounded_array.h" } +module cxx03_std_private_type_traits_is_callable [system] { header "__type_traits/is_callable.h" export std_private_type_traits_integral_constant } -module std_private_type_traits_is_char_like_type [system] { header "__type_traits/is_char_like_type.h" } -module std_private_type_traits_is_class [system] { header "__type_traits/is_class.h" } -module std_private_type_traits_is_compound [system] { header "__type_traits/is_compound.h" } -module std_private_type_traits_is_const [system] { header "__type_traits/is_const.h" } -module std_private_type_traits_is_constant_evaluated [system] { header "__type_traits/is_constant_evaluated.h" } -module std_private_type_traits_is_constructible [system] { header "__type_traits/is_constructible.h" } -module std_private_type_traits_is_convertible [system] { +module cxx03_std_private_type_traits_is_char_like_type [system] { header "__type_traits/is_char_like_type.h" } +module cxx03_std_private_type_traits_is_class [system] { header "__type_traits/is_class.h" } +module cxx03_std_private_type_traits_is_compound [system] { header "__type_traits/is_compound.h" } +module cxx03_std_private_type_traits_is_const [system] { header "__type_traits/is_const.h" } +module cxx03_std_private_type_traits_is_constant_evaluated [system] { header "__type_traits/is_constant_evaluated.h" } +module cxx03_std_private_type_traits_is_constructible [system] { header "__type_traits/is_constructible.h" } +module cxx03_std_private_type_traits_is_convertible [system] { header "__type_traits/is_convertible.h" export std_private_type_traits_is_array } -module std_private_type_traits_is_copy_assignable [system] { header "__type_traits/is_copy_assignable.h" } -module std_private_type_traits_is_copy_constructible [system] { header "__type_traits/is_copy_constructible.h" } -module std_private_type_traits_is_core_convertible [system] { +module cxx03_std_private_type_traits_is_copy_assignable [system] { header "__type_traits/is_copy_assignable.h" } +module cxx03_std_private_type_traits_is_copy_constructible [system] { header "__type_traits/is_copy_constructible.h" } +module cxx03_std_private_type_traits_is_core_convertible [system] { header "__type_traits/is_core_convertible.h" export std_private_type_traits_integral_constant } -module std_private_type_traits_is_destructible [system] { header "__type_traits/is_destructible.h" } -module std_private_type_traits_is_empty [system] { header "__type_traits/is_empty.h" } -module std_private_type_traits_is_enum [system] { +module cxx03_std_private_type_traits_is_destructible [system] { header "__type_traits/is_destructible.h" } +module cxx03_std_private_type_traits_is_empty [system] { header "__type_traits/is_empty.h" } +module cxx03_std_private_type_traits_is_enum [system] { header "__type_traits/is_enum.h" export std_private_type_traits_integral_constant } -module std_private_type_traits_is_equality_comparable [system] { +module cxx03_std_private_type_traits_is_equality_comparable [system] { header "__type_traits/is_equality_comparable.h" export std_private_type_traits_integral_constant } -module std_private_type_traits_is_execution_policy [system] { +module cxx03_std_private_type_traits_is_execution_policy [system] { header "__type_traits/is_execution_policy.h" export std_private_type_traits_remove_cvref } -module std_private_type_traits_is_final [system] { header "__type_traits/is_final.h" } -module std_private_type_traits_is_floating_point [system] { header "__type_traits/is_floating_point.h" } -module std_private_type_traits_is_function [system] { header "__type_traits/is_function.h" } -module std_private_type_traits_is_fundamental [system] { header "__type_traits/is_fundamental.h" } -module std_private_type_traits_is_implicitly_default_constructible [system] { +module cxx03_std_private_type_traits_is_final [system] { header "__type_traits/is_final.h" } +module cxx03_std_private_type_traits_is_floating_point [system] { header "__type_traits/is_floating_point.h" } +module cxx03_std_private_type_traits_is_function [system] { header "__type_traits/is_function.h" } +module cxx03_std_private_type_traits_is_fundamental [system] { header "__type_traits/is_fundamental.h" } +module cxx03_std_private_type_traits_is_implicitly_default_constructible [system] { header "__type_traits/is_implicitly_default_constructible.h" export std_private_type_traits_integral_constant } -module std_private_type_traits_is_integral [system] { header "__type_traits/is_integral.h" } -module std_private_type_traits_is_literal_type [system] { header "__type_traits/is_literal_type.h" } -module std_private_type_traits_is_member_pointer [system] { header "__type_traits/is_member_pointer.h" } -module std_private_type_traits_is_nothrow_assignable [system] { header "__type_traits/is_nothrow_assignable.h" } -module std_private_type_traits_is_nothrow_constructible [system] { +module cxx03_std_private_type_traits_is_integral [system] { header "__type_traits/is_integral.h" } +module cxx03_std_private_type_traits_is_literal_type [system] { header "__type_traits/is_literal_type.h" } +module cxx03_std_private_type_traits_is_member_pointer [system] { header "__type_traits/is_member_pointer.h" } +module cxx03_std_private_type_traits_is_nothrow_assignable [system] { header "__type_traits/is_nothrow_assignable.h" } +module cxx03_std_private_type_traits_is_nothrow_constructible [system] { header "__type_traits/is_nothrow_constructible.h" export std_private_type_traits_integral_constant } -module std_private_type_traits_is_nothrow_convertible [system] { header "__type_traits/is_nothrow_convertible.h" } -module std_private_type_traits_is_nothrow_destructible [system] { +module cxx03_std_private_type_traits_is_nothrow_convertible [system] { header "__type_traits/is_nothrow_convertible.h" } +module cxx03_std_private_type_traits_is_nothrow_destructible [system] { header "__type_traits/is_nothrow_destructible.h" export std_private_type_traits_is_destructible } -module std_private_type_traits_is_null_pointer [system] { +module cxx03_std_private_type_traits_is_null_pointer [system] { header "__type_traits/is_null_pointer.h" export std_cstddef } -module std_private_type_traits_is_object [system] { +module cxx03_std_private_type_traits_is_object [system] { header "__type_traits/is_object.h" export std_private_type_traits_is_scalar } -module std_private_type_traits_is_pod [system] { header "__type_traits/is_pod.h" } -module std_private_type_traits_is_pointer [system] { header "__type_traits/is_pointer.h" } -module std_private_type_traits_is_polymorphic [system] { header "__type_traits/is_polymorphic.h" } -module std_private_type_traits_is_primary_template [system] { +module cxx03_std_private_type_traits_is_pod [system] { header "__type_traits/is_pod.h" } +module cxx03_std_private_type_traits_is_pointer [system] { header "__type_traits/is_pointer.h" } +module cxx03_std_private_type_traits_is_polymorphic [system] { header "__type_traits/is_polymorphic.h" } +module cxx03_std_private_type_traits_is_primary_template [system] { header "__type_traits/is_primary_template.h" export std_private_type_traits_enable_if } -module std_private_type_traits_is_reference [system] { header "__type_traits/is_reference.h" } -module std_private_type_traits_is_reference_wrapper [system] { header "__type_traits/is_reference_wrapper.h" } -module std_private_type_traits_is_referenceable [system] { header "__type_traits/is_referenceable.h" } -module std_private_type_traits_is_same [system] { +module cxx03_std_private_type_traits_is_reference [system] { header "__type_traits/is_reference.h" } +module cxx03_std_private_type_traits_is_reference_wrapper [system] { header "__type_traits/is_reference_wrapper.h" } +module cxx03_std_private_type_traits_is_referenceable [system] { header "__type_traits/is_referenceable.h" } +module cxx03_std_private_type_traits_is_same [system] { header "__type_traits/is_same.h" export std_private_type_traits_integral_constant } -module std_private_type_traits_is_scalar [system] { +module cxx03_std_private_type_traits_is_scalar [system] { header "__type_traits/is_scalar.h" export std_private_type_traits_is_null_pointer } -module std_private_type_traits_is_signed [system] { header "__type_traits/is_signed.h" } -module std_private_type_traits_is_signed_integer [system] { header "__type_traits/is_signed_integer.h" } -module std_private_type_traits_is_specialization [system] { header "__type_traits/is_specialization.h" } -module std_private_type_traits_is_standard_layout [system] { header "__type_traits/is_standard_layout.h" } -module std_private_type_traits_is_swappable [system] { +module cxx03_std_private_type_traits_is_signed [system] { header "__type_traits/is_signed.h" } +module cxx03_std_private_type_traits_is_signed_integer [system] { header "__type_traits/is_signed_integer.h" } +module cxx03_std_private_type_traits_is_specialization [system] { header "__type_traits/is_specialization.h" } +module cxx03_std_private_type_traits_is_standard_layout [system] { header "__type_traits/is_standard_layout.h" } +module cxx03_std_private_type_traits_is_swappable [system] { header "__type_traits/is_swappable.h" export std_private_type_traits_is_move_constructible } -module std_private_type_traits_is_trivial [system] { header "__type_traits/is_trivial.h" } -module std_private_type_traits_is_trivially_assignable [system] { header "__type_traits/is_trivially_assignable.h" } -module std_private_type_traits_is_trivially_constructible [system] { header "__type_traits/is_trivially_constructible.h" } -module std_private_type_traits_is_trivially_copyable [system] { header "__type_traits/is_trivially_copyable.h" } -module std_private_type_traits_is_trivially_destructible [system] { header "__type_traits/is_trivially_destructible.h" } -module std_private_type_traits_is_trivially_lexicographically_comparable [system] { header "__type_traits/is_trivially_lexicographically_comparable.h" } -module std_private_type_traits_is_trivially_relocatable [system] { header "__type_traits/is_trivially_relocatable.h" } -module std_private_type_traits_is_unbounded_array [system] { header "__type_traits/is_unbounded_array.h" } -module std_private_type_traits_is_union [system] { header "__type_traits/is_union.h" } -module std_private_type_traits_is_unsigned [system] { header "__type_traits/is_unsigned.h" } -module std_private_type_traits_is_unsigned_integer [system] { header "__type_traits/is_unsigned_integer.h" } -module std_private_type_traits_is_valid_expansion [system] { header "__type_traits/is_valid_expansion.h" } -module std_private_type_traits_is_void [system] { +module cxx03_std_private_type_traits_is_trivial [system] { header "__type_traits/is_trivial.h" } +module cxx03_std_private_type_traits_is_trivially_assignable [system] { header "__type_traits/is_trivially_assignable.h" } +module cxx03_std_private_type_traits_is_trivially_constructible [system] { header "__type_traits/is_trivially_constructible.h" } +module cxx03_std_private_type_traits_is_trivially_copyable [system] { header "__type_traits/is_trivially_copyable.h" } +module cxx03_std_private_type_traits_is_trivially_destructible [system] { header "__type_traits/is_trivially_destructible.h" } +module cxx03_std_private_type_traits_is_trivially_lexicographically_comparable [system] { header "__type_traits/is_trivially_lexicographically_comparable.h" } +module cxx03_std_private_type_traits_is_trivially_relocatable [system] { header "__type_traits/is_trivially_relocatable.h" } +module cxx03_std_private_type_traits_is_unbounded_array [system] { header "__type_traits/is_unbounded_array.h" } +module cxx03_std_private_type_traits_is_union [system] { header "__type_traits/is_union.h" } +module cxx03_std_private_type_traits_is_unsigned [system] { header "__type_traits/is_unsigned.h" } +module cxx03_std_private_type_traits_is_unsigned_integer [system] { header "__type_traits/is_unsigned_integer.h" } +module cxx03_std_private_type_traits_is_valid_expansion [system] { header "__type_traits/is_valid_expansion.h" } +module cxx03_std_private_type_traits_is_void [system] { header "__type_traits/is_void.h" export std_private_type_traits_integral_constant } -module std_private_type_traits_is_volatile [system] { header "__type_traits/is_volatile.h" } -module std_private_type_traits_lazy [system] { header "__type_traits/lazy.h" } -module std_private_type_traits_make_32_64_or_128_bit [system] { header "__type_traits/make_32_64_or_128_bit.h" } -module std_private_type_traits_make_const_lvalue_ref [system] { header "__type_traits/make_const_lvalue_ref.h" } -module std_private_type_traits_make_signed [system] { header "__type_traits/make_signed.h" } -module std_private_type_traits_make_unsigned [system] { +module cxx03_std_private_type_traits_is_volatile [system] { header "__type_traits/is_volatile.h" } +module cxx03_std_private_type_traits_lazy [system] { header "__type_traits/lazy.h" } +module cxx03_std_private_type_traits_make_32_64_or_128_bit [system] { header "__type_traits/make_32_64_or_128_bit.h" } +module cxx03_std_private_type_traits_make_const_lvalue_ref [system] { header "__type_traits/make_const_lvalue_ref.h" } +module cxx03_std_private_type_traits_make_signed [system] { header "__type_traits/make_signed.h" } +module cxx03_std_private_type_traits_make_unsigned [system] { header "__type_traits/make_unsigned.h" export std_private_type_traits_is_unsigned } -module std_private_type_traits_maybe_const [system] { header "__type_traits/maybe_const.h" } -module std_private_type_traits_nat [system] { header "__type_traits/nat.h" } -module std_private_type_traits_negation [system] { header "__type_traits/negation.h" } -module std_private_type_traits_noexcept_move_assign_container [system] { header "__type_traits/noexcept_move_assign_container.h" } -module std_private_type_traits_promote [system] { header "__type_traits/promote.h" } -module std_private_type_traits_rank [system] { header "__type_traits/rank.h" } -module std_private_type_traits_remove_all_extents [system] { header "__type_traits/remove_all_extents.h" } -module std_private_type_traits_remove_const [system] { header "__type_traits/remove_const.h" } -module std_private_type_traits_remove_const_ref [system] { header "__type_traits/remove_const_ref.h" } -module std_private_type_traits_remove_cv [system] { +module cxx03_std_private_type_traits_maybe_const [system] { header "__type_traits/maybe_const.h" } +module cxx03_std_private_type_traits_nat [system] { header "__type_traits/nat.h" } +module cxx03_std_private_type_traits_negation [system] { header "__type_traits/negation.h" } +module cxx03_std_private_type_traits_noexcept_move_assign_container [system] { header "__type_traits/noexcept_move_assign_container.h" } +module cxx03_std_private_type_traits_promote [system] { header "__type_traits/promote.h" } +module cxx03_std_private_type_traits_rank [system] { header "__type_traits/rank.h" } +module cxx03_std_private_type_traits_remove_all_extents [system] { header "__type_traits/remove_all_extents.h" } +module cxx03_std_private_type_traits_remove_const [system] { header "__type_traits/remove_const.h" } +module cxx03_std_private_type_traits_remove_const_ref [system] { header "__type_traits/remove_const_ref.h" } +module cxx03_std_private_type_traits_remove_cv [system] { header "__type_traits/remove_cv.h" export std_private_type_traits_remove_const export std_private_type_traits_remove_volatile } -module std_private_type_traits_remove_cvref [system] { header "__type_traits/remove_cvref.h" } -module std_private_type_traits_remove_extent [system] { header "__type_traits/remove_extent.h" } -module std_private_type_traits_remove_pointer [system] { header "__type_traits/remove_pointer.h" } -module std_private_type_traits_remove_reference [system] { header "__type_traits/remove_reference.h" } -module std_private_type_traits_remove_volatile [system] { header "__type_traits/remove_volatile.h" } -module std_private_type_traits_result_of [system] { header "__type_traits/result_of.h" } -module std_private_type_traits_strip_signature [system] { header "__type_traits/strip_signature.h" } -module std_private_type_traits_type_identity [system] { header "__type_traits/type_identity.h" } -module std_private_type_traits_type_list [system] { header "__type_traits/type_list.h" } -module std_private_type_traits_underlying_type [system] { +module cxx03_std_private_type_traits_remove_cvref [system] { header "__type_traits/remove_cvref.h" } +module cxx03_std_private_type_traits_remove_extent [system] { header "__type_traits/remove_extent.h" } +module cxx03_std_private_type_traits_remove_pointer [system] { header "__type_traits/remove_pointer.h" } +module cxx03_std_private_type_traits_remove_reference [system] { header "__type_traits/remove_reference.h" } +module cxx03_std_private_type_traits_remove_volatile [system] { header "__type_traits/remove_volatile.h" } +module cxx03_std_private_type_traits_result_of [system] { header "__type_traits/result_of.h" } +module cxx03_std_private_type_traits_strip_signature [system] { header "__type_traits/strip_signature.h" } +module cxx03_std_private_type_traits_type_identity [system] { header "__type_traits/type_identity.h" } +module cxx03_std_private_type_traits_type_list [system] { header "__type_traits/type_list.h" } +module cxx03_std_private_type_traits_underlying_type [system] { header "__type_traits/underlying_type.h" export std_private_type_traits_is_enum } -module std_private_type_traits_unwrap_ref [system] { header "__type_traits/unwrap_ref.h" } -module std_private_type_traits_void_t [system] { header "__type_traits/void_t.h" } +module cxx03_std_private_type_traits_unwrap_ref [system] { header "__type_traits/unwrap_ref.h" } +module cxx03_std_private_type_traits_void_t [system] { header "__type_traits/void_t.h" } -module std_private_utility_as_const [system] { header "__utility/as_const.h" } -module std_private_utility_as_lvalue [system] { header "__utility/as_lvalue.h" } -module std_private_utility_auto_cast [system] { +module cxx03_std_private_utility_as_const [system] { header "__utility/as_const.h" } +module cxx03_std_private_utility_as_lvalue [system] { header "__utility/as_lvalue.h" } +module cxx03_std_private_utility_auto_cast [system] { header "__utility/auto_cast.h" export std_private_type_traits_decay } -module std_private_utility_cmp [system] { +module cxx03_std_private_utility_cmp [system] { header "__utility/cmp.h" export std_private_type_traits_make_unsigned } -module std_private_utility_convert_to_integral [system] { header "__utility/convert_to_integral.h" } -module std_private_utility_declval [system] { header "__utility/declval.h" } -module std_private_utility_empty [system] { header "__utility/empty.h" } -module std_private_utility_exception_guard [system] { header "__utility/exception_guard.h" } -module std_private_utility_exchange [system] { header "__utility/exchange.h" } -module std_private_utility_forward [system] { header "__utility/forward.h" } -module std_private_utility_forward_like [system] { header "__utility/forward_like.h" } -module std_private_utility_in_place [system] { header "__utility/in_place.h" } -module std_private_utility_integer_sequence [system] { header "__utility/integer_sequence.h" } -module std_private_utility_is_pointer_in_range [system] { header "__utility/is_pointer_in_range.h" } -module std_private_utility_is_valid_range [system] { header "__utility/is_valid_range.h" } -module std_private_utility_move [system] { +module cxx03_std_private_utility_convert_to_integral [system] { header "__utility/convert_to_integral.h" } +module cxx03_std_private_utility_declval [system] { header "__utility/declval.h" } +module cxx03_std_private_utility_empty [system] { header "__utility/empty.h" } +module cxx03_std_private_utility_exception_guard [system] { header "__utility/exception_guard.h" } +module cxx03_std_private_utility_exchange [system] { header "__utility/exchange.h" } +module cxx03_std_private_utility_forward [system] { header "__utility/forward.h" } +module cxx03_std_private_utility_forward_like [system] { header "__utility/forward_like.h" } +module cxx03_std_private_utility_in_place [system] { header "__utility/in_place.h" } +module cxx03_std_private_utility_integer_sequence [system] { header "__utility/integer_sequence.h" } +module cxx03_std_private_utility_is_pointer_in_range [system] { header "__utility/is_pointer_in_range.h" } +module cxx03_std_private_utility_is_valid_range [system] { header "__utility/is_valid_range.h" } +module cxx03_std_private_utility_move [system] { header "__utility/move.h" export std_private_type_traits_is_copy_constructible export std_private_type_traits_is_nothrow_move_constructible export std_private_type_traits_remove_reference } -module std_private_utility_no_destroy [system] { header "__utility/no_destroy.h" } -module std_private_utility_pair [system] { +module cxx03_std_private_utility_no_destroy [system] { header "__utility/no_destroy.h" } +module cxx03_std_private_utility_pair [system] { header "__utility/pair.h" export std_private_ranges_subrange_fwd export std_private_tuple_pair_like @@ -2118,19 +2118,19 @@ module std_private_utility_pair [system] { export std_private_type_traits_is_nothrow_move_assignable export std_private_utility_pair_fwd } -module std_private_utility_pair_fwd [system] { header "__fwd/pair.h" } -module std_private_utility_piecewise_construct [system] { header "__utility/piecewise_construct.h" } -module std_private_utility_priority_tag [system] { header "__utility/priority_tag.h" } -module std_private_utility_private_constructor_tag [system] { header "__utility/private_constructor_tag.h" } -module std_private_utility_rel_ops [system] { header "__utility/rel_ops.h" } -module std_private_utility_small_buffer [system] { header "__utility/small_buffer.h" } -module std_private_utility_swap [system] { +module cxx03_std_private_utility_pair_fwd [system] { header "__fwd/pair.h" } +module cxx03_std_private_utility_piecewise_construct [system] { header "__utility/piecewise_construct.h" } +module cxx03_std_private_utility_priority_tag [system] { header "__utility/priority_tag.h" } +module cxx03_std_private_utility_private_constructor_tag [system] { header "__utility/private_constructor_tag.h" } +module cxx03_std_private_utility_rel_ops [system] { header "__utility/rel_ops.h" } +module cxx03_std_private_utility_small_buffer [system] { header "__utility/small_buffer.h" } +module cxx03_std_private_utility_swap [system] { header "__utility/swap.h" export std_private_type_traits_is_swappable } -module std_private_utility_to_underlying [system] { header "__utility/to_underlying.h" } -module std_private_utility_unreachable [system] { header "__utility/unreachable.h" } +module cxx03_std_private_utility_to_underlying [system] { header "__utility/to_underlying.h" } +module cxx03_std_private_utility_unreachable [system] { header "__utility/unreachable.h" } -module std_private_variant_monostate [system] { header "__variant/monostate.h" } +module cxx03_std_private_variant_monostate [system] { header "__variant/monostate.h" } -module std_private_vector_fwd [system] { header "__fwd/vector.h" } +module cxx03_std_private_vector_fwd [system] { header "__fwd/vector.h" } diff --git a/libcxx/include/__cxx03/version b/libcxx/include/__cxx03/version index dd0fe4b4d2817..ed1857db05b31 100644 --- a/libcxx/include/__cxx03/version +++ b/libcxx/include/__cxx03/version @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_VERSIONH -#define _LIBCPP_VERSIONH +#ifndef _LIBCPP___CXX03_VERSIONH +#define _LIBCPP___CXX03_VERSIONH /* version synopsis @@ -563,4 +563,4 @@ __cpp_lib_void_t 201411L // clang-format on -#endif // _LIBCPP_VERSIONH +#endif // _LIBCPP___CXX03_VERSIONH diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h index 06d3225a6e22d..a421a3ef4f5f9 100644 --- a/libcxx/include/__functional/function.h +++ b/libcxx/include/__functional/function.h @@ -146,8 +146,8 @@ class __alloc_func<_Fp, _Ap, _Rp(_ArgTypes...)> { _LIBCPP_COMPRESSED_PAIR(_Fp, __func_, _Ap, __alloc_); public: - typedef _LIBCPP_NODEBUG _Fp _Target; - typedef _LIBCPP_NODEBUG _Ap _Alloc; + using _Target _LIBCPP_NODEBUG = _Fp; + using _Alloc _LIBCPP_NODEBUG = _Ap; _LIBCPP_HIDE_FROM_ABI const _Target& __target() const { return __func_; } @@ -198,7 +198,7 @@ class __default_alloc_func<_Fp, _Rp(_ArgTypes...)> { _Fp __f_; public: - typedef _LIBCPP_NODEBUG _Fp _Target; + using _Target _LIBCPP_NODEBUG = _Fp; _LIBCPP_HIDE_FROM_ABI const _Target& __target() const { return __f_; } diff --git a/libcxx/include/__fwd/memory.h b/libcxx/include/__fwd/memory.h index b9e151855ad7d..564000997dec6 100644 --- a/libcxx/include/__fwd/memory.h +++ b/libcxx/include/__fwd/memory.h @@ -20,6 +20,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD template class _LIBCPP_TEMPLATE_VIS allocator; +template +class _LIBCPP_TEMPLATE_VIS shared_ptr; + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___FWD_MEMORY_H diff --git a/libcxx/include/__fwd/memory_resource.h b/libcxx/include/__fwd/memory_resource.h index d68b2c2b63154..ca9d3770945c8 100644 --- a/libcxx/include/__fwd/memory_resource.h +++ b/libcxx/include/__fwd/memory_resource.h @@ -15,6 +15,8 @@ # pragma GCC system_header #endif +#if _LIBCPP_STD_VER >= 17 + _LIBCPP_BEGIN_NAMESPACE_STD namespace pmr { @@ -24,4 +26,6 @@ class _LIBCPP_AVAILABILITY_PMR _LIBCPP_TEMPLATE_VIS polymorphic_allocator; _LIBCPP_END_NAMESPACE_STD +#endif // _LIBCPP_STD_VER >= 17 + #endif // _LIBCPP___FWD_MEMORY_RESOURCE_H diff --git a/libcxx/include/__memory/allocator_arg_t.h b/libcxx/include/__memory/allocator_arg_t.h index dc4398bb02d34..72a0a9c399bd4 100644 --- a/libcxx/include/__memory/allocator_arg_t.h +++ b/libcxx/include/__memory/allocator_arg_t.h @@ -39,10 +39,10 @@ constexpr allocator_arg_t allocator_arg = allocator_arg_t(); template struct __uses_alloc_ctor_imp { - typedef _LIBCPP_NODEBUG __remove_cvref_t<_Alloc> _RawAlloc; - static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value; - static const bool __ic = is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value; - static const int value = __ua ? 2 - __ic : 0; + using _RawAlloc _LIBCPP_NODEBUG = __remove_cvref_t<_Alloc>; + static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value; + static const bool __ic = is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value; + static const int value = __ua ? 2 - __ic : 0; }; template diff --git a/libcxx/include/__memory/allocator_destructor.h b/libcxx/include/__memory/allocator_destructor.h index ed3d8918f5fe3..aac92a23fa0d4 100644 --- a/libcxx/include/__memory/allocator_destructor.h +++ b/libcxx/include/__memory/allocator_destructor.h @@ -20,11 +20,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD template class __allocator_destructor { - typedef _LIBCPP_NODEBUG allocator_traits<_Alloc> __alloc_traits; + using __alloc_traits _LIBCPP_NODEBUG = allocator_traits<_Alloc>; public: - typedef _LIBCPP_NODEBUG typename __alloc_traits::pointer pointer; - typedef _LIBCPP_NODEBUG typename __alloc_traits::size_type size_type; + using pointer _LIBCPP_NODEBUG = typename __alloc_traits::pointer; + using size_type _LIBCPP_NODEBUG = typename __alloc_traits::size_type; private: _Alloc& __alloc_; diff --git a/libcxx/include/__memory/pointer_traits.h b/libcxx/include/__memory/pointer_traits.h index 4acf3d18401ae..e35cfb7c3b878 100644 --- a/libcxx/include/__memory/pointer_traits.h +++ b/libcxx/include/__memory/pointer_traits.h @@ -50,17 +50,17 @@ struct __pointer_traits_element_type {}; template struct __pointer_traits_element_type<_Ptr, true> { - typedef _LIBCPP_NODEBUG typename _Ptr::element_type type; + using type _LIBCPP_NODEBUG = typename _Ptr::element_type; }; template