Commit Graph

1796 Commits

Author SHA1 Message Date
Victoria Mitchell
4ec3e5291f add new flag to skip "protocol implementation" symbols
rdar://59899968
2023-02-16 14:00:04 -07:00
swift-ci
5acf1c372e Merge remote-tracking branch 'origin/main' into rebranch 2023-02-16 12:54:58 -08:00
Rintaro Ishizaki
c82e17acb7 Merge pull request #63695 from rintaro/options-load-plugin-executable
[Option] Add compiler option to specify executable plugins
2023-02-16 12:35:35 -08:00
swift-ci
3d54aef31f Merge remote-tracking branch 'origin/main' into rebranch 2023-02-16 07:14:44 -08:00
Nate Chandler
1246a152a4 [Frontend] Relaxed flag combination check.
Previously, combining `-enable-lexical-lifetimes=false` with
`-enable-experimental-move-only` resulted in an error.  But this is a
valid combination: the former sets the `LexicalLifetimes` option to
`DiagnosticMarkersOnly`, which is what `-enable-experimental-move-only`
relies on.
2023-02-15 16:13:47 -08:00
Rintaro Ishizaki
bf0a62f3ce [Option] Add compiler option to specify executable plugins
Add a compiler option `-load-plugin-executable <path>#<module names>`.
Where '<path>' is a path to a plugin executable, '<module-name>' is a
comma-separated module names the plugin provides.

Nothing is using it at this point. Actual plugin infratructure are
introduced in follow-up commits
2023-02-15 14:43:21 -08:00
swift-ci
e1cd7779f7 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-10 00:35:26 -08:00
Doug Gregor
4705183149 [Macros] Add plugin search paths to load plugin modules by name.
Introduce `-plugin-path <path>` to add a search path where we will look
for compiler plugins. When resolving an external macro definition, look
for libraries in these search paths whose names match the module name
of the macro.

Implements rdar://105095761.
2023-02-09 13:47:26 -08:00
swift-ci
8e7eae199e Merge remote-tracking branch 'origin/main' into rebranch 2023-02-08 07:33:02 -08:00
Artem Chikin
c1599fede4 Add -swift-module-file frontend flag for explicit Swift module dependencies 2023-02-07 11:29:09 -07:00
swift-ci
d4f981232a Merge remote-tracking branch 'origin/main' into rebranch 2023-02-03 15:35:20 -08:00
Ellie Shin
258b13b05d Merge pull request #63355 from apple/es-export-pr
Add access level and scope checks to package types
2023-02-03 15:20:29 -08:00
Ellie Shin
be20333a87 Add access level and scope checks to package types
Resolves rdar://104617227
2023-02-02 16:51:17 -08:00
swift-ci
409f9c7f40 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-01 14:34:59 -08:00
Ben Barham
8c7f331ba7 Merge pull request #63339 from bnbarham/wd-hack
[Frontend] Split -working-directory<path>
2023-02-01 14:16:47 -08:00
Ben Barham
b5caa97b6b [Frontend] Split -working-directory<path>
Clang no longer supports `-working-directory<path>`. Split this argument
into `-working-directory <path>` so that clients passing the old
argument still work.
2023-01-31 16:17:11 -08:00
swift-ci
ef62fdf232 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-31 11:53:53 -08:00
Doug Gregor
8871129896 [Macros] Add frontend flag to dump macro expansions for diagnostics.
Add frontend flag `-emit-macro-expansion-files diagnostics` to emit any
macro expansion buffers referenced by diagnostics into files in a
temporary directory. This makes debugging type-checking failures in
macro expansions far easier, because you can see them after the
compiler process has exited.
2023-01-30 18:05:53 -08:00
swift-ci
df75f6ee09 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-25 22:33:52 -08:00
swift-ci
281088eb73 Merge pull request #63204 from meg-gupta/ptrauthcodegenpr
Initial support for ptrauth qualified function pointers in C
2023-01-25 22:19:34 -08:00
Meghana Gupta
a515e0db8e Add EnableImportPtrauthFieldFunctionPointers flag 2023-01-25 12:37:57 -08:00
Erik Eckstein
87ed8b4dc3 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-24 08:58:16 +01:00
Doug Gregor
fa845d8eb2 Merge pull request #63153 from DougGregor/swift-syntax-diagnostic-style
[Diagnostics] Add a swift-syntax diagnostic style
2023-01-22 13:44:14 -08:00
Doug Gregor
bdf1183757 [Diagnostics] Add a swift-syntax diagnostic style
The SwiftDiagnostics module within swift-syntax has a diagnostic
pretty-printer that does a nice rendering of the source code with
diagnostics placed inside gaps between the code lines.
Introduce another `-diagnostic-style` argument, `swift-syntax`,
to bridge from the pretty-printed C++ diagnostics over to the
swift-syntax diagnostics engine.
2023-01-21 23:09:56 -08:00
swift-ci
5388055f12 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-19 09:14:10 -08:00
Arnold Schwaighofer
8a38738abf IRGen: Initial support for relative protocol witness table emission 2023-01-18 13:43:25 -08:00
Erik Eckstein
712fd7922b Merge remote-tracking branch 'origin/main' into rebranch 2023-01-09 08:48:47 +01:00
Alexis Laferrière
d1343c86fb [Frontend] Intro flags to control deserialization safety
Deserialization safety remains off by default at the moment.
2023-01-06 12:02:47 -08:00
swift-ci
dcfb01cfb3 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-13 09:16:29 -08:00
Alexis Laferrière
010973c276 [Frontend|NFC] Rename ModuleInterfaceOptions::PrintPrivateInterfaceContent 2022-12-08 15:10:03 -08:00
Ben Barham
68d5d1f9ca Merge remote-tracking branch 'origin/main' into rebranch
Conflicts:
  lib/Frontend/CompilerInvocation.cpp - legacy pass manager removed
