SuccessChanges

Summary

  1. Remove math.h/cmath include from DataTypes.h (details)
  2. [WebAssembly] Handle event exports (details)
  3. [llvm][CodeGen] Avoid implicit cast of TypeSize to integer in `initActions`. (details)
  4. [ASTMatchers] Matchers that take enumerations args provide hints with invalid arguments (details)
  5. Fix mismatch from D77112 and D77499 (details)
  6. [clangd] Decouple preambleworker from astworker, NFCI (details)
  7. [clangd] Update TUStatus api to accommodate preamble thread (details)
  8. [clangd] Build ASTs only with fresh preambles or after building a new preamble (details)
  9. [gn build] Port 427c1dc4f42 (details)
  10. Delete a variable that's been unused since r313407. (details)
  11. [clangd] Fix bad include (details)
  12. [CodeGenObjC] Fix a crash when attempting to copy a zero-sized bit-field in a non-trivial C struct (details)
  13. AMDGPU: Remove dead paths for requiresUniformRegister (details)
  14. Minor typo improvements in documentation, NFC. (details)
  15. [libunwind] Support the new libc++ test format (details)
  16. [debugserver] Get rid of `else` after `return`. NFC. (details)
  17. Upstream Bionic definitions of ctype_base/regex. (details)
  18. [SelectionDAG] fix predecessor list for INLINEASM_BRs' parent (details)
  19. Make llvm_source_root in llvm-lit relative too. (details)
  20. [AsmPrinter] Do not define local aliases for global objects in a comdat (details)
  21. [gn build] (manually) port 6c1a9fb174ac3c (details)
Commit 3a29393b4709d15069130119cf1d136af4a92d77 by rnk
Remove math.h/cmath include from DataTypes.h

DataTypes.h is meant to wrap the integer type and limits headers, which
have some unfortunate variance. The FP math functions declared by math.h
are not unnecessary. math.h took a noticeable amount of time to parse
(~40ms), but that could be startup costs.

Anyway, we don't need to include it, so skipping it can't hurt.

This has been present since the initial CMake build was added in 2008.
The file was modifiedllvm/include/llvm-c/DataTypes.h
Commit c09acd5dd1472e73d5c33250ced5b9a805ea8f4a by aheejin
[WebAssembly] Handle event exports

Summary: This handles exports of events, which was missing.

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77566
The file was modifiedlld/test/wasm/event-section.ll
The file was modifiedlld/wasm/WriterUtils.cpp
Commit 53b7abdd238c89346e5516928af675e5ca973124 by francesco.petrogalli
[llvm][CodeGen] Avoid implicit cast of TypeSize to integer in `initActions`.

Reviewers: sdesmalen, efriedma

Reviewed By: efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77317
The file was modifiedllvm/lib/CodeGen/TargetLoweringBase.cpp
Commit 427c1dc4f4248ec71e32a8f3832a4e6258446672 by n.james93
[ASTMatchers] Matchers that take enumerations args provide hints with invalid arguments

Summary:
This adds support for giving hints when using dynamic matchers with enum args. Take this query, I couldn't figure out why the matcher wasn't working:
(Turns out it needed to be "IntegralToBoolean", but thats another bug itself)
```
clang-query> match implicitCastExpr(hasCastKind("CK_IntegralToBoolean"))
1:1: Error parsing argument 1 for matcher implicitCastExpr.
1:18: Error building matcher hasCastKind.
1:30: Incorrect type for arg 1. (Expected = string) != (Actual = String)
```
With this patch the new behaviour looks like this:
```
clang-query> match implicitCastExpr(hasCastKind("CK_IntegralToBoolean"))
1:1: Error parsing argument 1 for matcher implicitCastExpr.
1:18: Error building matcher hasCastKind.
1:30: Unknown value 'CK_IntegralToBoolean' for arg 1; did you mean 'IntegralToBoolean'
```

There are no test cases for this yet as there simply isn't any infrastructure for testing errors reported when parsing args that I can see.

