Commit Graph

186 Commits

Author SHA1 Message Date
John McCall
e880aac1e0 Add a convenience routine for searching for a complete
word within a camelCase identifier.

Basically StringRef::find but requiring the next character
to not be lowercase.

Swift SVN r17658
2014-05-08 00:51:25 +00:00
Enrico Granata
8d21def542 Change the demangling of _TtSf from Swift.Float32 to Swift.Float; and that of _TtSd from Swift.Float64 to Swift.Double
There has been a shuffling of which are structs and which are typealiases - the demangler should emit the struct names



Swift SVN r17590
2014-05-07 00:17:01 +00:00
Doug Gregor
8324dc92e1 Introduce and use camel_case::appendSentenceCase().
Swift SVN r17260
2014-05-02 17:43:00 +00:00
Ted Kremenek
050fd53af7 Rename UncheckedOptional to ImplicitlyUnwrappedOptional.
Swift SVN r17232
2014-05-02 06:13:57 +00:00
Doug Gregor
3d3ff6811a Add a pile of missing #includes exposed by pruning includes in top-of-tree LLVM.
Swift SVN r17157
2014-05-01 14:26:34 +00:00
Jordan Rose
8e44c2ee79 Break "NSUTF16" as "NSUTF, 16", not "NSUT, F16".
Previously, this declaration:

  typedef NS_OPTIONS(NSUInteger, NSABitmapFormat5) {
    NSAA16d,
    NSAB32d,
  };

...would import with members .A16d and .B32d, which is not necessarily
correct. (Is it "NS_AA_16d", or "NSA_A_16d"?) Be more conservative here.

Swift SVN r17125
2014-05-01 00:06:22 +00:00
Joe Groff
f7c3331c0e Demangle objc-to-native thunks.
Somehow the demangling for these thunks slipped through the cracks.

Swift SVN r17107
2014-04-30 19:57:42 +00:00
Dmitri Hrybenko
669f633070 Add "single extended grapheme cluster" literals (SEGCL) -- a subset of
double-quoted string literals that contain a single extended grapheme cluster

SEGCL by default infer type String, but you can ask to infer Character
for them.

Single quoted literals continue to infer Character.

Actual extended grapheme cluster segmentation is not implemented yet,
<rdar://problem/16755123> Implement extended grapheme cluster
segmentation in libSwiftBasic

This is part of
<rdar://problem/16363872> Remove single quoted characters

Swift SVN r17034
2014-04-29 14:08:16 +00:00
Jordan Rose
84f4d3b9fa Sink some triple predicates into swiftBasic.
getPlatformNameForTriple isn't currently being used anywhere elsee, but
this seems more consistent.

No functionality change.

Swift SVN r17002
2014-04-28 23:39:15 +00:00
Chris Lattner
a7012f23ef Remove swift::ArrayType. It is dead and vestigial code for supporting fixed size
arrays, which never got baked.  Remove it until we have time to do things right.


Swift SVN r16995
2014-04-28 21:18:27 +00:00
Joe Groff
857da9a4a2 Finish adding demanglings for the array value witnesses.
Swift SVN r16773
2014-04-24 22:32:54 +00:00
Joe Groff
f29a156e83 IRGen/Runtime: Add value witness slots for array witnesses.
Add value witnesses for destroyArray, initializeArrayWithCopy, and initializeArrayWithTake{FrontToBack,BackToFront}, and fill out the runtime value witness table implementations. Stub out the IRGen ones for now.

Swift SVN r16772
2014-04-24 22:25:26 +00:00
John McCall
b38a63950d Implement @unowned(unsafe).
This was part of the original weak design that
there was never any particular reason to rush the
implementation for.  It's convenient to do this now
so that we can use it to implement Unmanaged<T> for
importing CF types.

Swift SVN r16693
2014-04-23 08:51:23 +00:00
Chris Lattner
a3916614ef respond to mainline API changes in the Debug.h header, by defining the
DEBUG_TYPE macro in all .cpp files that use the DEBUG macro.  Hopefully
this will unbreak the build.


Swift SVN r16638
2014-04-22 02:54:55 +00:00
John McCall
8681963bcb A couple of long-overdue renames.
Builtin.ObjectPointer -> Builtin.NativeObject
Builtin.ObjCPointer -> Builtin.UnknownObject

Swift SVN r16634
2014-04-22 00:17:08 +00:00
Joe Groff
c73acc67f2 SIL: Add an "UnownedInnerPointer" result convention.
This will represent the return convention of imported __attribute__((objc_returns_inner_pointer)) methods. Leave it unimplemented for now until we can autorelease things sanely.

Swift SVN r16628
2014-04-21 21:57:13 +00:00
Joe Groff
ebe5f4620c Don't include the module in protocol conformance manglings.
The cost of hacks to swift_conformsToProtocol is starting to outweigh any benefit to being principled here. We'll get a linker error now if multiple modules declare a conformance for the same type to the same protocol, but that's arguably a good thing for 1.0 anyway, since we aren't set up to get that right in other ways.

Swift SVN r16554
2014-04-18 23:13:40 +00:00
Dmitri Hrybenko
3ac95bd0e3 swift-ide-test: add -parse-rest mode to allow one quickly check how a given
ReST document parses


Swift SVN r16518
2014-04-18 11:36:08 +00:00
Joe Groff
85ab7ed9e1 Remove mangling and demangling for block shims.
Swift SVN r16488
2014-04-18 02:36:54 +00:00
John McCall
4e49b17930 I'm not sure how this compiles for anyone else.
Swift SVN r16373
2014-04-15 18:31:59 +00:00
Argyrios Kyrtzidis
a9ea63a7f7 [IDE/ModuleInterface] Adjust the indentation of regular comments to match the current indentation level.
Swift SVN r16362
2014-04-15 06:27:40 +00:00
Doug Gregor
3be5c3c265 Selector splitting: turn all prepositions into directional prepositions except "with".
Swift SVN r16301
2014-04-14 05:14:39 +00:00
Doug Gregor
9d7f0b6211 Rework the selector-splitting heuristics.
This makes a number of changes to the selector-splitting
heuristics. Specifically:

  - Eliminate last-word splitting, and with it the notion of
    multi-words. We only split at prepositions now.
  - Introduce the notion of "linking verbs" such as "will" or
    "should"; when these show up, we refuse to split a selector, which
    helps with delegates.
  - Eliminate the special case for "get" and "set". It wasn't
    helping.
  




Swift SVN r16265
2014-04-12 20:32:16 +00:00
Doug Gregor
5d20720e87 Some more camelCase string utilities.
Swift SVN r16053
2014-04-08 15:13:18 +00:00
Doug Gregor
46a6724781 Selector splitting: "matching" is a preposition for Cocoa
Swift SVN r16018
2014-04-07 20:10:12 +00:00
Doug Gregor
49387beb25 Selector splitting: don't split selectors in the middle of whitelisted "multi-words".
Swift SVN r16016
2014-04-07 19:17:23 +00:00
Doug Gregor
5820f0dcfb Add "using" as a preposition, again.
Swift SVN r16014
2014-04-07 19:17:21 +00:00
Jordan Rose
9804a1c85e Fix Version.cpp to actually stringify the version, not the macro name.
Swift SVN r15916
2014-04-04 01:40:55 +00:00
Doug Gregor
6be1549508 Lowercase prepositions because it feels cleaner. NFC
Swift SVN r15866
2014-04-03 14:25:54 +00:00
Doug Gregor
925097a8b0 Add utilities for lower- and sentence-casing camelCase strings.
Swift SVN r15815
2014-04-02 18:29:50 +00:00
Doug Gregor
d6a173fead Add some utilities for working with camelCase names.
Swift SVN r15802
2014-04-02 15:18:32 +00:00
John McCall
f1180f5e6d in order to work correctly for non-@objc protocols.
Language features like erasing concrete metatype
values are also left for the future.  Still, baby steps.

The singleton ordinary metatype for existential types
is still potentially useful; we allow it to be written
as P.Protocol.

I've been somewhat cavalier in making code accept
AnyMetatypeType instead of a more specific type, and
it's likely that a number of these places can and
should be more restrictive.
When T is an existential type, parse T.Type as an
ExistentialMetatypeType instead of a MetatypeType.

An existential metatype is the formal type
 \exists t:P . (t.Type)
whereas the ordinary metatype is the formal type
 (\exists t:P . t).Type
which is singleton.  Our inability to express that
difference was leading to an ever-increasing cascade
of hacks where information is shadily passed behind
the scenes in order to make various operations with
static members of protocols work correctly.

This patch takes the first step towards fixing that
by splitting out existential metatypes and giving
them a pointer representation.  Eventually, we will
need them to be able to carry protocol witness tables

Swift SVN r15716
2014-04-01 00:38:28 +00:00
Ted Kremenek
9d580f6ebd CMake: Fix string escaping of compiler version so that it works with the Xcode generator. Xcode did not like parsing strings with unbalanced quotes
in the plist file.

