[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,214 @@ +//===--- TaggedUnionMemberCountCheck.cpp - clang-tidy -===// +// +// 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 +// +//===--===// + +#include "TaggedUnionMemberCountCheck.h" +#include "../utils/OptionsUtils.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallSet.h" + +using namespace clang::ast_matchers; + +namespace clang::tidy::bugprone { + +const char StrictModeOptionName[] = "StrictMode"; +const char EnableCountingEnumHeuristicOptionName[] = +"EnableCountingEnumHeuristic"; +const char CountingEnumPrefixesOptionName[] = "CountingEnumPrefixes"; +const char CountingEnumSuffixesOptionName[] = "CountingEnumSuffixes"; + +TaggedUnionMemberCountCheck::TaggedUnionMemberCountCheck( +StringRef Name, ClangTidyContext *Context) +: ClangTidyCheck(Name, Context), + StrictMode(Options.get(StrictModeOptionName, false)), + EnableCountingEnumHeuristic( + Options.get(EnableCountingEnumHeuristicOptionName, true)), + RawCountingEnumPrefixes(Options.get(CountingEnumPrefixesOptionName, "")), + RawCountingEnumSuffixes( + Options.get(CountingEnumSuffixesOptionName, "count")), + ParsedCountingEnumPrefixes( + utils::options::parseStringList(RawCountingEnumPrefixes)), + ParsedCountingEnumSuffixes( + utils::options::parseStringList(RawCountingEnumSuffixes)), + CountingEnumPrefixesSet( + Options.get(CountingEnumPrefixesOptionName).has_value()), + CountingEnumSuffixesSet( + Options.get(CountingEnumSuffixesOptionName).has_value()), + CountingEnumConstantDecl(nullptr) { + if (!EnableCountingEnumHeuristic) { +if (CountingEnumPrefixesSet) + configurationDiag("%0: Counting enum heuristic is disabled but " +"CountingEnumPrefixes is set") + << Name; +if (CountingEnumSuffixesSet) + configurationDiag("%0: Counting enum heuristic is disabled but " +"CountingEnumSuffixes is set") + << Name; + } +} + +void TaggedUnionMemberCountCheck::storeOptions( +ClangTidyOptions::OptionMap ) { + Options.store(Opts, StrictModeOptionName, StrictMode); + Options.store(Opts, EnableCountingEnumHeuristicOptionName, +EnableCountingEnumHeuristic); + Options.store(Opts, CountingEnumPrefixesOptionName, RawCountingEnumPrefixes); + Options.store(Opts, CountingEnumSuffixesOptionName, RawCountingEnumSuffixes); +} + +void TaggedUnionMemberCountCheck::registerMatchers(MatchFinder *Finder) { + Finder->addMatcher( + recordDecl( + anyOf(isStruct(), isClass()), + has(fieldDecl(hasType(qualType(hasCanonicalType(recordType() whisperity wrote: ```suggestion has(fieldDecl(hasType(qualType(hasCanonicalType(recordType(hasDeclaration(recordDecl(isUnion( ``` `recordType()` alone will likely also match other record/tag members such as structs or classes. https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,214 @@ +//===--- TaggedUnionMemberCountCheck.cpp - clang-tidy -===// +// +// 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 +// +//===--===// + +#include "TaggedUnionMemberCountCheck.h" +#include "../utils/OptionsUtils.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallSet.h" + +using namespace clang::ast_matchers; + +namespace clang::tidy::bugprone { + +const char StrictModeOptionName[] = "StrictMode"; +const char EnableCountingEnumHeuristicOptionName[] = +"EnableCountingEnumHeuristic"; +const char CountingEnumPrefixesOptionName[] = "CountingEnumPrefixes"; +const char CountingEnumSuffixesOptionName[] = "CountingEnumSuffixes"; + +TaggedUnionMemberCountCheck::TaggedUnionMemberCountCheck( +StringRef Name, ClangTidyContext *Context) +: ClangTidyCheck(Name, Context), + StrictMode(Options.get(StrictModeOptionName, false)), + EnableCountingEnumHeuristic( + Options.get(EnableCountingEnumHeuristicOptionName, true)), + RawCountingEnumPrefixes(Options.get(CountingEnumPrefixesOptionName, "")), + RawCountingEnumSuffixes( + Options.get(CountingEnumSuffixesOptionName, "count")), + ParsedCountingEnumPrefixes( + utils::options::parseStringList(RawCountingEnumPrefixes)), + ParsedCountingEnumSuffixes( + utils::options::parseStringList(RawCountingEnumSuffixes)), whisperity wrote: Technically what could happen here is that the `class` only stores the parsed list, and `storeOptions()` re-serialises the parsed input back into its raw comma(?)-separated form, there is a corresponding `utils::` function for this. (The entire `storeOptions()` thing is only needed, AFAIK, for checkers that would inherit yours, anyway. So it's not called often, but would save us having additional data members that do not 1:1 correspond to the configuration (or the intermittent temporary data) meaningfully.) https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,45 @@ +//===--- TaggedUnionMemberCountCheck.h - clang-tidy -*- 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 +// +//===--===// + +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TAGGEDUNIONMEMBERCOUNTCHECK_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TAGGEDUNIONMEMBERCOUNTCHECK_H + +#include "../ClangTidyCheck.h" + +namespace clang::tidy::bugprone { + +/// Gives warnings for tagged unions, where the number of tags is +/// different from the number of data members inside the union. +/// +/// For the user-facing documentation see: +/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/tagged-union-member-count.html +class TaggedUnionMemberCountCheck : public ClangTidyCheck { +public: + TaggedUnionMemberCountCheck(StringRef Name, ClangTidyContext *Context); + void storeOptions(ClangTidyOptions::OptionMap ) override; + void registerMatchers(ast_matchers::MatchFinder *Finder) override; + void check(const ast_matchers::MatchFinder::MatchResult ) override; + +private: + const bool StrictMode; + const bool EnableCountingEnumHeuristic; + const StringRef RawCountingEnumPrefixes; + const StringRef RawCountingEnumSuffixes; + std::vector ParsedCountingEnumPrefixes; + std::vector ParsedCountingEnumSuffixes; + const bool CountingEnumPrefixesSet; + const bool CountingEnumSuffixesSet; whisperity wrote: Why are these also needed? `StringRef` has an `empty()` method which could tell us whether it was set, in a condition. https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
})) +return true; + return false; +} + +size_t TaggedUnionMemberCountCheck::getNumberOfValidEnumValues( whisperity wrote: ```suggestion std::size_t TaggedUnionMemberCountCheck::getNumberOfValidEnumValues( ``` (`size_t` being defined is not guaranteed in a portable way.) https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: https://github.com/whisperity edited https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,45 @@ +//===--- TaggedUnionMemberCountCheck.h - clang-tidy -*- 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 +// +//===--===// + +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TAGGEDUNIONMEMBERCOUNTCHECK_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TAGGEDUNIONMEMBERCOUNTCHECK_H + +#include "../ClangTidyCheck.h" + +namespace clang::tidy::bugprone { + +/// Gives warnings for tagged unions, where the number of tags is +/// different from the number of data members inside the union. +/// +/// For the user-facing documentation see: +/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/tagged-union-member-count.html +class TaggedUnionMemberCountCheck : public ClangTidyCheck { +public: + TaggedUnionMemberCountCheck(StringRef Name, ClangTidyContext *Context); + void storeOptions(ClangTidyOptions::OptionMap ) override; + void registerMatchers(ast_matchers::MatchFinder *Finder) override; + void check(const ast_matchers::MatchFinder::MatchResult ) override; + +private: + const bool StrictMode; + const bool EnableCountingEnumHeuristic; + const StringRef RawCountingEnumPrefixes; + const StringRef RawCountingEnumSuffixes; + std::vector ParsedCountingEnumPrefixes; + std::vector ParsedCountingEnumSuffixes; whisperity wrote: (Just to verify, these **surely** won't dangle, right?) https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
})) +return true; + return false; +} + +size_t TaggedUnionMemberCountCheck::getNumberOfValidEnumValues( +const EnumDecl *Ed) noexcept { + bool FoundMax = false; + llvm::APSInt MaxTagValue; + llvm::SmallSet EnumValues; + + // Heuristic for counter enum constants. + // + // enum tag_with_counter { + // tag1, + // tag2, + // tag_count, <-- Searching for these enum constants + // }; + // + // The final tag count is decreased by 1 if and only if: + // 1. There is only one counting enum constant, + // 2. The counting enum constant is the last enum constant that is defined, + // 3. The value of the counting enum constant is the largest out of every enum + //constant. + // The 'ce' prefix is a shorthand for 'counting enum'. + size_t CeCount = 0; + bool CeIsLast = false; + llvm::APSInt CeValue = llvm::APSInt::get(0); + + for (const auto : Ed->enumerators()) { +const llvm::APSInt Val = Enumerator->getInitVal(); +EnumValues.insert(Val); +if (FoundMax) { + if (greaterBySign(Val, MaxTagValue) || + (signEquals(Val, MaxTagValue) && Val > MaxTagValue)) +MaxTagValue = Val; +} else { + MaxTagValue = Val; + FoundMax = true; +} + +if (EnableCountingEnumHeuristic) { + if (isCountingEnumLikeName(Enumerator->getName())) { +CeIsLast = true; +CeValue = Val; +CeCount += 1; +CountingEnumConstantDecl = Enumerator; + } else { +CeIsLast = false; + } +} + } + + size_t ValidValuesCount = EnumValues.size(); + if (CeCount == 1 && CeIsLast && CeValue == MaxTagValue) { +ValidValuesCount -= 1; + } else { +CountingEnumConstantDecl = nullptr; + } + + return ValidValuesCount; +} + +void TaggedUnionMemberCountCheck::check( +const MatchFinder::MatchResult ) { + const auto *Root = Result.Nodes.getNodeAs("root"); + const auto *UnionField = Result.Nodes.getNodeAs("union"); + const auto *TagField = Result.Nodes.getNodeAs("tags"); + whisperity wrote: ```suggestion const auto *Root = Result.Nodes.getNodeAs(RootNode); const auto *UnionField = Result.Nodes.getNodeAs(UnionNode); const auto *TagField = Result.Nodes.getNodeAs(EnumNode); assert(Root && UnionField && TagField); ``` https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
wiki/Sign_function) as a single value. Tangentially, perhaps you could add that in a separate patch with a few tests, a function that returns a 3-way enum `NEGATIVE, ZERO, POSITIVE`, and then this function simplifies to `A.getSign() == B.getSign()`, which is the most trivial expansion of the function's name. https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
nsitive(Suffix); + })) +return true; + return false; +} + +size_t TaggedUnionMemberCountCheck::getNumberOfValidEnumValues( +const EnumDecl *Ed) noexcept { + bool FoundMax = false; + llvm::APSInt MaxTagValue; + llvm::SmallSet EnumValues; ---- whisperity wrote: (Nit: Perhaps `32` elements is a rather large number for the general case, but this is just a theory.) https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,214 @@ +//===--- TaggedUnionMemberCountCheck.cpp - clang-tidy -===// +// +// 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 +// +//===--===// + +#include "TaggedUnionMemberCountCheck.h" +#include "../utils/OptionsUtils.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallSet.h" + +using namespace clang::ast_matchers; + +namespace clang::tidy::bugprone { + +const char StrictModeOptionName[] = "StrictMode"; +const char EnableCountingEnumHeuristicOptionName[] = +"EnableCountingEnumHeuristic"; +const char CountingEnumPrefixesOptionName[] = "CountingEnumPrefixes"; +const char CountingEnumSuffixesOptionName[] = "CountingEnumSuffixes"; + +TaggedUnionMemberCountCheck::TaggedUnionMemberCountCheck( +StringRef Name, ClangTidyContext *Context) +: ClangTidyCheck(Name, Context), + StrictMode(Options.get(StrictModeOptionName, false)), + EnableCountingEnumHeuristic( + Options.get(EnableCountingEnumHeuristicOptionName, true)), + RawCountingEnumPrefixes(Options.get(CountingEnumPrefixesOptionName, "")), + RawCountingEnumSuffixes( + Options.get(CountingEnumSuffixesOptionName, "count")), + ParsedCountingEnumPrefixes( + utils::options::parseStringList(RawCountingEnumPrefixes)), + ParsedCountingEnumSuffixes( + utils::options::parseStringList(RawCountingEnumSuffixes)), + CountingEnumPrefixesSet( + Options.get(CountingEnumPrefixesOptionName).has_value()), + CountingEnumSuffixesSet( + Options.get(CountingEnumSuffixesOptionName).has_value()), + CountingEnumConstantDecl(nullptr) { + if (!EnableCountingEnumHeuristic) { +if (CountingEnumPrefixesSet) + configurationDiag("%0: Counting enum heuristic is disabled but " +"CountingEnumPrefixes is set") + << Name; +if (CountingEnumSuffixesSet) + configurationDiag("%0: Counting enum heuristic is disabled but " +"CountingEnumSuffixes is set") + << Name; + } +} + +void TaggedUnionMemberCountCheck::storeOptions( +ClangTidyOptions::OptionMap ) { + Options.store(Opts, StrictModeOptionName, StrictMode); + Options.store(Opts, EnableCountingEnumHeuristicOptionName, +EnableCountingEnumHeuristic); + Options.store(Opts, CountingEnumPrefixesOptionName, RawCountingEnumPrefixes); + Options.store(Opts, CountingEnumSuffixesOptionName, RawCountingEnumSuffixes); +} + +void TaggedUnionMemberCountCheck::registerMatchers(MatchFinder *Finder) { + Finder->addMatcher( + recordDecl( + anyOf(isStruct(), isClass()), + has(fieldDecl(hasType(qualType(hasCanonicalType(recordType() + .bind("union")), whisperity wrote: (For the beauty of it, perhaps these literals could also become a `static constexpr llvm::StringLiteral` so they are consistently used in the `check()` function as well.) https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,45 @@ +//===--- TaggedUnionMemberCountCheck.h - clang-tidy -*- 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 +// +//===--===// + +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TAGGEDUNIONMEMBERCOUNTCHECK_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TAGGEDUNIONMEMBERCOUNTCHECK_H + +#include "../ClangTidyCheck.h" + +namespace clang::tidy::bugprone { + +/// Gives warnings for tagged unions, where the number of tags is +/// different from the number of data members inside the union. +/// +/// For the user-facing documentation see: +/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/tagged-union-member-count.html +class TaggedUnionMemberCountCheck : public ClangTidyCheck { +public: + TaggedUnionMemberCountCheck(StringRef Name, ClangTidyContext *Context); + void storeOptions(ClangTidyOptions::OptionMap ) override; + void registerMatchers(ast_matchers::MatchFinder *Finder) override; + void check(const ast_matchers::MatchFinder::MatchResult ) override; + +private: + const bool StrictMode; + const bool EnableCountingEnumHeuristic; + const StringRef RawCountingEnumPrefixes; + const StringRef RawCountingEnumSuffixes; + std::vector ParsedCountingEnumPrefixes; + std::vector ParsedCountingEnumSuffixes; + const bool CountingEnumPrefixesSet; + const bool CountingEnumSuffixesSet; + EnumConstantDecl *CountingEnumConstantDecl; + + size_t getNumberOfValidEnumValues(const EnumDecl *Ed) noexcept; whisperity wrote: ```suggestion size_t getNumberOfValidEnumValues(const EnumDecl *ED) noexcept; ``` (Nit.) https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,45 @@ +//===--- TaggedUnionMemberCountCheck.h - clang-tidy -*- 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 +// +//===--===// + +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TAGGEDUNIONMEMBERCOUNTCHECK_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_TAGGEDUNIONMEMBERCOUNTCHECK_H + +#include "../ClangTidyCheck.h" + +namespace clang::tidy::bugprone { + +/// Gives warnings for tagged unions, where the number of tags is +/// different from the number of data members inside the union. +/// +/// For the user-facing documentation see: +/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/tagged-union-member-count.html +class TaggedUnionMemberCountCheck : public ClangTidyCheck { +public: + TaggedUnionMemberCountCheck(StringRef Name, ClangTidyContext *Context); + void storeOptions(ClangTidyOptions::OptionMap ) override; + void registerMatchers(ast_matchers::MatchFinder *Finder) override; + void check(const ast_matchers::MatchFinder::MatchResult ) override; + +private: + const bool StrictMode; + const bool EnableCountingEnumHeuristic; + const StringRef RawCountingEnumPrefixes; + const StringRef RawCountingEnumSuffixes; + std::vector ParsedCountingEnumPrefixes; + std::vector ParsedCountingEnumSuffixes; + const bool CountingEnumPrefixesSet; + const bool CountingEnumSuffixesSet; + EnumConstantDecl *CountingEnumConstantDecl; whisperity wrote: Clang-Tidy checks usually consume the AST but do not modify it, so pointing to a non-`const` node here is definitely suspicious. ```suggestion const EnumConstantDecl *CountingEnumConstantDecl; ``` https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,214 @@ +//===--- TaggedUnionMemberCountCheck.cpp - clang-tidy -===// +// +// 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 +// +//===--===// + +#include "TaggedUnionMemberCountCheck.h" +#include "../utils/OptionsUtils.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallSet.h" + +using namespace clang::ast_matchers; + +namespace clang::tidy::bugprone { + +const char StrictModeOptionName[] = "StrictMode"; whisperity wrote: ```suggestion static constexpr llvm::StringLiteral StrictModeOptionName = "StrictMode"; ``` (Nit. And for the others, as well, if this version does not cause problems.) https://github.com/llvm/llvm-project/pull/89925 _______ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: @@ -0,0 +1,241 @@ +.. title:: clang-tidy - bugprone-tagged-union-member-count + +== whisperity wrote: (AFAIK this line is not needed and not used in other documentation files.) ```suggestion ``` https://github.com/llvm/llvm-project/pull/89925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= Message-ID: In-Reply-To: https://github.com/whisperity requested changes to this pull request. I found a very convoluted and somewhat silly edge case where I was able to defeat the matchers to make them produce a match in a position where it is clearly not intended. So the matchers will need to be given some thought, my idea is to have them constricted in a way to report only into non-implicit code, but perhaps this needs some more elaboration. Lambdas implicitly compile down to an unnamed `CXXRecordDecl`, and if you have captures in a lambda, they become (unnamed) fields of this class. https://godbolt.org/z/rvfY5K18T ```cpp enum E { A }; union U { int A; }; int main() { enum E e; union U u; auto L = [e, u] () {}; } ``` ``` Match #1: :9:14: note: "root" binds here 9 | auto L = [e, u] () {}; | ^ :9:15: note: "tags" binds here 9 | auto L = [e, u] () {}; | ^ :9:18: note: "union" binds here 9 | auto L = [e, u] () {}; | ^ ``` https://github.com/llvm/llvm-project/pull/89925 _______ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [libclang/python] Fix `get_exception_specification_kind` (PR #101548)
Endilll wrote: > Could you merge this for me? Done. > On related note, do you think my contributions would count for "a track > record of submitting high quality patches", i.e. should I apply for commit > access? You have unread messages in Discord :) https://github.com/llvm/llvm-project/pull/101548 _______ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [libclang/python] Fix `get_exception_specification_kind` (PR #101548)
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/101548 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] e7ee21f - [libclang/python] Fix `get_exception_specification_kind` (#101548)
Author: Jannick Kremer Date: 2024-08-02T17:25:30+04:00 New Revision: e7ee21fbc96664cf7736194c0ed922753e338989 URL: https://github.com/llvm/llvm-project/commit/e7ee21fbc96664cf7736194c0ed922753e338989 DIFF: https://github.com/llvm/llvm-project/commit/e7ee21fbc96664cf7736194c0ed922753e338989.diff LOG: [libclang/python] Fix `get_exception_specification_kind` (#101548) Fix a bug with `get_exception_specification_kind`. The function did not work before. Also add a test that confirms that it works now. Added: Modified: clang/bindings/python/clang/cindex.py clang/bindings/python/tests/cindex/test_exception_specification_kind.py clang/docs/ReleaseNotes.rst Removed: diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py index 2038ef6045c7d..c251c46a04adf 100644 --- a/clang/bindings/python/clang/cindex.py +++ b/clang/bindings/python/clang/cindex.py @@ -2654,7 +2654,7 @@ def get_exception_specification_kind(self): the ExceptionSpecificationKind enumeration. """ return ExceptionSpecificationKind.from_id( -conf.lib.clang.getExceptionSpecificationType(self) +conf.lib.clang_getExceptionSpecificationType(self) ) @property diff --git a/clang/bindings/python/tests/cindex/test_exception_specification_kind.py b/clang/bindings/python/tests/cindex/test_exception_specification_kind.py index 8e2a6b5c50223..e4742db31adbe 100644 --- a/clang/bindings/python/tests/cindex/test_exception_specification_kind.py +++ b/clang/bindings/python/tests/cindex/test_exception_specification_kind.py @@ -13,7 +13,7 @@ def find_function_declarations(node, declarations=[]): if node.kind == clang.cindex.CursorKind.FUNCTION_DECL: -declarations.append((node.spelling, node.exception_specification_kind)) +declarations.append(node) for child in node.get_children(): declarations = find_function_declarations(child, declarations) return declarations @@ -33,4 +33,12 @@ def test_exception_specification_kind(self): ("square2", ExceptionSpecificationKind.BASIC_NOEXCEPT), ("square3", ExceptionSpecificationKind.COMPUTED_NOEXCEPT), ] -self.assertListEqual(declarations, expected) +from_cursor = [ +(node.spelling, node.exception_specification_kind) for node in declarations +] +from_type = [ +(node.spelling, node.type.get_exception_specification_kind()) +for node in declarations +] +self.assertListEqual(from_cursor, expected) +self.assertListEqual(from_type, expected) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index efa01bfc92cf6..25f5bd37bbe94 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -302,6 +302,7 @@ Sanitizers Python Binding Changes -- +- Fixed an issue that led to crashes when calling ``Type.get_exception_specification_kind``. OpenMP Support -- _______ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm-branch-commits] [clang] [llvm] release/19.x: [clang] Fix definition of layout-compatible to ignore empty classes (PR #101491)
Endilll wrote: This should only affect `__builtin_is_layout_compatible` introduced in Clang 19, so we don't have an ABI we need to be compatible with. https://github.com/llvm/llvm-project/pull/101491 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[tianocore/edk2] b865c7: pip: bump edk2-basetools from 0.1.51 to 0.1.52
Branch: refs/heads/dependabot/pip/edk2-basetools-0.1.52 Home: https://github.com/tianocore/edk2 Commit: b865c723edad8233d533204ab8a3780169d78e2f https://github.com/tianocore/edk2/commit/b865c723edad8233d533204ab8a3780169d78e2f Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: 2024-08-02 (Fri, 02 Aug 2024) Changed paths: M pip-requirements.txt Log Message: --- pip: bump edk2-basetools from 0.1.51 to 0.1.52 Bumps [edk2-basetools](https://github.com/tianocore/edk2-basetools) from 0.1.51 to 0.1.52. - [Commits](https://github.com/tianocore/edk2-basetools/compare/v0.1.51...v0.1.52) --- updated-dependencies: - dependency-name: edk2-basetools dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] To unsubscribe from these emails, change your notification settings at https://github.com/tianocore/edk2/settings/notifications ___ edk2-commits mailing list edk2-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-commits
[tianocore/edk2] a2eb7b: pip: bump edk2-pytool-extensions from 0.27.6 to 0....
Branch: refs/heads/dependabot/pip/edk2-pytool-extensions-0.27.10 Home: https://github.com/tianocore/edk2 Commit: a2eb7b4969b5f3424c3b1e849632d356ad0b6156 https://github.com/tianocore/edk2/commit/a2eb7b4969b5f3424c3b1e849632d356ad0b6156 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: 2024-08-02 (Fri, 02 Aug 2024) Changed paths: M pip-requirements.txt Log Message: --- pip: bump edk2-pytool-extensions from 0.27.6 to 0.27.10 Bumps [edk2-pytool-extensions](https://github.com/tianocore/edk2-pytool-extensions) from 0.27.6 to 0.27.10. - [Release notes](https://github.com/tianocore/edk2-pytool-extensions/releases) - [Commits](https://github.com/tianocore/edk2-pytool-extensions/compare/v0.27.6...v0.27.10) --- updated-dependencies: - dependency-name: edk2-pytool-extensions dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] To unsubscribe from these emails, change your notification settings at https://github.com/tianocore/edk2/settings/notifications ___ edk2-commits mailing list edk2-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-commits
[tianocore/edk2] b08d89: pip: bump regex from 2024.5.15 to 2024.7.24
Branch: refs/heads/dependabot/pip/regex-2024.7.24 Home: https://github.com/tianocore/edk2 Commit: b08d89344bd99c86b7d869bab270757980d233ff https://github.com/tianocore/edk2/commit/b08d89344bd99c86b7d869bab270757980d233ff Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: 2024-08-02 (Fri, 02 Aug 2024) Changed paths: M pip-requirements.txt Log Message: --- pip: bump regex from 2024.5.15 to 2024.7.24 Bumps [regex](https://github.com/mrabarnett/mrab-regex) from 2024.5.15 to 2024.7.24. - [Changelog](https://github.com/mrabarnett/mrab-regex/blob/hg/changelog.txt) - [Commits](https://github.com/mrabarnett/mrab-regex/compare/2024.5.15...2024.7.24) --- updated-dependencies: - dependency-name: regex dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] To unsubscribe from these emails, change your notification settings at https://github.com/tianocore/edk2/settings/notifications ___ edk2-commits mailing list edk2-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-commits
[tianocore/edk2] dd98ba: pip: bump edk2-pytool-library from 0.21.8 to 0.21.9
Branch: refs/heads/dependabot/pip/edk2-pytool-library-0.21.9 Home: https://github.com/tianocore/edk2 Commit: dd98baf082d104d972f0e7904ad7b83da63ff111 https://github.com/tianocore/edk2/commit/dd98baf082d104d972f0e7904ad7b83da63ff111 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: 2024-08-02 (Fri, 02 Aug 2024) Changed paths: M pip-requirements.txt Log Message: --- pip: bump edk2-pytool-library from 0.21.8 to 0.21.9 Bumps [edk2-pytool-library](https://github.com/tianocore/edk2-pytool-library) from 0.21.8 to 0.21.9. - [Release notes](https://github.com/tianocore/edk2-pytool-library/releases) - [Commits](https://github.com/tianocore/edk2-pytool-library/compare/v0.21.8...v0.21.9) --- updated-dependencies: - dependency-name: edk2-pytool-library dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] To unsubscribe from these emails, change your notification settings at https://github.com/tianocore/edk2/settings/notifications ___ edk2-commits mailing list edk2-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-commits
[Lldb-commits] [lldb] [lldb][ClangExpressionParser][NFC] Factor LangOptions logic out of ClangExpressionParser constructor (PR #101669)
e { +// If we get here we don't have a valid target and just have to guess. +// Sometimes this will be ok to just use the host target triple (when we +// evaluate say "2+3", but other expressions like breakpoint conditions and +// other things that _are_ target specific really shouldn't just be using +// the host triple. In such a case the language runtime should expose an +// overridden options set (3), below. +m_compiler->getTargetOpts().Triple = llvm::sys::getDefaultTargetTriple(); +LLDB_LOGF(log, "Using default target triple of %s", + m_compiler->getTargetOpts().Triple.c_str()); + } + // Now add some special fixes for known architectures: Any arm32 iOS + // environment, but not on arm64 + if (m_compiler->getTargetOpts().Triple.find("arm64") == std::string::npos && + m_compiler->getTargetOpts().Triple.find("arm") != std::string::npos && + m_compiler->getTargetOpts().Triple.find("ios") != std::string::npos) { +m_compiler->getTargetOpts().ABI = "apcs-gnu"; + } + // Supported subsets of x86 + if (target_machine == llvm::Triple::x86 || + target_machine == llvm::Triple::x86_64) { +m_compiler->getTargetOpts().FeaturesAsWritten.push_back("+sse"); +m_compiler->getTargetOpts().FeaturesAsWritten.push_back("+sse2"); + } + + // Set the target CPU to generate code for. This will be empty for any CPU + // that doesn't really need to make a special + // CPU string. + m_compiler->getTargetOpts().CPU = target_arch.GetClangTargetCPU(); + + // Set the target ABI + abi = GetClangTargetABI(target_arch); + if (!abi.empty()) +m_compiler->getTargetOpts().ABI = abi; + + // 3. Create and install the target on the compiler. + m_compiler->createDiagnostics(); + // Limit the number of error diagnostics we emit. + // A value of 0 means no limit for both LLDB and Clang. + m_compiler->getDiagnostics().setErrorLimit(target_sp->GetExprErrorLimit()); + + auto target_info = TargetInfo::CreateTargetInfo( + m_compiler->getDiagnostics(), m_compiler->getInvocation().TargetOpts); + if (log) { +LLDB_LOGF(log, "Target datalayout string: '%s'", + target_info->getDataLayoutString()); +LLDB_LOGF(log, "Target ABI: '%s'", target_info->getABI().str().c_str()); +LLDB_LOGF(log, "Target vector alignment: %d", + target_info->getMaxVectorAlign()); + } + m_compiler->setTarget(target_info); + + assert(m_compiler->hasTarget()); + + // 4. Set language options. + SetupLangOpts(*m_compiler, *exe_scope, expr); + if (isa(_expr)) { +LLDB_LOG(log, "Adding lang options for importing C++ modules"); +SetupImportStdModuleLangOpts(*m_compiler); +SetupModuleHeaderPaths(m_compiler.get(), m_include_directories, target_sp); + } // Set CodeGen options m_compiler->getCodeGenOpts().EmitDeclMetadata = true; @@ -648,7 +657,7 @@ ClangExpressionParser::ClangExpressionParser( m_compiler->createSourceManager(m_compiler->getFileManager()); m_compiler->createPreprocessor(TU_Complete); - switch (language) { + switch (expr.Language().AsLanguageType()) { case lldb::eLanguageTypeC: case lldb::eLanguageTypeC89: case lldb::eLanguageTypeC99: `` https://github.com/llvm/llvm-project/pull/101669 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][ClangExpressionParser][NFC] Factor LangOptions logic out of ClangExpressionParser constructor (PR #101669)
te for most situations. + if (target_arch.IsValid()) { +std::string triple = target_arch.GetTriple().str(); +m_compiler->getTargetOpts().Triple = triple; +LLDB_LOGF(log, "Using %s as the target triple", + m_compiler->getTargetOpts().Triple.c_str()); + } else { +// If we get here we don't have a valid target and just have to guess. +// Sometimes this will be ok to just use the host target triple (when we +// evaluate say "2+3", but other expressions like breakpoint conditions and +// other things that _are_ target specific really shouldn't just be using +// the host triple. In such a case the language runtime should expose an +// overridden options set (3), below. +m_compiler->getTargetOpts().Triple = llvm::sys::getDefaultTargetTriple(); +LLDB_LOGF(log, "Using default target triple of %s", + m_compiler->getTargetOpts().Triple.c_str()); + } + // Now add some special fixes for known architectures: Any arm32 iOS + // environment, but not on arm64 + if (m_compiler->getTargetOpts().Triple.find("arm64") == std::string::npos && + m_compiler->getTargetOpts().Triple.find("arm") != std::string::npos && + m_compiler->getTargetOpts().Triple.find("ios") != std::string::npos) { +m_compiler->getTargetOpts().ABI = "apcs-gnu"; + } + // Supported subsets of x86 + if (target_machine == llvm::Triple::x86 || + target_machine == llvm::Triple::x86_64) { +m_compiler->getTargetOpts().FeaturesAsWritten.push_back("+sse"); +m_compiler->getTargetOpts().FeaturesAsWritten.push_back("+sse2"); + } + + // Set the target CPU to generate code for. This will be empty for any CPU + // that doesn't really need to make a special + // CPU string. + m_compiler->getTargetOpts().CPU = target_arch.GetClangTargetCPU(); + + // Set the target ABI + abi = GetClangTargetABI(target_arch); + if (!abi.empty()) +m_compiler->getTargetOpts().ABI = abi; + + // 3. Create and install the target on the compiler. + m_compiler->createDiagnostics(); + // Limit the number of error diagnostics we emit. + // A value of 0 means no limit for both LLDB and Clang. + m_compiler->getDiagnostics().setErrorLimit(target_sp->GetExprErrorLimit()); + + auto target_info = TargetInfo::CreateTargetInfo( + m_compiler->getDiagnostics(), m_compiler->getInvocation().TargetOpts); + if (log) { +LLDB_LOGF(log, "Target datalayout string: '%s'", + target_info->getDataLayoutString()); +LLDB_LOGF(log, "Target ABI: '%s'", target_info->getABI().str().c_str()); +LLDB_LOGF(log, "Target vector alignment: %d", + target_info->getMaxVectorAlign()); + } + m_compiler->setTarget(target_info); + + assert(m_compiler->hasTarget()); + + // 4. Set language options. + SetupLangOpts(*m_compiler, *exe_scope, expr); + if (isa(_expr)) { +LLDB_LOG(log, "Adding lang options for importing C++ modules"); +SetupImportStdModuleLangOpts(*m_compiler); +SetupModuleHeaderPaths(m_compiler.get(), m_include_directories, target_sp); + } // Set CodeGen options m_compiler->getCodeGenOpts().EmitDeclMetadata = true; @@ -648,7 +657,7 @@ ClangExpressionParser::ClangExpressionParser( m_compiler->createSourceManager(m_compiler->getFileManager()); m_compiler->createPreprocessor(TU_Complete); - switch (language) { + switch (expr.Language().AsLanguageType()) { case lldb::eLanguageTypeC: case lldb::eLanguageTypeC89: case lldb::eLanguageTypeC99: ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[jenkinsci/jenkins-multijob-plugin]
Branch: refs/heads/dependabot/maven/org.jenkins-ci.plugins-matrix-project-822.824.v14451b_c0fd42 Home: https://github.com/jenkinsci/jenkins-multijob-plugin To unsubscribe from these emails, change your notification settings at https://github.com/jenkinsci/jenkins-multijob-plugin/settings/notifications -- You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/jenkins-multijob-plugin/push/refs/heads/dependabot/maven/org.jenkins-ci.plugins-matrix-project-822.824.v14451b_c0fd42/cfce93-00%40github.com.
[jenkinsci/jenkins-multijob-plugin] 2e838c: Bump org.jenkins-ci.plugins:matrix-project from 78...
Branch: refs/heads/master Home: https://github.com/jenkinsci/jenkins-multijob-plugin Commit: 2e838c915a50529dd0940e12e8961e0f1087130b https://github.com/jenkinsci/jenkins-multijob-plugin/commit/2e838c915a50529dd0940e12e8961e0f1087130b Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: 2024-08-02 (Fri, 02 Aug 2024) Changed paths: M pom.xml Log Message: --- Bump org.jenkins-ci.plugins:matrix-project from 785.v06b_7f47b_c631 to 822.824.v14451b_c0fd42 (#356) * Bump org.jenkins-ci.plugins:matrix-project Bumps [org.jenkins-ci.plugins:matrix-project](https://github.com/jenkinsci/matrix-project-plugin) from 785.v06b_7f47b_c631 to 822.824.v14451b_c0fd42. - [Release notes](https://github.com/jenkinsci/matrix-project-plugin/releases) - [Changelog](https://github.com/jenkinsci/matrix-project-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/matrix-project-plugin/commits) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:matrix-project dependency-type: direct:production ... Signed-off-by: dependabot[bot] * Bumped jenkins version from 2.393 to 2.401.3 - Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Victor Balakine To unsubscribe from these emails, change your notification settings at https://github.com/jenkinsci/jenkins-multijob-plugin/settings/notifications -- You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/jenkins-multijob-plugin/push/refs/heads/master/cd30ec-2e838c%40github.com.
[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)
@@ -448,6 +448,20 @@ struct PointerDiffInfo { NeedsFreeze(NeedsFreeze) {} }; +/// A pair of pointers that could overlap across a loop iteration. SamTebbs33 wrote: That sounds good to me. I originally put it here so it was next to the related `PointerDiffInfo` https://github.com/llvm/llvm-project/pull/100579 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[Lldb-commits] [lldb] [lldb/Commands] Add `scripting template list` command with auto discovery (PR #97273)
DavidSpickett wrote: What did you intend with `/H`? If anything it would be https://learn.microsoft.com/en-us/cpp/build/reference/h-restrict-length-of-external-names?view=msvc-170 but clang-cl doesn't support this one. (yes, the bot uses clang-cl, we really should change the name) https://github.com/llvm/llvm-project/pull/97273 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[clang] [llvm] [NVPTX] Support __usAtomicCAS builtin (PR #99646)
? 16 : 32); + setMinCmpXchgSizeInBits(STI.hasAtomCas16() ? 16 : 32); setMaxAtomicSizeInBitsSupported(64); setMaxDivRemBitWidthSupported(64); } diff --git a/llvm/lib/Target/NVPTX/NVPTXSubtarget.h b/llvm/lib/Target/NVPTX/NVPTXSubtarget.h index 8df41913ff12e..1c7551ff5f78c 100644 --- a/llvm/lib/Target/NVPTX/NVPTXSubtarget.h +++ b/llvm/lib/Target/NVPTX/NVPTXSubtarget.h @@ -77,6 +77,7 @@ class NVPTXSubtarget : public NVPTXGenSubtargetInfo { bool hasAtomScope() const { return SmVersion >= 60; } bool hasAtomBitwise64() const { return SmVersion >= 32; } bool hasAtomMinMax64() const { return SmVersion >= 32; } + bool hasAtomCas16() const { return SmVersion >= 70 && PTXVersion >= 63; } bool hasLDG() const { return SmVersion >= 32; } bool hasHWROT32() const { return SmVersion >= 32; } bool hasImageHandles() const; >From 9a0c6260ea6186f12a22fc642cf1201ed683d71e Mon Sep 17 00:00:00 2001 From: Denis Gerasimov Date: Fri, 19 Jul 2024 23:36:51 +0300 Subject: [PATCH 5/6] Fixed builtin test --- clang/test/CodeGen/builtins-nvptx.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/clang/test/CodeGen/builtins-nvptx.c b/clang/test/CodeGen/builtins-nvptx.c index 3ba1fabd05335..dee68157b2b09 100644 --- a/clang/test/CodeGen/builtins-nvptx.c +++ b/clang/test/CodeGen/builtins-nvptx.c @@ -1,4 +1,7 @@ // REQUIRES: nvptx-registered-target +// RUN: %clang_cc1 -ffp-contract=off -triple nvptx64-unknown-unknown -target-cpu sm_70 -target-feature +ptx63 \ +// RUN:-fcuda-is-device -emit-llvm -o - -x cuda %s \ +// RUN: | FileCheck -check-prefix=CHECK -check-prefix=CHECK_PTX63_SM70 -check-prefix=LP64 %s // RUN: %clang_cc1 -ffp-contract=off -triple nvptx-unknown-unknown -target-cpu sm_80 -target-feature +ptx70 \ // RUN:-fcuda-is-device -emit-llvm -o - -x cuda %s \ // RUN: | FileCheck -check-prefix=CHECK -check-prefix=CHECK_PTX70_SM80 -check-prefix=LP32 %s @@ -235,7 +238,8 @@ __shared__ long long sll; // Check for atomic intrinsics // CHECK-LABEL: nvvm_atom -__device__ void nvvm_atom(float *fp, float f, double *dfp, double df, int *ip, +__device__ void nvvm_atom(float *fp, float f, double *dfp, double df, + unsigned short *usp, unsigned short us, int *ip, int i, unsigned int *uip, unsigned ui, long *lp, long l, long long *llp, long long ll) { // CHECK: atomicrmw add ptr {{.*}} seq_cst, align 4 @@ -306,9 +310,6 @@ __device__ void nvvm_atom(float *fp, float f, double *dfp, double df, int *ip, // CHECK: atomicrmw umin ptr {{.*}} seq_cst, align 8 __nvvm_atom_min_gen_ull((unsigned long long *), ll); - // CHECK: cmpxchg ptr {{.*}} seq_cst seq_cst, align 2 - // CHECK-NEXT: extractvalue { i16, i1 } {{%[0-9]+}}, 0 - __nvvm_atom_cas_gen_us(ip, 0, i); // CHECK: cmpxchg ptr {{.*}} seq_cst seq_cst, align 4 // CHECK-NEXT: extractvalue { i32, i1 } {{%[0-9]+}}, 0 __nvvm_atom_cas_gen_i(ip, 0, i); @@ -577,6 +578,12 @@ __device__ void nvvm_atom(float *fp, float f, double *dfp, double df, int *ip, __nvvm_atom_sys_cas_gen_ll(, ll, 0); #endif +#if __CUDA_ARCH__ >= 700 + // CHECK_PTX63_SM70: cmpxchg ptr {{.*}} seq_cst seq_cst, align 2 + // CHECK_PTX63_SM70-NEXT: extractvalue { i16, i1 } {{%[0-9]+}}, 0 + __nvvm_atom_cas_gen_us(usp, 0, us); +#endif + // CHECK: ret } >From aa8c9d3421fde140f8d4bf96ae233a6deadce78e Mon Sep 17 00:00:00 2001 From: "Denis.Gerasimov" Date: Fri, 2 Aug 2024 13:02:00 +0300 Subject: [PATCH 6/6] cta and sys intrinsics test --- clang/test/CodeGen/builtins-nvptx.c | 4 1 file changed, 4 insertions(+) diff --git a/clang/test/CodeGen/builtins-nvptx.c b/clang/test/CodeGen/builtins-nvptx.c index dee68157b2b09..4673c0c7eee01 100644 --- a/clang/test/CodeGen/builtins-nvptx.c +++ b/clang/test/CodeGen/builtins-nvptx.c @@ -582,6 +582,10 @@ __device__ void nvvm_atom(float *fp, float f, double *dfp, double df, // CHECK_PTX63_SM70: cmpxchg ptr {{.*}} seq_cst seq_cst, align 2 // CHECK_PTX63_SM70-NEXT: extractvalue { i16, i1 } {{%[0-9]+}}, 0 __nvvm_atom_cas_gen_us(usp, 0, us); + // CHECK_PTX63_SM70: call i16 @llvm.nvvm.atomic.cas.gen.i.cta.i16.p0 + __nvvm_atom_cta_cas_gen_us(usp, 0, us); + // CHECK_PTX63_SM70: call i16 @llvm.nvvm.atomic.cas.gen.i.sys.i16.p0 + __nvvm_atom_sys_cas_gen_us(usp, 0, us); #endif // CHECK: ret ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm-branch-commits] [clang] release/19.x: Ofast deprecation clarifications (#101005) (PR #101663)
github-actions[bot] wrote: @AaronBallman (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/101663 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/19.x: Ofast deprecation clarifications (#101005) (PR #101663)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/101663 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[jenkinsci/jenkins-multijob-plugin] cfce93: Bumped jenkins version from 2.393 to 2.401.3
Branch: refs/heads/dependabot/maven/org.jenkins-ci.plugins-matrix-project-822.824.v14451b_c0fd42 Home: https://github.com/jenkinsci/jenkins-multijob-plugin Commit: cfce93c1636522f9137391cb59196ec5f1f146a3 https://github.com/jenkinsci/jenkins-multijob-plugin/commit/cfce93c1636522f9137391cb59196ec5f1f146a3 Author: Victor Balakine Date: 2024-08-02 (Fri, 02 Aug 2024) Changed paths: M pom.xml Log Message: --- Bumped jenkins version from 2.393 to 2.401.3 To unsubscribe from these emails, change your notification settings at https://github.com/jenkinsci/jenkins-multijob-plugin/settings/notifications -- You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/jenkins-multijob-plugin/push/refs/heads/dependabot/maven/org.jenkins-ci.plugins-matrix-project-822.824.v14451b_c0fd42/ebc217-cfce93%40github.com.
[llvm-branch-commits] [clang] release/19.x: Ofast deprecation clarifications (#101005) (PR #101663)
https://github.com/AaronBallman approved this pull request. LGTM! There's no chance these changes are what is breaking the ABI precommit CI tests. ;-) https://github.com/llvm/llvm-project/pull/101663 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [llvm] release/19.x: [clang] Fix definition of layout-compatible to ignore empty classes (PR #101491)
https://github.com/AaronBallman approved this pull request. LGTM! The ABI precommit CI test failures look to be unrelated to these changes, but at the same time, this could potentially impact ABI (any time we change the behavior of a type trait, it can potentially impact ABI). So it may be good to get a second set of eyes on those failures just to be sure they're not caused by this PR. https://github.com/llvm/llvm-project/pull/101491 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[clang] [Clang] prevent assertion failure by avoiding required literal type checking in C context (PR #101426)
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/101426 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] b21df4b - [Clang] prevent assertion failure by avoiding required literal type checking in C context (#101426)
Author: Oleksandr T. Date: 2024-08-02T08:42:04-04:00 New Revision: b21df4b1cf718e48259133054caa2ce5966358e9 URL: https://github.com/llvm/llvm-project/commit/b21df4b1cf718e48259133054caa2ce5966358e9 DIFF: https://github.com/llvm/llvm-project/commit/b21df4b1cf718e48259133054caa2ce5966358e9.diff LOG: [Clang] prevent assertion failure by avoiding required literal type checking in C context (#101426) Fixes #101304 Added: Modified: clang/docs/ReleaseNotes.rst clang/lib/Sema/SemaDecl.cpp clang/test/Sema/constexpr.c Removed: diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 866adefd5d3c4..efa01bfc92cf6 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -156,6 +156,7 @@ Bug Fixes in This Version - Fixed the definition of ``ATOMIC_FLAG_INIT`` in so it can be used in C++. +- Fixed a failed assertion when checking required literal types in C context. (#GH101304). Bug Fixes to Compiler Builtins ^^ diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index a3f8126a9f915..4fea38d1b02a9 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -8756,7 +8756,8 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) { return; } - if (NewVD->isConstexpr() && !T->isDependentType() && + if (getLangOpts().CPlusPlus && NewVD->isConstexpr() && + !T->isDependentType() && RequireLiteralType(NewVD->getLocation(), T, diag::err_constexpr_var_non_literal)) { NewVD->setInvalidDecl(); diff --git a/clang/test/Sema/constexpr.c b/clang/test/Sema/constexpr.c index 8286cd2107d2f..5ea2ac24a503a 100644 --- a/clang/test/Sema/constexpr.c +++ b/clang/test/Sema/constexpr.c @@ -357,3 +357,6 @@ void infsNaNs() { constexpr double db5 = LD_SNAN; // expected-error {{constexpr initializer evaluates to nan which is not exactly representable in type 'const double'}} constexpr double db6 = INF; } + +constexpr struct S9 s9 = { }; // expected-error {{variable has incomplete type 'const struct S9'}} \ + // expected-note {{forward declaration of 'struct S9'}} _______ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [Clang] prevent assertion failure by avoiding required literal type checking in C context (PR #101426)
https://github.com/AaronBallman approved this pull request. LGTM! This seems like a pretty reasonable candidate to backport to 19.x as well: https://www.llvm.org/docs/GitHub.html#backporting-fixes-to-the-release-branches https://github.com/llvm/llvm-project/pull/101426 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [PPC] Implement BCD assist builtins (PR #101390)
@@ -0,0 +1,58 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// REQUIRES: powerpc-registered-target +// RUN: %clang_cc1 -triple powerpc64le-unknown-linux -O2 -target-cpu pwr7 \ +// RUN: -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple powerpc64-unknown-aix -O2 -target-cpu pwr7 \ +// RUN: -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple powerpc-unknown-aix -O2 -target-cpu pwr7 \ +// RUN: -emit-llvm %s -o - | FileCheck %s + +// CHECK-LABEL: define{{.*}} i64 @cdtbcd_test(i64 +// CHECK: [[CONV:%.*]] = trunc i64 {{.*}} to i32 +// CHECK-NEXT:[[TMP0:%.*]] = tail call i32 @llvm.ppc.cdtbcd(i32 [[CONV]]) +// CHECK-NEXT:[[CONV1:%.*]] = zext i32 [[TMP0]] to i64 +// CHECK-NEXT:ret i64 [[CONV1]] +long long cdtbcd_test(long long ll) { +return __builtin_cdtbcd (ll); chenzheng1030 wrote: Hmm, for compatibility with GCC, maybe this is right. But this is not good as in clang we are also providing `__cdtbcd()` for 64 bit inputs. Using GCC's 32-bit version will cause sacrifice of accuracy. I am not sure, for this case, should we add at least a warning and remind the user the other one can be used? https://github.com/llvm/llvm-project/pull/101390 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm-branch-commits] [clang] release/19.x: Ofast deprecation clarifications (#101005) (PR #101663)
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (llvmbot) Changes Backport 48d4d4b641702bf6db03a1bac73b7e13dea28349 Requested by: @AaronBallman --- Full diff: https://github.com/llvm/llvm-project/pull/101663.diff 1 Files Affected: - (modified) clang/docs/CommandGuide/clang.rst (+6-2) ``diff diff --git a/clang/docs/CommandGuide/clang.rst b/clang/docs/CommandGuide/clang.rst index 663aca1f6ddcb..a0c2594d06c61 100644 --- a/clang/docs/CommandGuide/clang.rst +++ b/clang/docs/CommandGuide/clang.rst @@ -429,8 +429,12 @@ Code Generation Options :option:`-Ofast` Enables all the optimizations from :option:`-O3` along with other aggressive optimizations that may violate strict compliance with -language standards. This is deprecated in favor of :option:`-O3` -in combination with :option:`-ffast-math`. +language standards. This is deprecated in Clang 19 and a warning is emitted +that :option:`-O3` in combination with :option:`-ffast-math` should be used +instead if the request for non-standard math behavior is intended. There +is no timeline yet for removal; the aim is to discourage use of +:option:`-Ofast` due to the surprising behavior of an optimization flag +changing the observable behavior of correct code. :option:`-Os` Like :option:`-O2` with extra optimizations to reduce code size. `` https://github.com/llvm/llvm-project/pull/101663 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[clang] Ofast deprecation clarifications (PR #101005)
llvmbot wrote: /pull-request llvm/llvm-project#101663 https://github.com/llvm/llvm-project/pull/101005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm-branch-commits] [clang] release/19.x: Ofast deprecation clarifications (#101005) (PR #101663)
llvmbot wrote: @AaronBallman What do you think about merging this PR to the release branch? https://github.com/llvm/llvm-project/pull/101663 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/19.x: Ofast deprecation clarifications (#101005) (PR #101663)
https://github.com/llvmbot milestoned https://github.com/llvm/llvm-project/pull/101663 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[clang] Ofast deprecation clarifications (PR #101005)
AaronBallman wrote: > We could add similar clarifications to the release notes, which were > initially included in an earlier version of this patch. So same question how > we would need to approach that. In terms of updating the release notes, once the cherry-pick happens, there's an automated bot message asking if you want to add a release note for the changes. I think the best way forward would be to follow those instructions and ask the release managers to help apply the changes. https://github.com/llvm/llvm-project/pull/101005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm-branch-commits] [llvm] [PowerPC] Add phony subregisters to cover the high half of the VSX registers. (#94628) (PR #101498)
tru wrote: @chenzheng1030 Since this is powerpc related - is this is a good candidate to backport? https://github.com/llvm/llvm-project/pull/101498 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[clang] Ofast deprecation clarifications (PR #101005)
https://github.com/AaronBallman milestoned https://github.com/llvm/llvm-project/pull/101005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Ofast deprecation clarifications (PR #101005)
AaronBallman wrote: We have instructions at https://www.llvm.org/docs/GitHub.html#backporting-fixes-to-the-release-branches but the basic gist of it is to add a special comment and add the PR to the correct milestone. As in: /cherry-pick 48d4d4b641702bf6db03a1bac73b7e13dea28349 https://github.com/llvm/llvm-project/pull/101005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm-branch-commits] [clang] [llvm] release/19.x: [clang] Fix definition of layout-compatible to ignore empty classes (PR #101491)
Struct, D, CStruct>)); + static_assert(__is_layout_compatible(CStruct, D, D, CStruct>, D>>)); + static_assert(__is_layout_compatible(CStruct, D)); + static_assert(__is_layout_compatible(CStruct, D, CStructWithQualifiers>)); + static_assert(__is_layout_compatible(CStructWithQualifiers, D, D, CStruct>, D>>)); } namespace IPIBO { diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index e34068592de81..8f988d01cb2a6 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -2027,6 +2027,12 @@ template bool equal(L &, R &) { adl_end(RRange)); } +template +bool equal(L &, R &, BinaryPredicate P) { + return std::equal(adl_begin(LRange), adl_end(LRange), adl_begin(RRange), +adl_end(RRange), P); +} + /// Returns true if all elements in Range are equal or when the Range is empty. template bool all_equal(R &) { auto Begin = adl_begin(Range); ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] release/19.x: [VP] Refactor VectorBuilder to avoid layering violation. NFC (#99276) (PR #101102)
nPredID); + +ASSERT_EQ(RoundTripVPID, VPID); +IsFullTrip = true; + } + ASSERT_TRUE(IsFullTrip); +} + /// Check that VPIntrinsic::getDeclarationForParams works. TEST_F(VPIntrinsicTest, VPIntrinsicDeclarationForParams) { std::unique_ptr M = createVPDeclarationModule(); >From 61073d52e02ba830ab6e8ae6de42f940a80891fa Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Fri, 26 Jul 2024 10:03:17 +0900 Subject: [PATCH 3/3] Revert "[llvm][Bazel] Adapt to 4eb30cfb3474e3770b465cdb39db3b7f6404c3ef" Since #99276 has been landed, the dependency has become redundant. This reverts commit aa94a43178e1e1fa4dbe7ee802d46623667067ae. (llvmorg-19-init-17718-gaa94a43178e1) (cherry picked from commit 5bf085921ec23e5fa1ea4a159c55a618a9299ce6) --- utils/bazel/llvm-project-overlay/llvm/BUILD.bazel | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel index 64d36c7b7f664..4d443e809d55b 100644 --- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel @@ -944,10 +944,7 @@ cc_library( srcs = glob([ "lib/IR/*.cpp", "lib/IR/*.h", -]) + [ -# To avoid a dependency cycle. -"include/llvm/Analysis/IVDescriptors.h", -], +]), hdrs = glob( [ "include/llvm/*.h", ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/19.x: [Clang] Correctly forward `--cuda-path` to the nvlink wrapper (#100170) (PR #100216)
uot;--"], "ptxas-path=">, +def ptxas_path_EQ : Joined<["--"], "ptxas-path=">, Flags<[WrapperOnlyOption]>, MetaVarName<"">, HelpText<"Set the 'ptxas' path">; def o : JoinedOrSeparate<["-"], "o">, MetaVarName<"">, >From 160b1c126a564d258666465e8fe462ab81fef722 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 23 Jul 2024 16:30:41 -0500 Subject: [PATCH 2/5] Update clang/test/Driver/linker-wrapper-passes.c --- clang/test/Driver/linker-wrapper-passes.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/test/Driver/linker-wrapper-passes.c b/clang/test/Driver/linker-wrapper-passes.c index 8c337ff906d17..a25ea6c78af66 100644 --- a/clang/test/Driver/linker-wrapper-passes.c +++ b/clang/test/Driver/linker-wrapper-passes.c @@ -1,5 +1,8 @@ // Check various clang-linker-wrapper pass options after -offload-opt. +// REQUIRES: llvm-plugins, llvm-examples +// REQUIRES: x86-registered-target +// REQUIRES: amdgpu-registered-target // Setup. // RUN: mkdir -p %t // RUN: %clang -cc1 -emit-llvm-bc -o %t/host-x86_64-unknown-linux-gnu.bc \ >From 7888929541d4879cda00f91ee8c1b0ea0db1282b Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 23 Jul 2024 16:31:26 -0500 Subject: [PATCH 3/5] Update clang/test/Driver/linker-wrapper-passes.c --- clang/test/Driver/linker-wrapper-passes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/test/Driver/linker-wrapper-passes.c b/clang/test/Driver/linker-wrapper-passes.c index a25ea6c78af66..39d1c0a12bf43 100644 --- a/clang/test/Driver/linker-wrapper-passes.c +++ b/clang/test/Driver/linker-wrapper-passes.c @@ -22,7 +22,7 @@ // RUN: %t/host-x86_64-unknown-linux-gnu.s // Check plugin, -passes, and no remarks. -// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \ +// RUN: clang-linker-wrapper -o a.out --embed-bitcode \ // RUN: --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \ // RUN: %offload-opt-loadbye --offload-opt=-wave-goodbye \ // RUN: --offload-opt=-passes="function(goodbye),module(inline)" 2>&1 | \ >From 104539e052efb966e0125571878d123cb657b753 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 23 Jul 2024 16:31:31 -0500 Subject: [PATCH 4/5] Update clang/test/Driver/linker-wrapper-passes.c --- clang/test/Driver/linker-wrapper-passes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/test/Driver/linker-wrapper-passes.c b/clang/test/Driver/linker-wrapper-passes.c index 39d1c0a12bf43..5a73a4427fa94 100644 --- a/clang/test/Driver/linker-wrapper-passes.c +++ b/clang/test/Driver/linker-wrapper-passes.c @@ -29,7 +29,7 @@ // RUN: FileCheck -match-full-lines -check-prefixes=OUT %s // Check plugin, -p, and remarks. -// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \ +// RUN: clang-linker-wrapper -o a.out --embed-bitcode \ // RUN: --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \ // RUN: %offload-opt-loadbye --offload-opt=-wave-goodbye \ // RUN: --offload-opt=-p="function(goodbye),module(inline)" \ >From 34b184f18f31e56b70facec59b44a3f16973ebfe Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 23 Jul 2024 16:31:36 -0500 Subject: [PATCH 5/5] Update clang/test/Driver/linker-wrapper-passes.c --- clang/test/Driver/linker-wrapper-passes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/test/Driver/linker-wrapper-passes.c b/clang/test/Driver/linker-wrapper-passes.c index 5a73a4427fa94..b257c942afa07 100644 --- a/clang/test/Driver/linker-wrapper-passes.c +++ b/clang/test/Driver/linker-wrapper-passes.c @@ -42,7 +42,7 @@ // RUN: -check-prefixes=YML %s // Check handling of bad plugin. -// RUN: not clang-linker-wrapper --dry-run \ +// RUN: not clang-linker-wrapper \ // RUN: --offload-opt=-load-pass-plugin=%t/nonexistent.so 2>&1 | \ // RUN: FileCheck -match-full-lines -check-prefixes=BAD-PLUGIN %s ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)
whisperity wrote: What happens in the following case? ```cpp std::vector V; const auto& V2 = V; std::find(V.begin(), V2.end(), 42); ``` These are syntactically different symbols, but still should be the same underlying memory area. Perhaps it could be mentioned in the documentation, that the Clang Static Analyser has (albeit only as alpha...) some iterator-related checkers as well, where range constraints are (attempted to be?) modelled path sensitively. https://github.com/llvm/llvm-project/pull/99917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)
@@ -0,0 +1,45 @@ +//===--- IncorrectIteratorsCheck.h - clang-tidy -*- 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 +// +//===--===// + +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INCORRECTITERATORSCHECK_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_INCORRECTITERATORSCHECK_H + +#include "../ClangTidyCheck.h" +#include "llvm/ADT/StringRef.h" + +namespace clang::tidy::bugprone { + +/// Detects calls to iterator algorithms that are called with potentially +/// invalid arguments. +/// +/// For the user-facing documentation see: +/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/incorrect-iterators.html +class IncorrectIteratorsCheck : public ClangTidyCheck { +public: + IncorrectIteratorsCheck(StringRef Name, ClangTidyContext *Context); + void registerMatchers(ast_matchers::MatchFinder *Finder) override; + void check(const ast_matchers::MatchFinder::MatchResult ) override; + void storeOptions(ClangTidyOptions::OptionMap ) override; + std::optional getCheckTraversalKind() const override; + bool isLanguageVersionSupported(const LangOptions ) const override; + +private: + std::vector BeginFree; + std::vector EndFree; + std::vector BeginMethod; + std::vector EndMethod; + std::vector RBeginFree; + std::vector REndFree; + std::vector RBeginMethod; + std::vector REndMethod; + std::vector MakeReverseIterator; whisperity wrote: These are usually `const`, as these correspond to the options obtained from the user's configuration. https://github.com/llvm/llvm-project/pull/99917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Ofast deprecation clarifications (PR #101005)
sjoerdmeijer wrote: > LGTM, let's go ahead and merge this and get it backported to 19.x, thank you! Thanks for your help with this. I am mostly unfamiliar with the release process. Do you know how we can achieve this? Do we suggest this commit to the release manager for a backport and cherry pick? Or do we prepare a patch? We could add similar clarifications to the release notes, which were initially included in an earlier version of this patch. So same question how we would need to approach that. https://github.com/llvm/llvm-project/pull/101005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Ofast deprecation clarifications (PR #101005)
https://github.com/sjoerdmeijer closed https://github.com/llvm/llvm-project/pull/101005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm-branch-commits] [clang] Backport "[analyzer] Restore recognition of mutex methods" (PR #101651)
github-actions[bot] wrote: @steakhal (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/101651 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[clang] [NFC][Clang] Remove unused arg (PR #101650)
https://github.com/chestnykh closed https://github.com/llvm/llvm-project/pull/101650 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] 0fd980e - [NFC][Clang] Remove unused arg (#101650)
Author: Dmitry Chestnykh Date: 2024-08-02T15:24:49+03:00 New Revision: 0fd980e1dbed1018c77e7c7c258a08a5bca61955 URL: https://github.com/llvm/llvm-project/commit/0fd980e1dbed1018c77e7c7c258a08a5bca61955 DIFF: https://github.com/llvm/llvm-project/commit/0fd980e1dbed1018c77e7c7c258a08a5bca61955.diff LOG: [NFC][Clang] Remove unused arg (#101650) `BuiltinID` is not used inside `CheckBuiltinTargetInSupported` Added: Modified: clang/lib/Sema/SemaChecking.cpp Removed: diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index e35d91e810dd9..ee143381cf4f7 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -1862,7 +1862,7 @@ static bool CheckBuiltinTargetNotInUnsupported( // Emit an error and return true if the current architecture is not in the list // of supported architectures. static bool -CheckBuiltinTargetInSupported(Sema , unsigned BuiltinID, CallExpr *TheCall, +CheckBuiltinTargetInSupported(Sema , CallExpr *TheCall, ArrayRef SupportedArchs) { llvm::Triple::ArchType CurArch = S.getASTContext().getTargetInfo().getTriple().getArch(); @@ -2151,7 +2151,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, case Builtin::BI_interlockedbittestandreset_rel: case Builtin::BI_interlockedbittestandreset_nf: if (CheckBuiltinTargetInSupported( -*this, BuiltinID, TheCall, +*this, TheCall, {llvm::Triple::arm, llvm::Triple::thumb, llvm::Triple::aarch64})) return ExprError(); break; @@ -2164,7 +2164,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, case Builtin::BI_interlockedbittestandreset64: case Builtin::BI_interlockedbittestandset64: if (CheckBuiltinTargetInSupported( -*this, BuiltinID, TheCall, +*this, TheCall, {llvm::Triple::x86_64, llvm::Triple::arm, llvm::Triple::thumb, llvm::Triple::aarch64, llvm::Triple::amdgcn})) return ExprError(); @@ -2172,7 +2172,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, case Builtin::BI__builtin_set_flt_rounds: if (CheckBuiltinTargetInSupported( -*this, BuiltinID, TheCall, +*this, TheCall, {llvm::Triple::x86, llvm::Triple::x86_64, llvm::Triple::arm, llvm::Triple::thumb, llvm::Triple::aarch64, llvm::Triple::amdgcn})) return ExprError(); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm-branch-commits] [clang] Backport "[analyzer] Restore recognition of mutex methods" (PR #101651)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/101651 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] 18ad020 - [analyzer] Restore recognition of mutex methods (#101511)
Author: Donát Nagy Date: 2024-08-02T12:44:40+02:00 New Revision: 18ad0209550ed258fc1a24e710613bc5e3e220af URL: https://github.com/llvm/llvm-project/commit/18ad0209550ed258fc1a24e710613bc5e3e220af DIFF: https://github.com/llvm/llvm-project/commit/18ad0209550ed258fc1a24e710613bc5e3e220af.diff LOG: [analyzer] Restore recognition of mutex methods (#101511) Before commit 705788c the checker alpha.unix.BlockInCriticalSection "recognized" the methods `std::mutex::lock` and `std::mutex::unlock` with an extremely trivial check that accepted any function (or method) named lock/unlock. To avoid matching unrelated user-defined function, this was refined to a check that also requires the presence of "std" and "mutex" as distinct parts of the qualified name. However, as #99628 reported, there are standard library implementations where some methods of `std::mutex` are inherited from an implementation detail base class and the new code wasn't able to recognize these methods, which led to emitting false positive reports. As a workaround, this commit partially restores the old behavior by omitting the check for the class name. In the future, it would be good to replace this hack with a solution which ensures that `CallDescription` understands inherited methods. (cherry picked from commit 99ae2edc2592e602b0eb5a287f4d003aa3902440) Added: clang/test/Analysis/block-in-critical-section-inheritance.cpp Modified: clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp Removed: diff --git a/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp index 40f7e9cede1f1..4cd2f2802f30c 100644 --- a/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp @@ -147,10 +147,18 @@ using MutexDescriptor = class BlockInCriticalSectionChecker : public Checker { private: const std::array MutexDescriptors{ - MemberMutexDescriptor({/*MatchAs=*/CDM::CXXMethod, - /*QualifiedName=*/{"std", "mutex", "lock"}, - /*RequiredArgs=*/0}, -{CDM::CXXMethod, {"std", "mutex", "unlock"}, 0}), + // NOTE: There are standard library implementations where some methods + // of `std::mutex` are inherited from an implementation detail base + // class, and those aren't matched by the name specification {"std", + // "mutex", "lock"}. + // As a workaround here we omit the class name and only require the + // presence of the name parts "std" and "lock"/"unlock". + // TODO: Ensure that CallDescription understands inherited methods. + MemberMutexDescriptor( + {/*MatchAs=*/CDM::CXXMethod, + /*QualifiedName=*/{"std", /*"mutex",*/ "lock"}, + /*RequiredArgs=*/0}, + {CDM::CXXMethod, {"std", /*"mutex",*/ "unlock"}, 0}), FirstArgMutexDescriptor({CDM::CLibrary, {"pthread_mutex_lock"}, 1}, {CDM::CLibrary, {"pthread_mutex_unlock"}, 1}), FirstArgMutexDescriptor({CDM::CLibrary, {"mtx_lock"}, 1}, diff --git a/clang/test/Analysis/block-in-critical-section-inheritance.cpp b/clang/test/Analysis/block-in-critical-section-inheritance.cpp new file mode 100644 index 0..db20df8c60a5c --- /dev/null +++ b/clang/test/Analysis/block-in-critical-section-inheritance.cpp @@ -0,0 +1,31 @@ +// RUN: %clang_analyze_cc1 \ +// RUN: -analyzer-checker=unix.BlockInCriticalSection \ +// RUN: -std=c++11 \ +// RUN: -analyzer-output text \ +// RUN: -verify %s + +unsigned int sleep(unsigned int seconds) {return 0;} +namespace std { +// There are some standard library implementations where some mutex methods +// come from an implementation detail base class. We need to ensure that these +// are matched correctly. +class __mutex_base { +public: + void lock(); +}; +class mutex : public __mutex_base{ +public: + void unlock(); + bool try_lock(); +}; +} // namespace std + +void gh_99628() { + std::mutex m; + m.lock(); + // expected-note@-1 {{Entering critical section here}} + sleep(10); + // expected-warning@-1 {{Call to blocking function 'sleep' inside of critical section}} + // expected-note@-2 {{Call to blocking function 'sleep' inside of critical section}} + m.unlock(); +} ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[clang] [C11] Claim conformance to WG14 N1396 (PR #101214)
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/101214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] cb58294 - [C11] Claim conformance to WG14 N1396 (#101214)
:.*:]] +// CHECK-AARCH64-NEXT:[[X_ADDR:%.*]] = alloca float, align 4 +// CHECK-AARCH64-NEXT:store float [[X]], ptr [[X_ADDR]], align 4 +// CHECK-AARCH64-NEXT:[[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4 +// CHECK-AARCH64-NEXT:[[CONV:%.*]] = fpext float [[TMP0]] to double +// CHECK-AARCH64-NEXT:[[MUL:%.*]] = fmul double [[CONV]], 1.00e+00 +// CHECK-AARCH64-NEXT:[[CONV1:%.*]] = fptrunc double [[MUL]] to float +// CHECK-AARCH64-NEXT:ret float [[CONV1]] +// +// CHECK-ARM-LABEL: define dso_local arm_aapcscc float @double_source_func_cast( +// CHECK-ARM-SAME: float noundef [[X:%.*]]) #[[ATTR0]] { +// CHECK-ARM-NEXT: [[ENTRY:.*:]] +// CHECK-ARM-NEXT:[[X_ADDR:%.*]] = alloca float, align 4 +// CHECK-ARM-NEXT:store float [[X]], ptr [[X_ADDR]], align 4 +// CHECK-ARM-NEXT:[[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4 +// CHECK-ARM-NEXT:[[CONV:%.*]] = fpext float [[TMP0]] to double +// CHECK-ARM-NEXT:[[MUL:%.*]] = fmul double [[CONV]], 1.00e+00 +// CHECK-ARM-NEXT:[[CONV1:%.*]] = fptrunc double [[MUL]] to float +// CHECK-ARM-NEXT:ret float [[CONV1]] +// +// CHECK-PPC32-LABEL: define dso_local float @double_source_func_cast( +// CHECK-PPC32-SAME: float noundef [[X:%.*]]) #[[ATTR0]] { +// CHECK-PPC32-NEXT: [[ENTRY:.*:]] +// CHECK-PPC32-NEXT:[[X_ADDR:%.*]] = alloca float, align 4 +// CHECK-PPC32-NEXT:store float [[X]], ptr [[X_ADDR]], align 4 +// CHECK-PPC32-NEXT:[[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4 +// CHECK-PPC32-NEXT:[[CONV:%.*]] = fpext float [[TMP0]] to double +// CHECK-PPC32-NEXT:[[MUL:%.*]] = fmul double [[CONV]], 1.00e+00 +// CHECK-PPC32-NEXT:[[CONV1:%.*]] = fptrunc double [[MUL]] to float +// CHECK-PPC32-NEXT:ret float [[CONV1]] +// +// CHECK-PPC64-LABEL: define dso_local float @double_source_func_cast( +// CHECK-PPC64-SAME: float noundef [[X:%.*]]) #[[ATTR0]] { +// CHECK-PPC64-NEXT: [[ENTRY:.*:]] +// CHECK-PPC64-NEXT:[[X_ADDR:%.*]] = alloca float, align 4 +// CHECK-PPC64-NEXT:store float [[X]], ptr [[X_ADDR]], align 4 +// CHECK-PPC64-NEXT:[[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4 +// CHECK-PPC64-NEXT:[[CONV:%.*]] = fpext float [[TMP0]] to double +// CHECK-PPC64-NEXT:[[MUL:%.*]] = fmul double [[CONV]], 1.00e+00 +// CHECK-PPC64-NEXT:[[CONV1:%.*]] = fptrunc double [[MUL]] to float +// CHECK-PPC64-NEXT:ret float [[CONV1]] +// +// CHECK-SPARCV9-LABEL: define dso_local float @double_source_func_cast( +// CHECK-SPARCV9-SAME: float noundef [[X:%.*]]) #[[ATTR0]] { +// CHECK-SPARCV9-NEXT: [[ENTRY:.*:]] +// CHECK-SPARCV9-NEXT:[[X_ADDR:%.*]] = alloca float, align 4 +// CHECK-SPARCV9-NEXT:store float [[X]], ptr [[X_ADDR]], align 4 +// CHECK-SPARCV9-NEXT:[[TMP0:%.*]] = load float, ptr [[X_ADDR]], align 4 +// CHECK-SPARCV9-NEXT:[[CONV:%.*]] = fpext float [[TMP0]] to double +// CHECK-SPARCV9-NEXT:[[MUL:%.*]] = fmul double [[CONV]], 1.00e+00 +// CHECK-SPARCV9-NEXT:[[CONV1:%.*]] = fptrunc double [[MUL]] to float +// CHECK-SPARCV9-NEXT:ret float [[CONV1]] +// +float double_source_func_cast(float x) { +#pragma clang fp eval_method(source) + return (float)(x * 1.0); +} diff --git a/clang/www/c_status.html b/clang/www/c_status.html index 3ea70b0163c70..0a80039a10578 100644 --- a/clang/www/c_status.html +++ b/clang/www/c_status.html @@ -501,7 +501,14 @@ C11 implementation status Wide function returns (alternate proposal) https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1396.htm;>N1396 - Unknown + +Yes* +Clang conforms to this paper on all targets except 32-bit x86 without +SSE2. However, Clang does not claim conformance to Annex F on any +target and does not intend to ever conform to Annex F on that specific +target, so no changes are needed to conform to this paper. + + Alignment ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Ofast deprecation clarifications (PR #101005)
https://github.com/AaronBallman approved this pull request. LGTM, let's go ahead and merge this and get it backported to 19.x, thank you! https://github.com/llvm/llvm-project/pull/101005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [OpenMP] Diagnostic check for imperfect loop collapse (PR #96087)
jtb20 wrote: ping? https://github.com/llvm/llvm-project/pull/96087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [NFC][Clang] Remove unused arg (PR #101650)
https://github.com/s-barannikov approved this pull request. https://github.com/llvm/llvm-project/pull/101650 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm-branch-commits] [compiler-rt] [llvm] release/19.x: [MC/DC][Coverage] Introduce "Bitmap Bias" for continuous mode (#96126) (PR #101629)
ornata wrote: IIUC - Scope: Programs built with MC/DC coverage with continuous mode enabled. - Risk: This is a new feature for MC/DC coverage. Previously, MC/DC had no support for continuous mode. There should be no breakage introduced for existing features. - Testing: LLVM lit tests attached. @chapuni What testing have you done other than LLVM lit tests? LLVM test suite? Clang itself? https://github.com/llvm/llvm-project/pull/101629 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[libunwind] [libunwind] Add GCS support for AArch64 (PR #99335)
john-brawn-arm wrote: Sorry to pester you about this, but would it be possible to get this approved in time for LLVM19 RC2 on Monday? This is the last piece of GCS work and it would be nice to have it all in a single LLVM release. https://github.com/llvm/llvm-project/pull/99335 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[libunwind] [libunwind] Add GCS support for AArch64 (PR #99335)
https://github.com/john-brawn-arm milestoned https://github.com/llvm/llvm-project/pull/99335 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [NVPTX] Support __usAtomicCAS builtin (PR #99646)
? 16 : 32); + setMinCmpXchgSizeInBits(STI.hasAtomCas16() ? 16 : 32); setMaxAtomicSizeInBitsSupported(64); setMaxDivRemBitWidthSupported(64); } diff --git a/llvm/lib/Target/NVPTX/NVPTXSubtarget.h b/llvm/lib/Target/NVPTX/NVPTXSubtarget.h index 8df41913ff12e..1c7551ff5f78c 100644 --- a/llvm/lib/Target/NVPTX/NVPTXSubtarget.h +++ b/llvm/lib/Target/NVPTX/NVPTXSubtarget.h @@ -77,6 +77,7 @@ class NVPTXSubtarget : public NVPTXGenSubtargetInfo { bool hasAtomScope() const { return SmVersion >= 60; } bool hasAtomBitwise64() const { return SmVersion >= 32; } bool hasAtomMinMax64() const { return SmVersion >= 32; } + bool hasAtomCas16() const { return SmVersion >= 70 && PTXVersion >= 63; } bool hasLDG() const { return SmVersion >= 32; } bool hasHWROT32() const { return SmVersion >= 32; } bool hasImageHandles() const; >From 877a83c697a06d9c4f7d3c27cadf741126889a54 Mon Sep 17 00:00:00 2001 From: Denis Gerasimov Date: Fri, 19 Jul 2024 23:36:51 +0300 Subject: [PATCH 5/6] Fixed builtin test --- clang/test/CodeGen/builtins-nvptx.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/clang/test/CodeGen/builtins-nvptx.c b/clang/test/CodeGen/builtins-nvptx.c index 3ba1fabd05335..dee68157b2b09 100644 --- a/clang/test/CodeGen/builtins-nvptx.c +++ b/clang/test/CodeGen/builtins-nvptx.c @@ -1,4 +1,7 @@ // REQUIRES: nvptx-registered-target +// RUN: %clang_cc1 -ffp-contract=off -triple nvptx64-unknown-unknown -target-cpu sm_70 -target-feature +ptx63 \ +// RUN:-fcuda-is-device -emit-llvm -o - -x cuda %s \ +// RUN: | FileCheck -check-prefix=CHECK -check-prefix=CHECK_PTX63_SM70 -check-prefix=LP64 %s // RUN: %clang_cc1 -ffp-contract=off -triple nvptx-unknown-unknown -target-cpu sm_80 -target-feature +ptx70 \ // RUN:-fcuda-is-device -emit-llvm -o - -x cuda %s \ // RUN: | FileCheck -check-prefix=CHECK -check-prefix=CHECK_PTX70_SM80 -check-prefix=LP32 %s @@ -235,7 +238,8 @@ __shared__ long long sll; // Check for atomic intrinsics // CHECK-LABEL: nvvm_atom -__device__ void nvvm_atom(float *fp, float f, double *dfp, double df, int *ip, +__device__ void nvvm_atom(float *fp, float f, double *dfp, double df, + unsigned short *usp, unsigned short us, int *ip, int i, unsigned int *uip, unsigned ui, long *lp, long l, long long *llp, long long ll) { // CHECK: atomicrmw add ptr {{.*}} seq_cst, align 4 @@ -306,9 +310,6 @@ __device__ void nvvm_atom(float *fp, float f, double *dfp, double df, int *ip, // CHECK: atomicrmw umin ptr {{.*}} seq_cst, align 8 __nvvm_atom_min_gen_ull((unsigned long long *), ll); - // CHECK: cmpxchg ptr {{.*}} seq_cst seq_cst, align 2 - // CHECK-NEXT: extractvalue { i16, i1 } {{%[0-9]+}}, 0 - __nvvm_atom_cas_gen_us(ip, 0, i); // CHECK: cmpxchg ptr {{.*}} seq_cst seq_cst, align 4 // CHECK-NEXT: extractvalue { i32, i1 } {{%[0-9]+}}, 0 __nvvm_atom_cas_gen_i(ip, 0, i); @@ -577,6 +578,12 @@ __device__ void nvvm_atom(float *fp, float f, double *dfp, double df, int *ip, __nvvm_atom_sys_cas_gen_ll(, ll, 0); #endif +#if __CUDA_ARCH__ >= 700 + // CHECK_PTX63_SM70: cmpxchg ptr {{.*}} seq_cst seq_cst, align 2 + // CHECK_PTX63_SM70-NEXT: extractvalue { i16, i1 } {{%[0-9]+}}, 0 + __nvvm_atom_cas_gen_us(usp, 0, us); +#endif + // CHECK: ret } >From 72f8bd98bca71407fd6125bf43ef88f401eb03f7 Mon Sep 17 00:00:00 2001 From: "Denis.Gerasimov" Date: Fri, 2 Aug 2024 13:02:00 +0300 Subject: [PATCH 6/6] cta and sys intrinsics test --- clang/test/CodeGen/builtins-nvptx.c | 4 1 file changed, 4 insertions(+) diff --git a/clang/test/CodeGen/builtins-nvptx.c b/clang/test/CodeGen/builtins-nvptx.c index dee68157b2b09..4673c0c7eee01 100644 --- a/clang/test/CodeGen/builtins-nvptx.c +++ b/clang/test/CodeGen/builtins-nvptx.c @@ -582,6 +582,10 @@ __device__ void nvvm_atom(float *fp, float f, double *dfp, double df, // CHECK_PTX63_SM70: cmpxchg ptr {{.*}} seq_cst seq_cst, align 2 // CHECK_PTX63_SM70-NEXT: extractvalue { i16, i1 } {{%[0-9]+}}, 0 __nvvm_atom_cas_gen_us(usp, 0, us); + // CHECK_PTX63_SM70: call i16 @llvm.nvvm.atomic.cas.gen.i.cta.i16.p0 + __nvvm_atom_cta_cas_gen_us(usp, 0, us); + // CHECK_PTX63_SM70: call i16 @llvm.nvvm.atomic.cas.gen.i.sys.i16.p0 + __nvvm_atom_sys_cas_gen_us(usp, 0, us); #endif // CHECK: ret ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Surface error for plain return statement in coroutine earlier (PR #100985)
github-actions[bot] wrote: @ivanaivanovska Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build, you may receive a report in an email or a comment on this PR. Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues. How to do this, and the rest of the post-merge process, is covered in detail [here](https://llvm.org/docs/MyFirstTypoFix.html#myfirsttypofix-issues-after-landing-your-pr). If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of [LLVM development](https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy). You can fix your changes and open a new PR to merge them again. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! https://github.com/llvm/llvm-project/pull/100985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Surface error for plain return statement in coroutine earlier (PR #100985)
https://github.com/ilya-biryukov closed https://github.com/llvm/llvm-project/pull/100985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] db1375f - Surface error for plain return statement in coroutine earlier (#100985)
%s -fcxx-exceptions -fexceptions -Wunused-result // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify=expected,cxx14_20,cxx20_23 %s -fcxx-exceptions -fexceptions -Wunused-result +// Run without -verify to check the order of errors we show. +// RUN: not %clang_cc1 -std=c++20 -fsyntax-only %s -fcxx-exceptions -fexceptions -Wunused-result 2>&1 | FileCheck %s + void no_coroutine_traits_bad_arg_await() { co_await a; // expected-error {{include }} // expected-error@-1 {{use of undeclared identifier 'a'}} @@ -154,12 +157,15 @@ namespace std { template struct coroutine_handle { static coroutine_handle from_address(void *) noexcept; + static coroutine_handle from_promise(PromiseType ); }; template <> struct coroutine_handle { template coroutine_handle(coroutine_handle) noexcept; static coroutine_handle from_address(void *) noexcept; + template + static coroutine_handle from_promise(PromiseType ); }; } // namespace std @@ -206,6 +212,22 @@ void mixed_yield_invalid() { return; // expected-error {{return statement not allowed in coroutine}} } +void mixed_yield_return_first(bool b) { + if (b) { +return; // expected-error {{return statement not allowed in coroutine}} + } + co_yield 0; // expected-note {{function is a coroutine due to use of 'co_yield'}} +} + +template +void mixed_return_for_range(bool b, T t) { + if (b) { +return; // expected-error {{return statement not allowed in coroutine}} + } + for co_await (auto i : t){}; // expected-warning {{'for co_await' belongs to CoroutineTS instead of C++20, which is deprecated}} + // expected-note@-1 {{function is a coroutine due to use of 'co_await'}} +} + template void mixed_yield_template(T) { co_yield blah; // expected-error {{use of undeclared identifier}} @@ -264,6 +286,13 @@ void mixed_coreturn(void_tag, bool b) { return; // expected-error {{not allowed in coroutine}} } +void mixed_coreturn_return_first(void_tag, bool b) { + if (b) +return; // expected-error {{not allowed in coroutine}} + else +co_return; // expected-note {{use of 'co_return'}} +} + void mixed_coreturn_invalid(bool b) { if (b) co_return; // expected-note {{use of 'co_return'}} @@ -291,6 +320,53 @@ void mixed_coreturn_template2(bool b, T) { return; // expected-error {{not allowed in coroutine}} } +struct promise_handle; + +struct Handle : std::coroutine_handle { // expected-note 4{{not viable}} +// expected-note@-1 4{{not viable}} +using promise_type = promise_handle; +}; + +struct promise_handle { +Handle get_return_object() noexcept { + { return Handle(std::coroutine_handle::from_promise(*this)); } +} +suspend_never initial_suspend() const noexcept { return {}; } +suspend_never final_suspend() const noexcept { return {}; } +void return_void() const noexcept {} +void unhandled_exception() const noexcept {} +}; + +Handle mixed_return_value() { + co_await a; // expected-note {{function is a coroutine due to use of 'co_await' here}} + return 0; // expected-error {{return statement not allowed in coroutine}} + // expected-error@-1 {{no viable conversion from returned value of type}} + // Check that we first show that return is not allowed in coroutine. + // The error about bad conversion is most likely spurious so we prefer to have it afterwards. + // CHECK-NOT: error: no viable conversion from returned value of type + // CHECK: error: return statement not allowed in coroutine + // CHECK: error: no viable conversion from returned value of type +} + +Handle mixed_return_value_return_first(bool b) { + if (b) { +return 0; // expected-error {{no viable conversion from returned value of type}} +// expected-error@-1 {{return statement not allowed in coroutine}} + } + co_await a; // expected-note {{function is a coroutine due to use of 'co_await' here}} + co_return 0; // expected-error {{no member named 'return_value' in 'promise_handle'}} +} + +Handle mixed_multiple_returns(bool b) { + if (b) { +return 0; // expected-error {{no viable conversion from returned value of type}} +// expected-error@-1 {{return statement not allowed in coroutine}} + } + co_await a; // expected-note {{function is a coroutine due to use of 'co_await' here}} + // The error 'return statement not allowed in coroutine' should appear only once. + return 0; // expected-error {{no viable conversion from returned value of type}} +} + struct CtorDtor { CtorDtor() { co_yield 0; // expected-error {{'co_yield' cannot be used in a constructor}} ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[jenkinsci/integrity-plugin]
Branch: refs/tags/integrity-plugin-2.6 Home: https://github.com/jenkinsci/integrity-plugin To unsubscribe from these emails, change your notification settings at https://github.com/jenkinsci/integrity-plugin/settings/notifications -- You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/integrity-plugin/push/refs/tags/integrity-plugin-2.6/00-a9c19b%40github.com.
[clang] Surface error for plain return statement in coroutine earlier (PR #100985)
+20 -fsyntax-only %s -fcxx-exceptions -fexceptions -Wunused-result 2>&1 | FileCheck %s void no_coroutine_traits_bad_arg_await() { @@ -339,18 +341,20 @@ Handle mixed_return_value() { co_await a; // expected-note {{function is a coroutine due to use of 'co_await' here}} return 0; // expected-error {{return statement not allowed in coroutine}} // expected-error@-1 {{no viable conversion from returned value of type}} + // Check that we first show that return is not allowed in coroutine. + // The error about bad conversion is most likely spurious so we prefer to have it afterwards. // CHECK-NOT: error: no viable conversion from returned value of type // CHECK: error: return statement not allowed in coroutine // CHECK: error: no viable conversion from returned value of type } Handle mixed_return_value_return_first(bool b) { - if (b) { -return 0; // expected-error {{no viable conversion from returned value of type}} -// expected-error@-1 {{return statement not allowed in coroutine}} -} -co_await a; // expected-note {{function is a coroutine due to use of 'co_await' here}} -co_return 0; // expected-error {{no member named 'return_value' in 'promise_handle'}} + if (b) { +return 0; // expected-error {{no viable conversion from returned value of type}} +// expected-error@-1 {{return statement not allowed in coroutine}} + } + co_await a; // expected-note {{function is a coroutine due to use of 'co_await' here}} + co_return 0; // expected-error {{no member named 'return_value' in 'promise_handle'}} } Handle mixed_multiple_returns(bool b) { @@ -359,6 +363,7 @@ Handle mixed_multiple_returns(bool b) { // expected-error@-1 {{return statement not allowed in coroutine}} } co_await a; // expected-note {{function is a coroutine due to use of 'co_await' here}} + // The error 'return statement not allowed in coroutine' should appear only once. return 0; // expected-error {{no viable conversion from returned value of type}} } >From 110540307d4487e081a147209e063d6f480eabfb Mon Sep 17 00:00:00 2001 From: Ivana Ivanovska Date: Fri, 2 Aug 2024 11:13:08 + Subject: [PATCH 4/4] Fixed assert, added comment, fixed formatting. --- clang/lib/Sema/SemaCoroutine.cpp | 7 --- clang/lib/Sema/SemaStmt.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp index e379987556f07..68ad6e3fd6414 100644 --- a/clang/lib/Sema/SemaCoroutine.cpp +++ b/clang/lib/Sema/SemaCoroutine.cpp @@ -687,14 +687,14 @@ bool Sema::checkFinalSuspendNoThrow(const Stmt *FinalSuspend) { // [stmt.return.coroutine]p1: // A coroutine shall not enclose a return statement ([stmt.return]). static void checkReturnStmtInCoroutine(Sema , FunctionScopeInfo *FSI) { - assert (!FSI && "FunctionScopeInfo is null"); + assert(FSI && "FunctionScopeInfo is null"); assert(FSI->FirstCoroutineStmtLoc.isValid() && -"first coroutine location not set"); + "first coroutine location not set"); if (FSI->FirstReturnLoc.isInvalid()) return; S.Diag(FSI->FirstReturnLoc, diag::err_return_in_coroutine); S.Diag(FSI->FirstCoroutineStmtLoc, diag::note_declared_coroutine_here) - << FSI->getFirstCoroutineStmtKeyword(); + << FSI->getFirstCoroutineStmtKeyword(); } bool Sema::ActOnCoroutineBodyStart(Scope *SC, SourceLocation KWLoc, @@ -707,6 +707,7 @@ bool Sema::ActOnCoroutineBodyStart(Scope *SC, SourceLocation KWLoc, auto *ScopeInfo = getCurFunction(); assert(ScopeInfo->CoroutinePromise); + // Avoid duplicate errors, report only on first keyword. if (ScopeInfo->FirstCoroutineStmtLoc == KWLoc) checkReturnStmtInCoroutine(*this, ScopeInfo); diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 7d4fcfbe321f4..d283eaa511011 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -3751,10 +3751,10 @@ Sema::ActOnReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp, FunctionScopeInfo *FSI = getCurFunction(); if (FSI->FirstReturnLoc.isInvalid() && FSI->isCoroutine()) { assert(FSI->FirstCoroutineStmtLoc.isValid() && - "first coroutine location not set"); + "first coroutine location not set"); Diag(ReturnLoc, diag::err_return_in_coroutine); Diag(FSI->FirstCoroutineStmtLoc, diag::note_declared_coroutine_here) -<< FSI->getFirstCoroutineStmtKeyword(); +<< FSI->getFirstCoroutineStmtKeyword(); } StmtResult R = ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm-branch-commits] [llvm] [AMDGPU][SILoadStoreOptimizer] Include constrained buffer load variants (PR #101619)
https://github.com/cdevadas updated https://github.com/llvm/llvm-project/pull/101619 >From ad8a8dfea913c92fb94079aab0a4a5905b30384d Mon Sep 17 00:00:00 2001 From: Christudasan Devadasan Date: Tue, 30 Jul 2024 14:46:36 +0530 Subject: [PATCH 1/3] [AMDGPU][SILoadStoreOptimizer] Include constrained buffer load variants Use the constrained buffer load opcodes while combining under-aligned load for XNACK enabled subtargets. --- .../Target/AMDGPU/SILoadStoreOptimizer.cpp| 75 ++- .../AMDGPU/llvm.amdgcn.s.buffer.load.ll | 56 +- .../CodeGen/AMDGPU/merge-sbuffer-load.mir | 564 -- 3 files changed, 613 insertions(+), 82 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp index ae537b194f50c..7553c370f694f 100644 --- a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp +++ b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp @@ -352,6 +352,8 @@ static unsigned getOpcodeWidth(const MachineInstr , const SIInstrInfo ) { return 1; case AMDGPU::S_BUFFER_LOAD_DWORDX2_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX2_SGPR_IMM: + case AMDGPU::S_BUFFER_LOAD_DWORDX2_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX2_SGPR_IMM_ec: case AMDGPU::S_LOAD_DWORDX2_IMM: case AMDGPU::S_LOAD_DWORDX2_IMM_ec: case AMDGPU::GLOBAL_LOAD_DWORDX2: @@ -363,6 +365,8 @@ static unsigned getOpcodeWidth(const MachineInstr , const SIInstrInfo ) { return 2; case AMDGPU::S_BUFFER_LOAD_DWORDX3_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX3_SGPR_IMM: + case AMDGPU::S_BUFFER_LOAD_DWORDX3_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX3_SGPR_IMM_ec: case AMDGPU::S_LOAD_DWORDX3_IMM: case AMDGPU::S_LOAD_DWORDX3_IMM_ec: case AMDGPU::GLOBAL_LOAD_DWORDX3: @@ -374,6 +378,8 @@ static unsigned getOpcodeWidth(const MachineInstr , const SIInstrInfo ) { return 3; case AMDGPU::S_BUFFER_LOAD_DWORDX4_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX4_SGPR_IMM: + case AMDGPU::S_BUFFER_LOAD_DWORDX4_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX4_SGPR_IMM_ec: case AMDGPU::S_LOAD_DWORDX4_IMM: case AMDGPU::S_LOAD_DWORDX4_IMM_ec: case AMDGPU::GLOBAL_LOAD_DWORDX4: @@ -385,6 +391,8 @@ static unsigned getOpcodeWidth(const MachineInstr , const SIInstrInfo ) { return 4; case AMDGPU::S_BUFFER_LOAD_DWORDX8_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX8_SGPR_IMM: + case AMDGPU::S_BUFFER_LOAD_DWORDX8_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX8_SGPR_IMM_ec: case AMDGPU::S_LOAD_DWORDX8_IMM: case AMDGPU::S_LOAD_DWORDX8_IMM_ec: return 8; @@ -499,12 +507,20 @@ static InstClassEnum getInstClass(unsigned Opc, const SIInstrInfo ) { case AMDGPU::S_BUFFER_LOAD_DWORDX3_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX4_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX8_IMM: + case AMDGPU::S_BUFFER_LOAD_DWORDX2_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX3_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX4_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX8_IMM_ec: return S_BUFFER_LOAD_IMM; case AMDGPU::S_BUFFER_LOAD_DWORD_SGPR_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX2_SGPR_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX3_SGPR_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX4_SGPR_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX8_SGPR_IMM: + case AMDGPU::S_BUFFER_LOAD_DWORDX2_SGPR_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX3_SGPR_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX4_SGPR_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX8_SGPR_IMM_ec: return S_BUFFER_LOAD_SGPR_IMM; case AMDGPU::S_LOAD_DWORD_IMM: case AMDGPU::S_LOAD_DWORDX2_IMM: @@ -587,12 +603,20 @@ static unsigned getInstSubclass(unsigned Opc, const SIInstrInfo ) { case AMDGPU::S_BUFFER_LOAD_DWORDX3_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX4_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX8_IMM: + case AMDGPU::S_BUFFER_LOAD_DWORDX2_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX3_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX4_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX8_IMM_ec: return AMDGPU::S_BUFFER_LOAD_DWORD_IMM; case AMDGPU::S_BUFFER_LOAD_DWORD_SGPR_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX2_SGPR_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX3_SGPR_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX4_SGPR_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX8_SGPR_IMM: + case AMDGPU::S_BUFFER_LOAD_DWORDX2_SGPR_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX3_SGPR_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX4_SGPR_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX8_SGPR_IMM_ec: return AMDGPU::S_BUFFER_LOAD_DWORD_SGPR_IMM; case AMDGPU::S_LOAD_DWORD_IMM: case AMDGPU::S_LOAD_DWORDX2_IMM: @@ -703,6 +727,10 @@ static AddressRegs getRegs(unsigned Opc, const SIInstrInfo ) { case AMDGPU::S_BUFFER_LOAD_DWORDX3_SGPR_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX4_SGPR_IMM: case AMDGPU::S_BUFFER_LOAD_DWORDX8_SGPR_IMM: + case AMDGPU::S_BUFFER_LOAD_DWORDX2_SGPR_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX3_SGPR_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX4_SGPR_IMM_ec: + case AMDGPU::S_BUFFER_LOAD_DWORDX8_SGPR_IMM_ec:
[clang] [llvm] [OpenMP] OpenMP 5.1 "assume" directive parsing support (PR #92731)
https://github.com/jtb20 updated https://github.com/llvm/llvm-project/pull/92731 >From b3d00ab3f6457094a8ccf4df03b72976e96cd307 Mon Sep 17 00:00:00 2001 From: Julian Brown Date: Thu, 1 Aug 2024 14:49:28 -0500 Subject: [PATCH 1/8] [OpenMP][clang] Add 'holds' clause for 'omp assume' directive --- clang/include/clang/AST/OpenMPClause.h| 27 +++ clang/include/clang/AST/RecursiveASTVisitor.h | 5 clang/include/clang/Sema/SemaOpenMP.h | 4 +++ clang/lib/AST/OpenMPClause.cpp| 6 + clang/lib/AST/StmtProfile.cpp | 2 ++ clang/lib/Parse/ParseOpenMP.cpp | 6 + clang/lib/Sema/SemaOpenMP.cpp | 9 +++ clang/lib/Sema/TreeTransform.h| 17 clang/lib/Serialization/ASTReader.cpp | 8 ++ clang/lib/Serialization/ASTWriter.cpp | 5 clang/tools/libclang/CIndex.cpp | 2 ++ llvm/include/llvm/Frontend/OpenMP/OMP.td | 10 +++ 12 files changed, 101 insertions(+) diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h index b029c72fa7d8f..47c2fd4400d52 100644 --- a/clang/include/clang/AST/OpenMPClause.h +++ b/clang/include/clang/AST/OpenMPClause.h @@ -2013,6 +2013,33 @@ class OMPMergeableClause : public OMPClause { } }; +/// This represents the 'holds' clause in the '#pragma omp assume' +/// directive. +/// +/// \code +/// #pragma omp assume holds() +/// \endcode +/// In this example directive '#pragma omp assume' has a 'holds' clause. +class OMPHoldsClause final +: public OMPOneStmtClause { + friend class OMPClauseReader; + +public: + /// Build 'holds' clause. + /// + /// \param StartLoc Starting location of the clause. + /// \param EndLoc Ending location of the clause. + OMPHoldsClause(Expr *E, SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation EndLoc) + : OMPOneStmtClause(E, StartLoc, LParenLoc, EndLoc) {} + + /// Build an empty clause. + OMPHoldsClause() : OMPOneStmtClause() {} + + Expr *getExpr() const { return getStmtAs(); } + void setExpr(Expr *E) { setStmt(E); } +}; + /// This represents 'read' clause in the '#pragma omp atomic' directive. /// /// \code diff --git a/clang/include/clang/AST/RecursiveASTVisitor.h b/clang/include/clang/AST/RecursiveASTVisitor.h index dcf5dbf449f8b..73ece1e72bbf1 100644 --- a/clang/include/clang/AST/RecursiveASTVisitor.h +++ b/clang/include/clang/AST/RecursiveASTVisitor.h @@ -3480,6 +3480,11 @@ bool RecursiveASTVisitor::VisitOMPAcqRelClause(OMPAcqRelClause *) { return true; } +template +bool RecursiveASTVisitor::VisitOMPHoldsClause(OMPHoldsClause *) { + return true; +} + template bool RecursiveASTVisitor::VisitOMPAcquireClause(OMPAcquireClause *) { return true; diff --git a/clang/include/clang/Sema/SemaOpenMP.h b/clang/include/clang/Sema/SemaOpenMP.h index aa61dae9415e2..7c793cf3077a6 100644 --- a/clang/include/clang/Sema/SemaOpenMP.h +++ b/clang/include/clang/Sema/SemaOpenMP.h @@ -940,6 +940,10 @@ class SemaOpenMP : public SemaBase { SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc); + /// Called on well-formed 'holds' clause. + OMPClause *ActOnOpenMPHoldsClause(Expr *E, SourceLocation StartLoc, +SourceLocation LParenLoc, +SourceLocation EndLoc); OMPClause *ActOnOpenMPSingleExprWithArgClause( OpenMPClauseKind Kind, ArrayRef Arguments, Expr *Expr, diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp index 042a5df5906ca..e83c81136c34b 100644 --- a/clang/lib/AST/OpenMPClause.cpp +++ b/clang/lib/AST/OpenMPClause.cpp @@ -1937,6 +1937,12 @@ void OMPClausePrinter::VisitOMPFailClause(OMPFailClause *Node) { } } +void OMPClausePrinter::VisitOMPHoldsClause(OMPHoldsClause *Node) { + OS << "holds("; + Node->getExpr()->printPretty(OS, nullptr, Policy, 0); + OS << ")"; +} + void OMPClausePrinter::VisitOMPSeqCstClause(OMPSeqCstClause *) { OS << "seq_cst"; } diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index f1e723b4242ee..97e4b3749f94c 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -584,6 +584,8 @@ void OMPClauseProfiler::VisitOMPCompareClause(const OMPCompareClause *) {} void OMPClauseProfiler::VisitOMPFailClause(const OMPFailClause *) {} +void OMPClauseProfiler::VisitOMPHoldsClause(const OMPHoldsClause *) {} + void OMPClauseProfiler::VisitOMPSeqCstClause(const OMPSeqCstClause *) {} void OMPClauseProfiler::VisitOMPAcqRelClause(const OMPAcqRelClause *) {} diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp index e975e96c5c7e4..afcbc93696de2 100644 --- a/clang/lib/Parse/ParseOpenMP.cpp +++ b/clang/lib/Parse/ParseOpenMP.cpp @@ -3206,6
[clang] Surface error for plain return statement in coroutine earlier (PR #100985)
https://github.com/ilya-biryukov approved this pull request. Thanks! The changes LG, I'll wait until premerge checks finish and merge it into mainline. https://github.com/llvm/llvm-project/pull/100985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Surface error for plain return statement in coroutine earlier (PR #100985)
@@ -694,6 +707,9 @@ bool Sema::ActOnCoroutineBodyStart(Scope *SC, SourceLocation KWLoc, auto *ScopeInfo = getCurFunction(); assert(ScopeInfo->CoroutinePromise); + if (ScopeInfo->FirstCoroutineStmtLoc == KWLoc) ivanaivanovska wrote: Done. https://github.com/llvm/llvm-project/pull/100985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] Surface error for plain return statement in coroutine earlier (PR #100985)
@@ -684,6 +684,19 @@ bool Sema::checkFinalSuspendNoThrow(const Stmt *FinalSuspend) { return ThrowingDecls.empty(); } +// [stmt.return.coroutine]p1: +// A coroutine shall not enclose a return statement ([stmt.return]). +static void checkReturnStmtInCoroutine(Sema , FunctionScopeInfo *FSI) { + assert (!FSI && "FunctionScopeInfo is null"); ivanaivanovska wrote: Right. No, assertions were off, so I missed it. I fixed that now. Thanks. https://github.com/llvm/llvm-project/pull/100985 _______ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm-branch-commits] [clang] Backport "[analyzer] Restore recognition of mutex methods" (PR #101651)
https://github.com/Xazax-hun approved this pull request. LGTM, makes sense to backport. https://github.com/llvm/llvm-project/pull/101651 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[clang] Surface error for plain return statement in coroutine earlier (PR #100985)
+20 -fsyntax-only %s -fcxx-exceptions -fexceptions -Wunused-result 2>&1 | FileCheck %s void no_coroutine_traits_bad_arg_await() { @@ -339,18 +341,20 @@ Handle mixed_return_value() { co_await a; // expected-note {{function is a coroutine due to use of 'co_await' here}} return 0; // expected-error {{return statement not allowed in coroutine}} // expected-error@-1 {{no viable conversion from returned value of type}} + // Check that we first show that return is not allowed in coroutine. + // The error about bad conversion is most likely spurious so we prefer to have it afterwards. // CHECK-NOT: error: no viable conversion from returned value of type // CHECK: error: return statement not allowed in coroutine // CHECK: error: no viable conversion from returned value of type } Handle mixed_return_value_return_first(bool b) { - if (b) { -return 0; // expected-error {{no viable conversion from returned value of type}} -// expected-error@-1 {{return statement not allowed in coroutine}} -} -co_await a; // expected-note {{function is a coroutine due to use of 'co_await' here}} -co_return 0; // expected-error {{no member named 'return_value' in 'promise_handle'}} + if (b) { +return 0; // expected-error {{no viable conversion from returned value of type}} +// expected-error@-1 {{return statement not allowed in coroutine}} + } + co_await a; // expected-note {{function is a coroutine due to use of 'co_await' here}} + co_return 0; // expected-error {{no member named 'return_value' in 'promise_handle'}} } Handle mixed_multiple_returns(bool b) { @@ -359,6 +363,7 @@ Handle mixed_multiple_returns(bool b) { // expected-error@-1 {{return statement not allowed in coroutine}} } co_await a; // expected-note {{function is a coroutine due to use of 'co_await' here}} + // The error 'return statement not allowed in coroutine' should appear only once. return 0; // expected-error {{no viable conversion from returned value of type}} } >From 110540307d4487e081a147209e063d6f480eabfb Mon Sep 17 00:00:00 2001 From: Ivana Ivanovska Date: Fri, 2 Aug 2024 11:13:08 + Subject: [PATCH 4/4] Fixed assert, added comment, fixed formatting. --- clang/lib/Sema/SemaCoroutine.cpp | 7 --- clang/lib/Sema/SemaStmt.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp index e379987556f07..68ad6e3fd6414 100644 --- a/clang/lib/Sema/SemaCoroutine.cpp +++ b/clang/lib/Sema/SemaCoroutine.cpp @@ -687,14 +687,14 @@ bool Sema::checkFinalSuspendNoThrow(const Stmt *FinalSuspend) { // [stmt.return.coroutine]p1: // A coroutine shall not enclose a return statement ([stmt.return]). static void checkReturnStmtInCoroutine(Sema , FunctionScopeInfo *FSI) { - assert (!FSI && "FunctionScopeInfo is null"); + assert(FSI && "FunctionScopeInfo is null"); assert(FSI->FirstCoroutineStmtLoc.isValid() && -"first coroutine location not set"); + "first coroutine location not set"); if (FSI->FirstReturnLoc.isInvalid()) return; S.Diag(FSI->FirstReturnLoc, diag::err_return_in_coroutine); S.Diag(FSI->FirstCoroutineStmtLoc, diag::note_declared_coroutine_here) - << FSI->getFirstCoroutineStmtKeyword(); + << FSI->getFirstCoroutineStmtKeyword(); } bool Sema::ActOnCoroutineBodyStart(Scope *SC, SourceLocation KWLoc, @@ -707,6 +707,7 @@ bool Sema::ActOnCoroutineBodyStart(Scope *SC, SourceLocation KWLoc, auto *ScopeInfo = getCurFunction(); assert(ScopeInfo->CoroutinePromise); + // Avoid duplicate errors, report only on first keyword. if (ScopeInfo->FirstCoroutineStmtLoc == KWLoc) checkReturnStmtInCoroutine(*this, ScopeInfo); diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 7d4fcfbe321f4..d283eaa511011 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -3751,10 +3751,10 @@ Sema::ActOnReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp, FunctionScopeInfo *FSI = getCurFunction(); if (FSI->FirstReturnLoc.isInvalid() && FSI->isCoroutine()) { assert(FSI->FirstCoroutineStmtLoc.isValid() && - "first coroutine location not set"); + "first coroutine location not set"); Diag(ReturnLoc, diag::err_return_in_coroutine); Diag(FSI->FirstCoroutineStmtLoc, diag::note_declared_coroutine_here) -<< FSI->getFirstCoroutineStmtKeyword(); +<< FSI->getFirstCoroutineStmtKeyword(); } StmtResult R = ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][Static analyzer] fix crash on using `bitcast(, )` as array subscript (PR #101647)
@@ -30,3 +30,10 @@ void f3(void *dest) { void *src = __builtin_alloca(5); memcpy(dest, src, 1); // expected-warning{{2nd function call argument is a pointer to uninitialized value}} } + +// Reproduce crash from GH#94496. When array is used as subcript to another array, CSA cannot model it +// and should just assume it's unknown and do not crash. +void f4(char *array) { + char b[4] = {0}; + array[__builtin_bit_cast(int, b)] = 0x10; // no crash pskrgag wrote: Also `clang_analyzer_dump_int(__builtin_bit_cast(int, b));` ends up with `lazyCompoundVal{0x18602338,b}` . I guess, you meant `clang_analyzer_dump_int(array[__builtin_bit_cast(int, b)]);` ? https://github.com/llvm/llvm-project/pull/101647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm-branch-commits] [llvm] [AMDGPU][SILoadStoreOptimizer] Include constrained buffer load variants (PR #101619)
@@ -1696,38 +1734,51 @@ unsigned SILoadStoreOptimizer::getNewOpcode(const CombineInfo , case UNKNOWN: llvm_unreachable("Unknown instruction class"); - case S_BUFFER_LOAD_IMM: + case S_BUFFER_LOAD_IMM: { +const MachineMemOperand *MMO = *CI.I->memoperands_begin(); arsenm wrote: Avoid assuming there is an MMO, the verifier does not enforce this https://github.com/llvm/llvm-project/pull/101619 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AMDGPU][SILoadStoreOptimizer] Include constrained buffer load variants (PR #101619)
@@ -1679,6 +1711,12 @@ MachineBasicBlock::iterator SILoadStoreOptimizer::mergeFlatStorePair( return New; } +static bool needsConstraintedOpcode(const GCNSubtarget , arsenm wrote: Typo needsConstraintedOpcode https://github.com/llvm/llvm-project/pull/101619 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[clang] [clang][Static analyzer] fix crash on using `bitcast(, )` as array subscript (PR #101647)
@@ -30,3 +30,10 @@ void f3(void *dest) { void *src = __builtin_alloca(5); memcpy(dest, src, 1); // expected-warning{{2nd function call argument is a pointer to uninitialized value}} } + +// Reproduce crash from GH#94496. When array is used as subcript to another array, CSA cannot model it +// and should just assume it's unknown and do not crash. +void f4(char *array) { + char b[4] = {0}; + array[__builtin_bit_cast(int, b)] = 0x10; // no crash pskrgag wrote: Indeed, I forgot about the that! Also added static_assert to make error a bit more understandable just in case smth gets broken. Thank you, fixed! https://github.com/llvm/llvm-project/pull/101647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][Static analyzer] fix crash on using `bitcast(, )` as array subscript (PR #101647)
https://github.com/pskrgag updated https://github.com/llvm/llvm-project/pull/101647 >From d94748f76ca793bf40cb57dd904d487c51bdcd40 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 2 Aug 2024 12:02:11 +0300 Subject: [PATCH 1/3] clang/csa: fix crash on using bitcast(, ) as array subscript --- clang/lib/StaticAnalyzer/Core/Store.cpp | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/clang/lib/StaticAnalyzer/Core/Store.cpp b/clang/lib/StaticAnalyzer/Core/Store.cpp index 67ca61bb56ba2..72587ef31a17c 100644 --- a/clang/lib/StaticAnalyzer/Core/Store.cpp +++ b/clang/lib/StaticAnalyzer/Core/Store.cpp @@ -472,7 +472,19 @@ SVal StoreManager::getLValueElement(QualType elementType, NonLoc Offset, const auto *ElemR = dyn_cast(BaseRegion); // Convert the offset to the appropriate size and signedness. - Offset = svalBuilder.convertToArrayIndex(Offset).castAs(); + auto Off = svalBuilder.convertToArrayIndex(Offset).getAs(); + if (!Off) { +// Handle cases when LazyCompoundVal is used for an array index. +// Such case is possible if code does: +// +// char b[4]; +// a[__builtin_bitcast(int, b)]; +// +// Return UnknownVal, since we cannot model it. +return UnknownVal(); + } + + Offset = Off.value(); if (!ElemR) { // If the base region is not an ElementRegion, create one. >From 515520dde7eb4d0365b0eed4627b19d4dedde5d7 Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 2 Aug 2024 12:14:11 +0300 Subject: [PATCH 2/3] clang/csa: add test case for array[bitcast(, )] --- clang/test/Analysis/exercise-ps.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/clang/test/Analysis/exercise-ps.c b/clang/test/Analysis/exercise-ps.c index d1e1771afddb5..9bba16c282967 100644 --- a/clang/test/Analysis/exercise-ps.c +++ b/clang/test/Analysis/exercise-ps.c @@ -30,3 +30,10 @@ void f3(void *dest) { void *src = __builtin_alloca(5); memcpy(dest, src, 1); // expected-warning{{2nd function call argument is a pointer to uninitialized value}} } + +// Reproduce crash from GH#94496. When array is used as subcript to another array, CSA cannot model it +// and should just assume it's unknown and do not crash. +void f4(char *array) { + char b[4] = {0}; + array[__builtin_bit_cast(int, b)] = 0x10; // no crash +} >From 514d89e411285451625a4adad55eedea0e850cdc Mon Sep 17 00:00:00 2001 From: Pavel Skripkin Date: Fri, 2 Aug 2024 13:56:10 +0300 Subject: [PATCH 3/3] clang/csa: pin triple with sizeof(int) == 4 in exercise-ps and fix style --- clang/lib/StaticAnalyzer/Core/Store.cpp | 2 -- clang/test/Analysis/exercise-ps.c | 8 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/clang/lib/StaticAnalyzer/Core/Store.cpp b/clang/lib/StaticAnalyzer/Core/Store.cpp index 72587ef31a17c..b436dd746d21f 100644 --- a/clang/lib/StaticAnalyzer/Core/Store.cpp +++ b/clang/lib/StaticAnalyzer/Core/Store.cpp @@ -476,10 +476,8 @@ SVal StoreManager::getLValueElement(QualType elementType, NonLoc Offset, if (!Off) { // Handle cases when LazyCompoundVal is used for an array index. // Such case is possible if code does: -// // char b[4]; // a[__builtin_bitcast(int, b)]; -// // Return UnknownVal, since we cannot model it. return UnknownVal(); } diff --git a/clang/test/Analysis/exercise-ps.c b/clang/test/Analysis/exercise-ps.c index 9bba16c282967..4b483b1a88a2f 100644 --- a/clang/test/Analysis/exercise-ps.c +++ b/clang/test/Analysis/exercise-ps.c @@ -1,5 +1,6 @@ -// RUN: %clang_analyze_cc1 %s -verify -Wno-error=implicit-function-declaration \ -// RUN: -analyzer-checker=core,unix.Malloc \ +// RUN: %clang_analyze_cc1 %s -triple=x86_64-unknown-linux \ +// RUN: -verify -Wno-error=implicit-function-declaration \ +// RUN: -analyzer-checker=core,unix.Malloc,debug.ExprInspection \ // RUN: -analyzer-config core.CallAndMessage:ArgPointeeInitializedness=true // // Just exercise the analyzer on code that has at one point caused issues @@ -35,5 +36,8 @@ void f3(void *dest) { // and should just assume it's unknown and do not crash. void f4(char *array) { char b[4] = {0}; + + _Static_assert(sizeof(int) == 4, "Wrong triple for the test"); + array[__builtin_bit_cast(int, b)] = 0x10; // no crash } _______ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][ExprConst] allow single element access of vector object to be constant expression (PR #101126)
of array of 2 elements}} + +// make sure clang rejects taking address of a vector element +static_assert([0]); // expected-error {{address of vector element requested}} + } namespace ExtVector { @@ -19,11 +33,14 @@ static_assert(b[0] == 1 && b[1] == 2 && b[2] == 3 && b[3] == 4); static_assert(b.s0 == 1 && b.s1 == 2 && b.s2 == 3 && b.s3 == 4); static_assert(b.x == 1 && b.y == 2 && b.z == 3 && b.w == 4); static_assert(b.r == 1 && b.g == 2 && b.b == 3 && b.a == 4); -static_assert(b[5]); // expected-error {{not an integral constant expression}} expected-note {{read of dereferenced one-past-the-end pointer}} +static_assert(b[5]); // expected-error {{not an integral constant expression}} expected-note {{cannot refer to element 5 of array of 4 elements}} // FIXME: support selecting multiple elements static_assert(b.lo.lo == 1); // expected-error {{not an integral constant expression}} // static_assert(b.lo.lo==1 && b.lo.hi==2 && b.hi.lo == 3 && b.hi.hi == 4); // static_assert(b.odd[0]==1 && b.odd[1]==2 && b.even[0] == 3 && b.even[1] == 4); +// make sure clang rejects taking address of a vector element +static_assert([1]); // expected-error {{address of vector element requested}} + } ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [analyzer] Restore recognition of mutex methods (PR #101511)
=?utf-8?q?Don=C3=A1t?= Nagy Message-ID: In-Reply-To: steakhal wrote: Backport PR in https://github.com/llvm/llvm-project/pull/101651 https://github.com/llvm/llvm-project/pull/101511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm-branch-commits] [clang] Backport "[analyzer] Restore recognition of mutex methods" (PR #101651)
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Balazs Benics (steakhal) Changes Before commit 705788c the checker alpha.unix.BlockInCriticalSection "recognized" the methods `std::mutex::lock` and `std::mutex::unlock` with an extremely trivial check that accepted any function (or method) named lock/unlock. To avoid matching unrelated user-defined function, this was refined to a check that also requires the presence of "std" and "mutex" as distinct parts of the qualified name. However, as #99628 reported, there are standard library implementations where some methods of `std::mutex` are inherited from an implementation detail base class and the new code wasn't able to recognize these methods, which led to emitting false positive reports. As a workaround, this commit partially restores the old behavior by omitting the check for the class name. In the future, it would be good to replace this hack with a solution which ensures that `CallDescription` understands inherited methods. (cherry picked from commit 99ae2edc2592e602b0eb5a287f4d003aa3902440) --- Full diff: https://github.com/llvm/llvm-project/pull/101651.diff 2 Files Affected: - (modified) clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp (+12-4) - (added) clang/test/Analysis/block-in-critical-section-inheritance.cpp (+31) ``diff diff --git a/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp index 40f7e9cede1f1..4cd2f2802f30c 100644 --- a/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp @@ -147,10 +147,18 @@ using MutexDescriptor = class BlockInCriticalSectionChecker : public Checker { private: const std::array MutexDescriptors{ - MemberMutexDescriptor({/*MatchAs=*/CDM::CXXMethod, - /*QualifiedName=*/{"std", "mutex", "lock"}, - /*RequiredArgs=*/0}, -{CDM::CXXMethod, {"std", "mutex", "unlock"}, 0}), + // NOTE: There are standard library implementations where some methods + // of `std::mutex` are inherited from an implementation detail base + // class, and those aren't matched by the name specification {"std", + // "mutex", "lock"}. + // As a workaround here we omit the class name and only require the + // presence of the name parts "std" and "lock"/"unlock". + // TODO: Ensure that CallDescription understands inherited methods. + MemberMutexDescriptor( + {/*MatchAs=*/CDM::CXXMethod, + /*QualifiedName=*/{"std", /*"mutex",*/ "lock"}, + /*RequiredArgs=*/0}, + {CDM::CXXMethod, {"std", /*"mutex",*/ "unlock"}, 0}), FirstArgMutexDescriptor({CDM::CLibrary, {"pthread_mutex_lock"}, 1}, {CDM::CLibrary, {"pthread_mutex_unlock"}, 1}), FirstArgMutexDescriptor({CDM::CLibrary, {"mtx_lock"}, 1}, diff --git a/clang/test/Analysis/block-in-critical-section-inheritance.cpp b/clang/test/Analysis/block-in-critical-section-inheritance.cpp new file mode 100644 index 0..db20df8c60a5c --- /dev/null +++ b/clang/test/Analysis/block-in-critical-section-inheritance.cpp @@ -0,0 +1,31 @@ +// RUN: %clang_analyze_cc1 \ +// RUN: -analyzer-checker=unix.BlockInCriticalSection \ +// RUN: -std=c++11 \ +// RUN: -analyzer-output text \ +// RUN: -verify %s + +unsigned int sleep(unsigned int seconds) {return 0;} +namespace std { +// There are some standard library implementations where some mutex methods +// come from an implementation detail base class. We need to ensure that these +// are matched correctly. +class __mutex_base { +public: + void lock(); +}; +class mutex : public __mutex_base{ +public: + void unlock(); + bool try_lock(); +}; +} // namespace std + +void gh_99628() { + std::mutex m; + m.lock(); + // expected-note@-1 {{Entering critical section here}} + sleep(10); + // expected-warning@-1 {{Call to blocking function 'sleep' inside of critical section}} + // expected-note@-2 {{Call to blocking function 'sleep' inside of critical section}} + m.unlock(); +} `````` https://github.com/llvm/llvm-project/pull/101651 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] Backport "[analyzer] Restore recognition of mutex methods" (PR #101651)
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/101651 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] Backport "[analyzer] Restore recognition of mutex methods" (PR #101651)
ned int seconds) {return 0;} +namespace std { +// There are some standard library implementations where some mutex methods +// come from an implementation detail base class. We need to ensure that these +// are matched correctly. +class __mutex_base { +public: + void lock(); +}; +class mutex : public __mutex_base{ +public: + void unlock(); + bool try_lock(); +}; +} // namespace std + +void gh_99628() { + std::mutex m; + m.lock(); + // expected-note@-1 {{Entering critical section here}} + sleep(10); + // expected-warning@-1 {{Call to blocking function 'sleep' inside of critical section}} + // expected-note@-2 {{Call to blocking function 'sleep' inside of critical section}} + m.unlock(); +} ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] Backport "[analyzer] Restore recognition of mutex methods" (PR #101651)
https://github.com/steakhal milestoned https://github.com/llvm/llvm-project/pull/101651 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[clang] [analyzer] Restore recognition of mutex methods (PR #101511)
NagyDonat wrote: > Let's merge this, and backport it into clang-19. I'll deal with that. Thanks! https://github.com/llvm/llvm-project/pull/101511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang][Static analyzer] fix crash on using `bitcast(, )` as array subscript (PR #101647)
@@ -472,7 +472,19 @@ SVal StoreManager::getLValueElement(QualType elementType, NonLoc Offset, const auto *ElemR = dyn_cast(BaseRegion); // Convert the offset to the appropriate size and signedness. - Offset = svalBuilder.convertToArrayIndex(Offset).castAs(); + auto Off = svalBuilder.convertToArrayIndex(Offset).getAs(); pskrgag wrote: This does not work, since it is not possible to cast `UnknownVal` to `NoLoc` https://github.com/llvm/llvm-project/pull/101647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[jenkinsci/ssh-agent-plugin]
Branch: refs/heads/dependabot/maven/org.jenkins-ci.plugins-plugin-4.86 Home: https://github.com/jenkinsci/ssh-agent-plugin To unsubscribe from these emails, change your notification settings at https://github.com/jenkinsci/ssh-agent-plugin/settings/notifications -- You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/ssh-agent-plugin/push/refs/heads/dependabot/maven/org.jenkins-ci.plugins-plugin-4.86/141f81-00%40github.com.
[jenkinsci/ssh-agent-plugin] 141f81: Bump org.jenkins-ci.plugins:plugin from 4.85 to 4.86
Branch: refs/heads/master Home: https://github.com/jenkinsci/ssh-agent-plugin Commit: 141f81deb53225d1166a520c02deef9af68988be https://github.com/jenkinsci/ssh-agent-plugin/commit/141f81deb53225d1166a520c02deef9af68988be Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: 2024-08-01 (Thu, 01 Aug 2024) Changed paths: M pom.xml Log Message: --- Bump org.jenkins-ci.plugins:plugin from 4.85 to 4.86 Bumps [org.jenkins-ci.plugins:plugin](https://github.com/jenkinsci/plugin-pom) from 4.85 to 4.86. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-4.85...plugin-4.86) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Commit: cff23d0496edab14d2a975006c56226520a65df4 https://github.com/jenkinsci/ssh-agent-plugin/commit/cff23d0496edab14d2a975006c56226520a65df4 Author: Jesse Glick Date: 2024-08-02 (Fri, 02 Aug 2024) Changed paths: M pom.xml Log Message: --- Merge pull request #154 from jenkinsci/dependabot/maven/org.jenkins-ci.plugins-plugin-4.86 Bump org.jenkins-ci.plugins:plugin from 4.85 to 4.86 Compare: https://github.com/jenkinsci/ssh-agent-plugin/compare/ba986f80ba2c...cff23d0496ed To unsubscribe from these emails, change your notification settings at https://github.com/jenkinsci/ssh-agent-plugin/settings/notifications -- You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/ssh-agent-plugin/push/refs/heads/master/ba986f-cff23d%40github.com.
[clang] [NFC][Clang] Remove unused arg (PR #101650)
https://github.com/chestnykh updated https://github.com/llvm/llvm-project/pull/101650 >From 0f724e3aacde40f5d3d06c3e1082667dec36656b Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Fri, 2 Aug 2024 13:44:00 +0300 Subject: [PATCH 1/2] [NFC][Clang] Remove unused arg BuiltinID is not used inside `CheckBuiltinTargetInSupported` --- clang/lib/Sema/SemaChecking.cpp | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index bb30b1e289a1c..eb816816d2d07 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -1862,7 +1862,7 @@ static bool CheckBuiltinTargetNotInUnsupported( // Emit an error and return true if the current architecture is not in the list // of supported architectures. static bool -CheckBuiltinTargetInSupported(Sema , unsigned BuiltinID, CallExpr *TheCall, +CheckBuiltinTargetInSupported(Sema , CallExpr *TheCall, ArrayRef SupportedArchs) { llvm::Triple::ArchType CurArch = S.getASTContext().getTargetInfo().getTriple().getArch(); @@ -2095,6 +2095,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, } FPOptions FPO; + switch (BuiltinID) { case Builtin::BI__builtin_cpu_supports: case Builtin::BI__builtin_cpu_is: @@ -2151,7 +2152,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, case Builtin::BI_interlockedbittestandreset_rel: case Builtin::BI_interlockedbittestandreset_nf: if (CheckBuiltinTargetInSupported( -*this, BuiltinID, TheCall, +*this, TheCall, {llvm::Triple::arm, llvm::Triple::thumb, llvm::Triple::aarch64})) return ExprError(); break; @@ -2164,7 +2165,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, case Builtin::BI_interlockedbittestandreset64: case Builtin::BI_interlockedbittestandset64: if (CheckBuiltinTargetInSupported( -*this, BuiltinID, TheCall, +*this, TheCall, {llvm::Triple::x86_64, llvm::Triple::arm, llvm::Triple::thumb, llvm::Triple::aarch64, llvm::Triple::amdgcn})) return ExprError(); @@ -2172,7 +2173,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, case Builtin::BI__builtin_set_flt_rounds: if (CheckBuiltinTargetInSupported( -*this, BuiltinID, TheCall, +*this, TheCall, {llvm::Triple::x86, llvm::Triple::x86_64, llvm::Triple::arm, llvm::Triple::thumb, llvm::Triple::aarch64, llvm::Triple::amdgcn})) return ExprError(); >From 00158bc570838cff376af2794fb7fff07a4f31f6 Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Fri, 2 Aug 2024 13:47:24 +0300 Subject: [PATCH 2/2] [clang] Remove unneeded newline --- clang/lib/Sema/SemaChecking.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index eb816816d2d07..ed0eea9763b2a 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -2095,7 +2095,6 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, } FPOptions FPO; - switch (BuiltinID) { case Builtin::BI__builtin_cpu_supports: case Builtin::BI__builtin_cpu_is: ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [NFC][Clang] Remove unused arg (PR #101650)
llvmbot wrote: @llvm/pr-subscribers-clang Author: Dmitry Chestnykh (chestnykh) Changes `BuiltinID` is not used inside `CheckBuiltinTargetInSupported` --- Full diff: https://github.com/llvm/llvm-project/pull/101650.diff 1 Files Affected: - (modified) clang/lib/Sema/SemaChecking.cpp (+5-4) ``diff diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index bb30b1e289a1c..eb816816d2d07 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -1862,7 +1862,7 @@ static bool CheckBuiltinTargetNotInUnsupported( // Emit an error and return true if the current architecture is not in the list // of supported architectures. static bool -CheckBuiltinTargetInSupported(Sema , unsigned BuiltinID, CallExpr *TheCall, +CheckBuiltinTargetInSupported(Sema , CallExpr *TheCall, ArrayRef SupportedArchs) { llvm::Triple::ArchType CurArch = S.getASTContext().getTargetInfo().getTriple().getArch(); @@ -2095,6 +2095,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, } FPOptions FPO; + switch (BuiltinID) { case Builtin::BI__builtin_cpu_supports: case Builtin::BI__builtin_cpu_is: @@ -2151,7 +2152,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, case Builtin::BI_interlockedbittestandreset_rel: case Builtin::BI_interlockedbittestandreset_nf: if (CheckBuiltinTargetInSupported( -*this, BuiltinID, TheCall, +*this, TheCall, {llvm::Triple::arm, llvm::Triple::thumb, llvm::Triple::aarch64})) return ExprError(); break; @@ -2164,7 +2165,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, case Builtin::BI_interlockedbittestandreset64: case Builtin::BI_interlockedbittestandset64: if (CheckBuiltinTargetInSupported( -*this, BuiltinID, TheCall, +*this, TheCall, {llvm::Triple::x86_64, llvm::Triple::arm, llvm::Triple::thumb, llvm::Triple::aarch64, llvm::Triple::amdgcn})) return ExprError(); @@ -2172,7 +2173,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, case Builtin::BI__builtin_set_flt_rounds: if (CheckBuiltinTargetInSupported( -*this, BuiltinID, TheCall, +*this, TheCall, {llvm::Triple::x86, llvm::Triple::x86_64, llvm::Triple::arm, llvm::Triple::thumb, llvm::Triple::aarch64, llvm::Triple::amdgcn})) return ExprError(); `` https://github.com/llvm/llvm-project/pull/101650 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits