Commit Graph

11 Commits

Author SHA1 Message Date
Alejandro Alonso
234410f2fe Change to _hasAtomicBitWidth 2023-10-09 14:05:45 -07:00
Alejandro Alonso
a3f4361280 Add _atomicBitWidth compilation conditional
fix warning
2023-09-29 14:43:34 -07:00
Dario Rexin
294342a1d3 Add _pointerBitWidth platform condition (#41534)
* Add _pointerBitWidth platform condition

* Fixes after rebasing

---------

Co-authored-by: Xiaodi Wu <xiaodi.wu@gmail.com>
2023-03-21 20:59:32 -07:00
Rintaro Ishizaki
5cbbadb750 [Parse] Migrate tests to Swift4 2018-07-07 01:29:43 +09:00
Slava Pestov
5d2752f7d2 Run tests with -swift-version 4 by default
Some test now fail, so add an explicit -swift-version 3.
2018-06-19 23:24:19 -07:00
Graydon Hoare
3807b3fa1e [Parse] Add platform conditional targetEnvironment(simulator) 2017-11-28 13:51:01 -08:00
Rintaro Ishizaki
04f31a76c0 Merge pull request #7955 from rintaro/parse-ifconfig-validate
[Parse] Separate compilation condition validation and evaluation
2017-05-16 12:06:31 +09:00
practicalswift
7eb7d5b109 [gardening] Fix 100 typos. 2017-04-18 17:01:42 +02:00
Rintaro Ishizaki
bd3b2c6601 [Parse] Add warning for compound name in compilation condition in swift3 2017-03-29 00:43:28 +09:00
Rintaro Ishizaki
b56ab17fa5 [Parse] Separate compilation condition validation and evaluation
Fixes:
https://bugs.swift.org/browse/SR-3455
https://bugs.swift.org/browse/SR-3663
https://bugs.swift.org/browse/SR-4032
https://bugs.swift.org/browse/SR-4031

Now, compilation conditions are validated at first, then evaluated. Also,
in non-Swift3 mode, '&&' now has higher precedence than '||'.
'A || B && C || D' are evaluated as 'A || (B && C) || D'.

Swift3 source breaking changes:

* [SR-3663] This used to be accepted and evaluate to 'true' because of short
  circuit without any validation.

  #if true || true * 12 = try Anything is OK?
  print("foo")
  #endif

  In this change, remaining expressions are properly validated and
  diagnosed if it's invalid.

* [SR-4031] Compound name references are now diagnosed as errors.
  e.g. `#if os(foo:bar:)(macOS)` or `#if FLAG(x:y:)`

Swift3 compatibility:

* [SR-3663] The precedence of '||' and '&&' are still the same and the
  following code evaluates to 'true'.

  #if false || true && false
  print("foo")
  #endif
2017-03-23 01:25:29 +09:00
Rintaro Ishizaki
1d499546eb [Parse] Don't construct DeclRefExpr in #if conditions (#7522)
This code should compile:

  func foo(FOO: Int, swift: String, Linux: Bool) {
  #if FOO && swift(>=3.0) && os(Linux)
    // do something
  #endif
  }
2017-02-17 12:41:42 +09:00