Enable the new Swift driver!

This substitutes swift_driver in as the new "swift". Tests that currently
test "%swift" will invoke "swift -frontend", much like "clang -cc1".
Most command-line interaction will look the same, except that Swift can
now emit linked libraries (using -emit-library) and executables (using
-emit-executable, or by not passing a mode option at all).

If you are working with @transparent functions, note that they will not be
properly inlined across file boundaries unless you use
-force-single-frontend-invocation, which emulates the old swift binary.
There are Radars for this already: <rdar://problem/15366167&15693042>

The name 'swift_driver' is now a symlink for 'swift'. This will be removed
next week.

The old 'swift' is still available as 'swift_old', though it is not being
tested at all. This will be removed in two weeks.

Clean CMake builds will get this immediately.

Incremental CMake builds will not get the new driver unless you explicitly
enable the SWIFT_NEW_DRIVER option (-DSWIFT_NEW_DRIVER=ON on the command line).
This option will go away in a week.

Makefile builds will get this immediately because I didn't want to work out
how to maintain both modes.

Much credit to Connor for bringing up the entire driver and for doing much
of the work in ensuring that all the tests continue to pass.

Swift SVN r13380
This commit is contained in:
Jordan Rose
2014-02-03 22:48:39 +00:00
parent e9e4db4168
commit 16b5a57838
9 changed files with 12 additions and 8 deletions

View File

@@ -31,7 +31,7 @@ PATH_TO_SWIFT_SOURCES := $(addprefix $(PROJ_SRC_DIR)/, $(SWIFT_SOURCES))
$(SWIFT_HEADER_DIR)/UIKit.swiftmodule: $(ObjDir)/UIKit.o $(SWIFT_HEADER_DIR)
$(ObjDir)/UIKit.o: $(PATH_TO_SWIFT_SOURCES) $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE) $(SWIFT_COMPILER) $(LibDir)/libswift_runtime.a
$(Echo) "Compiling $(notdir $@) for $(BuildMode) build"
$(Verb) $(SWIFT_COMPILER) $(SWIFT_FLAGS) -o $@ -c -emit-module -module-link-name $(LIBRARYNAME) -parse-as-library $(PATH_TO_SWIFT_SOURCES)
$(Verb) $(SWIFT_COMPILER) $(SWIFT_FLAGS) -o $@ -c -emit-module -module-link-name $(LIBRARYNAME) -force-single-frontend-invocation -parse-as-library $(PATH_TO_SWIFT_SOURCES)
@mv $(ObjDir)/UIKit.swiftmodule $(SWIFT_HEADER_DIR)
all-local:: $(SWIFT_HEADER_DIR)/UIKit.swiftmodule