2022-12-07 10:13:47 -08:00
Arnold Schwaighofer
39e5e3990d IRGen: Co-locate metadata instatiation/completions/accessor functions in a special section
For spatial locality on startup.

Hide collocating metadata functions in a separate section behind a flag.
The default is not to collocate functions.

rdar://101593202
2022-12-05 09:52:04 -08:00
swift-ci
4e20be1f15 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-01 01:34:17 -08:00
Franklin Schrans
d3e96590d9 Merge pull request #61637 from theMomax/extension-block-symbols-deactivation-flag
Make emission of extension block symbols a formal feature
2022-12-01 08:18:24 +01:00
Erik Eckstein
d89c6b2d70 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-01 07:48:51 +01:00
Dario Rexin
3cf40ea504 [IRGen] Re-introduce TypeLayout strings (#62059)
* Introduce TypeLayout Strings

Layout strings encode the structure of a type into a byte string that can be
interpreted by a runtime function to achieve a destroy or copy. Rather than
generating ir for a destroy/assignWithCopy/etc, we instead generate a layout
string which encodes enough information for a called runtime function to
perform the operation for us. Value witness functions tend to be quite large,
so this allows us to replace them with a single call instead. This gives us the
option of making a codesize/runtime cost trade off.

* Added Attribute @_GenerateLayoutBytecode

This marks a type definition that should use generic bytecode based
value witnesses rather than generating the standard suite of
value witness functions. This should reduce the codesize of the binary
for a runtime interpretation of the bytecode cost.

* Statically link in implementation

Summary:
This creates a library to store the runtime functions in to deploy to
runtimes that do not implement bytecode layouts. Right now, that is
everything. Once these are added to the runtime itself, it can be used
to deploy to old runtimes.

* Implement Destroy at Runtime Using LayoutStrings

If GenerateLayoutBytecode is enabled, Create a layout string and use it
to call swift_generic_destroy

* Add Resilient type and Archetype Support for BytecodeLayouts

Add Resilient type and Archetype Support to Bytecode Layouts

* Implement Bytecode assign/init with copy/take

Implements swift_generic_initialize and swift_generic_assign to allow copying
types using bytecode based witnesses.

* Add EnumTag Support

* Add IRGen Bytecode Layouts Test

Added a test to ensure layouts are correct and getting generated

* Implement BytecodeLayouts ObjC retain/release

* Fix for Non static alignments in aligned groups

* Disable MultiEnums

MultiEnums currently have some correctness issues with non fixed multienum
types. Disabling them for now then going to attempt a correct implementation in
a follow up patch

* Fixes after merge

* More fixes

* Possible fix for native unowned

* Use TypeInfoeBasedTypeLayoutEntry for all scalars when ForceStructTypeLayouts is disabled

* Remove @_GenerateBytecodeLayout attribute

* Fix typelayout_based_value_witness.swift

Co-authored-by: Gwen Mittertreiner <gwenm@fb.com>
Co-authored-by: Gwen Mittertreiner <gwen.mittertreiner@gmail.com>
2022-11-29 21:05:22 -08:00
swift-ci
efef52a86e Merge remote-tracking branch 'origin/main' into rebranch 2022-11-28 09:33:40 -08:00
Erik Eckstein
ab1b343dad use new llvm::Optional API
`getValue` -> `value`
`getValueOr` -> `value_or`
`hasValue` -> `has_value`
`map` -> `transform`

The old API will be deprecated in the rebranch.
To avoid merge conflicts, use the new API already in the main branch.

rdar://102362022
2022-11-21 19:44:24 +01:00
Rintaro Ishizaki
d458c8b74a Merge remote-tracking branch 'origin/main' into rebranch
Conflicts:
	include/swift/Sema/ConstraintSystem.h
	include/swift/Syntax/AbsoluteRawSyntax.h
	include/swift/Syntax/Syntax.h
	include/swift/Syntax/SyntaxData.h
	lib/DependencyScan/ModuleDependencyCacheSerialization.cpp
	lib/Syntax/SyntaxFactory.cpp.gyb
	lib/Syntax/SyntaxNodes.cpp.gyb
	tools/SourceKit/lib/SwiftLang/SwiftEditor.cpp
	tools/swift-syntax-test/swift-syntax-test.cpp
2022-11-18 09:37:38 -08:00
Alexis Laferrière
9f34fa3601 Merge pull request #62148 from xymus/library-level-ipi-intro
[Sema] Accept and store the IPI library-level
2022-11-17 13:34:27 -08:00
Alexis Laferrière
a926b0555b [Sema] Accept and store the IPI library-level
Prepare to accept the `ipi` argument to the `-library-level` flag. IPI
stands for Internal Programming Interface and would describe a module
that's not to be distributed outside of its project.

In the future, the compiler could use that information to report when a
distributed module (api or spi) imports publicly a module that's not
distributed.

rdar://102435183
2022-11-16 16:29:56 -08:00
Robert Widmann
37e7052c68 Remove -emit-syntax and -verify-syntax-tree 2022-11-16 15:07:48 -08:00
swift-ci
c2e69c2370 Merge remote-tracking branch 'origin/main' into rebranch 2022-11-15 21:54:13 -08:00
Doug Gregor
0bc94509f2 Merge pull request #62107 from DougGregor/dump-macro-expansions 2022-11-15 21:48:01 -08:00
Doug Gregor
f2f974bb94 [Macros] Add a flag -dump-macro-expansions as a debugging aid. 2022-11-14 21:31:29 -08:00
swift-ci
e65fa9c45d Merge remote-tracking branch 'origin/main' into rebranch 2022-11-11 22:52:44 -08:00
eeckstein
ddc69e7d0d Merge pull request #62057 from eeckstein/enable-stack-protection
SILOptimizer: enable stack protection by default
2022-11-12 07:38:19 +01:00
swift-ci
873f636d9a Merge remote-tracking branch 'origin/main' into rebranch 2022-11-11 14:13:49 -08:00
Holly Borla
3dad05301d Merge pull request #62064 from hborla/experimental-feature-flags
[FrontendOptions] Remove bespoke experimental feature flags in favor of `-enable-experimental-feature X`.
2022-11-11 14:06:44 -08:00
swift-ci
ca8635e2f6 Merge remote-tracking branch 'origin/main' into rebranch 2022-11-11 12:03:33 -08:00