Reviewers: klimek, jdoerfert, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: aaron.ballman, dexonsmith, mgorny, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77499
The file was modifiedclang/lib/ASTMatchers/Dynamic/Diagnostics.cpp
The file was modifiedclang/include/clang/ASTMatchers/Dynamic/Diagnostics.h
The file was addedclang/lib/ASTMatchers/Dynamic/Marshallers.cpp
The file was modifiedclang/lib/ASTMatchers/Dynamic/Marshallers.h
The file was modifiedclang/lib/ASTMatchers/Dynamic/CMakeLists.txt
The file was modifiedclang/unittests/ASTMatchers/Dynamic/ParserTest.cpp
Commit a473f0a36c3f4117d8e77d3d8636303ff2f99d09 by n.james93
Fix mismatch from D77112 and D77499
The file was modifiedclang/lib/ASTMatchers/Dynamic/Marshallers.cpp
Commit 276a95bdf27c887a0a8c6c703db1fd2f8da27a03 by kadircet
[clangd] Decouple preambleworker from astworker, NFCI

Summary:
First step to enable deferred preamble builds. Not intending to land it
alone, will have follow-ups that will implement full deferred build
functionality and will land after all of them are ready.

Reviewers: sammccall

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D76125
The file was modifiedclang-tools-extra/clangd/TUScheduler.cpp
The file was modifiedclang-tools-extra/clangd/Preamble.cpp
The file was modifiedclang-tools-extra/clangd/Preamble.h
Commit 6b85032c95bee2e15ce7f239316de4d11e6ca08b by kadircet
[clangd] Update TUStatus api to accommodate preamble thread

Summary:
TUStatus api had a single thread in mind. This introudces a section
action to represent state of the preamble thread. In the file status extension,
we keep old behavior almost the same. We only prepend current task with a
`parsing includes` if preamble thread is working. We omit the idle thread in the
output unless both threads are idle.

Reviewers: sammccall

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D76304
The file was modifiedclang-tools-extra/clangd/ClangdLSPServer.cpp
The file was modifiedclang-tools-extra/clangd/unittests/TUSchedulerTests.cpp
The file was modifiedclang-tools-extra/clangd/TUScheduler.cpp
The file was modifiedclang-tools-extra/clangd/TUScheduler.h
Commit c31367e95ce1e1e3fe97b1aee54a746f8dafc779 by kadircet
[clangd] Build ASTs only with fresh preambles or after building a new preamble

Summary:
This is another step for out-of-order preamble builds. To keep the
diagnostic behavior same, we only build ASTs either with "usable" preambles,
the ones that are fully applicable to a given ParseInput, or after building a
new preamble. Which is the same behaviour as what we do today. ASTs
built in the latter is called golden ASTs.

Reviewers: sammccall

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D76725
The file was modifiedclang-tools-extra/clangd/unittests/TestTU.cpp
The file was modifiedclang-tools-extra/clangd/TUScheduler.cpp
The file was modifiedclang-tools-extra/clangd/Preamble.cpp
The file was modifiedclang-tools-extra/clangd/unittests/TUSchedulerTests.cpp
The file was modifiedclang-tools-extra/clangd/unittests/FileIndexTests.cpp
The file was modifiedclang-tools-extra/clangd/Preamble.h
The file was modifiedclang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
Commit f32d4161db0e14a0ec0cd08c369e0f4d862a9f51 by llvmgnsyncbot
[gn build] Port 427c1dc4f42
The file was modifiedllvm/utils/gn/secondary/clang/lib/ASTMatchers/Dynamic/BUILD.gn
Commit cc54466dd940322e3cf3b3dc7dae4890fb45882a by thakis
Delete a variable that's been unused since r313407.

No intended behavior change.
The file was modifiedllvm/utils/llvm-lit/llvm-lit.in
The file was modifiedllvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn
Commit 549e87f3d04bbae91bc7bc38609ce7073e2c8a6d by kadircet
[clangd] Fix bad include
The file was modifiedclang-tools-extra/clangd/unittests/TUSchedulerTests.cpp
Commit d33c7de8e11f2727ef5e325d931ae94af8619bf9 by erik.pilkington
[CodeGenObjC] Fix a crash when attempting to copy a zero-sized bit-field in a non-trivial C struct

Zero sized bit-fields aren't included in the CGRecordLayout, so we shouldn't be
calling EmitLValueForField for them. rdar://60695105

Differential revision: https://reviews.llvm.org/D76782
The file was modifiedclang/include/clang/AST/NonTrivialTypeVisitor.h
The file was modifiedclang/lib/CodeGen/CGNonTrivialStruct.cpp
The file was modifiedclang/test/CodeGenObjC/strong-in-c-struct.m
Commit 869f05c83491ce59208c0e24ce9fc48da22fd833 by arsenm2
AMDGPU: Remove dead paths for requiresUniformRegister

The extracts from control flow intrinsics are already properly handled
by divergence analysis. The inline asm case isn't dead, but has also
never really worked correctly so leave it as-is for now.
The file was modifiedllvm/lib/Target/AMDGPU/SIISelLowering.cpp
Commit 8ba7a2d5dfaf9ca26abc699d725ca5c0aaa938a8 by clattner
Minor typo improvements in documentation, NFC.
The file was modifiedmlir/docs/WritingAPass.md
Commit 649f042802d3ed9648da4b1939ac387bc4fe9976 by jaskiewiczs
[libunwind] Support the new libc++ test format

Reviewers: ldionne, #libunwind, mstorsjo

Reviewed By: ldionne, #libunwind, mstorsjo

Subscribers: mstorsjo, dexonsmith, llvm-commits, libcxx-commits

Tags: #llvm, #libunwind

Differential Revision: https://reviews.llvm.org/D77501
The file was modifiedlibunwind/test/lit.cfg
Commit 6f9ea26002914cd3bcc27f09e65a151c81682352 by ditaliano
[debugserver] Get rid of `else` after `return`. NFC.
The file was modifiedlldb/tools/debugserver/source/DNB.cpp
Commit cbf1904a3e054357806163b12547e1bed1641d5c by danalbert
Upstream Bionic definitions of ctype_base/regex.

Summary:
This is a patch that Android has been carrying in its tree for several
years. This patch upstreams the existing ABI.

There's some historical cruft here. __regex_word used to be a part of
regex_traits rather than ctype_base. Bionic also used to use its own
ctype implementation because the libc++ builtin one wasn't available
yet. Bionic's ctype masks were 8 bits wide and already saturated, so a
wider type needed to be used for the regex mask, and the existing
value was already used so Android needed to specify its own.

Since then Android has migrated to the builtin ctype implementation
and this patch probably should have been dropped then. Unfortunately
that was not noticed at the time, so now we need to keep this to
maintain the current ABI.

Reviewers: EricWF, #libc, ldionne

Reviewed By: #libc, ldionne

Subscribers: dexonsmith, ldionne, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D76171
The file was modifiedlibcxx/include/regex
The file was modifiedlibcxx/include/__locale
Commit 5bc291be71548a1e876f9813778099e09543cb82 by ndesaulniers
[SelectionDAG] fix predecessor list for INLINEASM_BRs' parent

Summary:
A bug report mentioned that LLVM was producing jumps off the end of a
function when using "asm goto with outputs". Further digging pointed to
MachineBasicBlocks that had their address taken and were indirect
targets of INLINEASM_BR being removed by BranchFolder, because their
predecessor list was empty, so they appeared to have no entry.

This was a cascading failure caused earlier, during Pre-RA instruction
scheduling. We have a few special cases in Pre-RA instruction scheduling
where we split a MachineBasicBlock in two.  This requires careful
handing of predecessor and successor lists for a MachineBasicBlock that
was split, and careful handing of PHI MachineInstrs that referred to the
MachineBasicBlock before it was split.

The clue that led to this fix was the observation that many callers of
MachineBasicBlock::splice() frequently call
MachineBasicBlock::transferSuccessorsAndUpdatePHIs() to update their PHI
nodes after a splice. We don't want to reuse that method, as we have
custom successor transferring logic for this block split.

This patch fixes 2 pre-existing bugs, and adds tests.

The first bug was that MachineBasicBlock::splice() correctly handles
updating most successors and predecessors; we don't need to do anything
more than removing the previous fallthrough block from the first half of
the split block post splice. Previously, we were updating the successor
list incorrectly (updating successors updates predecessors).

The second bug was that PHI nodes that needed registers from the first
half of the split block were not having entries populated.  The register
live out information was correct, and the FuncInfo->PHINodesToUpdate was
correct. Specifically, the check in SelectionDAGISel::FinishBasicBlock:

    for (unsigned i = 0, e = FuncInfo->PHINodesToUpdate.size(); i != e; ++i) {
      MachineInstrBuilder PHI(*MF, FuncInfo->PHINodesToUpdate[i].first);
      if (!FuncInfo->MBB->isSuccessor(PHI->getParent()))
        continue;
      PHI.addReg(FuncInfo->PHINodesToUpdate[i].second).addMBB(FuncInfo->MBB);

was `continue`ing because FuncInfo->MBB tracks the second half of
the post-split block; no one was updating PHI entries for the first half
of the post-split block.

SelectionDAGBuilder::UpdateSplitBlock() already expects to perform
special handling for MachineBasicBlocks that were split post calls to
ScheduleDAGSDNodes::EmitSchedule(), so I'm confident that it's both
correct for ScheduleDAGSDNodes::EmitSchedule() to return the second half
of the split block `CopyBB` which updates `FuncInfo->MBB` (ie. the
current MachineBasicBlock being processed), and perform special handling
for this in SelectionDAGBuilder::UpdateSplitBlock().

Reviewers: void, craig.topper, efriedma

Reviewed By: void, efriedma

Subscribers: hfinkel, fhahn, MatzeB, efriedma, hiraditya, llvm-commits, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76961
The file was addedllvm/test/CodeGen/X86/callbr-asm-outputs-pred-succ.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
The file was modifiedllvm/test/CodeGen/X86/callbr-asm-outputs.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
Commit 6c1a9fb174ac3cf66bfdbab5a327957a0a35ad85 by thakis
Make llvm_source_root in llvm-lit relative too.

No intended behavior change.
The file was modifiedllvm/utils/llvm-lit/llvm-lit.in
The file was modifiedllvm/utils/llvm-lit/CMakeLists.txt
Commit a0222ac1f9c20d513caed09557d5ef83574f453c by leonardchan
[AsmPrinter] Do not define local aliases for global objects in a comdat

A global symbol that is defined in a comdat should not generate an alias since
call sites that would've referred to that symbol will refer to their own
independent local aliases rather than the surviving global comdat one. This
could result in something that looks like:

```
ld.lld: error: relocation refers to a discarded section: .text._ZN3fbl8internal18NullFunctionTargetIvJjjPjEED1Ev.stub
>>> defined in user-x64-clang/obj/system/ulib/minfs/libminfs.a(minfs._sources.file.cc.o)
>>> section group signature: _ZN3fbl8internal18NullFunctionTargetIvJjjPjEED1Ev.stub
>>> prevailing definition is in user-x64-clang/obj/system/ulib/minfs/libminfs.a(minfs._sources.vnode.cc.o)
>>> referenced by function.h:169 (../../zircon/system/ulib/fbl/include/fbl/function.h:169)
>>>               minfs._sources.file.cc.o:(minfs::File::AllocateAndCommitData(std::__2::unique_ptr<minfs::Transaction, std::__2::default_delete<minfs::Transaction> >)) in archive user-x64-clang/obj/system/ulib/minfs/libminfs.a
```

We ran into this when experimenting with a new C++ ABI for fuchsia
(refer to D72959) which takes relative offsets between comdat'd functions
which is why the normal C++ user wouldn't run into this.

Differential Revision: https://reviews.llvm.org/D77429
The file was addedllvm/test/CodeGen/X86/semantic-interposition-comdat.ll
The file was modifiedllvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Commit 0c9f750a132898d2a90382806ce2662321207c98 by thakis
[gn build] (manually) port 6c1a9fb174ac3c
The file was modifiedllvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn