Commit Graph

38 Commits

Author SHA1 Message Date
Bob Wilson
8e330ee344 NFC: Fix indentation around the newly renamed LLVM_DEBUG macro.
Jordan used a sed command to rename DEBUG to LLVM_DEBUG. That caused some
lines to wrap and messed up indentiation for multi-line arguments.
2018-07-21 00:56:18 -07:00
Jordan Rose
cefb0b62ba Replace old DEBUG macro with new LLVM_DEBUG
...using a sed command provided by Vedant:

$ find . -name \*.cpp -print -exec sed -i "" -E "s/ DEBUG\(/ LLVM_DEBUG(/g" {} \;
2018-07-20 14:37:26 -07:00
Ben Cohen
a1adf9f347 Squash a few more unused warnings (#17743) 2018-07-05 08:24:17 -07:00
Slava Pestov
34fd4ae512 AST: Use DeclBaseName::Kind::Constructor
Fixes <rdar://problem/35852727>, <https://bugs.swift.org/browse/SR-1660>,
<https://bugs.swift.org/browse/SR-6557>.
2018-03-16 00:25:56 -07:00
Bob Wilson
e55cc83fa6 Adjust use of Preprocessor::getCurrentSubmodule to match clang r302098. 2017-05-06 11:22:44 -07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Michael Gottesman
1af1cbfb76 [gardening] Add a bunch of end namespace comments found by clang-tidy. 2016-12-06 19:22:52 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Michael Ilseman
15af7f224d [ClangImporter] Refactor Clang reasoning into new files.
Introduces new files ClangAdapter.h/cpp, which will serve as a
convenient place to put code reasoning about Clang details. Refactors
out most Clang-related is*, has*, and get* methods from the
ImporterImpl. In the future, an adapter class could help serve to
seperate the concerns of the importer from the details of how to
correctly use Clang APIs.
2016-09-12 21:02:09 -07:00
Michael Ilseman
b51e0f61f7 [ClangImporter] Refactor off CF reasoning helpers
Move helper methods off of the Impl and into CFTypeInfo.h, where we
have the other CF type reasoning logic.

NFC
2016-09-10 18:41:06 -07:00
Michael Ilseman
9d76ce983e [Import as Member] Fix oversight where we skip getter validation.
In the code that makes sure to pair up getters/setters only from the
same top level module, we were accidentally skipping the final
validity checks (e.g. do the number of parameters line up). This fixes
that.
2016-06-30 18:34:29 -07:00
Doug Gregor
abc42b459e [Clang importer] Allow a CF type spelled with "void *".
There wasn't any justification for the "const" restriction. Fixes
rdar://problem/24821660.
2016-05-24 22:39:20 -07:00
Michael Ilseman
667615307c [Import as Member] Skip needless prefix words.
When adding a prefix to the first argument of an initializer, skip
needless leading words such as "With" or "CF".
2016-05-06 14:50:58 -07:00
Michael Ilseman
08ac432d3c [Import as member] Don't pair up get/set pairs from other modules
While inferring get/set, we paired them up even when one of them was
available through a custom objc header (e.g. a private
header). Instead, fail to pair them up. Test case added.
2016-04-13 13:08:16 -07:00
Michael Ilseman
a51d4330d4 [Import as member] Don't infer special CF memory management names 2016-04-06 11:03:18 -07:00
Michael Ilseman
427bf752a4 [Import as member] Perform checks on get-only property inference
Fixes a bug where we weren't performing enough checks on inferred
computed properties that did not have a pair-ed up setter.
2016-04-06 11:03:18 -07:00
Michael Ilseman
2eda983846 [Import as member] Don't create empty Identifiers
Instead of creating empty Identifiers for empty parameter labels,
create null ones. This fixes issues where we meant to infer wildcard
labels.
2016-04-04 15:46:38 -07:00
practicalswift
c553385e62 [gardening] Fix recently introduced typo: "rougly" → "roughly" 2016-03-28 21:52:02 +02:00
Michael Ilseman
028c5bad6b [Import as member] Abort inference on undefined structs 2016-03-14 10:27:03 -07:00
Michael Ilseman
03a16e0e07 [Import as member] Properly handled CF and attributed types.
Read through attributed types when determing effective Clang decl
context, use lower level CF type information, and const-ify
EffectiveClangContext.

This puts an end to known disappearing imported members.
2016-03-10 18:53:51 -08:00
Michael Ilseman
2fc931494e [Import as member] Desugar to find the effective Clang decl context.
Adds incremental de-sugaring to any non-CF typedefs we find in our
types when trying to determine the effective DC. Additionally, cleans
up some logic and allows us to fail earlier on types we cannot
possibly extend.
2016-03-10 16:42:47 -08:00
Michael Ilseman
c494f2478a [Import as member] Extend 'Mutable' skipping to method inference 2016-03-10 13:27:44 -08:00
Michael Ilseman
de913b3512 [Import as member] Ignore all case for unique-concat-ing labels 2016-03-10 12:49:30 -08:00
Michael Ilseman
3dbbd69912 [Import as member] Special case 'Mutable' types
Recognize the special word Mutable in type names and other matches, so
as to import them onto the mutable type despite word re-ordering.
2016-03-10 11:55:38 -08:00
Michael Ilseman
594cf05331 [Import as member] Omit needless words
This hooks up omitNeedlessWords to import as member.

Unfortunately, we are now left straddling different approaches to
handling our strings, I'll be refactoring that soon.
2016-03-10 11:21:59 -08:00
Michael Ilseman
81f16c311a [Import as member] Skip globals whose names begin with underscore 2016-03-09 15:40:11 -08:00
Michael Ilseman
6757d2a361 [Import as member] Drop redundancies when forming new names 2016-03-09 15:21:55 -08:00
Michael Ilseman
3c690d422d [Import as method] Create an empty tuple first parameter
For function that we are importing as init, if there's dangling words
after the "Create" or "Make", we move them onto the first argument
label. This introduces the creation of an empty tuple parameter when
that init has no arguments.
2016-03-09 15:20:04 -08:00
Michael Ilseman
32faa62502 [Import as member] Lower case initialisms 2016-03-09 14:26:43 -08:00
Michael Ilseman
d5007ed080 [Clang importer] Clean up inference word manipulations.
NFC
2016-03-08 23:27:55 -08:00
Michael Ilseman
ff2db64b6f [Clang importer] Infer import as member name uniquing
In many contexts we may end up concatinating strings which introduce
redundancy in the resulting names. This uniques them.
2016-03-08 18:25:26 -08:00
Michael Ilseman
bbe1f7a0a5 [Clang importer] Extra correctness checks for inferring as properties.
Introduces validToImportAsProperty, which has to perform extra
checking the make sure that a get/set pair are compatible with import
as a property. This includes matching up 'self' parameters, matching
get's return type with the set's argument type, etc. Includes more
extensive tests.
2016-03-08 16:35:30 -08:00
Michael Ilseman
3f7c54d0e7 [Clang importer] Introduce inference statistics and debug output.
NFC
2016-03-08 15:27:02 -08:00
Michael Ilseman
f96b8d64f7 [Clang importer] Infer init: move extra words onto first parameter 2016-03-07 17:55:13 -08:00
Michael Ilseman
73f7fd2eb6 [Clang importer] Infer get-only properties and static properties.
Expands support for inference of computed properties, whether instance
or static, to include get-only. Adds test cases for both inference and
manual annotation for static computed properties.
2016-03-07 16:51:34 -08:00
Michael Ilseman
c39aebce24 [Clang importer] Infer static properties and methods
Adds inference support for static properties and methods, requiring us
to accurately do longest-prefix typename searches.

Tests cases included.
2016-03-07 16:36:59 -08:00
Michael Ilseman
3b8f498324 [Clang importer] Lower camel-case inferred names 2016-03-07 10:50:08 -08:00
Michael Ilseman
d38f190acb [Clang importer] Basic import-as-member inference system
Introduces import-as-member (IAM) inferene system, to automatically
infer details that would otherwise have to be manually specified with
the swift_name attribute.

Basic functionality present, though there are some issues with
properties at the moment. No hooks, options, or tests yet, stay tuned.
2016-03-06 23:54:56 -08:00