PR #14729 made more calls to llvm.trap() non-mergeable. This follow-up
adds asserts to IRBuilder which make it harder to accidentally introduce
mergeable calls to llvm.trap() in the future.
The newly-added assertions exposed an issue in GenBuiltin while
compiling parts of the stdlib. This PR fixes the issue.
Suggested by Adrian Prantl!
rdar://32772768
- make @noescape function types trivial
- think_to_thick_function with @noescape result type
- Fix for getSwiftFunctionPointerCallee
Part of:
SR-5441
rdar://36116691
We incorrectly lowered callsites when we had sil function return types
that involved both direct return types that we decide to lower
indirectly, and indirect return types.
@convention(thin) () -> (@owned String, @owned String, @owned String, @out Any, @out Any)
(This should have been handled by the address lowering pass but isn't)
rdar://35874410
When lowering the arguments for the FFI call on certain targets, LLVM
expects that the parameter be passed as a structure rather than the
extracted values. Enhance the argument lowering for the call and the
function construction to ensure that the type can be flattened according
to the ABI for the target before attempting to explode it for the SIL
IRGen lowering. This allows building for targets such as Linux ARM HF
and Linux ARM SF target with the HF floating point ABI.
Addresses SR-6142!
To make this stick, I've disallowed direct use of that overload of
CreateCall. I've left the Constant overloads available, but eventually
we might want to consider fixing those, too, just to get all of this
code out of the business of manually remembering to pass around
attributes and calling conventions.
The test changes reflect the fact that we weren't really setting
attributes consistently at all, in this case on value witnesses.
The goals here are four-fold:
- provide cleaner internal abstractions
- avoid IR bloat from extra bitcasts
- avoid recomputing function-type lowering information
- allow more information to be propagated from the function
access site (e.g. class_method) to the call site
Use this framework immediately for class and protocol methods.
* IRGen: Use LLVM's alloc size to compute padding between types
We need to subtract alignment padding when doing type layout in terms of llvm types
rdar://32618125
SR-5137
Replace `NameOfType foo = dyn_cast<NameOfType>(bar)` with DRY version `auto foo = dyn_cast<NameOfType>(bar)`.
The DRY auto version is by far the dominant form already used in the repo, so this PR merely brings the exceptional cases (redundant repetition form) in line with the dominant form (auto form).
See the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es11-use-auto-to-avoid-redundant-repetition-of-type-names) for a general discussion on why to use `auto` to avoid redundant repetition of type names.
This is an opencl type that we did not use in the compiler anyways. Our only use
was to make sure that we had covered switches on clang builtin types (and
asserted if we ever hit that case in a switch).
Use the generic type lowering algorithm described in
"docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion
type to the type expected by the ABI.
Change IRGen to use the swift calling convention (swiftcc) for native swift
functions.
Use the 'swiftself' attribute on self parameters and for closures contexts.
Use the 'swifterror' parameter for swift error parameters.
Change functions in the runtime that are called as native swift functions to use
the swift calling convention.
rdar://19978563