Commit Graph

25 Commits

Author SHA1 Message Date
Bob Wilson
deddf19aae Merge remote-tracking branch 'origin/master' into master-next 2016-12-13 10:23:03 -08:00
Hugh Bellamy
137b2ab295 Fix errors and warnings building swift/reflection on Windows with MSVC 2016-12-11 10:00:32 +00:00
Bob Wilson
13da3fa8b1 Merge remote-tracking branch 'origin/master' into master-next 2016-12-04 18:16:09 -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
Bob Wilson
9cc68d6c9f Update for clang r283671: remove use of clEnumValEnd. 2016-10-15 11:02:20 -07:00
Michael Gottesman
cb5aa4d093 Merge pull request #3007 from compnerd/expected-more
[master-next] swift-reflection-dump: Expected more
2016-06-25 02:14:04 -07:00
Michael Gottesman
8d00a6cb59 Merge remote-tracking branch 'origin/master' into master-next
Conflicts:
	stdlib/public/SDK/GameplayKit/CMakeLists.txt
	test/DebugInfo/bound-namealiastype.swift
	test/DebugInfo/structs.swift
	test/IRGen/c_globals.swift
	test/SourceKit/DocSupport/doc_clang_module.swift
	test/SourceKit/Indexing/index_with_clang_module.swift
	utils/update-checkout
2016-06-25 01:13:50 -07:00
Saleem Abdulrasool
aff54d5d80 swift-reflection-dump: Expected more
Now that more APIs are returning expected, just change unwrap to use the
Expected interface and remove the Expected to Error conversion.
2016-06-13 14:45:12 -07:00
Slava Pestov
5cc4ce1760 Reflection: Looking up CaptureDescriptors by remote address
Remote metadata for closure contexts points to a capture descriptor.
We have a local copy of all capture descriptors. Translate the
address by recording the local and remote start address of
reflection metadata.
2016-05-09 13:40:57 -07:00
Mark Lacey
b044c4d74f Fixes for uses of new Expected<T> type in LLVM. 2016-05-03 17:02:54 -07:00
Slava Pestov
71d28691ef Reflection: Plumb through capture descriptor section 2016-05-02 01:16:25 -07:00
Slava Pestov
faecfda594 Reflection: Consolidate some code for passing around reflection sections
I'm about to add a new section, and I'd like to update as few
places as possible.
2016-04-30 15:12:38 -07:00
Slava Pestov
95d648779b Reflection: Fix some bugs in swift-reflection-test
- Improper handling of read() returning an incomplete read
- Update SwiftReflectionTest library for new builtin types section

Only tested manually so far; automated tests coming soon.
2016-04-27 18:17:25 -07:00
Slava Pestov
2380f9f957 Re-apply "Reflection: Preliminary implementation of struct and tuple type lowering"
Re-apply now that reflection metadata is emitted by default and
the test can actually pass. Oops...
2016-04-21 15:15:38 -07:00
Greg Parker
4f98a54eb4 Revert "Reflection: Preliminary implementation of struct and tuple type lowering" and "Reflection: Fix a nit"
Test Reflection/typeref_lowering.swift failed on a bot:
https://ci.swift.org/job/oss-swift-package-osx/1346/

This reverts commits 52f475c0b0 and f4af29b53c.
2016-04-19 01:51:48 -07:00
Slava Pestov
52f475c0b0 Reflection: Preliminary implementation of struct and tuple type lowering
Now that we can parse and substitute typerefs, and look up field
types, we finally have enough infrastructure in place to do some
basic layout of struct and tuple types from within the Reflection
library.

To facilitate testing, swift-reflection-dump now accepts multiple
-binary-filename flags, allowing types defined in the standard
library to be looked up.

More detailed end-to-end tests will come once I finish the
typeref-to-metadata builder.
2016-04-18 23:13:50 -07:00
Slava Pestov
3936cd2f78 Reflection: swift-reflection-dump now only needs a TypeRefBuilder and not a ReflectionContext, NFC
Since swift-reflection-dump does not have a remote address space,
it doesn't need a full ReflectionContext. Now that TypeRefBuilder
has been refactored, we can use that instead.
2016-04-16 02:19:29 -07:00
Slava Pestov
824bd7544d IRGen: Emit typerefs for all builtin types referenced from reflection metadata sections
In order to perform layout, the remote mirrors library needs to know
about the size, alignment and extra inhabitants of builtin types.

Ideally we would emit a reflection info section in libswiftRuntime.o,
but in the meantime just duplicate builtin type metadata for all
builtin types referenced from the current module instead.

In practice only the stdlib and a handful of overlays like the SIMD
overlay use builtin types, and only a few at a time.

Tested manually by running swift-reflection-tool on the standard
library -- I'll add automated tests by using -parse-stdlib to
reference Builtin types in a subsequent patch that adds more layout
logic.

NFC if -enable-reflection-metadata is off.
2016-04-15 00:12:11 -07:00
Chris Lattner
2f9e91d267 make an 'else' block unconditional, aborting if the cast<> fails. The
old code would end up dereferencing an uninitialized pointer in the case
where the cast would fail, it is better to explode violently.
2016-04-12 21:07:28 -07:00
Slava Pestov
b898f43972 Reflection: Fix memory management issue in swift-reflection-dump
MachOUniversalBinary::getObjectForArch() returns a value containing
a unique_ptr; if we just fish out the unique_ptr value using get(),
it will be freed too soon.

Instead, hold on to the unique_ptr until we are done with everything.
2016-04-12 19:15:37 -07:00
Slava Pestov
39f0fff19d Reflection: Small stylistic cleanups, NFC 2016-04-12 19:15:36 -07:00
John McCall
91f02848df Organize the MemoryReader interface headers to better support
multiple clients.
2016-04-12 16:05:29 -07:00
David Farler
358a0fefe8 Add SwiftRemoteMirror library
This will wrap the ./lib/Reflection functionality in a C
interface.
2016-04-05 13:45:46 -07:00
practicalswift
cd41538162 [gardening] Fix file header formatting. 2016-03-30 18:20:50 +02:00
David Farler
5ea5bb06a3 Split swift-refleciton-test into host and target test targets
swift-reflection-test is now the test that forks a swift executable
and performs remote reflection, making it runnable on other targets,
such as the iOS simulator.

swift-reflection-dump is now a host-side tool that dumps the remote
reflection sections for any platform binary and will continue to
link in LLVM object file support.

This necessitates finally moving lib/Refleciton into stdlib/public,
since we're linking target-specific versions of the test tool and
we would eventually like to adopt some of this functionality in
the runtime anyway.
2016-03-28 16:34:44 -07:00