Commit Graph

43 Commits

Author SHA1 Message Date
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00
Kuba (Brecka) Mracek
de015c6464 Unify asprintf/vasprintf implementations and make them truly portable by using vsnprintf (#39314) 2021-09-15 21:09:03 -07:00
Daniel Rodríguez Troitiño
a184e9e6a9 [cmake] Install runtime swiftDemangle pieces.
In DLL environments (Windows) a library RUNTIME piece will be the
DLL itself (while the .lib will be the LIBRARY piece). Adding a RUNTIME
destination install swiftDemangle.dll correctly in its expected place.

This was avoiding some tests from running in the Windows CI machines. It
should also allow people use tools like swift-demangle.
2019-10-22 17:53:32 -07:00
Alex Langford
61be4d969f [CMake][NFC] Introduce component targets for proper dependency tracking
This commit introduces a CMake target for each component, adds install targets
for them, and switches build-script-impl to use the target `install-components`
for installation. Each of the targets for each component depends on each
of the individual targets and outputs that are associated with the
corresponding swift-component.

This is equivalent to what already exists, because right now install rules are
only generated for components that we want to install. Therefore, this commit
should be an NFC.

This is a resubmission (with modifications) of an earlier change. I originally
committed this but there were problems with some installation rules.
2019-08-22 10:16:50 -07:00
Ben Langmuir
327c666b8a Revert "[CMake][NFC] Introduce component targets for proper dependency tracking" 2019-08-08 16:35:59 -07:00
Alex Langford
50a0e87c69 [CMake][NFC] Introduce component targets for proper dependency tracking
This commit introduces a CMake target for each component, adds install targets
for them, and switches build-script-impl to use the target `install-components`
for installation. Each of the targets for each component depends on each
of the individual targets and outputs that are associated with the
corresponding swift-component.

This is equivalent to what already exists, because right now install rules are
only generated for components that we want to install. Therefore, this commit
should be an NFC.
2019-08-08 11:50:35 -07:00
Saleem Abdulrasool
647fd3efec Merge pull request #26193 from xiaobai/fix-component-build
[CMake][NFC] Support cmake install components for targets with multiple target files
2019-07-17 17:26:21 -07:00
Alex Langford
07214e1377 [CMake] Support cmake install components for targets with multiple target files
When installing a target, you could have multiple target files with
different rules for installation. For example, you can specify rules for
`RUNTIME` files, `LIBRARY` files, `ARCHIVE` files, etc. Each of these
can take several options, e.g. `DESTINATION`. When you want to specify
the install component for a target, each of the different target file
rules need to have their own `COMPONENT` field. If not, they end up as
"Unspecified" which means they will not get installed with the
associated swift component.
2019-07-17 13:27:41 -07:00
Michael Gottesman
610c903605 Change two instances where we are using strcmp to use == as a follow up to #26158. 2019-07-17 12:04:23 -07:00
Michael Gottesman
f952ff0ee4 [ast] Move printing code from ASTPrinter onto a helper on BuiltinType and have ASTPrinter call that instead. 2019-07-16 23:26:01 -07:00
Alex Langford
3d9a28925b [CMake] Modify swift_install_in_component to support cmake install components
CMake supports the notion of installation components. Right now we have some
custom code for supporting swift components. I think that for installation
purposes, it would be nice to use the CMake component system.

This should be a non-functional change. We should still only be generating
install rules for targets and files in components we want to install, and we
still use the install ninja target to install everything.
2019-04-19 14:06:11 -07:00
Saleem Abdulrasool
b0005e9f87 build: remove C_COMPILE_FLAGS from add_swift_host_library
Use the appropriate CMake mechanism for controlling flags for building
the code.
2019-03-10 15:38:55 -07:00
Saleem Abdulrasool
9934532e07 cmake: switch host libraries to use target_link_libraries
This is a follow up to the discussion on #22740 to switch the host
libraries to use the `target_link_libraries` rather than the
`LINK_LIBRARIES` special handling.  This allows the dependency to be
properly tracked by CMake and allows us to use the more modern syntax.
2019-02-22 15:28:07 -08:00
Erik Eckstein
706f4c8622 Demangler library: add a function swift_demangle_getModuleName to get the module name of a mangled symbol.
rdar://problem/47560963
2019-02-19 11:26:42 -08:00
Michael Gottesman
a761d7c0ba Revert "Revert "Revert "[Build System: CMake] make add_swift_library a wrapper to add_llvm_library"""
This reverts commit 121f5b64be.

Sorry to revert this again. This commit makes some pretty big changes. After
messing with the merge-conflict created by this internally, I did not feel
comfortable landing this now. I talked with Saleem and he agreed with me that
this was the right thing to do.
2018-11-06 13:24:00 -08:00
Saleem Abdulrasool
121f5b64be Revert "Revert "[Build System: CMake] make add_swift_library a wrapper to add_llvm_library""
This reverts commit 103f9a8246.
2018-11-05 14:37:40 -08:00
Xi Ge
103f9a8246 Revert "[Build System: CMake] make add_swift_library a wrapper to add_llvm_library" 2018-11-02 12:49:07 -07:00
Saleem Abdulrasool
39dde93c88 add_swift_host_library: rename LINK_LIBRARIES to LINK_LIBS 2018-10-31 12:46:31 -07:00
Saleem Abdulrasool
e0b839330d add_swift_host_library: remove C_COMPILE_FLAGS 2018-10-31 12:46:31 -07:00
Michael Gottesman
3f17bb6ddf Carefully split the build's invocation of add_swift_library into host/target variants.
The key thing here is that all of the underlying code is exactly the same. I
purposely did not debride anything. This is to ensure that I am not touching too
much and increasing the probability of weird errors from occurring. Thus the
exact same code should be executed... just the routing changed.
2018-10-27 12:58:51 -07:00
Saleem Abdulrasool
983a446916 SwiftDemangle: disable ABI breaking checks
Since this library uses ADT headers, it will pull in a dependency for
LLVMSupport (Error.cpp has the necessary variable declaration for ABI breaking
checks).  Disable the ABI breaking check validation as we only use the library
for header-only dependencies.  Avoiding this dependency shaves nearly 900 KiB
from the resultant binary.
2018-09-07 10:18:29 -07:00
David Zarzycki
b61a34fe2b [SwiftDemangle] NFC: Increase portability via C standard APIs 2017-11-25 16:22:21 -05:00
Davide Italiano
83d4548854 [FreeBSD] Unbreak libdemangle build, libbsd is not required. 2017-11-16 13:18:57 -08:00
Saleem Abdulrasool
7e888d43cd SwiftDemangle: build on non-Darwin targets
This can be useful as a consumer for demangling swift symbols.  Build
the shared library on non-Darwin targets as well.
2017-11-01 13:39:37 -07:00
Erik Eckstein
5e80555c9b demangler: put the demangler into a separate library
Previously it was part of swiftBasic.

The demangler library does not depend on llvm (except some header-only utilities like StringRef). Putting it into its own library makes sure that no llvm stuff will be linked into clients which use the demangler library.

This change also contains other refactoring, like moving demangler code into different files. This makes it easier to remove the old demangler from the runtime library when we switch to the new symbol mangling.

Also in this commit: remove some unused API functions from the demangler Context.

fixes rdar://problem/30503344
2017-03-09 13:42:43 -08:00
Erik Eckstein
be986d753c demangler: add an API to check if a function has the swiftcc calling convention 2017-03-01 14:16:38 -08:00
Erik Eckstein
b4c8f6bb15 Demangle: Don’t use demangle_wrappers in the SwiftDemangle library.
This avoids linking parts of the llvm utilities into the library.
It fixes an option-registere-more-than-once problem in the SwiftDemangle unit test.
rdar://problem/30503344
2017-02-16 09:59:21 -08:00
Michael Gottesman
8437819b5a [CMake] Revert recent changes.
These changes caused a number of issues:

1. No debug info is emitted when a release-debug info compiler is built.
2. OS X deployment target specification is broken.
3. Swift options were broken without any attempt any recreating that
functionality. The specific option in question is --force-optimized-typechecker.

Such refactorings should be done in a fashion that does not break existing
users and use cases.

This reverts commit e6ce2ff388.
This reverts commit e8645f3750.
This reverts commit 89b038ea7e.
This reverts commit 497cac64d9.
This reverts commit 953ad094da.
This reverts commit e096d1c033.

rdar://30549345
2017-02-15 22:26:06 -08:00
Chris Bieneman
e096d1c033 [CMake] Simplify add_swift_library
This patch splits add_swift_library into two functions one which handles
the simple case of adding a library that is part of the compiler being
built and the second handling the more complicated case of "target"
libraries, which may need to build for one or more targets.

The new add_swift_library is built using llvm_add_library, which re-uses
LLVM's CMake modules. In adapting to use LLVM's modules some of
add_swift_library's named parameters have been removed and
LINK_LIBRARIES has changed to LINK_LIBS, and LLVM_LINK_COMPONENTS
changed to LINK_COMPONENTS.

This patch also cleans up libswiftBasic's handling of UUID library and
headers, and how it interfaces with gyb sources.

add_swift_library also no longer has the FILE_DEPENDS parameter, which
doesn't matter because llvm_add_library's DEPENDS parameter has the same
behavior.
2017-02-14 14:28:10 -08:00
Slava Pestov
dfebf20670 Merge pull request #6387 from hughbe/symlink-win32
[CMake] fix symlink creation on Windows
2017-01-09 12:27:21 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Hugh Bellamy
af07b626d4 Remove creating compatability symlink in swiftDemangle 2016-12-27 14:55:05 +00:00
Hugh Bellamy
888afe139c Fix creating symlinks on Windows 2016-12-27 14:55:05 +00:00
Erik Eckstein
7208b18410 Mangling: support the new mangling prefix in various prefix checks 2016-12-15 14:08:11 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Argyrios Kyrtzidis
404acacb21 [SwiftDemangle] Make an unexposed function static, NFC. 2016-02-16 12:16:56 -08:00
practicalswift
1339b5403b Consistent use of header comment format.
Correct format:
//===--- Name of file - Description ----------------------------*- Lang -*-===//
2016-01-04 13:26:31 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Joe Groff
0cd5aa8c7c Change mangling for the Swift module from 'Ss' to 's'.
'Ss' appears in manglings tens of thousands of times in the standard library and is also incredibly frequent in other modules. This alone is enough to shrink the standard library by 59KB.

Swift SVN r32409
2015-10-02 22:39:44 +00:00
David Farler
b460aa0c86 Further shorten demangled names in simplified mode
Break up "Simplified" demangling mode (shortened demangled descriptions
for the sake of displaying in UI with small areas) into more
fine-grained options instead of an opaque "Simplified" option and
provide a static preset of options for displaying stack traces in
Xcode UI and other tools, for example.

- Don't print unmangled suffixes
- Don't print module names
- Shorten various generic specialization descriptions as just
  "specialized"
- Don't display long protocol conformances
- Truncate where clauses
- Don't display so-called "entity" types
- Shorten "partial apply *"
- Shorten thunk phrases
- Shorten value witness phrases
- Truncate archetype references

rdar://problem/21753651

Swift SVN r30247
2015-07-16 03:35:46 +00:00
David Farler
4d71001aa4 Provide 'Simplified' demangling mode
To support UI applications displaying demangled names in a limited
amount of screen space, provide a new SwiftDemangle API and Demangler
option to do the following:

- Skip all module name prefixes when printing contexts
- Don't print implicit self/metatype parameters when printing
function types

Add a '-simplified' flag to swift-demangle to support testing at the
command line.

Swift SVN r28727
2015-05-18 22:48:30 +00:00
Jordan Rose
22696e0884 [CMake] Simplify compatibility symlink command for libfunctionNameDemangle.dylib.
No intended functionality change. (I thought this was broken in Xcode but it
turns out I just wasn't building the library.)

Swift SVN r27043
2015-04-06 21:24:01 +00:00
Dmitri Hrybenko
321d4d4792 Rename libfunctionNameDemangle.dylib to libswiftDemangle.dylib
This library becomes a permanent interface that we would need to support
in the long term, so we should get dylib names and APIs right.

rdar://20418214

Swift SVN r26957
2015-04-03 22:12:28 +00:00