Commit Graph

520 Commits

Author SHA1 Message Date
David Farler 5ca4b428eb [TypeRef] Add isStruct, isClass, isEnum accessors
These will be used during layout calculation and for nicer
printing.
2016-03-17 19:03:13 -07:00
Ted Kremenek b796305846 Merge pull request #1371 from hpux735/thumb
Added thumb to supported platforms conditions
2016-03-08 22:10:13 -08:00
David Farler e958f99acf Revert "Mangle declared interface type into NominalTypeDescriptor's Name"
This reverts commit 2262bd579a.

This information isn't necessary for field descriptor lookup,
after all. It's only the fields that need to have generic information,
which is already in the field descriptor.
2016-03-03 12:55:35 -08:00
David Farler 2262bd579a Mangle declared interface type into NominalTypeDescriptor's Name
Previously, the mangling didn't include generics, but these are
needed to key off of the new field descriptor metadata, as well
as to construct type references for the nominal type.
2016-03-03 12:14:38 -08:00
AnnaZaks 767d9ca914 Merge pull request #1434 from apple/asan
[asan] Add basic support for Address Sanitizer function instrumentation
2016-02-29 18:58:40 -08:00
Doug Gregor 87f1d577a3 [Omit needless words] Retain "with" after splitting more regularly.
The verb-based heuristic was unpredictable and not clearly
better. Back off to something more obvious.
2016-02-29 13:14:24 -08:00
Doug Gregor b890e4c29f [Omit needless words] Use the property lists to restrict BaseNameSelf pruning.
This eliminates some apparent inconsistencies in the translation,
fixing rdar://problem/24860176.
2016-02-29 13:14:23 -08:00
practicalswift 34188788a1 [gardening] Sort file listings in CMakeLists.txt files 2016-02-27 19:50:30 +01:00
zaks 2110235fd3 [asan] Cleanup based on Jordan's review comments 2016-02-26 16:02:40 -08:00
zaks d727c68fde [asan] Add "unsupported option .. for target" error message
ASan support for Linux does not exist at this point.
2016-02-25 15:20:51 -08:00
zaks ef925f8fb3 [asan] Add basic support for Address Sanitizer function instrumentation
ASan allows to catch and diagnose memory corruption errors, which are possible
when using unsafe pointers.

This patch introduces a new driver/frontend option -sanitize=address to enable
ASan. When option is passed in, the ASan llvm passes will be turned on and
all functions will gain SanitizeAddress llvm attribute.
2016-02-24 09:45:38 -08:00
zaks f049c24a02 Introduce a helper to make switching on darwin platforms less error prone
Introduce DarwinPlatformKind, which would allow us to switch on darwin
platforms instead of copying and pasting the brittle logic in several places.
Use the helper method to simplify ClangImporter.
2016-02-23 19:09:25 -08:00
Doug Gregor 5290a381b4 [Omit needless words] Stop moving "of" onto the base name.
The benefits from moving "of" onto the base name were outweighed by
the complications to the API guidelines.
2016-02-23 10:24:03 -08:00
Dmitri Gribenko 7235595264 Merge pull request #1108 from tinysun212/porting-to-cygwin
Porting to cygwin
2016-02-22 18:53:30 -08:00
Doug Gregor 4e16f625b1 [Omit needless words] "de-" is a verb prefix.
... and handle verb prefixes properly.
2016-02-22 14:11:09 -08:00
Erik Eckstein 27929cba2a Support for mangling of generic specializations with different reabstraction.
This will be needed when the generic specializer will be able to change indirect arguments/results to direct arguments/results.
2016-02-22 13:58:10 -08:00
Doug Gregor 24cede9543 [Omit needless words] Treat "Mask" as a skippable type suffix.
Fixes rdar://problem/23751733.
2016-02-22 11:39:20 -08:00
Doug Gregor 03fe1d0a35 [Omit needless words] More Cocoa verbs: activate, deactivate, reattach.
Fixes rdar://problem/23556916.
2016-02-22 11:22:09 -08:00
Han Sangjin e06c7136cb Porting to Cygwin. rebased and squashed 2016-02-22 13:20:21 +09:00
William Dillon 390e50c999 Added thumb to supported platforms conditions 2016-02-21 16:56:02 +00:00
Doug Gregor 4b116d0e26 [Omit needless words] enqueue/dequeue are verbs 2016-02-16 16:17:56 -08:00
Doug Gregor bc18e4521b [Omit needless words] After "by", recognize gerunds more liberally. 2016-02-12 16:40:10 -08:00
Jordan Rose c90511a74e Merge pull request #1289 from jrose-apple/conditional-compilation-blocks
Rename "build configurations" to "conditional compilation blocks".
2016-02-12 14:02:21 -08:00
Doug Gregor 1cd7a8611d [Omit needless words] Introduce set-specific verbs. 2016-02-12 12:52:13 -08:00
Doug Gregor 0e46850a66 [Omit needless words] "ObjectValue" in the name matches "Object" in the type.
Fixes rdar://problem/24618946.
2016-02-12 12:41:40 -08:00
Jordan Rose 6272941c5c Rename "build configurations" to "conditional compilation blocks".
...because "build configuration" is already the name of an Xcode feature.

- '#if' et al are "conditional compilation directives".
- The condition is a "conditional compilation expression", or just
  "condition" if it's obvious.
- The predicates are "platform conditions" (including 'swift(>=...)')
- The options set with -D are "custom conditional compilation flags".
  (Thanks, Kevin!)

I left "IfConfigDecl" as is, as well as SourceKit's various "BuildConfig"
settings because some of them are part of the SourceKit request format.
We can change these in follow-up commits, or not.

rdar://problem/19812930
2016-02-12 11:09:26 -08:00
Doug Gregor bdfedf70ed [Omit needless words] Treat "passing" as a preposition 2016-02-12 10:53:35 -08:00
Doug Gregor a87782e414 [Omit needless words] Handle "extended prepositions" like "compatible with".
Also, be more careful not to produce base names that are keywords.
2016-02-12 10:33:59 -08:00
Doug Gregor f61aa7a86e [Omit needless words] Prepend is a verb. 2016-02-11 16:44:06 -08:00
Doug Gregor 90af7e60e7 [Omit needless words] "Of" associates left except when determining properties of the result. 2016-02-11 16:44:05 -08:00
Doug Gregor 4bbdec1cfc [Omit needless words] "update" is a verb. 2016-02-11 16:44:05 -08:00
Doug Gregor e720333032 [Omit needless words] Only move "lonely of" arguments back to the base name.
If the first argument label would end up as "of" following splitting
and pruning, move that "of" onto the base name.
2016-02-11 16:44:05 -08:00
Doug Gregor 643725f75a [Omit needless words] The preposition "of" binds to the word preceding it. 2016-02-11 16:44:05 -08:00
Doug Gregor a024fe0115 [Omit needless words] Split at a preposition before "of", if one exists.
This helps for cases such as "appendWithContentsOfFoo", where
"contentsOf" or "contentsOfFoo" is a better argument label than "foo"
or "ofFoo".
2016-02-11 16:44:05 -08:00
Doug Gregor 850e0e2fc3 [Omit needless words] Skip over verbs and gerunds when looking for a preposition. 2016-02-11 16:44:04 -08:00
Doug Gregor 720d67faf4 [Omit needless words] Split out find-last-preposition. NFC 2016-02-11 16:44:04 -08:00
Doug Gregor 10e98da40d [Omit needless words] Clip is a poor verb for Cocoa imports 2016-02-11 16:44:04 -08:00
Doug Gregor 55b406a20d [Omit needless words] Stop preventing argument labels named "for", "with", or other vacuous words.
Fixes rdar://problem/23752046.
2016-02-11 16:44:04 -08:00
practicalswift 7d67f58e1f [gardening] Fix recently introduced typo: "prposition" → "preposition" 2016-02-11 19:12:49 +01:00
Doug Gregor 050b324593 [Omit needless words] Split before last preposition in most cases.
Splitting *before* the last preposition tends to keep the
prepositional phrase together. Only leave the preposition on the base
name in rare cases where we would end up with weird argument labels
(e.g., prefer "moveTo(x:y:)" to "move(toX:y:)").

Also, refine our heuristics for when we can remove the preposition
entirely.
2016-02-10 14:20:44 -08:00
Doug Gregor 0533f6158d [Omit needless words] Move a paired preposition into the first argument label.
If the second argument label starts with a preposition for a split
selector, move the preposition into the first argument label. For
example:

-  func transitionFrom(fromViewController: NSViewController, to
toViewController: NSViewController, options:
NSViewControllerTransitionOptions = [], completionHandler completion:
(() -> Void)? = nil)
+  func transition(from fromViewController: NSViewController, to
toViewController: NSViewController, options:
NSViewControllerTransitionOptions = [], completionHandler completion:
(() -> Void)? = nil)
2016-02-08 22:41:16 -08:00
Doug Gregor 8a3a2958e7 [Omit needless words] Improve our handling of plural acronyms. 2016-02-08 22:41:16 -08:00
Doug Gregor 32b0c8c4a8 [Omit needless words] "No" conflicts after "With". 2016-02-08 22:41:15 -08:00
Doug Gregor d03d831e1e [Omit needless words] Drop split preposition if the first parameter is defaulted. 2016-02-08 16:23:27 -08:00
Doug Gregor c04a67ae4c [Omit needless words] Don't split setters, "action-like" methods.
Suggested by Brent Royal-Gordon.
2016-02-07 21:40:10 -08:00
Doug Gregor e05cf6e018 [Omit needless words] Split first selector piece into base name/first argument label. 2016-02-05 23:03:36 -08:00
Doug Gregor bd8fc9614e [Omit needless words] Match type/name words ignoring case 2016-02-05 22:27:45 -08:00
Doug Gregor 10c2a48ffc [Omit needless words] Tweak the verb lists slightly. 2016-02-05 22:27:44 -08:00
Doug Gregor 1dec2f1f34 [Clang importer] After stripping a prefix, lowercase initialisms as well. 2016-02-03 16:11:59 -08:00
David Farler be58b3c2e3 Extract Version value out of optional when parsing _compiler_version
rdar://problem/24476174
2016-02-02 23:50:13 -08:00