[clang] [clang/www/get_started.html] Use newer `cmake` syntax (PR #93503)
https://github.com/Endilll requested changes to this pull request. I'm fine with `cmake --build`, but I don't think that replacing `cd` with `-S` and `-B` is an improvement. https://github.com/llvm/llvm-project/pull/93503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang/www/get_started.html] Use newer `cmake` syntax (PR #93503)
@@ -67,15 +67,13 @@ On Unix-like Systems Build LLVM and Clang: cd llvm-project -mkdir build (in-tree build is not supported) -cd build This builds both LLVM and Clang in release mode. Alternatively, if you need a debug build, switch Release to Debug. See https://llvm.org/docs/CMake.html#frequently-used-cmake-variables;>frequently used cmake variables for more options. -cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm Endilll wrote: Yeah, instead of spreading the complexity between three lines, it's now concentrated in one. I'd expect users to be more familiar with `cd` and `mkdir` than with `-S` and `-B`, so this change would make the docs less accessible. https://github.com/llvm/llvm-project/pull/93503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang/www/get_started.html] Use newer `cmake` syntax (PR #93503)
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/93503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)
@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase { BuiltinFunction }; + /// A helper function to provide Attribute Location for the Attr types + /// AND the ParsedAttr. + template + static std::enable_if_t, SourceLocation> + getAttrLoc(const AttrInfo ) { +return AL.getLocation(); + } + SourceLocation getAttrLoc(const ParsedAttr ); + + /// If Expr is a valid integer constant, get the value of the integer + /// expression and return success or failure. May output an error. + /// + /// Negative argument is implicitly converted to unsigned, unless + /// \p StrictlyUnsigned is true. + template + bool checkUInt32Argument(const AttrInfo , const Expr *Expr, uint32_t , + unsigned Idx = UINT_MAX, + bool StrictlyUnsigned = false) { +std::optional I = llvm::APSInt(32); +if (Expr->isTypeDependent() || +!(I = Expr->getIntegerConstantExpr(Context))) { + if (Idx != UINT_MAX) +Diag(getAttrLoc(AI), diag::err_attribute_argument_n_type) +<< << Idx << AANT_ArgumentIntegerConstant +<< Expr->getSourceRange(); + else +Diag(getAttrLoc(AI), diag::err_attribute_argument_type) +<< << AANT_ArgumentIntegerConstant << Expr->getSourceRange(); + return false; +} + +if (!I->isIntN(32)) { + Diag(Expr->getExprLoc(), diag::err_ice_too_large) + << toString(*I, 10, false) << 32 << /* Unsigned */ 1; + return false; +} + +if (StrictlyUnsigned && I->isSigned() && I->isNegative()) { + Diag(getAttrLoc(AI), diag::err_attribute_requires_positive_integer) + << << /*non-negative*/ 1; + return false; +} + +Val = (uint32_t)I->getZExtValue(); +return true; + } + + bool isFunctionOrMethod(const Decl *D); + bool isFunctionOrMethodOrBlock(const Decl *D); Endilll wrote: This should be fixed now. https://github.com/llvm/llvm-project/pull/93179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)
Endilll wrote: > > `const_cast` here is a relatively recent addition, and I checked out with > > @erichkeane that the use case (pack expansion) is legit. According to the > > approach you're suggesting, the one who wrote this `const_cast` should > > instead refactor the MLTAL to use `llvm::MutableArrayRef`. > > Take a guess who that person was > > > I tried, pretty hard, but ultimately failed. The change turned out to be > > touching every corner of our template engine, with no end in sight. > > Oh well, sorry I wasn't around to advise against it. No worries, I was eliminating `const_cast`s on my own, which resulted in 84aee95124549c5d13e22053af254e3fcc02bc84, 8aa6511f4209bba33a74c4ef6e208fda5c0f3d27, df575be9d864886684e536cd76c5a96bb0d443a6, and f7b0b99c52ee36ed6ca8abcce74a752e483768d6. https://github.com/llvm/llvm-project/pull/93493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)
Endilll wrote: I think I should post here an example from our codebase that made me think twice about this PR. First, there's a `MultiLevelTemplateArgumentList` (MLTAL for short), which I believe is one of the backbones of our template engine: https://github.com/llvm/llvm-project/blob/42b4be6d7b896fcf2ef16818862a5be3e98ca791/clang/include/clang/Sema/Template.h#L76-L79 As you can see, actual argument list is defined as an `ArrayRef`, which is a view type that propagates constness to its elements. Then, there's a `SetArgument` function: https://github.com/llvm/llvm-project/blob/42b4be6d7b896fcf2ef16818862a5be3e98ca791/clang/include/clang/Sema/Template.h#L196-L204 `const_cast` here is a relatively recent addition, and I checked out with @erichkeane that the use case (pack expansion) is legit. According to the approach you're suggesting, the one who wrote this `const_cast` should instead refactor the MLTAL to use `llvm::MutableArrayRef`. I tried, pretty hard, but ultimately failed. The change turned out to be touching every corner of our template engine, with no end in sight. While you're claiming that annotating things with `const` should stop digging the hole, this is not necessarily the case. That's why we're asking this change to be done with a "does it make sense for this thing to be `const`?" attitude. https://github.com/llvm/llvm-project/pull/93493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)
@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase { BuiltinFunction }; + /// A helper function to provide Attribute Location for the Attr types + /// AND the ParsedAttr. + template + static std::enable_if_t, SourceLocation> + getAttrLoc(const AttrInfo ) { +return AL.getLocation(); + } + SourceLocation getAttrLoc(const ParsedAttr ); + + /// If Expr is a valid integer constant, get the value of the integer + /// expression and return success or failure. May output an error. + /// + /// Negative argument is implicitly converted to unsigned, unless + /// \p StrictlyUnsigned is true. + template + bool checkUInt32Argument(const AttrInfo , const Expr *Expr, uint32_t , + unsigned Idx = UINT_MAX, + bool StrictlyUnsigned = false) { +std::optional I = llvm::APSInt(32); +if (Expr->isTypeDependent() || +!(I = Expr->getIntegerConstantExpr(Context))) { + if (Idx != UINT_MAX) +Diag(getAttrLoc(AI), diag::err_attribute_argument_n_type) +<< << Idx << AANT_ArgumentIntegerConstant +<< Expr->getSourceRange(); + else +Diag(getAttrLoc(AI), diag::err_attribute_argument_type) +<< << AANT_ArgumentIntegerConstant << Expr->getSourceRange(); + return false; +} + +if (!I->isIntN(32)) { + Diag(Expr->getExprLoc(), diag::err_ice_too_large) + << toString(*I, 10, false) << 32 << /* Unsigned */ 1; + return false; +} + +if (StrictlyUnsigned && I->isSigned() && I->isNegative()) { + Diag(getAttrLoc(AI), diag::err_attribute_requires_positive_integer) + << << /*non-negative*/ 1; + return false; +} + +Val = (uint32_t)I->getZExtValue(); +return true; + } + + bool isFunctionOrMethod(const Decl *D); + bool isFunctionOrMethodOrBlock(const Decl *D); Endilll wrote: I see `isFunctionOrMethod` used in AVR-, MIPS-, MSP430-, and X86-specific functions in `SemaDeclAttr.cpp`. If we're to move target specific functions, which I'll try to do, I'd need to replicate the hack every time. I can inline the function where it's used, or I can copy-paste the definition of static function where it's needed. We can also rename it to e.g. `isFunctionDeclOrMethodDecl` to avoid the confusion. https://github.com/llvm/llvm-project/pull/93179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang/www/get_started.html] Use newer `cmake` syntax (PR #93503)
@@ -67,15 +67,13 @@ On Unix-like Systems Build LLVM and Clang: cd llvm-project -mkdir build (in-tree build is not supported) -cd build This builds both LLVM and Clang in release mode. Alternatively, if you need a debug build, switch Release to Debug. See https://llvm.org/docs/CMake.html#frequently-used-cmake-variables;>frequently used cmake variables for more options. -cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm Endilll wrote: I don't necessarily agree that `-S` and `-B` are newer or better than what our documentation currently says. `-G "Unix Makefiles"` is clearly outdated, though, in the presence of `ninja`. https://github.com/llvm/llvm-project/pull/93503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
@@ -1,82 +0,0 @@ -#===--===## Endilll wrote: Committed as 681fc40d68936f145963207236d62886e5a34e5d https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] 42b4be6 - [clang][NFC] Remove `utils/ci/run-buildbot` script
Author: Vlad Serebrennikov Date: 2024-05-28T13:45:22+03:00 New Revision: 42b4be6d7b896fcf2ef16818862a5be3e98ca791 URL: https://github.com/llvm/llvm-project/commit/42b4be6d7b896fcf2ef16818862a5be3e98ca791 DIFF: https://github.com/llvm/llvm-project/commit/42b4be6d7b896fcf2ef16818862a5be3e98ca791.diff LOG: [clang][NFC] Remove `utils/ci/run-buildbot` script A follow up for #93318. Discussion happened at https://github.com/llvm/llvm-project/pull/93318#discussion_r1616281934 Added: Modified: Removed: clang/utils/ci/run-buildbot diff --git a/clang/utils/ci/run-buildbot b/clang/utils/ci/run-buildbot deleted file mode 100755 index c68ddad571f3c..0 --- a/clang/utils/ci/run-buildbot +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash -#===--===## -# -# 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 -# -#===--===## - -set -ex -set -o pipefail -unset LANG -unset LC_ALL -unset LC_COLLATE - -PROGNAME="$(basename "${0}")" - -function usage() { -cat < - -[-h|--help] Display this help and exit. - ---llvm-rootPath to the root of the LLVM monorepo. By default, we try -to figure it out based on the current working directory. - ---build-dirThe directory to use for building the library. By default, -this is '/build/'. -EOF -} - -if [[ $# == 0 ]]; then - usage - exit 0 -fi - -while [[ $# -gt 0 ]]; do -case ${1} in --h|--help) -usage -exit 0 -;; ---llvm-root) -MONOREPO_ROOT="${2}" -shift; shift -;; ---build-dir) -BUILD_DIR="${2}" -shift; shift -;; -*) -BUILDER="${1}" -shift -;; -esac -done - -MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}" -BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build/${BUILDER}}" -INSTALL_DIR="${BUILD_DIR}/install" - -function clean() { -rm -rf "${BUILD_DIR}" -} - -# Print the version of a few tools to aid diagnostics in some cases -cmake --version -ninja --version - -case "${BUILDER}" in -build-clang) -mkdir install -# We use Release here to avoid including debug information. Otherwise, the -# clang binary is very large, which is problematic because we need to upload -# the artifacts for other jobs to use. This may seem like nothing, but with -# the number of jobs we run daily, this can result in thousands of GB of -# network I/O. -cmake \ --S llvm \ --B ${BUILD_DIR} \ --G Ninja \ --DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ --DCMAKE_BUILD_TYPE=Release \ --DCMAKE_INSTALL_PREFIX=install \ --DLLVM_TARGETS_TO_BUILD=Native \ --DLLVM_ENABLE_PROJECTS="clang;compiler-rt" \ - -ninja -C ${BUILD_DIR} install-clang install-clang-resource-headers -ccache -s -tar -cJvf install.tar.xz install/ -buildkite-agent artifact upload --debug install.tar.xz -;; -generic-cxx03) -buildkite-agent artifact download install.tar.xz . -tar -xvf install.tar.xz -export CC=$(pwd)/install/bin/clang -export CXX=$(pwd)/install/bin/clang++ -chmod +x install/bin/clang install/bin/clang++ - -clean -cmake -S "${MONOREPO_ROOT}/runtimes" -B "${BUILD_DIR}" -GNinja \ - -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \ - -DLIBCXX_CXX_ABI=libcxxabi \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ - -DLIBCXX_TEST_PARAMS="std=c++03" \ - -DLIBCXXABI_TEST_PARAMS="std=c++03" - -ninja -vC "${BUILD_DIR}" check-runtimes -;; -generic-cxx26) -buildkite-agent artifact download install.tar.xz . -tar -xvf install.tar.xz -export CC=$(pwd)/install/bin/clang -export CXX=$(pwd)/install/bin/clang++ -chmod +x install/bin/clang install/bin/clang++ - -clean -cmake -S "${MONOREPO_ROOT}/runtimes" -B "${BUILD_DIR}" -GNinja \ - -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \ - -DLIBCXX_CXX_ABI=libcxxabi \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
@@ -1,82 +0,0 @@ -#===--===## Endilll wrote: I decided to keep it intact out of caution, and asked on Discord instead whether this file is still needed. https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)
Endilll wrote: Sounds like you have a plan after this PR, which is good. I was worried that you're just applying `const` where it doesn't cause issues _today_. Such approach to const-correctness has been failing us (it leads to `const_cast`s down the usage chain). https://github.com/llvm/llvm-project/pull/93493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Be const-correct with all uses of `Module *`. (PR #93493)
Endilll wrote: Can you make sure that at every place this PR touches `const` makes sense? I found out recently that we can be quite good at pretending that something is `const`, all the way down until we realize we need a `const_cast`, because modification is required in that one place. https://github.com/llvm/llvm-project/pull/93493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang] Static and explicit object member functions with the same parameter-type-lists (PR #93430)
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -std=c++23 %s -ast-dump | FileCheck --check-prefixes=CXX23 %s + +namespace cwg2771 { // cwg2771: 18 + +struct A{ +int a; +void cwg2771(){ + int* r = +} +}; +// CXX23: CXXMethodDecl{{.+}}cwg2771 +// CXX23-NEXT: CompoundStmt +// CXX23-NEXT: DeclStmt +// CXX23-NEXT: VarDecl +// CXX23-NEXT: UnaryOperator +// CXX23-NEXT: MemberExpr +// CXX23-NEXT: CXXThisExpr{{.+}}'cwg2771::A *' +} Endilll wrote: ```suggestion } // namespace cwg2771 ``` https://github.com/llvm/llvm-project/pull/93430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang] Static and explicit object member functions with the same parameter-type-lists (PR #93430)
@@ -240,3 +240,29 @@ void test() { } } #endif + + +#if __cplusplus >= 202302L Endilll wrote: Move `#if` inside `namespace`. https://github.com/llvm/llvm-project/pull/93430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang] Static and explicit object member functions with the same parameter-type-lists (PR #93430)
@@ -240,3 +240,29 @@ void test() { } } #endif + + +#if __cplusplus >= 202302L +namespace cwg2692 { // cwg2692: 19 + + struct A { +static void f(A); // #cwg2692-1 +void f(this A); // #cwg2692-2 + +void g(); + }; + + void A::g() { +(::f)(A()); // expected-error {{call to 'f' is ambiguous}} Endilll wrote: Follow `// expected-error@-1` style, like the rest of DR tests. https://github.com/llvm/llvm-project/pull/93430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang] Static and explicit object member functions with the same parameter-type-lists (PR #93430)
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -std=c++23 %s -ast-dump | FileCheck --check-prefixes=CXX23 %s + +namespace cwg2771 { // cwg2771: 18 + +struct A{ +int a; +void cwg2771(){ + int* r = Endilll wrote: You can use `#pragma clang __debug dump ` to match less AST in FileCheck. https://github.com/llvm/llvm-project/pull/93430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] In Sema use new parentEvaluationContext function (PR #93338)
https://github.com/Endilll commented: LGTM https://github.com/llvm/llvm-project/pull/93338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] In Sema use new parentEvaluationContext function (PR #93338)
@@ -5153,6 +5153,12 @@ class Sema final : public SemaBase { return ExprEvalContexts.back(); }; + ExpressionEvaluationContextRecord () { +assert(ExprEvalContexts.size() >= 2 && + "Must be in an expression evaluation context"); +return ExprEvalContexts[ExprEvalContexts.size() - 2]; + }; + const ExpressionEvaluationContextRecord () const { Endilll wrote: You should implement const overload in terms of non-const overload you just added via `const_cast` on `this` to avoid duplication. https://github.com/llvm/llvm-project/pull/93338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] In Sema use new parentEvaluationContext function (PR #93338)
@@ -17693,12 +17691,13 @@ void Sema::PopExpressionEvaluationContext() { // Append the collected materialized temporaries into previous context before // exit if the previous also is a lifetime extending context. - auto = ExprEvalContexts[ExprEvalContexts.size() - 2]; + auto = parentEvaluationContext(); if (getLangOpts().CPlusPlus23 && Rec.InLifetimeExtendingContext && PrevRecord.InLifetimeExtendingContext && !Rec.ForRangeLifetimeExtendTemps.empty()) { -PrevRecord.ForRangeLifetimeExtendTemps.append( -Rec.ForRangeLifetimeExtendTemps); +const_cast &>( Endilll wrote: For the context, our overall const-correctness situation in Sema is less than ideal, to put it mildly. In this particular case I think we need to add a non-const overload for `parentEvaluationContext()` with the following prototype: `ExpressionEvaluationContextRecord ()`. https://github.com/llvm/llvm-project/pull/93338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/93318 >From 16ec4c725d86020831541a64bada8f4629a0972c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 24 May 2024 19:15:54 +0300 Subject: [PATCH 01/17] [clang][ci] Move libc++ testing into the main PR pipeline --- .ci/generate-buildkite-pipeline-premerge | 31 ++- .ci/monolithic-linux.sh | 65 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge index e1c66ac18e7ac..d563fa6a01120 100755 --- a/.ci/generate-buildkite-pipeline-premerge +++ b/.ci/generate-buildkite-pipeline-premerge @@ -85,6 +85,22 @@ function compute-projects-to-test() { done } +function compute-runtimes-to-test() { + projects=${@} + for project in ${projects}; do +echo "${project}" +case ${project} in +clang) + for p in libcxx libcxxabi libunwind; do +echo $p + done +*) + # Nothing to do +;; +esac + done +} + function add-dependencies() { projects=${@} for project in ${projects}; do @@ -178,6 +194,15 @@ function check-targets() { cross-project-tests) echo "check-cross-project" ;; +libcxx) + echo "check-cxx" +;; +libcxxabi) + echo "check-cxxabi" +;; +libunwind) + echo "check-unwind" +;; lldb) echo "check-all" # TODO: check-lldb may not include all the LLDB tests? ;; @@ -231,6 +256,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) +linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) +linux_runtimes=$(${linux_runtimes_to_test} | sort | uniq) + windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects})) windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) @@ -255,7 +284,7 @@ if [[ "${linux_projects}" != "" ]]; then CC: 'clang' CXX: 'clang++' commands: - - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})"' + - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"' EOF fi diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index b00a4b984a1d2..bbd90f7d496b1 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++03" \ + -DLIBCXXABI_TEST_PARAMS="std=c++03" + + echo "--- ninja runtimes C++03" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes C++26" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++26" \ + -DLIBCXXABI_TEST_PARAMS="std=c++26" + + echo "--- ninja runtimes C++26" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes clang modules" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ +
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
@@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + Endilll wrote: > 1. It's not parallelized anymore Performance that we get from parallelization only helps when there's low amount of PRs to test to begin with (so we have idle agents). This is not the case we need to focus on at the moment > 2. If one job fails, you don't get signal from whether the other jobs would > fail too Sure, but I consider it minor. Nothing stop us from iterating on this later. > 3. The reporting on Github is going to be confusing because everything will > be under the same job Entirety of the reporting for Clang PRs has been single `buildkite/github-pull-requests` entry, and even with the very recent change that enabled per-job reporting, libc++ jobs haven't been reported. So this patch doesn't regress anything for Clang contributors. We still have the primary piece of information whether the CI passed or not. Again, we can iterate on this later. > 4. This doesn't scale if we want to add more testing to be done against the > just-built Clang Additional Clang testing has scaling problems either way, because as I mentioned earlier, splitting jobs only helps when there are free agents to begin with. > Instead, I would suggest changing generate-buildkite-pipeline so that it adds > additional steps to the pipeline when we're testing Clang. These steps can > communicate via artifacts uploading/downloading like they used to. If you're willing to do the work in a reasonable time (remember we're reducing CI pressure here), you can take over this PR or I can abandon it. I personally had enough of bash scripting to iterate on this immediately. https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
@@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++03" \ + -DLIBCXXABI_TEST_PARAMS="std=c++03" Endilll wrote: Fixed. https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
@@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ Endilll wrote: Thank you! This should be fixed now. https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/93318 >From 16ec4c725d86020831541a64bada8f4629a0972c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 24 May 2024 19:15:54 +0300 Subject: [PATCH 01/16] [clang][ci] Move libc++ testing into the main PR pipeline --- .ci/generate-buildkite-pipeline-premerge | 31 ++- .ci/monolithic-linux.sh | 65 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge index e1c66ac18e7ac..d563fa6a01120 100755 --- a/.ci/generate-buildkite-pipeline-premerge +++ b/.ci/generate-buildkite-pipeline-premerge @@ -85,6 +85,22 @@ function compute-projects-to-test() { done } +function compute-runtimes-to-test() { + projects=${@} + for project in ${projects}; do +echo "${project}" +case ${project} in +clang) + for p in libcxx libcxxabi libunwind; do +echo $p + done +*) + # Nothing to do +;; +esac + done +} + function add-dependencies() { projects=${@} for project in ${projects}; do @@ -178,6 +194,15 @@ function check-targets() { cross-project-tests) echo "check-cross-project" ;; +libcxx) + echo "check-cxx" +;; +libcxxabi) + echo "check-cxxabi" +;; +libunwind) + echo "check-unwind" +;; lldb) echo "check-all" # TODO: check-lldb may not include all the LLDB tests? ;; @@ -231,6 +256,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) +linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) +linux_runtimes=$(${linux_runtimes_to_test} | sort | uniq) + windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects})) windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) @@ -255,7 +284,7 @@ if [[ "${linux_projects}" != "" ]]; then CC: 'clang' CXX: 'clang++' commands: - - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})"' + - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"' EOF fi diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index b00a4b984a1d2..bbd90f7d496b1 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++03" \ + -DLIBCXXABI_TEST_PARAMS="std=c++03" + + echo "--- ninja runtimes C++03" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes C++26" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++26" \ + -DLIBCXXABI_TEST_PARAMS="std=c++26" + + echo "--- ninja runtimes C++26" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes clang modules" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ +
[clang] [clang] In Sema use new parentEvaluationContext function (PR #93338)
https://github.com/Endilll commented: `Sema.h` changes look good. https://github.com/llvm/llvm-project/pull/93338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] In Sema use new parentEvaluationContext function (PR #93338)
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/93338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
Endilll wrote: > You may want to have someone double-checkout those new libcxx jobs. Sure. libc++ jobs are not really new: I basically copied them over from https://github.com/llvm/llvm-project/blob/b9d40a7ae4b3e5b9829eca8a497637c9fab6dd3e/clang/utils/ci/run-buildbot#L94-L147 https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
Endilll wrote: > Can we also delete > https://github.com/llvm/llvm-project/blob/main/clang/utils/ci/buildkite-pipeline.yml Done. https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/93318 >From 16ec4c725d86020831541a64bada8f4629a0972c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 24 May 2024 19:15:54 +0300 Subject: [PATCH 01/13] [clang][ci] Move libc++ testing into the main PR pipeline --- .ci/generate-buildkite-pipeline-premerge | 31 ++- .ci/monolithic-linux.sh | 65 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge index e1c66ac18e7ac..d563fa6a01120 100755 --- a/.ci/generate-buildkite-pipeline-premerge +++ b/.ci/generate-buildkite-pipeline-premerge @@ -85,6 +85,22 @@ function compute-projects-to-test() { done } +function compute-runtimes-to-test() { + projects=${@} + for project in ${projects}; do +echo "${project}" +case ${project} in +clang) + for p in libcxx libcxxabi libunwind; do +echo $p + done +*) + # Nothing to do +;; +esac + done +} + function add-dependencies() { projects=${@} for project in ${projects}; do @@ -178,6 +194,15 @@ function check-targets() { cross-project-tests) echo "check-cross-project" ;; +libcxx) + echo "check-cxx" +;; +libcxxabi) + echo "check-cxxabi" +;; +libunwind) + echo "check-unwind" +;; lldb) echo "check-all" # TODO: check-lldb may not include all the LLDB tests? ;; @@ -231,6 +256,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) +linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) +linux_runtimes=$(${linux_runtimes_to_test} | sort | uniq) + windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects})) windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) @@ -255,7 +284,7 @@ if [[ "${linux_projects}" != "" ]]; then CC: 'clang' CXX: 'clang++' commands: - - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})"' + - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"' EOF fi diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index b00a4b984a1d2..bbd90f7d496b1 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++03" \ + -DLIBCXXABI_TEST_PARAMS="std=c++03" + + echo "--- ninja runtimes C++03" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes C++26" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++26" \ + -DLIBCXXABI_TEST_PARAMS="std=c++26" + + echo "--- ninja runtimes C++26" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes clang modules" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ +
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll ready_for_review https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
@@ -178,6 +194,15 @@ function check-targets() { cross-project-tests) echo "check-cross-project" ;; +libcxx) + echo "check-cxx" +;; +libcxxabi) + echo "check-cxxabi" +;; +libunwind) + echo "check-unwind" Endilll wrote: No, because they are not on the list of all projects. You can check for yourself in the build I linked above. It says `./.ci/monolithic-linux.sh "clang;clang;lld;clang-tools-extra;compiler-rt;llvm" "check-all check-clang check-clang-tools" "libcxx;libcxxabi;libunwind" "check-cxx check-cxxabi check-unwind"` There are definitely other approaches to implementing what I do here, but I tried to stick to the ways script has been structured. https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/93318 >From 16ec4c725d86020831541a64bada8f4629a0972c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 24 May 2024 19:15:54 +0300 Subject: [PATCH 01/12] [clang][ci] Move libc++ testing into the main PR pipeline --- .ci/generate-buildkite-pipeline-premerge | 31 ++- .ci/monolithic-linux.sh | 65 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge index e1c66ac18e7ac..d563fa6a01120 100755 --- a/.ci/generate-buildkite-pipeline-premerge +++ b/.ci/generate-buildkite-pipeline-premerge @@ -85,6 +85,22 @@ function compute-projects-to-test() { done } +function compute-runtimes-to-test() { + projects=${@} + for project in ${projects}; do +echo "${project}" +case ${project} in +clang) + for p in libcxx libcxxabi libunwind; do +echo $p + done +*) + # Nothing to do +;; +esac + done +} + function add-dependencies() { projects=${@} for project in ${projects}; do @@ -178,6 +194,15 @@ function check-targets() { cross-project-tests) echo "check-cross-project" ;; +libcxx) + echo "check-cxx" +;; +libcxxabi) + echo "check-cxxabi" +;; +libunwind) + echo "check-unwind" +;; lldb) echo "check-all" # TODO: check-lldb may not include all the LLDB tests? ;; @@ -231,6 +256,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) +linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) +linux_runtimes=$(${linux_runtimes_to_test} | sort | uniq) + windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects})) windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) @@ -255,7 +284,7 @@ if [[ "${linux_projects}" != "" ]]; then CC: 'clang' CXX: 'clang++' commands: - - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})"' + - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"' EOF fi diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index b00a4b984a1d2..bbd90f7d496b1 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++03" \ + -DLIBCXXABI_TEST_PARAMS="std=c++03" + + echo "--- ninja runtimes C++03" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes C++26" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++26" \ + -DLIBCXXABI_TEST_PARAMS="std=c++26" + + echo "--- ninja runtimes C++26" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes clang modules" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ +
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
Endilll wrote: https://buildkite.com/llvm-project/github-pull-requests/builds/67044#018fab83-257d-446a-9ec2-3faab776dfa8 has both new additions and `clang-ci` run at the same time. `clang-ci` took 15 minutes, Linux run of GitHub Pull requests pipeline that does what `clang-ci` does on top of what it has been doing took 22.5 minutes. It used to take anywhere between 8 and 12 minutes based on a recently completed builds I see. Based on the steps that we don't need to do anymore, we should be saving 4-6 minutes per build: 1) Checking out the repo to generate the pipeline (2 minutes) 2) Build Clang (3.5 minutes) 3) Upload the artifacts, download them 3 times and unpack 3 times (0.5 minutes) https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/93318 >From 16ec4c725d86020831541a64bada8f4629a0972c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 24 May 2024 19:15:54 +0300 Subject: [PATCH 01/10] [clang][ci] Move libc++ testing into the main PR pipeline --- .ci/generate-buildkite-pipeline-premerge | 31 ++- .ci/monolithic-linux.sh | 65 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge index e1c66ac18e7ac..d563fa6a01120 100755 --- a/.ci/generate-buildkite-pipeline-premerge +++ b/.ci/generate-buildkite-pipeline-premerge @@ -85,6 +85,22 @@ function compute-projects-to-test() { done } +function compute-runtimes-to-test() { + projects=${@} + for project in ${projects}; do +echo "${project}" +case ${project} in +clang) + for p in libcxx libcxxabi libunwind; do +echo $p + done +*) + # Nothing to do +;; +esac + done +} + function add-dependencies() { projects=${@} for project in ${projects}; do @@ -178,6 +194,15 @@ function check-targets() { cross-project-tests) echo "check-cross-project" ;; +libcxx) + echo "check-cxx" +;; +libcxxabi) + echo "check-cxxabi" +;; +libunwind) + echo "check-unwind" +;; lldb) echo "check-all" # TODO: check-lldb may not include all the LLDB tests? ;; @@ -231,6 +256,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) +linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) +linux_runtimes=$(${linux_runtimes_to_test} | sort | uniq) + windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects})) windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) @@ -255,7 +284,7 @@ if [[ "${linux_projects}" != "" ]]; then CC: 'clang' CXX: 'clang++' commands: - - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})"' + - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"' EOF fi diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index b00a4b984a1d2..bbd90f7d496b1 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++03" \ + -DLIBCXXABI_TEST_PARAMS="std=c++03" + + echo "--- ninja runtimes C++03" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes C++26" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++26" \ + -DLIBCXXABI_TEST_PARAMS="std=c++26" + + echo "--- ninja runtimes C++26" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes clang modules" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ +
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/93318 >From 16ec4c725d86020831541a64bada8f4629a0972c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 24 May 2024 19:15:54 +0300 Subject: [PATCH 1/9] [clang][ci] Move libc++ testing into the main PR pipeline --- .ci/generate-buildkite-pipeline-premerge | 31 ++- .ci/monolithic-linux.sh | 65 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge index e1c66ac18e7ac..d563fa6a01120 100755 --- a/.ci/generate-buildkite-pipeline-premerge +++ b/.ci/generate-buildkite-pipeline-premerge @@ -85,6 +85,22 @@ function compute-projects-to-test() { done } +function compute-runtimes-to-test() { + projects=${@} + for project in ${projects}; do +echo "${project}" +case ${project} in +clang) + for p in libcxx libcxxabi libunwind; do +echo $p + done +*) + # Nothing to do +;; +esac + done +} + function add-dependencies() { projects=${@} for project in ${projects}; do @@ -178,6 +194,15 @@ function check-targets() { cross-project-tests) echo "check-cross-project" ;; +libcxx) + echo "check-cxx" +;; +libcxxabi) + echo "check-cxxabi" +;; +libunwind) + echo "check-unwind" +;; lldb) echo "check-all" # TODO: check-lldb may not include all the LLDB tests? ;; @@ -231,6 +256,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) +linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) +linux_runtimes=$(${linux_runtimes_to_test} | sort | uniq) + windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects})) windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) @@ -255,7 +284,7 @@ if [[ "${linux_projects}" != "" ]]; then CC: 'clang' CXX: 'clang++' commands: - - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})"' + - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"' EOF fi diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index b00a4b984a1d2..bbd90f7d496b1 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++03" \ + -DLIBCXXABI_TEST_PARAMS="std=c++03" + + echo "--- ninja runtimes C++03" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes C++26" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++26" \ + -DLIBCXXABI_TEST_PARAMS="std=c++26" + + echo "--- ninja runtimes C++26" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes clang modules" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ +
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/93318 >From 16ec4c725d86020831541a64bada8f4629a0972c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 24 May 2024 19:15:54 +0300 Subject: [PATCH 1/8] [clang][ci] Move libc++ testing into the main PR pipeline --- .ci/generate-buildkite-pipeline-premerge | 31 ++- .ci/monolithic-linux.sh | 65 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge index e1c66ac18e7ac..d563fa6a01120 100755 --- a/.ci/generate-buildkite-pipeline-premerge +++ b/.ci/generate-buildkite-pipeline-premerge @@ -85,6 +85,22 @@ function compute-projects-to-test() { done } +function compute-runtimes-to-test() { + projects=${@} + for project in ${projects}; do +echo "${project}" +case ${project} in +clang) + for p in libcxx libcxxabi libunwind; do +echo $p + done +*) + # Nothing to do +;; +esac + done +} + function add-dependencies() { projects=${@} for project in ${projects}; do @@ -178,6 +194,15 @@ function check-targets() { cross-project-tests) echo "check-cross-project" ;; +libcxx) + echo "check-cxx" +;; +libcxxabi) + echo "check-cxxabi" +;; +libunwind) + echo "check-unwind" +;; lldb) echo "check-all" # TODO: check-lldb may not include all the LLDB tests? ;; @@ -231,6 +256,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) +linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) +linux_runtimes=$(${linux_runtimes_to_test} | sort | uniq) + windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects})) windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) @@ -255,7 +284,7 @@ if [[ "${linux_projects}" != "" ]]; then CC: 'clang' CXX: 'clang++' commands: - - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})"' + - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"' EOF fi diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index b00a4b984a1d2..bbd90f7d496b1 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++03" \ + -DLIBCXXABI_TEST_PARAMS="std=c++03" + + echo "--- ninja runtimes C++03" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes C++26" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++26" \ + -DLIBCXXABI_TEST_PARAMS="std=c++26" + + echo "--- ninja runtimes C++26" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes clang modules" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ +
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/93318 >From 16ec4c725d86020831541a64bada8f4629a0972c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 24 May 2024 19:15:54 +0300 Subject: [PATCH 1/7] [clang][ci] Move libc++ testing into the main PR pipeline --- .ci/generate-buildkite-pipeline-premerge | 31 ++- .ci/monolithic-linux.sh | 65 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge index e1c66ac18e7ac..d563fa6a01120 100755 --- a/.ci/generate-buildkite-pipeline-premerge +++ b/.ci/generate-buildkite-pipeline-premerge @@ -85,6 +85,22 @@ function compute-projects-to-test() { done } +function compute-runtimes-to-test() { + projects=${@} + for project in ${projects}; do +echo "${project}" +case ${project} in +clang) + for p in libcxx libcxxabi libunwind; do +echo $p + done +*) + # Nothing to do +;; +esac + done +} + function add-dependencies() { projects=${@} for project in ${projects}; do @@ -178,6 +194,15 @@ function check-targets() { cross-project-tests) echo "check-cross-project" ;; +libcxx) + echo "check-cxx" +;; +libcxxabi) + echo "check-cxxabi" +;; +libunwind) + echo "check-unwind" +;; lldb) echo "check-all" # TODO: check-lldb may not include all the LLDB tests? ;; @@ -231,6 +256,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) +linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) +linux_runtimes=$(${linux_runtimes_to_test} | sort | uniq) + windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects})) windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) @@ -255,7 +284,7 @@ if [[ "${linux_projects}" != "" ]]; then CC: 'clang' CXX: 'clang++' commands: - - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})"' + - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"' EOF fi diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index b00a4b984a1d2..bbd90f7d496b1 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++03" \ + -DLIBCXXABI_TEST_PARAMS="std=c++03" + + echo "--- ninja runtimes C++03" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes C++26" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++26" \ + -DLIBCXXABI_TEST_PARAMS="std=c++26" + + echo "--- ninja runtimes C++26" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes clang modules" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ +
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/93318 >From 16ec4c725d86020831541a64bada8f4629a0972c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 24 May 2024 19:15:54 +0300 Subject: [PATCH 1/6] [clang][ci] Move libc++ testing into the main PR pipeline --- .ci/generate-buildkite-pipeline-premerge | 31 ++- .ci/monolithic-linux.sh | 65 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge index e1c66ac18e7ac..d563fa6a01120 100755 --- a/.ci/generate-buildkite-pipeline-premerge +++ b/.ci/generate-buildkite-pipeline-premerge @@ -85,6 +85,22 @@ function compute-projects-to-test() { done } +function compute-runtimes-to-test() { + projects=${@} + for project in ${projects}; do +echo "${project}" +case ${project} in +clang) + for p in libcxx libcxxabi libunwind; do +echo $p + done +*) + # Nothing to do +;; +esac + done +} + function add-dependencies() { projects=${@} for project in ${projects}; do @@ -178,6 +194,15 @@ function check-targets() { cross-project-tests) echo "check-cross-project" ;; +libcxx) + echo "check-cxx" +;; +libcxxabi) + echo "check-cxxabi" +;; +libunwind) + echo "check-unwind" +;; lldb) echo "check-all" # TODO: check-lldb may not include all the LLDB tests? ;; @@ -231,6 +256,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) +linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) +linux_runtimes=$(${linux_runtimes_to_test} | sort | uniq) + windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects})) windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) @@ -255,7 +284,7 @@ if [[ "${linux_projects}" != "" ]]; then CC: 'clang' CXX: 'clang++' commands: - - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})"' + - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"' EOF fi diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index b00a4b984a1d2..bbd90f7d496b1 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++03" \ + -DLIBCXXABI_TEST_PARAMS="std=c++03" + + echo "--- ninja runtimes C++03" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes C++26" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++26" \ + -DLIBCXXABI_TEST_PARAMS="std=c++26" + + echo "--- ninja runtimes C++26" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes clang modules" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ +
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/93318 >From 16ec4c725d86020831541a64bada8f4629a0972c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 24 May 2024 19:15:54 +0300 Subject: [PATCH 1/5] [clang][ci] Move libc++ testing into the main PR pipeline --- .ci/generate-buildkite-pipeline-premerge | 31 ++- .ci/monolithic-linux.sh | 65 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge index e1c66ac18e7ac..d563fa6a01120 100755 --- a/.ci/generate-buildkite-pipeline-premerge +++ b/.ci/generate-buildkite-pipeline-premerge @@ -85,6 +85,22 @@ function compute-projects-to-test() { done } +function compute-runtimes-to-test() { + projects=${@} + for project in ${projects}; do +echo "${project}" +case ${project} in +clang) + for p in libcxx libcxxabi libunwind; do +echo $p + done +*) + # Nothing to do +;; +esac + done +} + function add-dependencies() { projects=${@} for project in ${projects}; do @@ -178,6 +194,15 @@ function check-targets() { cross-project-tests) echo "check-cross-project" ;; +libcxx) + echo "check-cxx" +;; +libcxxabi) + echo "check-cxxabi" +;; +libunwind) + echo "check-unwind" +;; lldb) echo "check-all" # TODO: check-lldb may not include all the LLDB tests? ;; @@ -231,6 +256,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) +linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) +linux_runtimes=$(${linux_runtimes_to_test} | sort | uniq) + windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects})) windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) @@ -255,7 +284,7 @@ if [[ "${linux_projects}" != "" ]]; then CC: 'clang' CXX: 'clang++' commands: - - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})"' + - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"' EOF fi diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index b00a4b984a1d2..bbd90f7d496b1 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++03" \ + -DLIBCXXABI_TEST_PARAMS="std=c++03" + + echo "--- ninja runtimes C++03" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes C++26" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++26" \ + -DLIBCXXABI_TEST_PARAMS="std=c++26" + + echo "--- ninja runtimes C++26" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes clang modules" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ +
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/93318 >From 16ec4c725d86020831541a64bada8f4629a0972c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 24 May 2024 19:15:54 +0300 Subject: [PATCH 1/4] [clang][ci] Move libc++ testing into the main PR pipeline --- .ci/generate-buildkite-pipeline-premerge | 31 ++- .ci/monolithic-linux.sh | 65 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge index e1c66ac18e7ac..d563fa6a01120 100755 --- a/.ci/generate-buildkite-pipeline-premerge +++ b/.ci/generate-buildkite-pipeline-premerge @@ -85,6 +85,22 @@ function compute-projects-to-test() { done } +function compute-runtimes-to-test() { + projects=${@} + for project in ${projects}; do +echo "${project}" +case ${project} in +clang) + for p in libcxx libcxxabi libunwind; do +echo $p + done +*) + # Nothing to do +;; +esac + done +} + function add-dependencies() { projects=${@} for project in ${projects}; do @@ -178,6 +194,15 @@ function check-targets() { cross-project-tests) echo "check-cross-project" ;; +libcxx) + echo "check-cxx" +;; +libcxxabi) + echo "check-cxxabi" +;; +libunwind) + echo "check-unwind" +;; lldb) echo "check-all" # TODO: check-lldb may not include all the LLDB tests? ;; @@ -231,6 +256,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) +linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) +linux_runtimes=$(${linux_runtimes_to_test} | sort | uniq) + windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects})) windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) @@ -255,7 +284,7 @@ if [[ "${linux_projects}" != "" ]]; then CC: 'clang' CXX: 'clang++' commands: - - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})"' + - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"' EOF fi diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index b00a4b984a1d2..bbd90f7d496b1 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++03" \ + -DLIBCXXABI_TEST_PARAMS="std=c++03" + + echo "--- ninja runtimes C++03" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes C++26" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++26" \ + -DLIBCXXABI_TEST_PARAMS="std=c++26" + + echo "--- ninja runtimes C++26" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes clang modules" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ +
[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/93318 >From 16ec4c725d86020831541a64bada8f4629a0972c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 24 May 2024 19:15:54 +0300 Subject: [PATCH 1/3] [clang][ci] Move libc++ testing into the main PR pipeline --- .ci/generate-buildkite-pipeline-premerge | 31 ++- .ci/monolithic-linux.sh | 65 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge index e1c66ac18e7ac..d563fa6a01120 100755 --- a/.ci/generate-buildkite-pipeline-premerge +++ b/.ci/generate-buildkite-pipeline-premerge @@ -85,6 +85,22 @@ function compute-projects-to-test() { done } +function compute-runtimes-to-test() { + projects=${@} + for project in ${projects}; do +echo "${project}" +case ${project} in +clang) + for p in libcxx libcxxabi libunwind; do +echo $p + done +*) + # Nothing to do +;; +esac + done +} + function add-dependencies() { projects=${@} for project in ${projects}; do @@ -178,6 +194,15 @@ function check-targets() { cross-project-tests) echo "check-cross-project" ;; +libcxx) + echo "check-cxx" +;; +libcxxabi) + echo "check-cxxabi" +;; +libunwind) + echo "check-unwind" +;; lldb) echo "check-all" # TODO: check-lldb may not include all the LLDB tests? ;; @@ -231,6 +256,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test}) +linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq) +linux_runtimes=$(${linux_runtimes_to_test} | sort | uniq) + windows_projects_to_test=$(exclude-windows $(compute-projects-to-test ${modified_projects})) windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq) windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq) @@ -255,7 +284,7 @@ if [[ "${linux_projects}" != "" ]]; then CC: 'clang' CXX: 'clang++' commands: - - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})"' + - './.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"' EOF fi diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index b00a4b984a1d2..bbd90f7d496b1 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -54,3 +54,68 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ echo "--- ninja" # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +runtimes="${3}" +runtime_targets="${4}" + +# Compiling runtimes with just-built Clang and running their tests +# as an additional testing for Clang. +if [[ "${runtimes}" != "" ]]; then + if [[ "${runtime_targets}" == "" ]]; then +echo "Runtimes to build are specified, but targets are not." + fi + + RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" + INSTALL_DIR="${RUNTIMES_BUILD_DIR}/install" + mkdir -p ${RUNTIMES_BUILD_DIR} + + echo "--- cmake runtimes C++03" + + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++03" \ + -DLIBCXXABI_TEST_PARAMS="std=c++03" + + echo "--- ninja runtimes C++03" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes C++26" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ + -DLLVM_ENABLE_RUNTIMES="${runtimes}" \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLIBCXX_TEST_PARAMS="std=c++26" \ + -DLIBCXXABI_TEST_PARAMS="std=c++26" + + echo "--- ninja runtimes C++26" + + ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + + echo "--- cmake runtimes clang modules" + + rm -rf "${RUNTIMES_BUILD_DIR}" + cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ + -DCMAKE_C_COMPILER="${BUILD_DIR}/bin/clang" \ + -DCMAKE_CXX_COMPILER="${BUILD_DIR}/bin/clang++" \ +
[clang] [clang][ci] Remove unnecessary BuildKite jobs for Clang (PR #93233)
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/93233 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)
@@ -1213,6 +1213,197 @@ static bool isRemark(const Record ) { return ClsName == "CLASS_REMARK"; } +// Presumes the text has been split at the first whitespace or hyphen. +static bool isExemptAtStart(StringRef Text) { + // Fast path, the first character is lowercase or not alphanumeric. + if (isLower(Text[0]) || !isAlnum(Text[0])) +return true; + + // If the text is all uppercase (or numbers, +, or _), then we assume it's an + // acronym and that's allowed. This covers cases like ISO, C23, C++14, and + // OBJECT_MODE. However, if there's only a single letter other than "C", we + // do not exempt it so that we catch a case like "A really bad idea" while + // still allowing a case like "C does not allow...". + if (llvm::all_of(Text, [](char C) { +return isUpper(C) || isDigit(C) || C == '+' || C == '_'; + })) +return Text.size() > 1 || Text[0] == 'C'; + + // Otherwise, there are a few other exemptions. + return StringSwitch(Text) + .Case("AddressSanitizer", true) + .Case("CFString", true) + .Case("Clang", true) + .Case("Fuchsia", true) + .Case("GNUstep", true) + .Case("IBOutletCollection", true) + .Case("Microsoft", true) + .Case("Neon", true) + .StartsWith("NSInvocation", true) // NSInvocation, NSInvocation's + .Case("Objective", true) // Objective-C (- is a word boundary) Endilll wrote: ```suggestion .Case("Objective", true) // Objective-C (hyphen is a word boundary) ``` https://github.com/llvm/llvm-project/pull/93229 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][ci] Remove unnecessary BuildKite jobs for Clang (PR #93233)
https://github.com/Endilll approved this pull request. OK, I'll try to add this testing to "GitHub Pull Requests" later so that we can avoid building Clang twice. https://github.com/llvm/llvm-project/pull/93233 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][ci] Remove unnecessary BuildKite jobs for Clang (PR #93233)
Endilll wrote: Do we even need to build Clang and run libc++ jobs? I don't even see them linked in libc++ PR, even besides the fact that I think libc++ is fully tested with GitHub Actions. https://github.com/llvm/llvm-project/pull/93233 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)
@@ -1213,6 +1213,194 @@ static bool isRemark(const Record ) { return ClsName == "CLASS_REMARK"; } +// Presumes the text has been split at the first whitespace or hyphen. +static bool isExemptAtStart(StringRef Text) { + // Fast path, the first character is lowercase or not alphanumeric. + if (isLower(Text[0]) || !isAlnum(Text[0])) +return true; + + // If the text is all uppercase (or numbers, +, or _), then we assume it's an + // acronym and that's allowed. This covers cases like ISO, C23, C++14, and + // OBJECT_MODE. However, if there's only a single letter other than "C", we + // do not exempt it so that we catch a case like "A really bad idea" while + // still allowing a case like "C does not allow...". + if (llvm::all_of(Text, [](char C) { +return isUpper(C) || isDigit(C) || C == '+' || C == '_'; + })) +return Text.size() > 1 || Text[0] == 'C'; + + // Otherwise, there are a few other exemptions. + return StringSwitch(Text) + .Case("AddressSanitizer", true) + .Case("CFString", true) + .Case("Clang", true) + .Case("Fuchsia", true) + .Case("GNUstep", true) + .Case("IBOutletCollection", true) + .Case("Microsoft", true) + .Case("Neon", true) + .StartsWith("NSInvocation", true) // NSInvocation, NSInvocation's + .Case("Objective", true) // Objective-C, Objective-C++ + .Case("OpenACC", true) + .Case("OpenCL", true) + .Case("OpenMP", true) + .Case("Pascal", true) + .Case("Swift", true) + .Case("Unicode", true) + .Case("Vulkan", true) + .Case("WebAssembly", true) + .Default(false); +} + +// Does not presume the text has been split at all. +static bool isExemptAtEnd(StringRef Text) { + // Rather than come up with a list of characters that are allowed, we go the + // other way and look only for characters that are not allowed. + switch (Text.back()) { + default: +return true; + case '?': +// Explicitly allowed to support "; did you mean?". +return true; + case '.': + case '!': +return false; + } +} + +static void verifyDiagnosticWording(const Record ) { + StringRef FullDiagText = Diag.getValueAsString("Summary"); + + auto DiagnoseStart = [&](StringRef Text) { +// Verify that the text does not start with a capital letter, except for +// special cases that are exempt like ISO and C++. Find the first word +// by looking for a word breaking character. +char Separators[] = {' ', '-', ',', '}'}; +auto Iter = std::find_first_of( +Text.begin(), Text.end(), std::begin(Separators), std::end(Separators)); + +StringRef First = Text.substr(0, Iter - Text.begin()); +if (!isExemptAtStart(First)) { + PrintError(, + "Diagnostics should not start with a capital letter; '" + + First + "' is invalid"); +} + }; + + auto DiagnoseEnd = [&](StringRef Text) { +// Verify that the text does not end with punctuation like '.' or '!'. +if (!isExemptAtEnd(Text)) { + PrintError(, "Diagnostics should not end with punctuation; '" + +Text.substr(Text.size() - 1, 1) + "' is invalid"); +} + }; + + // If the diagnostic starts with %select, look through it to see whether any + // of the options will cause a problem. + if (FullDiagText.starts_with("%select{")) { +// Do a balanced delimiter scan from the start of the text to find the +// closing '}', skipping intermediary {} pairs. + +size_t BraceCount = 1; +auto Iter = FullDiagText.begin() + /*%select{*/ 8; +for (auto End = FullDiagText.end(); Iter != End; ++Iter) { + char Ch = *Iter; + if (Ch == '{') +++BraceCount; + else if (Ch == '}') +--BraceCount; + if (!BraceCount) +break; +} +// Defending against a malformed diagnostic string. +if (BraceCount != 0) + return; + +StringRef SelectText = FullDiagText.substr( +/*%select{*/ 8, Iter - FullDiagText.begin() - /*%select{*/ 8); Endilll wrote: You beat me to this! Yeah, that'd be nice. https://github.com/llvm/llvm-project/pull/93229 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Diagnose problematic diagnostic messages (PR #93229)
@@ -1213,6 +1213,194 @@ static bool isRemark(const Record ) { return ClsName == "CLASS_REMARK"; } +// Presumes the text has been split at the first whitespace or hyphen. +static bool isExemptAtStart(StringRef Text) { + // Fast path, the first character is lowercase or not alphanumeric. + if (isLower(Text[0]) || !isAlnum(Text[0])) +return true; + + // If the text is all uppercase (or numbers, +, or _), then we assume it's an + // acronym and that's allowed. This covers cases like ISO, C23, C++14, and + // OBJECT_MODE. However, if there's only a single letter other than "C", we + // do not exempt it so that we catch a case like "A really bad idea" while + // still allowing a case like "C does not allow...". + if (llvm::all_of(Text, [](char C) { +return isUpper(C) || isDigit(C) || C == '+' || C == '_'; + })) +return Text.size() > 1 || Text[0] == 'C'; + + // Otherwise, there are a few other exemptions. + return StringSwitch(Text) + .Case("AddressSanitizer", true) + .Case("CFString", true) + .Case("Clang", true) + .Case("Fuchsia", true) + .Case("GNUstep", true) + .Case("IBOutletCollection", true) + .Case("Microsoft", true) + .Case("Neon", true) + .StartsWith("NSInvocation", true) // NSInvocation, NSInvocation's + .Case("Objective", true) // Objective-C, Objective-C++ Endilll wrote: Probably worth a comment that `-` is considered a word boundary, so both Objective-C and Objective-C++ are covered. https://github.com/llvm/llvm-project/pull/93229 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)
Endilll wrote: > FYI this causes a minor compile-time improvement in stage1 builds using gcc: > https://llvm-compile-time-tracker.com/compare.php?from=32c3561d44aa792ef08d72b5a4c342c9965bc4c2=4feae05c6abda364a9295aecfa600d7d4e7dfeb6=instructions:u > While that's nice, it does suggest that the flags are not the same as before. @nikic Can you elaborate on those numbers? Do you say that Clang (compiled with GCC) which compiles those tests works faster now? https://github.com/llvm/llvm-project/pull/92953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/93190 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)
https://github.com/Endilll approved this pull request. https://github.com/llvm/llvm-project/pull/93190 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [flang] Fix more diagnostic wording for style; NFC (PR #93190)
@@ -10362,12 +10362,12 @@ def err_shufflevector_argument_too_large : Error< "index for __builtin_shufflevector must be less than the total number " "of vector elements">; def err_shufflevector_minus_one_is_undefined_behavior_constexpr : Error< - "index for __builtin_shufflevector not within the bounds of the input vectors; index of -1 found at position %0 not permitted in a constexpr context.">; + "index for __builtin_shufflevector not within the bounds of the input vectors; index of -1 found at position %0 not permitted in a constexpr context">; Endilll wrote: ```suggestion "index for __builtin_shufflevector not within the bounds of the input vectors; index of -1 found at position %0 is not permitted in a constexpr context">; ``` https://github.com/llvm/llvm-project/pull/93190 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)
@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase { BuiltinFunction }; + /// A helper function to provide Attribute Location for the Attr types Endilll wrote: We decided that there's nothing to change here after an offline discussion. https://github.com/llvm/llvm-project/pull/93179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)
Endilll wrote: Quite expectedly, I see buildbot failures. Working on them. https://lab.llvm.org/buildbot/#/builders/36/builds/45836 https://lab.llvm.org/buildbot/#/builders/57/builds/35200 https://github.com/llvm/llvm-project/pull/92953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/93179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)
@@ -67,6 +67,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringExtras.h" Endilll wrote: For `toString(*I, 10, false)` in `CheckUInt32Argument` definition that I moved. https://github.com/llvm/llvm-project/pull/93179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)
@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase { BuiltinFunction }; + /// A helper function to provide Attribute Location for the Attr types Endilll wrote: Yes, I moved them together, so http://eel.is/c++draft/over.match.best#general-2.4 should apply as usual. https://github.com/llvm/llvm-project/pull/93179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/92953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)
Endilll wrote: > Should update the GitHub autolabeler paths for the targets if they don't get > caught talready AMDGPU has been already caught, I updated the rest. Thank you! https://github.com/llvm/llvm-project/pull/93179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Introduce target-specific `Sema` components (PR #93179)
Endilll wrote: The only thing clang-format complain about is switches for builtins for ARM, Hexagon, MIPS, and SystemZ. I don't feel like it makes improvements there, but open for input from contributors in those areas. https://github.com/llvm/llvm-project/pull/93179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Introduce `SemaX86` (PR #93098)
Endilll wrote: @RKSimon Not at the moment. The current goal is to reduce amount of declarations in `Sema`, and target-specific functions are easy to move out and, importantly, teach where new ones should be placed. No functional changes intended. I don't know much about our CodeGen, so I'm not proposing anything myself. That said, if there's an appetite for something of this sort there, and someone knowledgeable of CodeGen is willing to guide me and help get stakeholders agree, I can do the work. https://github.com/llvm/llvm-project/pull/93098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Reland #90786 ([BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C) (PR #93121)
https://github.com/Endilll commented: `Sema.h` changes look good. https://github.com/llvm/llvm-project/pull/93121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Introduce `SemaX86` (PR #93098)
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/93098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Catch missing format attributes (PR #70024)
https://github.com/Endilll commented: Sema.h changes look good. https://github.com/llvm/llvm-project/pull/70024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/92953 >From 66e05ac24613435dbe774d49684d8ff9d119c4c3 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Tue, 21 May 2024 21:41:24 +0300 Subject: [PATCH 1/3] Remove some `try_compile` CMake checks for compiler flags This patch remove 36 checks for compiler flags that are done via invoking the compiler across LLVM, Clang, and LLDB. It's was made possible by raising the bar for supported compilers that has been happening over the years since the checks were added. This is going to improve CMake configuration times. This topic was highlighted in https://discourse.llvm.org/t/cmake-compiler-flag-checks-are-really-slow-ideas-to-speed-them-up/78882. --- clang/CMakeLists.txt | 5 +- .../tests/functional/exec/CMakeLists.txt | 6 +- lldb/cmake/modules/LLDBConfig.cmake | 20 +-- llvm/cmake/config-ix.cmake| 19 +-- llvm/cmake/modules/AddLLVM.cmake | 4 +- llvm/cmake/modules/HandleLLVMOptions.cmake| 142 -- third-party/unittest/CMakeLists.txt | 4 +- 7 files changed, 80 insertions(+), 120 deletions(-) diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index c20ce47a12abb..a6bcb853a464c 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -349,10 +349,7 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wno-long-long") endif () - check_cxx_compiler_flag("-Werror -Wnested-anon-types" CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG) - if( CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG ) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types" ) - endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types" ) endif () # Determine HOST_LINK_VERSION on Darwin. diff --git a/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt b/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt index 95c6fdb610e0f..cb6ebda183725 100644 --- a/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt +++ b/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt @@ -2,11 +2,7 @@ project(exec C) cmake_minimum_required(VERSION 3.20.0) -include(CheckCCompilerFlag) -check_c_compiler_flag("-std=c99" C99_SUPPORTED) -if (C99_SUPPORTED) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") -endif() +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") include(CheckFunctionExists) include(CheckSymbolExists) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index 3c6223b015bb1..6458f2e174643 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -187,24 +187,18 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/../clang/include") # form -W, and if supported, add the corresponding -Wno- option. # Disable GCC warnings -check_cxx_compiler_flag("-Wdeprecated-declarations" CXX_SUPPORTS_DEPRECATED_DECLARATIONS) -append_if(CXX_SUPPORTS_DEPRECATED_DECLARATIONS "-Wno-deprecated-declarations" CMAKE_CXX_FLAGS) - -check_cxx_compiler_flag("-Wunknown-pragmas" CXX_SUPPORTS_UNKNOWN_PRAGMAS) -append_if(CXX_SUPPORTS_UNKNOWN_PRAGMAS "-Wno-unknown-pragmas" CMAKE_CXX_FLAGS) - -check_cxx_compiler_flag("-Wstrict-aliasing" CXX_SUPPORTS_STRICT_ALIASING) -append_if(CXX_SUPPORTS_STRICT_ALIASING "-Wno-strict-aliasing" CMAKE_CXX_FLAGS) +append("-Wno-deprecated-declarations" CMAKE_CXX_FLAGS) +append("-Wno-unknown-pragmas" CMAKE_CXX_FLAGS) +append("-Wno-strict-aliasing" CMAKE_CXX_FLAGS) check_cxx_compiler_flag("-Wstringop-truncation" CXX_SUPPORTS_STRINGOP_TRUNCATION) append_if(CXX_SUPPORTS_STRINGOP_TRUNCATION "-Wno-stringop-truncation" CMAKE_CXX_FLAGS) # Disable Clang warnings -check_cxx_compiler_flag("-Wdeprecated-register" CXX_SUPPORTS_DEPRECATED_REGISTER) -append_if(CXX_SUPPORTS_DEPRECATED_REGISTER "-Wno-deprecated-register" CMAKE_CXX_FLAGS) - -check_cxx_compiler_flag("-Wvla-extension" CXX_SUPPORTS_VLA_EXTENSION) -append_if(CXX_SUPPORTS_VLA_EXTENSION "-Wno-vla-extension" CMAKE_CXX_FLAGS) +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + append("-Wno-deprecated-register" CMAKE_CXX_FLAGS) + append("-Wno-vla-extension" CMAKE_CXX_FLAGS) +endif() # Disable MSVC warnings if( MSVC ) diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index bf1b110245bb2..0900e1107076e 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -415,15 +415,14 @@ if( LLVM_ENABLE_PIC ) set(ENABLE_PIC 1) else() set(ENABLE_PIC 0) - check_cxx_compiler_flag("-fno-pie" SUPPORTS_NO_PIE_FLAG) - if(SUPPORTS_NO_PIE_FLAG) -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-pie") - endif() + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-pie") endif() -check_cxx_compiler_flag("-Wvariadic-macros" SUPPORTS_VARIADIC_MACROS_FLAG) -check_cxx_compiler_flag("-Wgnu-zero-variadic-macro-arguments" -
[clang] [clang] Introduce `SemaX86` (PR #93098)
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/93098 This patch moves `Sema` functions that are specific for x86 into the new `SemaX86` class. This continues previous efforts to split `Sema` up. Additional context can be found in #84184 and #92682. >From 662c3458d6452c4016a57e92ad22d2eeb05315f4 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 23 May 2024 00:17:07 +0300 Subject: [PATCH 1/2] [clang] Introduce `SemaX86` --- clang/include/clang/Sema/Sema.h| 17 +- clang/include/clang/Sema/SemaX86.h | 39 ++ clang/lib/Sema/CMakeLists.txt | 1 + clang/lib/Sema/Sema.cpp| 2 + clang/lib/Sema/SemaChecking.cpp| 853 +--- clang/lib/Sema/SemaX86.cpp | 875 + 6 files changed, 926 insertions(+), 861 deletions(-) create mode 100644 clang/include/clang/Sema/SemaX86.h create mode 100644 clang/lib/Sema/SemaX86.cpp diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h index 97784f5ae0dc8..057ff61ccc644 100644 --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -177,6 +177,7 @@ class SemaOpenMP; class SemaPseudoObject; class SemaRISCV; class SemaSYCL; +class SemaX86; class StandardConversionSequence; class Stmt; class StringLiteral; @@ -1037,6 +1038,11 @@ class Sema final : public SemaBase { return *SYCLPtr; } + SemaX86 () { +assert(X86Ptr); +return *X86Ptr; + } + /// Source of additional semantic information. IntrusiveRefCntPtr ExternalSource; @@ -1076,6 +1082,7 @@ class Sema final : public SemaBase { std::unique_ptr PseudoObjectPtr; std::unique_ptr RISCVPtr; std::unique_ptr SYCLPtr; + std::unique_ptr X86Ptr; ///@} @@ -2122,16 +2129,6 @@ class Sema final : public SemaBase { CallExpr *TheCall); bool CheckMipsBuiltinArgument(unsigned BuiltinID, CallExpr *TheCall); bool CheckSystemZBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall); - bool CheckX86BuiltinRoundingOrSAE(unsigned BuiltinID, CallExpr *TheCall); - bool CheckX86BuiltinGatherScatterScale(unsigned BuiltinID, CallExpr *TheCall); - bool CheckX86BuiltinTileArguments(unsigned BuiltinID, CallExpr *TheCall); - bool CheckX86BuiltinTileArgumentsRange(CallExpr *TheCall, - ArrayRef ArgNums); - bool CheckX86BuiltinTileDuplicate(CallExpr *TheCall, ArrayRef ArgNums); - bool CheckX86BuiltinTileRangeAndDuplicate(CallExpr *TheCall, -ArrayRef ArgNums); - bool CheckX86BuiltinFunctionCall(const TargetInfo , unsigned BuiltinID, - CallExpr *TheCall); bool CheckPPCBuiltinFunctionCall(const TargetInfo , unsigned BuiltinID, CallExpr *TheCall); bool CheckAMDGCNBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall); diff --git a/clang/include/clang/Sema/SemaX86.h b/clang/include/clang/Sema/SemaX86.h new file mode 100644 index 0..16293b23ff520 --- /dev/null +++ b/clang/include/clang/Sema/SemaX86.h @@ -0,0 +1,39 @@ +//===- SemaX86.h --- X86 target-specific routines -*- C++ -*---===// +// +// 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 +// +//===--===// +/// \file +/// This file declares semantic analysis functions specific to X86. +/// +//===--===// + +#ifndef LLVM_CLANG_SEMA_SEMAX86_H +#define LLVM_CLANG_SEMA_SEMAX86_H + +#include "clang/AST/Expr.h" +#include "clang/Basic/LLVM.h" +#include "clang/Basic/TargetInfo.h" +#include "clang/Sema/SemaBase.h" + +namespace clang { +class SemaX86 : public SemaBase { +public: + SemaX86(Sema ); + + bool CheckBuiltinRoundingOrSAE(unsigned BuiltinID, CallExpr *TheCall); + bool CheckBuiltinGatherScatterScale(unsigned BuiltinID, CallExpr *TheCall); + bool CheckBuiltinTileArguments(unsigned BuiltinID, CallExpr *TheCall); + bool CheckBuiltinTileArgumentsRange(CallExpr *TheCall, + ArrayRef ArgNums); + bool CheckBuiltinTileDuplicate(CallExpr *TheCall, ArrayRef ArgNums); + bool CheckBuiltinTileRangeAndDuplicate(CallExpr *TheCall, +ArrayRef ArgNums); + bool CheckBuiltinFunctionCall(const TargetInfo , unsigned BuiltinID, + CallExpr *TheCall); +}; +} // namespace clang + +#endif // LLVM_CLANG_SEMA_SEMAX86_H diff --git a/clang/lib/Sema/CMakeLists.txt b/clang/lib/Sema/CMakeLists.txt index 6b7742cae2db9..fe6471c81ff01 100644 --- a/clang/lib/Sema/CMakeLists.txt +++ b/clang/lib/Sema/CMakeLists.txt @@ -71,6 +71,7 @@ add_clang_library(clangSema SemaTemplateInstantiateDecl.cpp
[clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/92953 >From 66e05ac24613435dbe774d49684d8ff9d119c4c3 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Tue, 21 May 2024 21:41:24 +0300 Subject: [PATCH 1/2] Remove some `try_compile` CMake checks for compiler flags This patch remove 36 checks for compiler flags that are done via invoking the compiler across LLVM, Clang, and LLDB. It's was made possible by raising the bar for supported compilers that has been happening over the years since the checks were added. This is going to improve CMake configuration times. This topic was highlighted in https://discourse.llvm.org/t/cmake-compiler-flag-checks-are-really-slow-ideas-to-speed-them-up/78882. --- clang/CMakeLists.txt | 5 +- .../tests/functional/exec/CMakeLists.txt | 6 +- lldb/cmake/modules/LLDBConfig.cmake | 20 +-- llvm/cmake/config-ix.cmake| 19 +-- llvm/cmake/modules/AddLLVM.cmake | 4 +- llvm/cmake/modules/HandleLLVMOptions.cmake| 142 -- third-party/unittest/CMakeLists.txt | 4 +- 7 files changed, 80 insertions(+), 120 deletions(-) diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index c20ce47a12abb..a6bcb853a464c 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -349,10 +349,7 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wno-long-long") endif () - check_cxx_compiler_flag("-Werror -Wnested-anon-types" CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG) - if( CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG ) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types" ) - endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types" ) endif () # Determine HOST_LINK_VERSION on Darwin. diff --git a/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt b/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt index 95c6fdb610e0f..cb6ebda183725 100644 --- a/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt +++ b/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt @@ -2,11 +2,7 @@ project(exec C) cmake_minimum_required(VERSION 3.20.0) -include(CheckCCompilerFlag) -check_c_compiler_flag("-std=c99" C99_SUPPORTED) -if (C99_SUPPORTED) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") -endif() +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") include(CheckFunctionExists) include(CheckSymbolExists) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index 3c6223b015bb1..6458f2e174643 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -187,24 +187,18 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/../clang/include") # form -W, and if supported, add the corresponding -Wno- option. # Disable GCC warnings -check_cxx_compiler_flag("-Wdeprecated-declarations" CXX_SUPPORTS_DEPRECATED_DECLARATIONS) -append_if(CXX_SUPPORTS_DEPRECATED_DECLARATIONS "-Wno-deprecated-declarations" CMAKE_CXX_FLAGS) - -check_cxx_compiler_flag("-Wunknown-pragmas" CXX_SUPPORTS_UNKNOWN_PRAGMAS) -append_if(CXX_SUPPORTS_UNKNOWN_PRAGMAS "-Wno-unknown-pragmas" CMAKE_CXX_FLAGS) - -check_cxx_compiler_flag("-Wstrict-aliasing" CXX_SUPPORTS_STRICT_ALIASING) -append_if(CXX_SUPPORTS_STRICT_ALIASING "-Wno-strict-aliasing" CMAKE_CXX_FLAGS) +append("-Wno-deprecated-declarations" CMAKE_CXX_FLAGS) +append("-Wno-unknown-pragmas" CMAKE_CXX_FLAGS) +append("-Wno-strict-aliasing" CMAKE_CXX_FLAGS) check_cxx_compiler_flag("-Wstringop-truncation" CXX_SUPPORTS_STRINGOP_TRUNCATION) append_if(CXX_SUPPORTS_STRINGOP_TRUNCATION "-Wno-stringop-truncation" CMAKE_CXX_FLAGS) # Disable Clang warnings -check_cxx_compiler_flag("-Wdeprecated-register" CXX_SUPPORTS_DEPRECATED_REGISTER) -append_if(CXX_SUPPORTS_DEPRECATED_REGISTER "-Wno-deprecated-register" CMAKE_CXX_FLAGS) - -check_cxx_compiler_flag("-Wvla-extension" CXX_SUPPORTS_VLA_EXTENSION) -append_if(CXX_SUPPORTS_VLA_EXTENSION "-Wno-vla-extension" CMAKE_CXX_FLAGS) +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + append("-Wno-deprecated-register" CMAKE_CXX_FLAGS) + append("-Wno-vla-extension" CMAKE_CXX_FLAGS) +endif() # Disable MSVC warnings if( MSVC ) diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index bf1b110245bb2..0900e1107076e 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -415,15 +415,14 @@ if( LLVM_ENABLE_PIC ) set(ENABLE_PIC 1) else() set(ENABLE_PIC 0) - check_cxx_compiler_flag("-fno-pie" SUPPORTS_NO_PIE_FLAG) - if(SUPPORTS_NO_PIE_FLAG) -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-pie") - endif() + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-pie") endif() -check_cxx_compiler_flag("-Wvariadic-macros" SUPPORTS_VARIADIC_MACROS_FLAG) -check_cxx_compiler_flag("-Wgnu-zero-variadic-macro-arguments" -
[clang] [clang] Introduce `SemaRISCV` (PR #92682)
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/92682 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add tests for CWG issues regarding completeness of types (PR #92113)
@@ -86,6 +86,23 @@ struct A { }; } +namespace cwg1458 { // cwg1458: 3.1 +#if __cplusplus >= 201103L +struct A; + +void f() { + constexpr A* a = nullptr; + constexpr int p = &*a; + // expected-error@-1 {{cannot initialize a variable of type 'const int' with an rvalue of type 'A *'}} + constexpr A *p2 = &*a; Endilll wrote: We are documenting that our constant evaluator doesn't consider this UB. https://github.com/llvm/llvm-project/pull/92113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add tests for CWG issues regarding completeness of types (PR #92113)
@@ -451,6 +463,25 @@ static_assert(!__is_nothrow_constructible(D4, int), ""); #endif } // namespace cwg1350 +namespace cwg1352 { // cwg1352: 3.0 +struct A { +#if __cplusplus >= 201103L + int a = sizeof(A); Endilll wrote: > It also mentions in the body of member function Yeah, that is worth adding. I'll prepare a PR. https://github.com/llvm/llvm-project/pull/92113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Add tests for CWG issues regarding completeness of types (PR #92113)
@@ -451,6 +463,25 @@ static_assert(!__is_nothrow_constructible(D4, int), ""); #endif } // namespace cwg1350 +namespace cwg1352 { // cwg1352: 3.0 +struct A { +#if __cplusplus >= 201103L + int a = sizeof(A); Endilll wrote: It's not going to fail for static member initializers because of (I suspect) subsequent changes that were made to the wording: http://eel.is/c++draft/class.mem.general#8.5 https://github.com/llvm/llvm-project/pull/92113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][NFC] Refactor `Sema::TagUseKind` (PR #92689)
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/92689 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang] Implement resolution for CWG1835 (PR #92957)
Endilll wrote: It was a pure accident I opened this PR. I think draft status does a good job at silencing notifications. I spend a decent amount of time in P1787R6, so I might be able to provide good feedback. I'll take a look tomorrow. It would be nice to see a test for CWG1835 among the changes, even if you're not sure about your interpretation. https://github.com/llvm/llvm-project/pull/92957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] Disable compiling and testing Flang on Clang changes (PR #92740)
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/92740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)
Endilll wrote: Here are CE links with the set of minimum required compilers that should cover almost all the changes I made: https://godbolt.org/z/j98xzhrGa https://godbolt.org/z/errv4WhfP https://godbolt.org/z/vnoh8YqEP Windows-targeted flags were tested both on MSVC on CE, and on clang-cl 5.0 locally. https://github.com/llvm/llvm-project/pull/92953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)
Endilll wrote: On my setup, this patch improves CMake configuration times (from a clean state) from 51 seconds down to 46 seconds (average of 3 measurements). My setup: ancient x86 hardware, Debian Sid, nightly Clang, build directory on a RAM disk. CMake invocation: `cmake -DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_ENABLE_RUNTIMES="libunwind;libcxx;libcxxabi" -DCMAKE_BUILD_TYPE=Debug -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_DOXYGEN=ON -DLLVM_ENABLE_LIBCXX=ON -DBUILD_SHARED_LIBS=ON -DLLDB_ENABLE_PYTHON=ON ~/endill/llvm-project/llvm`. https://github.com/llvm/llvm-project/pull/92953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/92953 This patch remove 36 checks for compiler flags that are done via invoking the compiler across LLVM, Clang, and LLDB. It's was made possible by raising the bar for supported compilers that has been happening over the years since the checks were added. This is going to improve CMake configuration times. This topic was highlighted in https://discourse.llvm.org/t/cmake-compiler-flag-checks-are-really-slow-ideas-to-speed-them-up/78882. >From 66e05ac24613435dbe774d49684d8ff9d119c4c3 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Tue, 21 May 2024 21:41:24 +0300 Subject: [PATCH] Remove some `try_compile` CMake checks for compiler flags This patch remove 36 checks for compiler flags that are done via invoking the compiler across LLVM, Clang, and LLDB. It's was made possible by raising the bar for supported compilers that has been happening over the years since the checks were added. This is going to improve CMake configuration times. This topic was highlighted in https://discourse.llvm.org/t/cmake-compiler-flag-checks-are-really-slow-ideas-to-speed-them-up/78882. --- clang/CMakeLists.txt | 5 +- .../tests/functional/exec/CMakeLists.txt | 6 +- lldb/cmake/modules/LLDBConfig.cmake | 20 +-- llvm/cmake/config-ix.cmake| 19 +-- llvm/cmake/modules/AddLLVM.cmake | 4 +- llvm/cmake/modules/HandleLLVMOptions.cmake| 142 -- third-party/unittest/CMakeLists.txt | 4 +- 7 files changed, 80 insertions(+), 120 deletions(-) diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index c20ce47a12abb..a6bcb853a464c 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -349,10 +349,7 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wno-long-long") endif () - check_cxx_compiler_flag("-Werror -Wnested-anon-types" CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG) - if( CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG ) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types" ) - endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types" ) endif () # Determine HOST_LINK_VERSION on Darwin. diff --git a/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt b/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt index 95c6fdb610e0f..cb6ebda183725 100644 --- a/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt +++ b/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt @@ -2,11 +2,7 @@ project(exec C) cmake_minimum_required(VERSION 3.20.0) -include(CheckCCompilerFlag) -check_c_compiler_flag("-std=c99" C99_SUPPORTED) -if (C99_SUPPORTED) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") -endif() +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") include(CheckFunctionExists) include(CheckSymbolExists) diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index 3c6223b015bb1..6458f2e174643 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -187,24 +187,18 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/../clang/include") # form -W, and if supported, add the corresponding -Wno- option. # Disable GCC warnings -check_cxx_compiler_flag("-Wdeprecated-declarations" CXX_SUPPORTS_DEPRECATED_DECLARATIONS) -append_if(CXX_SUPPORTS_DEPRECATED_DECLARATIONS "-Wno-deprecated-declarations" CMAKE_CXX_FLAGS) - -check_cxx_compiler_flag("-Wunknown-pragmas" CXX_SUPPORTS_UNKNOWN_PRAGMAS) -append_if(CXX_SUPPORTS_UNKNOWN_PRAGMAS "-Wno-unknown-pragmas" CMAKE_CXX_FLAGS) - -check_cxx_compiler_flag("-Wstrict-aliasing" CXX_SUPPORTS_STRICT_ALIASING) -append_if(CXX_SUPPORTS_STRICT_ALIASING "-Wno-strict-aliasing" CMAKE_CXX_FLAGS) +append("-Wno-deprecated-declarations" CMAKE_CXX_FLAGS) +append("-Wno-unknown-pragmas" CMAKE_CXX_FLAGS) +append("-Wno-strict-aliasing" CMAKE_CXX_FLAGS) check_cxx_compiler_flag("-Wstringop-truncation" CXX_SUPPORTS_STRINGOP_TRUNCATION) append_if(CXX_SUPPORTS_STRINGOP_TRUNCATION "-Wno-stringop-truncation" CMAKE_CXX_FLAGS) # Disable Clang warnings -check_cxx_compiler_flag("-Wdeprecated-register" CXX_SUPPORTS_DEPRECATED_REGISTER) -append_if(CXX_SUPPORTS_DEPRECATED_REGISTER "-Wno-deprecated-register" CMAKE_CXX_FLAGS) - -check_cxx_compiler_flag("-Wvla-extension" CXX_SUPPORTS_VLA_EXTENSION) -append_if(CXX_SUPPORTS_VLA_EXTENSION "-Wno-vla-extension" CMAKE_CXX_FLAGS) +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + append("-Wno-deprecated-register" CMAKE_CXX_FLAGS) + append("-Wno-vla-extension" CMAKE_CXX_FLAGS) +endif() # Disable MSVC warnings if( MSVC ) diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index bf1b110245bb2..0900e1107076e 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -415,15 +415,14 @@ if( LLVM_ENABLE_PIC ) set(ENABLE_PIC 1) else()
[clang-tools-extra] e6b14b6 - [clangd] Fix directory separators in `infinite-instantiation.test`
Author: Vlad Serebrennikov Date: 2024-05-21T21:01:21+03:00 New Revision: e6b14b6f8bfeeea8d24c8dccb17053ba491d5879 URL: https://github.com/llvm/llvm-project/commit/e6b14b6f8bfeeea8d24c8dccb17053ba491d5879 DIFF: https://github.com/llvm/llvm-project/commit/e6b14b6f8bfeeea8d24c8dccb17053ba491d5879.diff LOG: [clangd] Fix directory separators in `infinite-instantiation.test` Fixing https://lab.llvm.org/buildbot/#/builders/123/builds/26934 caused by #92888. Third time the charm! Added: Modified: clang-tools-extra/clangd/test/infinite-instantiation.test Removed: diff --git a/clang-tools-extra/clangd/test/infinite-instantiation.test b/clang-tools-extra/clangd/test/infinite-instantiation.test index d379a9c2d523e..a9c787c77027c 100644 --- a/clang-tools-extra/clangd/test/infinite-instantiation.test +++ b/clang-tools-extra/clangd/test/infinite-instantiation.test @@ -1,5 +1,5 @@ // RUN: rm -rf %t.dir && mkdir -p %t.dir -// RUN: echo '[{"directory": "%/t.dir", "command": "clang -ftemplate-depth=100 -x c++ %s", "file": "%/s"}]' > %t.dir/compile_commands.json +// RUN: echo '[{"directory": "%/t.dir", "command": "clang -ftemplate-depth=100 -x c++ %/s", "file": "%/s"}]' > %t.dir/compile_commands.json // RUN: not clangd --compile-commands-dir=%t.dir -check=%s 2>&1 | FileCheck -strict-whitespace %s // CHECK: [template_recursion_depth_exceeded] ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang] Change how the argument of a delete expression is converted (PR #92814)
@@ -1230,11 +1230,11 @@ namespace cwg598 { // cwg598: yes int = h(N::i); } -namespace cwg599 { // cwg599: partial +namespace cwg599 { // cwg599: 19 typedef int Fn(); struct S { operator void*(); }; struct T { operator Fn*(); }; - struct U { operator int*(); operator void*(); }; // #cwg599-U + struct U { operator int*(); operator void*(); }; struct V { operator int*(); operator Fn*(); }; void f(void *p, void (*q)(), S s, T t, U u, V v) { Endilll wrote: Sorry, you added reference to pointer cases, which made me realize that pointers to references I've been asking for are prohibited by http://eel.is/c++draft/dcl.ref#5.sentence-1 https://github.com/llvm/llvm-project/pull/92814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang] Change how the argument of a delete expression is converted (PR #92814)
@@ -1245,12 +1245,7 @@ namespace cwg599 { // cwg599: partial // expected-error@-1 {{cannot delete expression with pointer-to-'void' type 'void *'}} delete t; // expected-error@-1 {{cannot delete expression of type 'T'}} -// FIXME: This is valid, but is rejected due to a non-conforming GNU -// extension allowing deletion of pointers to void. delete u; -// expected-error@-1 {{ambiguous conversion of delete expression of type 'U' to a pointer}} Endilll wrote: That explains it. Thank you! https://github.com/llvm/llvm-project/pull/92814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang] Change how the argument of a delete expression is converted (PR #92814)
@@ -1230,11 +1230,11 @@ namespace cwg598 { // cwg598: yes int = h(N::i); } -namespace cwg599 { // cwg599: partial +namespace cwg599 { // cwg599: 19 typedef int Fn(); struct S { operator void*(); }; struct T { operator Fn*(); }; - struct U { operator int*(); operator void*(); }; // #cwg599-U + struct U { operator int*(); operator void*(); }; struct V { operator int*(); operator Fn*(); }; void f(void *p, void (*q)(), S s, T t, U u, V v) { Endilll wrote: Thank you, but we still need it here for completeness of the DR test. It's not an issue when a DR test overlap with some other test outside of DR test suite. https://github.com/llvm/llvm-project/pull/92814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] 7c640d1 - [clangd] Fix directory separators in `infinite-instatiation.test`
Author: Vlad Serebrennikov Date: 2024-05-21T17:12:35+03:00 New Revision: 7c640d1d43d7a151100e92c678757e0ce897bcc2 URL: https://github.com/llvm/llvm-project/commit/7c640d1d43d7a151100e92c678757e0ce897bcc2 DIFF: https://github.com/llvm/llvm-project/commit/7c640d1d43d7a151100e92c678757e0ce897bcc2.diff LOG: [clangd] Fix directory separators in `infinite-instatiation.test` Another take at fixing https://lab.llvm.org/buildbot/#/builders/123/builds/26920 and https://lab.llvm.org/buildbot/#/builders/123/builds/26913 caused by #92888 Added: Modified: clang-tools-extra/clangd/test/infinite-instantiation.test Removed: diff --git a/clang-tools-extra/clangd/test/infinite-instantiation.test b/clang-tools-extra/clangd/test/infinite-instantiation.test index da1a294142429..d379a9c2d523e 100644 --- a/clang-tools-extra/clangd/test/infinite-instantiation.test +++ b/clang-tools-extra/clangd/test/infinite-instantiation.test @@ -1,5 +1,5 @@ // RUN: rm -rf %t.dir && mkdir -p %t.dir -// RUN: echo '[{"directory": "%t.dir", "command": "clang -ftemplate-depth=100 -x c++ %s", "file": "%s"}]' > %t.dir/compile_commands.json +// RUN: echo '[{"directory": "%/t.dir", "command": "clang -ftemplate-depth=100 -x c++ %s", "file": "%/s"}]' > %t.dir/compile_commands.json // RUN: not clangd --compile-commands-dir=%t.dir -check=%s 2>&1 | FileCheck -strict-whitespace %s // CHECK: [template_recursion_depth_exceeded] ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] 2117136 - [clangd] Fix bad directory path in `infinite-instantiations.test`
Author: Vlad Serebrennikov Date: 2024-05-21T15:42:31+03:00 New Revision: 2117136b2b78ef3b83202909ffaf351598da8bd5 URL: https://github.com/llvm/llvm-project/commit/2117136b2b78ef3b83202909ffaf351598da8bd5 DIFF: https://github.com/llvm/llvm-project/commit/2117136b2b78ef3b83202909ffaf351598da8bd5.diff LOG: [clangd] Fix bad directory path in `infinite-instantiations.test` Addresses buildbot failure https://lab.llvm.org/buildbot/#/builders/123/builds/26913 caused by #92888 Added: Modified: clang-tools-extra/clangd/test/infinite-instantiation.test Removed: diff --git a/clang-tools-extra/clangd/test/infinite-instantiation.test b/clang-tools-extra/clangd/test/infinite-instantiation.test index 98260c075d240..da1a294142429 100644 --- a/clang-tools-extra/clangd/test/infinite-instantiation.test +++ b/clang-tools-extra/clangd/test/infinite-instantiation.test @@ -1,5 +1,5 @@ // RUN: rm -rf %t.dir && mkdir -p %t.dir -// RUN: echo '[{"directory": "%/t.dir", "command": "clang -ftemplate-depth=100 -x c++ %s", "file": "%s"}]' > %t.dir/compile_commands.json +// RUN: echo '[{"directory": "%t.dir", "command": "clang -ftemplate-depth=100 -x c++ %s", "file": "%s"}]' > %t.dir/compile_commands.json // RUN: not clangd --compile-commands-dir=%t.dir -check=%s 2>&1 | FileCheck -strict-whitespace %s // CHECK: [template_recursion_depth_exceeded] ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang] Introduce `SemaPseudoObject` (PR #92646)
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/92646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clangd] Reduce instantiation depth in `infinite-instantiations.test` (PR #92888)
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/92888 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clangd] Reduce instantiation depth in `infinite-instantiations.test` (PR #92888)
Endilll wrote: Linux CI passed, so I'm merging this. https://github.com/llvm/llvm-project/pull/92888 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clangd] Reduce instantiation depth in `infinite-instantiations.test` (PR #92888)
https://github.com/Endilll ready_for_review https://github.com/llvm/llvm-project/pull/92888 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clangd] Reduce instantiation depth in `infinite-instantiations.test` (PR #92888)
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/92888 This patch reduces template instantiation depth in `infinite-instantiations.test`, because it doesn't seem to be concerned with the default instantiation depth in particular, but has a very material impact on testing times of clangd. Which subsequently affects CI run times for all Clang changes. The following numbers are taken from https://buildkite.com/llvm-project/github-pull-requests/builds/65299, but they are the same for any CI run with clangd: Linux: ``` Slowest Tests: -- 35.19s: Clangd :: infinite-instantiation.test 5.53s: Clangd :: protocol.test 1.48s: Clang Tools :: clang-tidy/checkers/modernize/use-emplace.cpp 1.40s: Clang Tools :: clang-tidy/checkers/misc/non-private-member-variables-in-classes.cpp 1.17s: Clang Tools :: clang-tidy/checkers/google/upgrade-googletest-case.cpp 1.15s: Clang Tools :: clang-tidy/checkers/bugprone/unsafe-functions.c 1.10s: Clang Tools :: clang-tidy/infrastructure/check_clang_tidy.cpp 1.07s: Clang Tools :: clang-tidy/checkers/readability/redundant-casting.cpp 1.06s: Clang Tools :: clang-tidy/checkers/misc/const-correctness-values.cpp 1.02s: Clang Tools :: clang-tidy/checkers/bugprone/implicit-widening-of-multiplication-result-char.cpp 1.00s: Clang Tools :: clang-tidy/checkers/modernize/loop-convert-reverse.cpp 0.97s: Clang Tools :: clang-tidy/checkers/modernize/loop-convert-basic.cpp 0.95s: Clang Tools :: clang-tidy/checkers/modernize/use-std-print.cpp 0.93s: Clang Tools :: clang-tidy/checkers/modernize/loop-convert-extra.cpp 0.92s: Clang Tools :: clang-tidy/checkers/altera/single-work-item-barrier.cpp 0.90s: Clang Tools :: clang-tidy/checkers/readability/identifier-naming-hungarian-notation-lower-case-prefix.cpp 0.90s: Clang Tools :: clang-tidy/checkers/modernize/use-auto-min-type-name-length.cpp 0.89s: Clang Tools :: clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp 0.88s: Clang Tools :: clang-tidy/checkers/readability/identifier-naming-hungarian-notation.cpp 0.85s: Clangd Unit Tests :: ./ClangdTests/Hover/All ``` Windows: ``` Slowest Tests: -- 244.74s: Clangd :: infinite-instantiation.test 11.42s: Clangd :: protocol.test 8.97s: Clang Tools :: clang-tidy/checkers/misc/non-private-member-variables-in-classes.cpp 7.44s: Clang Tools :: clang-tidy/checkers/altera/single-work-item-barrier.cpp 6.71s: Clang Tools :: clang-tidy/checkers/bugprone/unsafe-functions.c 6.61s: Clang Tools :: clang-tidy/checkers/bugprone/implicit-widening-of-multiplication-result-char.cpp 6.42s: Clang Tools :: clang-tidy/infrastructure/check_clang_tidy.cpp 6.32s: Clang Tools :: clang-tidy/checkers/modernize/loop-convert-reverse.cpp 6.01s: Clang Tools :: clang-tidy/checkers/readability/redundant-casting.cpp 5.62s: Clang Tools :: clang-tidy/checkers/modernize/use-auto-min-type-name-length.cpp 5.58s: Clang Tools :: clang-tidy/checkers/modernize/replace-disallow-copy-and-assign-macro.cpp 5.46s: Clang Tools :: clang-tidy/checkers/readability/function-cognitive-complexity-flags.cpp 5.08s: Clang Tools :: clang-tidy/checkers/readability/avoid-return-with-void-value.cpp 5.07s: Clang Tools :: clang-tidy/checkers/readability/redundant-declaration.cpp 4.99s: Clang Tools :: clang-tidy/checkers/readability/identifier-naming-hungarian-notation-lower-case-prefix.cpp 4.91s: Clang Tools :: clang-tidy/checkers/bugprone/implicit-widening-of-multiplication-result-pointer-offset.cpp 4.87s: Clang Tools :: clang-tidy/checkers/readability/identifier-naming-hungarian-notation-cfgfile.cpp 4.79s: Clang Tools :: clang-tidy/checkers/google/upgrade-googletest-case.cpp 4.78s: Clang Tools :: clang-tidy/infrastructure/clean-up-code.cpp 4.76s: Clang Tools :: clang-tidy/checkers/bugprone/implicit-widening-of-multiplication-result-int.cpp ``` >From 3a75e820f83f500a5ef438e6f61dc3bf0f39ea7d Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Tue, 21 May 2024 12:45:36 +0300 Subject: [PATCH] [clangd] Reduce instantiation depth in `infinite-instantiations.test` --- clang-tools-extra/clangd/test/infinite-instantiation.test | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clangd/test/infinite-instantiation.test b/clang-tools-extra/clangd/test/infinite-instantiation.test index 85a1b656f4908..98260c075d240 100644 --- a/clang-tools-extra/clangd/test/infinite-instantiation.test +++ b/clang-tools-extra/clangd/test/infinite-instantiation.test @@ -1,5 +1,6 @@ -// RUN: cp %s %t.cpp -// RUN: not clangd -check=%t.cpp 2>&1 | FileCheck -strict-whitespace %s +// RUN: rm -rf %t.dir && mkdir -p %t.dir +// RUN: echo '[{"directory": "%/t.dir", "command": "clang -ftemplate-depth=100 -x c++ %s", "file": "%s"}]' > %t.dir/compile_commands.json +// RUN: not clangd --compile-commands-dir=%t.dir -check=%s 2>&1 | FileCheck
[clang] [clang] Introduce `SemaRISCV` (PR #92682)
@@ -0,0 +1,52 @@ +//===- SemaRISCV.h --- RISC-V target-specific routines ===// Endilll wrote: Fixed https://github.com/llvm/llvm-project/pull/92682 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [Clang] Fix definition of layout-compatible to ignore empty classes (PR #92103)
@@ -561,6 +561,42 @@ void CXXRecordDecl::addedClassSubobject(CXXRecordDecl *Subobj) { data().StructuralIfLiteral = false; } +const CXXRecordDecl *CXXRecordDecl::getStandardLayoutBaseWithFields() const { +#ifndef NDEBUG + { +assert( +isStandardLayout() && +"getStandardLayoutBaseWithFields called on a non-standard-layout type"); +unsigned NumberOfBasesWithFields = 0; +if (!field_empty()) + ++NumberOfBasesWithFields; +std::set UniqueBases; Endilll wrote: Have you considered `llvm::DenseSet`? https://github.com/llvm/llvm-project/pull/92103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [Clang] Fix definition of layout-compatible to ignore empty classes (PR #92103)
https://github.com/Endilll commented: Thank you for working on this! https://github.com/llvm/llvm-project/pull/92103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [Clang] Fix definition of layout-compatible to ignore empty classes (PR #92103)
@@ -561,6 +561,42 @@ void CXXRecordDecl::addedClassSubobject(CXXRecordDecl *Subobj) { data().StructuralIfLiteral = false; } +const CXXRecordDecl *CXXRecordDecl::getStandardLayoutBaseWithFields() const { +#ifndef NDEBUG Endilll wrote: We have `EXPENSIVE_CHECKS` macro to guard expensive checks. https://github.com/llvm/llvm-project/pull/92103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [Clang] Fix definition of layout-compatible to ignore empty classes (PR #92103)
@@ -561,6 +561,42 @@ void CXXRecordDecl::addedClassSubobject(CXXRecordDecl *Subobj) { data().StructuralIfLiteral = false; } +const CXXRecordDecl *CXXRecordDecl::getStandardLayoutBaseWithFields() const { +#ifndef NDEBUG + { +assert( +isStandardLayout() && +"getStandardLayoutBaseWithFields called on a non-standard-layout type"); Endilll wrote: I think this assert should be on the default code path, not just for expensive checks. https://github.com/llvm/llvm-project/pull/92103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits