Commit Graph

8 Commits

Author SHA1 Message Date
Hamish Knight
1ffa8eeea4 [ClangImporter] Query Preprocessor::macros instead of getPreprocessingRecord for header printing
This better matches what the clang importer does
normally, avoids a Clang issue where
`getPreprocessedEntitiesInRange` returns incorrect
results, and avoids the need to enable the
preprocessor record. This then lets us re-enable
`print_clang_headers.swift`.

rdar://102151774
2023-05-11 21:10:28 +01:00
Ben Langmuir
b083020759 Revert "Normalize version tuples in availability attributes coming from clang to use "."" 2017-09-05 14:03:31 -07:00
Ben Langmuir
f1c48daf70 Normalize version tuples in availability attributes coming from clang to use "."
Seen as @available attributes being printed with "_" in interface
generation, but fixing it in the importer means they can't leak into
anywhere else.

rdar://problem/30451293
2017-09-01 16:24:21 -07:00
Jordan Rose
01cb554387 Re-apply "Make all CF types Equatable and Hashable." (#4568)
Like NSObject, CFType has primitive operations CFEqual and CFHash,
so Swift should allow those types to show up in Hashable positions
(like dictionaries). The most general way to do this was to
introduce a new protocol, _CFObject, and then have the importer
automatically make all CF types conform to it.

This did require one additional change: the == implementation that
calls through to CFEqual is in a new CoreFoundation overlay, but the
conformance is in the underlying Clang module. Therefore, operator
lookup for conformances has been changed to look in the overlay for
an imported declaration (if there is one).

This re-applies 361ab62454, reverted in
f50b1e73dc, after a /very/ long interval
where we decided if it was worth breaking people who've added these
conformances on their own. Since the workaround isn't too difficult---
use `#if swift(>=3.2)` to guard the extension introducing the
conformance---it was deemed acceptable.

https://bugs.swift.org/browse/SR-2388
2017-05-08 14:05:11 -07:00
Argyrios Kyrtzidis
2ec7a31b6f [IDE] When doing ObjC header interface printing, ignore forward references to protocols as well.
Swift SVN r30945
2015-08-03 15:25:19 +00:00
Argyrios Kyrtzidis
881a98bca9 [IDE] When doing ObjC header interface printing, ignore decls in that header that are forward references.
rdar://21135249

Swift SVN r30941
2015-08-03 05:27:11 +00:00
Argyrios Kyrtzidis
d9032c0e39 [IDE] Make sure that ClangImporter::lookupDeclsFromHeader forwards to the passed in filter
function and that filter receives macros as well.

Swift SVN r28971
2015-05-23 20:20:27 +00:00
Argyrios Kyrtzidis
42cc79b27a [test] Move inputs for test/IDE/print_clang_header.swift to their own subdirectory. NFC.
Swift SVN r28960
2015-05-23 08:14:54 +00:00