Skip to content

Merge stable/20221013 into swift/release/5.9 #6619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 115 commits into from
Apr 12, 2023

Conversation

adrian-prantl
Copy link

Because the automerger wasn't set up, swift/release/5.9 is currently behind of stable/20221013. Now that the automerger is set up, I'm doing a one-time merge of stable/20221013 into swift/release/5.9 to make sure all the "lost" contents is on the branch.

thetruestblue and others added 30 commits March 23, 2023 12:34
…interceptors

Spinlock symbols are removed from headers in MacOS version 10.12 and greater.
Even though they are deprecated, the symbols remain available on the system.

The TSAN interceptors currently cause a build failure after this version because
of the change in availability of the symbol.

We want to continue intercepting the symbols available on the OS.
So we add forward declarations so that the TSAN interceptors can build.

This is tested with the existing osspinlock_norace test.

Differential Revision: https://reviews.llvm.org/D146537

(cherry picked from commit ae484c2)
[TSAN][Darwin] Forward declare spinlock functions on darwin for TSAN …
The error message changed in D144664.

(cherry picked from commit fad6010)
…tu_test

[cherry-pick][lldb/test] Update error message in debug-types-signature-loop.s
Fix backtick handling in parsed commands.
The old reproducer functionality has been removed. Remove this call as
it's now just a NO-OP.

(cherry picked from commit 0016f47)
[lldb] Remove errant call to SBReproducer.SetWorkingDirectory
This is a minor u-opt but more importantly the `Progress` type requires
that the count of imports being >=1.  This avoids an assertion being
triggered.
The IncludeTreeBuilder is responsible for building the include-tree for
a specific TU. Factor it out of IncludeTreeActionConsumer to prepare for
building modules, which require their own builder.

(cherry picked from commit 062b023)
(cherry picked from commit 30c89b9)
These were only used by include-tree, and we now have a mechanism to
inject PPCallbacks without going through DependencyActionController.
Remove them and simplify the IncludeTreeActionController.

(cherry picked from commit c603c65)
(cherry picked from commit ca4eed9)
This adds the scaffolding needed for include-tree to push
IncludeTreeBuilder stacks, to compute an include-tree for a module and
to get fmodule-file-cache-key options for dependencies. Note: this does
not yet support building or importing modules, but it lets us compute
dependencies in the right way.

(cherry picked from commit 3b87a20)
(cherry picked from commit 3221056)
Moves IncludeFile after IncludeTree in the header file in preparation
for changing it to IncludeTree::File. Also moves FileInfo to IncludeTree
to simplify declaration.

(cherry picked from commit f36469e)
(cherry picked from commit fa13d21)
(cherry picked from commit 7caa9d9)
(cherry picked from commit 2c3a949)
This handles building and importing simple modules and PCH with modules
using include-tree, when modules are found via header path.

* Extend IncludeTree to represent module imports and modulemap mainfile
* Make IncludeTreeBuilder add the new nodes for #include
* Make PPDirectives import modules from PPCachedActions in #include
* Teach FrontendAction/CompilerInvocation how to setup the main input
  file modulemap and module includes buffer from IncludeTreeRoot.

There are still lots of things missing, including @import syntax and
submodule semantics.

(cherry picked from commit 55b697d)
(cherry picked from commit a9db055)
Track the submodule of each modular header and enter the submodule via
PPCachedActions. This fixes declaration and macro header visibility.

(cherry picked from commit bd61c2c)
(cherry picked from commit d926cee)
…dule

When building a non-header file with -fmodule-name set, add the
requisite modulemap file even though it is not imported as a module, and
test that we are getting the right semantics for the header include.

(cherry picked from commit 43df61c)
(cherry picked from commit 1459055)
With explicit imports, we do not record the module import in the include
tree, because the only thing that happens is to lookup the module by
name, which works already via the command-line options that provide the
module via the action cache.

(cherry picked from commit a13b79f)
(cherry picked from commit 232e662)
…4 header

Add the ability to generate universal binaries with a fat64 header.

rdar://107223939

Differential revision: https://reviews.llvm.org/D146879

(cherry picked from commit 4d683f7)
…ontext NFC

Unlike the cache key string, these are not needed for multiple modules
at once, and this allows us to store the include-tree ID for a PCH,
which will be useful in the next commit.

(cherry picked from commit d64e27a)
(cherry picked from commit 843daa7)
Instead of looking through the PCH or modules for input files and
loading them into the current FileManager while scanning, merge them
directly from the include-tree that was used to build that PCH and/or
module. This makes it easier to understand where files come from in the
include-tree, and eliminates certain issues where the scanner module may
include more files than are necessary, or include them with different
paths in the case of VFS/symlinks.  It also avoids needing to re-stat
these files if they are not used during scanning the importing TU. As
part of this, we teach IncludeTreeFilesystem to handle ./ stripping in
paths to match what ASTWriter does.

(cherry picked from commit 4c3f73e)
(cherry picked from commit fcf503d)
Instead of putting the modulemap file in the include-tree filesystem and
parsing it at build time, create a data structure that represents just
the parts of the modulemap we need when building the module:

* Flags (explicit, system, framework, etc.)
* Exports (export *, export Foo)
* LinkLibraries (implicit framework autolink, link Foo)

Additionally, we add modular headers lazily by inserting known headers
when we encounter an include-tree header that is part of a submodule
(this is needed for missing #include diagnostics).

This removes the possibility of mismatches between header paths seen
during modulemap parsing from the paths we embed due to #includes, for
exmaple due to VFS virtual vs external paths.

(cherry picked from commit a237e68)

 Conflicts:
	clang/include/clang/Basic/Module.h
	clang/lib/Serialization/ASTWriter.cpp

(cherry picked from commit c6b9298)
* Private modules with fmodule-name
* Inferred framework modules
* Framework autolink
* VFS

(cherry picked from commit 9565950)
(cherry picked from commit 871b0e7)
…isibility

Modules imported for visibility only can happen when -fmodule-name
matches a modular header that is imported more than once so that we
trigger the correct re-exports but without trying to import a module.

(cherry picked from commit d844c16)
(cherry picked from commit 02b64b7)
We were dropping the modular import of a private module if its public
module was imported via PCH, because we skipped parsing the private
modulemap during scanning.

(cherry picked from commit 6034ccd)
(cherry picked from commit ab658ce)
This was review feedback on a previous PR that somehow went missing.
Bring it back.

(cherry picked from commit f1ccf9d)
(cherry picked from commit 0b727cd)
Missing the module named by fmodule-name is not an error for a TU or
PCH.

(cherry picked from commit fcd06ba)
(cherry picked from commit 3e11b20)
kpdev and others added 11 commits April 5, 2023 15:10
Currently in some cases lldb reports stop reason as "step out" or "step over" (from thread plan completion) instead of "breakpoint", if the user breakpoint happens to be set on the same address.
The part of llvm@f08f5c9 seems to overwrite internal breakpoint detection logic, so that only the last breakpoint for the current stop address is considered.
Together with step-out plans not clearing its breakpoint until they are destrouyed, this creates a situation when there is a user breakpoint set for address, but internal breakpoint makes lldb report a plan completion stop reason instead of breakpoint.
This patch reverts that internal breakpoint detection logic to consider all breakpoints

Reviewed By: jingham

Differential Revision: https://reviews.llvm.org/D140368

(cherry picked from commit 2af0a47)
…ternal

[lldb] Consider all breakpoints in breakpoint detection
Fix doxygen warning: '\c' command does not have a valid word argument
[-Wdocumentation]
In Shell tests, replace use of the `p` alias with the `expression` command.

To avoid conflating tests of the alias with tests of the expression command,
this patch canonicalizes to the use `expression`.

See also D141539 which made the same change to API tests.

Differential Revision: https://reviews.llvm.org/D146230

(cherry picked from commit d875838)
…ry-pick

NFC: Dependency scanner cherry-picks
Change `dwim-print` to now disable persistent results by default, unless requested by
the user with the `--persistent-result` flag.

Ex:

```
(lldb) dwim-print 1 + 1
(int) 2
(lldb) dwim-print --persistent-result on -- 1 + 1
(int) $0 = 2
```

Users who wish to enable persistent results can make and use an alias that includes
`--persistent-result on`.

Differential Revision: https://reviews.llvm.org/D145609

(cherry picked from commit 3854963)
@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test

1 similar comment
@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test

@kavon
Copy link
Member

kavon commented Apr 11, 2023

please hold off on merging this before I get a chance to approve this PR :)

@adrian-prantl
Copy link
Author

@swift-ci test windows

Copy link
Member

@kavon kavon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to land. Once the reverts from this land in stable/20221013 we should merge #6630 to fix that. Thanks for working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.