Commit Graph

62 Commits

Author SHA1 Message Date
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Todd Fiala
8cb107cab6 Added llvm namespace qualifier to StringRef.
Fixes an lldb build break when including Version.h.


Swift SVN r32730
2015-10-16 21:10:38 +00:00
David Farler
e1a7a0f0ab Refactor CompilerVersion
This is a WIP to make CompilerVersion more general.

- Rename CompilerVersion to just "Version"
- Make version comparison general and put _compiler_version special logic
  with its second version component in a specialized parsing function
- Add a generic version parsing function

Swift SVN r32726
2015-10-16 17:43:28 +00:00
David Farler
7c48e3a362 Define __SWIFT_COMPILER_VERSION in the ClangImporter
Pass a preprocessor definition for the internal compiler
version when importing types.

rdar://problem/23100689

Swift SVN r32725
2015-10-16 17:43:27 +00:00
David Farler
a67596a9d9 Enforce practical limits of _compiler_version
Internal compiler versions must be able to be packed into a 64-bit
value, and there is a limit on how many components we can use and which
values they can take on.

Versions must have no more than five components, assuming a version
X.Y.Z.a.b, where X, Y, Z, a, and b are integers with the following
inclusive ranges:

X: [0 - 214747]
Y: [0 - 999]
Z: [0 - 999]
a: [0 - 999]
b: [0 - 999]

Swift SVN r32724
2015-10-16 17:43:24 +00:00
Sean Callanan
8fd7ba162f Use the llvm:: namespace to refer to StringRef and SmallVector, fixing lldb.
Swift SVN r32301
2015-09-29 17:09:57 +00:00
David Farler
2a0f027317 Review changes for _compiler_version
A couple of small tweaks to _compiler_version based on review comments:
- Fix &&/|| rejection to work with _compiler_version on either side of the
expression. Also add some test cases around this.
- Use clang/LLVM facilities for isdigit and atoi.
- Assert if parsing an invalid version string and there is no diagnostic
engine.
- Clean up some crumbs in the CMake configs.

rdar://problem/22730282

Swift SVN r32212
2015-09-24 22:47:01 +00:00
David Farler
9d373d0fc7 Add _compiler_version build configuration
This configuration clause will suppress lex diagnostics and skip parsing
altogether if the code under the clause isn't active - the compiler must
have a repository version greater than or equal to the version given to
_compiler_version.

This option is only meant to be used sparingly and not to track the
Swift *language* version.

Example, if using a compiler versioned 700.0.28:

  #if _compiler_version("700.0.23")
    print("This code will compile for versions 700.0.23 and later.")
  #else
    This + code + will + not + be + parsed
  #endif

Included are new diagnostics for checking that the version is formatted
correctly and isn't empty.

New tests:
- Compiler version comparison unit tests
- Build configuration diagnostics
- Skipping parsing of code under inactive clauses

rdar://problem/22730282

Swift SVN r32195
2015-09-24 02:14:47 +00:00
Dmitri Hrybenko
41cd10e3f1 build-script/libSwiftBasic: properly propagate the Swift version down to
Version.cpp

rdar://19166288 rdar://19445760

Swift SVN r24592
2015-01-21 05:01:42 +00:00
Adrian Prantl
801dc3d20e Debug info: Actually encode the Swift version number instead of constant 1.
<rdar://problem/18729762> CU's RuntimeVersion field should have the Swift runtime version number

Swift SVN r23087
2014-11-03 17:48:06 +00:00
Joe Pamer
7b771affd9 Add limited build configuration support for testing against compiler submit versions. (rdar://problem/16337966)
This is meant to be utilized for a narrow set of scenarios specific to dogfooding our pre-1.0 compiler, so please do not take any dependencies on this.  In fact, I'll be removing this in the next milestone.  (See rdar://problem/16380797.)

Also included - improve error recovery when parsing broken build configuration clauses.

Swift SVN r15694
2014-03-31 20:34:02 +00:00
Connor Wakamo
ed2038585f Initial set of changes to add a new 'swift_driver' executable.
- Added a couple of new targets:
  - libswiftDriver, which contains most of the driver implementation
  - swift_driver, which produces the actual executable

- Added centralized version information into libswiftBasic.

- Added a new "Driver Design & Internals" document, which currently describes
  the high-level design of the Swift driver.

- Implemented an early version of the functionality of the driver, including
  versions of the Parse, Pipeline, Bind, Translate, and Execute driver stages.
  Parse, Pipeline, and Bind are largely implemented; Translate and Execute are
  early placeholders. (Translate produces "swift_driver --version" and "ld -v"
  commands, while Execute performs all subtasks sequentially, rather than in
  parallel.)

This is just the starting point for the Swift driver. Tests for the existing
behavior are forthcoming.

Swift SVN r10933
2013-12-06 21:23:01 +00:00