Commit Graph

1004 Commits

Author SHA1 Message Date
Erik Eckstein
c671717c0e Fix re-mangling of function specialization constant strings which start with a digit. 2017-02-20 16:39:36 -08:00
Erik Eckstein
03a5c2449c Temporarily disable the re-mangling check.
Until rdar://problem/30592808 is fixed
2017-02-18 13:01:51 -08:00
Hugh Bellamy
a570f6b87b Merge pull request #7405 from hughbe/visual-studio-bug
Work around Visual Studio bug inferring type of auto
2017-02-18 09:26:40 +07:00
Erik Eckstein
8a6a9461d3 Only mangle non-private top-level classes and protocol with the old-style for the ObjC metadata.
Only those types can be de-mangled by the ObjC runtime anyway.
Also move this mangling logic into the ASTMangler class. This avoids keeping the old mangler around just for that purpose.
2017-02-16 18:20:05 -08:00
Erik Eckstein
2df8d5e8ad Let the demangler handle old-style mangled ObjC runtime type names.
This avoids linking the full old demangler into the swift runtime.
2017-02-16 18:20:05 -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
Erik Eckstein
2d127e4192 Reinstate ”Use the new mangling for reflection."
It also uses the new mangling for type names in meta-data (except for top-level non-generic classes).
lldb has now support for new mangled metadata type names.

This reinstates commit 21ba292943.
2017-02-15 09:47:22 -08:00
Erik Eckstein
86e7bdeed8 Demangler: Use a fixed-size array for Word substitutions.
There can be at most 26 word substitutions.
This avoids some memory allocations and is a work-around for the asan problem rdar://problem/30406870
2017-02-15 09:47:22 -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
Doug Gregor
dca8553615 [Mangling] Remove "archetype" mangling node.
The mangler never produces a mangling here, the demangler doesn't
demangle anything here, the remangler punted or asserted, and type
reconstruction did something very wrong. Delete this code.
2017-02-13 15:56:30 -08:00
Hugh Bellamy
f001b7562b Use relatively new LLVM_FALLLTHROUGH instead of our own SWIFT_FALLTHROUGH 2017-02-12 10:47:03 +07:00
Hugh Bellamy
a94f65cb5e Include llvm/Support/Compiler.h wherever we use __has_attribute 2017-02-12 09:30:22 +07:00
Erik Eckstein
64b77bad56 Mangling: fix a wrong assert in the demangle printer for SILBoxType 2017-02-10 13:21:31 -08:00
Erik Eckstein
ebe19757e1 Demangler: add a new API for the demangler which enables bump-pointer allocation of demangling nodes.
Instead of a global demangleSymbolAsNode, which returns a reference-counted NodePointer, there is now a Context class which owns the nodes.
So now demangleSymbolAsNode is a member of Context and the returned NodePointer is alive as long as the Context is alive.

This is still a NFC: the new ABI still maps to the old functions.
The purpose of this change is to let lldb adapt to the new API and then we can switch to the new implementation.
2017-02-10 12:25:58 -08:00
Erik Eckstein
479237b9ac Mangling: isSwiftSymbol should get a null terminated string rather than a char pointer + length
This avoids doing a strlen in lldb when calling this function.

rdar://problem/30062026
2017-02-09 14:05:00 -08:00
Erik Eckstein
254f36aba5 Revert "Use the new mangling for reflection."
This needs some changes in lldb.
Disabled for now until lldb supports the new mangling.

This reverts commit 21ba292943.
2017-02-08 09:01:51 -08:00
Erik Eckstein
21ba292943 Use the new mangling for reflection.
For this we are linking the new re-mangler instead of the old one into the swift runtime library.
Also we are linking the new de-mangling into the swift runtime library.

