summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/cf-runtime-abi.c
Commit message (Collapse)AuthorAgeFilesLines
* CodeGen: ensure 8-byte aligned String Swift CF ABISaleem Abdulrasool2019-08-091-0/+6
| | | | | | | | | CFStrings should be 8-byte aligned when built for the Swift CF runtime ABI as the atomic CF info field must be properly aligned. This is a problem on 32-bit platforms which would give the structure 4-byte alignment rather than 8-byte alignment. llvm-svn: 368471
* CodeGen: correct the case for swift 4.2, 5.0Saleem Abdulrasool2018-10-261-9/+9
| | | | | | | This corrects the leader for the swift names. The encoding for 4.2 and 5.0 differ by a single bit on the second character and were swapped. llvm-svn: 345360
* CodeGen: alter CFConstantString class name for swift 5.0Saleem Abdulrasool2018-10-251-4/+4
| | | | | | | Swift 5.0 has changed the name decoration for swift symbols, using a 'S' sigil rather than 's' as in 4.2. Adopt the new convention. llvm-svn: 345291
* Driver,CodeGen: introduce support for Swift CFString layoutSaleem Abdulrasool2018-10-241-0/+60
Add a new driver level flag `-fcf-runtime-abi=` that allows one to specify the runtime ABI for CoreFoundation. This controls the language interoperability. In particular, this is relevant for generating the CFConstantString classes (primarily through the `__builtin___CFStringMakeConstantString` builtin) which construct a reference to the "CFObject"'s `isa` field. This type differs between swift 4.1 and 4.2+. Valid values for the new option include: - objc [default behaviour] - enable ObjectiveC interoperability - swift-4.1 - enable interoperability with swift 4.1 - swift-4.2 - enable interoperability with swift 4.2 - swift-5.0 - enable interoperability with swift 5.0 - swift [alias] - target the latest swift ABI Furthermore, swift 4.2+ changed the layout for the CFString when building CoreFoundation *without* ObjectiveC interoperability. In such a case, a field was added to the CFObject base type changing it from: <{ const int*, int }> to <{ uintptr_t, uintptr_t, uint64_t }>. In swift 5.0, the CFString type will be further adjusted to change the length from a uint32_t on everything but BE LP64 targets to uint64_t. Note that the default behaviour for clang remains unchanged and the new layout must be explicitly opted into via `-fcf-runtime-abi=swift*`. llvm-svn: 345222
OpenPOWER on IntegriCloud