This was exposed by r15694, but probably did not manifest as
the string escaping logic previously only happened on B&I submissions.

In this approach, the final version quad is turned into a string
within Version.cpp, not at the -D invocation.

Swift SVN r15708
2014-03-31 23:32:21 +00:00
Joe Pamer
7b771affd9 Add limited build configuration support for testing against compiler submit versions. (rdar://problem/16337966)
This is meant to be utilized for a narrow set of scenarios specific to dogfooding our pre-1.0 compiler, so please do not take any dependencies on this.  In fact, I'll be removing this in the next milestone.  (See rdar://problem/16380797.)

Also included - improve error recovery when parsing broken build configuration clauses.

Swift SVN r15694
2014-03-31 20:34:02 +00:00
Argyrios Kyrtzidis
f1d14c0911 [Basic/LangOptions] Remove std::unordered_map/unordered_set from LangOptions and use SmallVector instead.
The config options are so few that a map is not worth it currently.

Swift SVN r15476
2014-03-26 00:26:17 +00:00
Dmitri Hrybenko
866511e27d Add mangling for SubscriptDecls to allow us to produce USRs for them
<rdar://problem/16237251> USR generator skips SubscriptDecls


Swift SVN r14923
2014-03-11 18:03:04 +00:00
Dmitri Hrybenko
86cd6260ce SourceManager: use 'unsigned' as buffer ID type
Swift SVN r14849
2014-03-09 16:24:11 +00:00
Dmitri Hrybenko
ef0942c69c Add a convenience API SourceManager::addMemBufferCopy() to simplify adding a
buffer in case the client does not need a pointer to the buffer.


Swift SVN r14777
2014-03-07 11:41:08 +00:00
John McCall
143689ec2a Escape \x7F as a non-ASCII character.
Thanks to Jordan for the review!

Swift SVN r14705
2014-03-06 00:23:47 +00:00
Chris Lattner
11bedff2f3 the swift.Slice type got removed a long time ago, being replaced with
what is now Swift.Array.  Update various internal stuff to refer to
Array instead of Slice.  NFC.


Swift SVN r14567
2014-03-02 06:21:37 +00:00
John McCall
5463c2072b Demangle partial-apply forwarding thunks.
rdar://16167733

Swift SVN r14538
2014-02-28 22:03:49 +00:00
John McCall
227e2d0159 Refactor the demangling of <global> so that it can be used in
recursive positions.

Also change the representation of certain <global>s in the
demangling tree by sinking <directness> down as a child of
the affected node.

Swift SVN r14537
2014-02-28 22:03:46 +00:00
Dmitri Hrybenko
b71d4c5a2c SourceManager: emphasize that some APIs accept only valid SourceLocations
Adding these asserts would help debugging.  Without the asserts it would fail
anyway, but in a more obscure place, usually with a null pointer dereference.


Swift SVN r14512
2014-02-28 10:58:17 +00:00
Ted Kremenek
028f9d0561 Remove rest of Makefile build except for 'docs' and 'www'.
For 'docs' and 'www' it is possible these are still being used,
as they work independent of the Makefile build.  Keeping them for now.

Swift SVN r14418
2014-02-26 22:21:25 +00:00
Mark Lacey
3d890ae562 Formatting fix in demangler. NFC.
Swift SVN r14405
2014-02-26 21:13:19 +00:00
Doug Gregor
981f8f6509 Rename "destructor" -> "deinit" (as a keyword) and -> "deinitializer" (in diagnostics).
Swift SVN r14380
2014-02-26 05:51:45 +00:00
Doug Gregor
0bde325327 Collapse 'DynamicSelf' into 'Self'.
Swift SVN r14377
2014-02-26 05:04:05 +00:00
Joe Groff
98d6fecc99 '.metatype' -> '.Type'
Also, reserve 'type' as a keyword for ensuing syntax changes.

Swift SVN r14375
2014-02-26 04:23:21 +00:00
Joe Groff
89807a939e Mangle the protocol constraints on associated types in GenericParamLists.
A short-term fix to <rdar://problem/16079822> that keeps generic overloads from creating symbol collisions without requiring a larger migration of the debugger or other tools.

Swift SVN r14353
2014-02-25 21:56:04 +00:00
Ted Kremenek
ea80d0473d Fix unreachable code warning by tightening code. No functionality change.
Swift SVN r14055
2014-02-18 22:26:58 +00:00