It also switches to the new mangling for class names of generic swift classes in the metadata.
Note that for non-generic class we still have to use the old mangling, because the ObjC runtime in the OS depends on it (it de-mangles the class names).
But names of generic classes are not handled by the ObjC runtime anyway, so there should be no problem to change the mangling for those.
The reason for this change is that it avoids linking the old re-mangler into the runtime library.
2017-02-07 08:36:21 -08:00
Erik Eckstein
5bb69bde58 Mangling: be more tolerant about missing Type nodes in the new re-mangler.
The runtime library sometimes does not generate type nodes when building a class name.
2017-02-07 08:36:21 -08:00
Erik Eckstein
ee1aa04c11 Mangling: don’t use llvm_unreachable in Remangler because we don’t have this if the Remangler linked into the swift runtime library 2017-02-07 08:36:21 -08:00
Erik Eckstein
e6f2e7bc88 Mangling: add a few utility functions in the new mangler and demangler which will be used by reflection mangling 2017-02-07 08:36:21 -08:00
Erik Eckstein
2ced2f2b49 Mangling: fix selectMangling for Release build
rdar://problem/30387928
2017-02-06 19:31:29 -08:00
Erik Eckstein
81384b6f82 demangler: Add API functions for classifying symbols.
To be used by lldb.
Also add a -classify option in swift-demangler to test those new API functions.
2017-01-31 17:27:10 -08:00
Hugh Bellamy
d8508f66f6 Merge pull request #7051 from hughbe/new-platforms
Fix warnings for unhandled triples after LLVM upstream update
2017-01-27 08:55:24 +00:00
swift-ci
9580f41a0e Merge pull request #7054 from JaSpa/fix-ndebug-linker-error 2017-01-26 11:34:31 -08:00
Erik Eckstein
39c21c92c8 Mangling: better check for the -new-mangling-for-tests option 2017-01-26 08:54:31 -08:00
Janek Spaderna
98f5eaddf6 [Mangling] Fix linker error in NDEBUG build 2017-01-26 11:57:22 +01:00
Hugh Bellamy
2c1bc3c822 Fix warnings for unhandled triples after LLVM upstream update
> warning C4062: enumerator 'llvm::Triple::Fuchsia' in switch of enum
'llvm::Triple::OSType' is not handled
> warning C4062: enumerator 'llvm::Triple::Contiki' in switch of enum
'llvm::Triple::OSType' is not handled
> warning C4062: enumerator 'llvm::Triple::LastOSType' in switch of enum
'llvm::Triple::OSType' is not handled
2017-01-26 10:11:34 +00:00
Erik Eckstein
4c7d68b590 Mangling: fix compile error in release build 2017-01-25 12:37:57 -08:00
Erik Eckstein
f15075f88b Mangling: fix the check if a new mangled name contains an old mangled function name.
This is used to decide whether a symbol should be tested for correct re-mangling.
2017-01-24 17:46:18 -08:00
Erik Eckstein
21ff1ba378 Mangling: fix wrong re-mangling of identifier-like node substitutions.
rdar://problem/30172848
2017-01-24 17:34:32 -08:00
Erik Eckstein
4d00ac1bba New mangling: add a -new-mangling-for-tests option.
This option enables the new mangling for everything except the Swift stdlib module.
Used to switch test files explicitly to the new mangling.
2017-01-24 15:27:45 -08:00
Erik Eckstein
a56a97c89f Mangling: prepare for using new mangling for USR and debug-info type generation.
Select between old and new mangling as we already do in other places in the compiler.
NFC as long as the new mangling is not enabled yet.
2017-01-23 17:49:00 -08:00
Erik Eckstein
8730f9d5fb Mangling: correct de-mangling of type aliases when used in debug type mangling 2017-01-23 17:49:00 -08:00
practicalswift
a9d6d8938c [gardening] Fix recently introduced typos 2017-01-22 20:40:45 +01:00
Slava Pestov
7b5cf4ab7d Merge pull request #3841 from tinysun212/pr-swiftc-cygwin-2
[swiftc] Fixed for Cygwin
2017-01-19 20:17:47 -08:00
Hugh Bellamy
975d8d1297 Fix Windows build as a result of recent TaskQueue changes 2017-01-19 09:22:28 +00:00
Han Sangjin
b8dd577693 [swiftc] Fixed for Cygwin
Fixed for the difference of Cygwin with other Windows variants (MSVC,
Itanium, MinGW).

- The platform name is renamed to "cygwin" from "windows" which is used
  for searching the standard libraries.

- The consideration for DLL storage class (DllExport/DllImport) is not
  required for Cygwin and MinGW. There is no problem when linking in
  these environment.

- Cygwin should use large memory model as default.(This may be changed
  if someone ports to 32bit)

- Cygwin and MinGW should use the autolink feature in the sameway of
  Linux due to the linker's limit.
2017-01-19 05:48:24 +09:00
Robert Widmann
3eba4fd3ab Merge pull request #6787 from matthewcarroll/SR-3175-Include-signal-number-in-parseable-output-message
SR-3175: Include the terminating signal number in the driver output
2017-01-18 11:00:59 -07:00
Bob Wilson
34514513fd Merge remote-tracking branch 'origin/master' into master-next 2017-01-15 17:34:17 -08:00
Slava Pestov
62b12edc4b Merge pull request #6819 from hughbe/uuid-linkers
Fix linker failures compiling Swift on Windows
2017-01-15 13:47:19 -08:00
Hugh Bellamy
09abbfeefd Fix lib/Basic Windows/Cygwin build
(cherry picked from commit ff17c26b7a)

https://github.com/apple/swift/pull/6812
2017-01-14 20:48:43 -05:00
Hugh Bellamy
9414f46731 Fix linker failures compiling Swift on Windows 2017-01-14 21:01:55 +00:00
Hugh Bellamy
2445862e1b FIx recently introduced MSVC control path warnings 2017-01-14 12:40:41 +00:00
Slava Pestov
e61bf33980 Merge pull request #5945 from slavapestov/remove-archetype-mangling
Remove archetype mangling
2017-01-13 12:07:57 -08:00
Matthew Carroll
5497bfb7b4 SR-3175: Include the terminating signal number in the driver output
* Add the signal number of the terminated task to the output of the driver on platforms for which the signal number is available. The new key in the parseable driver output is "signal".
* Add a test to verify that the signal number is emitted.
* Add documentation for the new "signal" key emitted in the parseable driver output.

https://bugs.swift.org/browse/SR-3175
2017-01-13 13:48:41 -05:00
Erik Eckstein
ac90e27aa7 Demangler: fix a crash when trying to demangle wrong mangled generic args
The actual problem is that the mangling is wrong. But it’s hard to fix now and we will switch to the new mangling anyway.
So this fix just makes sure the demangler (and therefore lldb) does not crash.

fixes rdar://problem/29881277
2017-01-13 08:48:41 -08:00
Slava Pestov
ee295ddbb8 AST: Nuke the unqualified archetype mangling 2017-01-12 23:20:35 -08:00
Bob Wilson
c765d5e3a5 Merge remote-tracking branch 'origin/master' into master-next 2017-01-12 15:58:19 -08:00
Slava Pestov
bbecb33d13 Merge pull request #4532 from jtbandes/suggestions
[QoI] offer typo correction for platform conditionals
2017-01-12 13:31:05 -08:00
swift-ci
808c48401f Merge pull request #6743 from swiftix/wip-partial-pre-specializations-wip-layout-constraints 2017-01-12 10:12:44 -08:00