Skip to content

Commit

Permalink
Merge branch 'main' into intrinsics/clip
Browse files Browse the repository at this point in the history
  • Loading branch information
joaosaffran authored and joaosaffran-zz committed Nov 6, 2024
2 parents 20587a9 + a6637ae commit 834ebff
Show file tree
Hide file tree
Showing 2,849 changed files with 88,053 additions and 43,140 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/libcxx-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ env:
jobs:
stage1:
if: github.repository_owner == 'llvm'
runs-on: libcxx-runners-8-set
runs-on: libcxx-runners-set
container: ghcr.io/libcxx/actions-builder:testing-2024-09-21
continue-on-error: false
strategy:
fail-fast: false
Expand Down Expand Up @@ -85,7 +86,8 @@ jobs:
**/crash_diagnostics/*
stage2:
if: github.repository_owner == 'llvm'
runs-on: libcxx-runners-8-set
runs-on: libcxx-runners-set
container: ghcr.io/libcxx/actions-builder:testing-2024-09-21
needs: [ stage1 ]
continue-on-error: false
strategy:
Expand Down Expand Up @@ -162,20 +164,21 @@ jobs:
'benchmarks',
'bootstrapping-build'
]
machine: [ 'libcxx-runners-8-set' ]
machine: [ 'libcxx-runners-set' ]
include:
- config: 'generic-cxx26'
machine: libcxx-runners-8-set
machine: libcxx-runners-set
- config: 'generic-asan'
machine: libcxx-runners-8-set
machine: libcxx-runners-set
- config: 'generic-tsan'
machine: libcxx-runners-8-set
machine: libcxx-runners-set
- config: 'generic-ubsan'
machine: libcxx-runners-8-set
machine: libcxx-runners-set
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
- config: 'generic-msan'
machine: libcxx-runners-8-set
machine: libcxx-runners-set
runs-on: ${{ matrix.machine }}
container: ghcr.io/libcxx/actions-builder:testing-2024-09-21
steps:
- uses: actions/checkout@v4
- name: ${{ matrix.config }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ InMemorySymbolIndex::InMemorySymbolIndex(

std::vector<SymbolAndSignals>
InMemorySymbolIndex::search(llvm::StringRef Identifier) {
auto I = LookupTable.find(std::string(Identifier));
auto I = LookupTable.find(Identifier);
if (I != LookupTable.end())
return I->second;
return {};
Expand Down
3 changes: 2 additions & 1 deletion clang-tools-extra/clang-include-fixer/InMemorySymbolIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class InMemorySymbolIndex : public SymbolIndex {
search(llvm::StringRef Identifier) override;

private:
std::map<std::string, std::vector<find_all_symbols::SymbolAndSignals>>
std::map<std::string, std::vector<find_all_symbols::SymbolAndSignals>,
std::less<>>
LookupTable;
};

Expand Down
38 changes: 34 additions & 4 deletions clang-tools-extra/clang-query/Query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ bool HelpQuery::run(llvm::raw_ostream &OS, QuerySession &QS) const {
" set bind-root (true|false) "
"Set whether to bind the root matcher to \"root\".\n"
" set print-matcher (true|false) "
"Set whether to print the current matcher,\n"
"Set whether to print the current matcher.\n"
" set enable-profile (true|false) "
"Set whether to enable matcher profiling.\n"
" set traversal <kind> "
"Set traversal kind of clang-query session. Available kinds are:\n"
" AsIs "
Expand Down Expand Up @@ -82,27 +84,53 @@ namespace {

struct CollectBoundNodes : MatchFinder::MatchCallback {
std::vector<BoundNodes> &Bindings;
CollectBoundNodes(std::vector<BoundNodes> &Bindings) : Bindings(Bindings) {}
StringRef Unit;
CollectBoundNodes(std::vector<BoundNodes> &Bindings, StringRef Unit)
: Bindings(Bindings), Unit(Unit) {}
void run(const MatchFinder::MatchResult &Result) override {
Bindings.push_back(Result.Nodes);
}
StringRef getID() const override { return Unit; }
};

struct QueryProfiler {
llvm::StringMap<llvm::TimeRecord> Records;

~QueryProfiler() {
llvm::TimerGroup TG("clang-query", "clang-query matcher profiling",
Records);
TG.print(llvm::errs());
llvm::errs().flush();
}
};

} // namespace

bool MatchQuery::run(llvm::raw_ostream &OS, QuerySession &QS) const {
unsigned MatchCount = 0;

std::optional<QueryProfiler> Profiler;
if (QS.EnableProfile)
Profiler.emplace();

for (auto &AST : QS.ASTs) {
MatchFinder Finder;
ast_matchers::MatchFinder::MatchFinderOptions FinderOptions;
std::optional<llvm::StringMap<llvm::TimeRecord>> Records;
if (QS.EnableProfile) {
Records.emplace();
FinderOptions.CheckProfiling.emplace(*Records);
}

MatchFinder Finder(FinderOptions);
std::vector<BoundNodes> Matches;
DynTypedMatcher MaybeBoundMatcher = Matcher;
if (QS.BindRoot) {
std::optional<DynTypedMatcher> M = Matcher.tryBind("root");
if (M)
MaybeBoundMatcher = *M;
}
CollectBoundNodes Collect(Matches);
StringRef OrigSrcName = AST->getOriginalSourceFileName();
CollectBoundNodes Collect(Matches, OrigSrcName);
if (!Finder.addDynamicMatcher(MaybeBoundMatcher, &Collect)) {
OS << "Not a valid top-level matcher.\n";
return false;
Expand All @@ -111,6 +139,8 @@ bool MatchQuery::run(llvm::raw_ostream &OS, QuerySession &QS) const {
ASTContext &Ctx = AST->getASTContext();
Ctx.getParentMapContext().setTraversalKind(QS.TK);
Finder.matchAST(Ctx);
if (QS.EnableProfile)
Profiler->Records[OrigSrcName] += (*Records)[OrigSrcName];

if (QS.PrintMatcher) {
SmallVector<StringRef, 4> Lines;
Expand Down
5 changes: 5 additions & 0 deletions clang-tools-extra/clang-query/QueryParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ enum ParsedQueryVariable {
PQV_Output,
PQV_BindRoot,
PQV_PrintMatcher,
PQV_EnableProfile,
PQV_Traversal
};

Expand Down Expand Up @@ -285,6 +286,7 @@ QueryRef QueryParser::doParse() {
.Case("output", PQV_Output)
.Case("bind-root", PQV_BindRoot)
.Case("print-matcher", PQV_PrintMatcher)
.Case("enable-profile", PQV_EnableProfile)
.Case("traversal", PQV_Traversal)
.Default(PQV_Invalid);
if (VarStr.empty())
Expand All @@ -303,6 +305,9 @@ QueryRef QueryParser::doParse() {
case PQV_PrintMatcher:
Q = parseSetBool(&QuerySession::PrintMatcher);
break;
case PQV_EnableProfile:
Q = parseSetBool(&QuerySession::EnableProfile);
break;
case PQV_Traversal:
Q = parseSetTraversalKind(&QuerySession::TK);
break;
Expand Down
3 changes: 2 additions & 1 deletion clang-tools-extra/clang-query/QuerySession.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class QuerySession {
QuerySession(llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs)
: ASTs(ASTs), PrintOutput(false), DiagOutput(true),
DetailedASTOutput(false), BindRoot(true), PrintMatcher(false),
Terminate(false), TK(TK_AsIs) {}
EnableProfile(false), Terminate(false), TK(TK_AsIs) {}

llvm::ArrayRef<std::unique_ptr<ASTUnit>> ASTs;

Expand All @@ -36,6 +36,7 @@ class QuerySession {

bool BindRoot;
bool PrintMatcher;
bool EnableProfile;
bool Terminate;

TraversalKind TK;
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ std::optional<DurationScale> getScaleForDurationInverse(llvm::StringRef Name) {
{"ToDoubleNanoseconds", DurationScale::Nanoseconds},
{"ToInt64Nanoseconds", DurationScale::Nanoseconds}});

auto ScaleIter = ScaleMap.find(std::string(Name));
auto ScaleIter = ScaleMap.find(Name);
if (ScaleIter == ScaleMap.end())
return std::nullopt;

Expand All @@ -260,7 +260,7 @@ std::optional<DurationScale> getScaleForTimeInverse(llvm::StringRef Name) {
{"ToUnixMicros", DurationScale::Microseconds},
{"ToUnixNanos", DurationScale::Nanoseconds}});

auto ScaleIter = ScaleMap.find(std::string(Name));
auto ScaleIter = ScaleMap.find(Name);
if (ScaleIter == ScaleMap.end())
return std::nullopt;

Expand Down
10 changes: 10 additions & 0 deletions clang-tools-extra/clangd/Protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,16 @@ bool fromJSON(const llvm::json::Value &Params, ClientCapabilities &R,
P.field("offsetEncoding")))
return false;
}

if (auto *Experimental = O->getObject("experimental")) {
if (auto *TextDocument = Experimental->getObject("textDocument")) {
if (auto *Completion = TextDocument->getObject("completion")) {
if (auto EditsNearCursor = Completion->getBoolean("editsNearCursor"))
R.CompletionFixes |= *EditsNearCursor;
}
}
}

return true;
}

Expand Down
8 changes: 4 additions & 4 deletions clang-tools-extra/clangd/TidyProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DotClangTidyCache : private FileCache {
[this](std::optional<llvm::StringRef> Data) {
Value.reset();
if (Data && !Data->empty()) {
tidy::DiagCallback Diagnostics = [](const llvm::SMDiagnostic &D) {
auto Diagnostics = [](const llvm::SMDiagnostic &D) {
switch (D.getKind()) {
case llvm::SourceMgr::DK_Error:
elog("tidy-config error at {0}:{1}:{2}: {3}", D.getFilename(),
Expand Down Expand Up @@ -149,7 +149,7 @@ static void mergeCheckList(std::optional<std::string> &Checks,
*Checks = llvm::join_items(",", *Checks, List);
}

TidyProviderRef provideEnvironment() {
TidyProvider provideEnvironment() {
static const std::optional<std::string> User = [] {
std::optional<std::string> Ret = llvm::sys::Process::GetEnv("USER");
#ifdef _WIN32
Expand All @@ -167,7 +167,7 @@ TidyProviderRef provideEnvironment() {
return [](tidy::ClangTidyOptions &, llvm::StringRef) {};
}

TidyProviderRef provideDefaultChecks() {
TidyProvider provideDefaultChecks() {
// These default checks are chosen for:
// - low false-positive rate
// - providing a lot of value
Expand Down Expand Up @@ -251,7 +251,7 @@ TidyProvider disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks) {
};
}

TidyProviderRef provideClangdConfig() {
TidyProvider provideClangdConfig() {
return [](tidy::ClangTidyOptions &Opts, llvm::StringRef) {
const auto &CurTidyConfig = Config::current().Diagnostics.ClangTidy;
if (!CurTidyConfig.Checks.empty())
Expand Down
6 changes: 3 additions & 3 deletions clang-tools-extra/clangd/TidyProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ using TidyProviderRef = llvm::function_ref<void(tidy::ClangTidyOptions &,
TidyProvider combine(std::vector<TidyProvider> Providers);

/// Provider that just sets the defaults.
TidyProviderRef provideEnvironment();
TidyProvider provideEnvironment();

/// Provider that will enable a nice set of default checks if none are
/// specified.
TidyProviderRef provideDefaultChecks();
TidyProvider provideDefaultChecks();

/// Provider the enables a specific set of checks and warnings as errors.
TidyProvider addTidyChecks(llvm::StringRef Checks,
Expand All @@ -51,7 +51,7 @@ disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks = {});
TidyProvider provideClangTidyFiles(ThreadsafeFS &);

// Provider that uses clangd configuration files.
TidyProviderRef provideClangdConfig();
TidyProvider provideClangdConfig();

tidy::ClangTidyOptions getTidyOptionsForFile(TidyProviderRef Provider,
llvm::StringRef Filename);
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Improvements to clang-doc
Improvements to clang-query
---------------------------

The improvements are...
- Added `set enable-profile true/false` command for basic matcher profiling.

Improvements to clang-tidy
--------------------------
Expand Down
39 changes: 39 additions & 0 deletions clang/Maintainers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ Sema
| Sirraide
| aeternalmail\@gmail.com (email), Sirraide (GitHub), Ætérnal (Discord), Sirraide (Discourse)
| Mariya Podchishchaeva
| mariya.podchishchaeva\@intel.com (email), Fznamznon (GitHub), fznamznon (Discord), Fznamznon (Discourse)

Recovery AST
~~~~~~~~~~~~
| Haojian Wu
| hokein.wu\@gmail.com (email), hokein (Phabricator), hokein (GitHub), hokein (Discourse)

Experimental new constant interpreter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -132,6 +141,15 @@ Compiler options
| jan_svoboda\@apple.com (email), jansvoboda11 (Phabricator), jansvoboda11 (GitHub)

API Notes
~~~~~~~~~~~~~~~~
| Egor Zhdan
| e_zhdan\@apple.com (email), egorzhdan (GitHub), egor.zhdan (Discourse)
| Saleem Abdulrasool
| compnerd\@compnerd.org (email), compnerd (GitHub), compnerd (Discourse)

OpenBSD driver
~~~~~~~~~~~~~~
| Brad Smith
Expand All @@ -144,6 +162,12 @@ Driver parts not covered by someone else
| i\@maskray.me (email), MaskRay (Phabricator), MaskRay (GitHub)

Constant Expressions
~~~~~~~~~~~~~~~~~~~~
| Mariya Podchishchaeva
| mariya.podchishchaeva\@intel.com (email), Fznamznon (GitHub), fznamznon (Discord), Fznamznon (Discourse)

Tools
-----
These maintainers are responsible for user-facing tools under the Clang
Expand Down Expand Up @@ -295,6 +319,21 @@ SYCL conformance
| alexey.bader\@intel.com (email), bader (Phabricator), bader (GitHub)

HLSL conformance
~~~~~~~~~~~~~~~~
| Chris Bieneman
| chris.bieneman\@gmail.com (email), llvm-beanz (GitHub), beanz (Discord), beanz (Discourse)

Issue Triage
~~~~~~~~~~~~
| Shafik Yaghmour
| shafik.yaghmour\@intel.com (email), shafik (GitHub), shafik.yaghmour (Discord), shafik (Discourse)
| hstk30
| hanwei62\@huawei.com (email), hstk30-hw (GitHub), hstk30(Discord), hstk30 (Discourse)

Inactive Maintainers
====================
The following people have graciously spent time performing maintainership
Expand Down
2 changes: 2 additions & 0 deletions clang/docs/OpenMPSupport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ implementation.
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
| memory management | alignment for allocate directive and clause | :good:`done` | D115683 |
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
| memory management | 'allocator' modifier for allocate clause | :good:`done` | https://github.com/llvm/llvm-project/pull/114883 |
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
| memory management | new memory management routines | :none:`unclaimed` | |
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
| memory management | changes to omp_alloctrait_key enum | :none:`unclaimed` | |
Expand Down
Loading

0 comments on commit 834ebff

Please sign in to comment.