Commit Graph

71 Commits

Author SHA1 Message Date
Dmitri Hrybenko
5ccee15360 ReST unittests: remove an empty test array, it is causing a -Wzero-length-array
warning


Swift SVN r17409
2014-05-04 23:46:04 +00:00
Doug Gregor
a30238b208 Add more missing #includes.
Swift SVN r17162
2014-05-01 16:16:29 +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
John McCall
63072df530 Add class size and address point fields to class metadata.
I've put these fields on the class object for now, just
so we can at least theoretically update them.  A superclass
that grew left rather than right could maybe even be made
to work with this schema, but probably not.

rdar://16705821

Swift SVN r16880
2014-04-26 10:57:50 +00:00
Dmitri Hrybenko
00722d4c2e Comment parsing: extract parameter name from the text in :param: field
Swift SVN r16750
2014-04-24 09:13:42 +00:00
Dmitri Hrybenko
b365285ae3 ReST parsing: add two more tests
Swift SVN r16516
2014-04-18 11:16:48 +00:00
Dmitri Hrybenko
68e8fee5fc Comment parsing: put more information into the generated XML documents
This commit adds infrastructure for conversion and testing it.

The conversion is still incomplete, pending discussion about which tags should
we use in the XML documents.  I copied the RelaxNG schema from Clang, and will
edit it accordingly.


Swift SVN r16451
2014-04-17 15:42:51 +00:00
Doug Gregor
3b1841eb6d Remove the unit test for MultiWordMap
Swift SVN r16268
2014-04-13 00:21:32 +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
Dmitri Hrybenko
3ad1f7783c ReST parser: add some tests for LineListRef, and fix a bug in
LineListRef::getLinePart() found by them


Swift SVN r15870
2014-04-03 15:35:24 +00:00
Dmitri Hrybenko
f370da96b1 ReST: make data in a LineList be owned by ReSTContext, so that users don't have
to carry all LineLists along with a ReSTContext.


Swift SVN r15863
2014-04-03 11:03:09 +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
Dmitri Hrybenko
44c7a737ce ReST tests: add a test and remove a test from comments that was already
implemented


Swift SVN r15419
2014-03-24 17:32:16 +00:00
Dmitri Hrybenko
8d59f36796 Implement a basic ReST parser on block level, producing a ReST AST
This parser does not recognize inline markup.


Swift SVN r15416
2014-03-24 16:33:43 +00:00
Dmitri Hrybenko
d51769b6a5 Implement some elements of a ReST parser
It does not yet understand a lot of ReST constructs, in particular, it does not
understand inline markup at all, but it is good enough to extract brief
comments.

The parser in BriefParser.cpp does not construct any ASTs or emit any warnings.
This is a special parser for brief comments that should be as fast as possible.
Real ReST parser will come later.


Swift SVN r15046
2014-03-14 13:03:19 +00:00
Dmitri Hrybenko
b9c87184ea Add an ABI-stable libfunctionNameDemangle library, which enables external
clients to use the Swift demangler without depending on compiler internals.


Swift SVN r14776
2014-03-07 09:32:39 +00:00
Dmitri Hrybenko
65cf5f2098 Lexer: compute ArtificialEOF correctly in a sublexer of a sublexer
This fixes code completion crash in rdar://15561934, but there are still no
code completion results in interpolated string literals.


Swift SVN r14539
2014-02-28 23:03:06 +00:00
Dmitri Hrybenko
d681b81641 Revert my r14516, it breaks the buildbot
Swift SVN r14518
2014-02-28 15:28:39 +00:00
Dmitri Hrybenko
3bb9166405 Lexer: don't advance current pointer past end of the source buffer in case
there is a string literal with embedded NUL just before EOF

This used to crash, rdar://15561934


Swift SVN r14516
2014-02-28 14:28:25 +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
Dave Zarzycki
a85b2a3d78 Runtime: Rename Alloc.* to HeapObject.* (NFC)
Swift SVN r14228
2014-02-21 20:12:07 +00:00
John McCall
272a81cc4e Add the SuccessorMap data structure.
A successor map is a somewhat targetted data structure which
is designed to give you the value for the lowest key that is
larger than the lookup key.

This is useful when applying a transformation that isn't
entirely one-to-one but where we nonetheless want to preserve
the original order as much as possible, e.g. when IR-genning
SILFunctions.

Swift SVN r14199
2014-02-21 02:22:00 +00:00
John McCall
10ac15ed0d Lex $notAllDigits as an identifier and diagnose it in the lexer
outside of debugger-support mode.  Rip out the existing special-case
code when parsing expr-identifier.

This means that the Lexer needs a LangOptions.  Doug and I
talked about just adding that as a field of SourceMgr, but
decided that it was worth it to preserve the possibility of
parsing different dialects in different source files.

By design, the lexer doesn't tokenize fundamentally differently
in different language modes; it might decide something is invalid,
or it might (eventually) use a different token kind for the
same consumed text, but we don't want it deciding to consume more or
less of the stream per token.

Note that SIL mode does make that kind of difference, and that
arguably means that various APIs for tokenizing need to take a
"is SIL mode" flag, but we're getting away with it because we
just don't really care about fidelity of SIL source files.

rdar://14899000

Swift SVN r13896
2014-02-14 01:54:17 +00:00
Greg Parker
1892c003bc [test] Add test machinery for iOS, but don't use or enable anything yet.
Swift SVN r13407
2014-02-04 07:00:48 +00:00
John McCall
c5aa41ffd1 Change around some manglings to make them carry more
information and be easier to demangle.

Swift SVN r11423
2013-12-18 08:33:52 +00:00
Argyrios Kyrtzidis
e7b15e3a7f [unittests] Link libswiftBasic to its unit tests.
Swift SVN r10041
2013-11-08 18:29:37 +00:00
Argyrios Kyrtzidis
44d46de7c9 Use swift::SourceManager's addNewSourceBuffer() instead of llvm::SourceMgr's AddNewSourceBuffer().
Also remove the SourceLoc parameter from addNewSourceBuffer(). In llvm::SourceMgr
it is used to indicate textual inclusion, which we don't have in swift.

Swift SVN r10014
2013-11-07 00:51:56 +00:00
Joe Groff
87c26c3fcb Unit-test that existential metadata is instantiated with the right kind.
Swift SVN r9878
2013-11-01 20:21:46 +00:00
Joe Groff
98f0a5fc03 Update runtime unit tests for getExistentialTypeMetadata name change.
Swift SVN r9875
2013-11-01 18:27:43 +00:00
Joe Groff
37e652b2ba Runtime: Add swift_getExistentialMetadata entry point.
Set up a metadata cache for existential type metadata. Instantiate existential metadata by first sorting the protocol list, so that it is order invariant, precomputing the overall witness table count and class constraint of the composition so it can be cached in the existential metadata.

We still need to implement value witnesses for existential containers in the runtime before this is complete. We can at least test the uniquing and flags computations at this point.

Swift SVN r9727
2013-10-28 20:53:20 +00:00
Joe Groff
3a8f81433f IRGen: Add a nominal type descriptor to class metadata.
Swift SVN r9503
2013-10-18 22:51:27 +00:00
Dmitri Hrybenko
28c24ea5a9 Fix Metadata unittest after r9249
Swift SVN r9256
2013-10-12 07:32:32 +00:00
John McCall
8fbc790d39 Subsume OwnershipConventions into SILFunctionType.
Swift SVN r9186
2013-10-11 00:50:57 +00:00
Joe Groff
e109124186 Replace 'union' keyword with 'enum'.
This only touches the compiler and tests. Doc updates to follow.

Swift SVN r8478
2013-09-20 01:33:14 +00:00
John McCall
d01e725fee Fix Makefile build of unittests.
Swift SVN r8330
2013-09-17 07:22:27 +00:00
Joe Groff
000d8e4953 Runtime: Add functions for dynamic single-payload dispatch.
Add functions to dynamically query the extra inhabitants of a single-payload union's payload metadata, then identify or store bit patterns used to represent empty cases, whether they happen to use extra inhabitants or added tag bits.

Swift SVN r8320
2013-09-17 01:29:35 +00:00
Argyrios Kyrtzidis
5db368ce7b [Lexer] Introduce Lexer::getLocForStartOfToken() that returns the location at the start of the token that a given offset points to.
Swift SVN r8281
2013-09-16 18:41:16 +00:00
Joe Groff
d516b1fe59 Update metadata unittest for generic metadata pattern ABI change.
Swift SVN r7902
2013-09-04 17:50:42 +00:00
Dmitri Hrybenko
8a8b97985b Lexer: fix a bug where restoring lexer state could produce duplicate
code_complete tokens


Swift SVN r7636
2013-08-27 22:34:29 +00:00
Dmitri Hrybenko
dc439adb59 Lexer: improve recovery for invalid character literals and invalid escape
sequences in charater literals

Now we return tok::character_literal with REPLACEMENT CHARACTER U+FFFD instead
of tok::unknown.


Swift SVN r7475
2013-08-22 20:56:47 +00:00
Dmitri Hrybenko
5a88513e71 Don't link to curses library explicitly
LLVM build system has been fixed to pass down this linker flag automatically.


Swift SVN r7048
2013-08-08 17:46:52 +00:00
John McCall
14cb7001b3 Implement basic support for [weak].
Swift SVN r7041
2013-08-08 04:04:51 +00:00
Dmitri Hrybenko
b1f6da2837 Add some tests for SourceManager routines that compare SourceLocs and SourceRanges
Swift SVN r7002
2013-08-07 21:32:19 +00:00
Adrian Prantl
1a0875bc3f Add curses library to the unit tests.
Swift SVN r6996
2013-08-07 20:24:22 +00:00
Argyrios Kyrtzidis
4908da8361 [Lexer] Remove the public Lexer constructor that accepts a StringRef.
Replace uses of it with the newly introduced constructor that accepts a buffer ID.
The StringRef constructor was rather unsafe since it had the implicit requirement that the StringRef
was null-terminated.

Swift SVN r6942
2013-08-06 14:59:03 +00:00
Argyrios Kyrtzidis
7e81b4919a [IDE] Rename "code_completion" namespace to "ide"
Swift SVN r6834
2013-08-02 02:50:28 +00:00
Dmitri Hrybenko
e1c4ae3174 Wrap llvm::SourceMgr in swift::SourceManager so that we can add new members
to the source manager.


Swift SVN r6815
2013-08-01 20:39:22 +00:00
Dmitri Hrybenko
68bba56cec Lexer tests: simplify helper function: no need to pass down a SourceMgr
Swift SVN r6810
2013-08-01 18:39:20 +00:00
Dmitri Hrybenko
72ae1fd842 swift::tokenize: don't include tok::eof, per feedback from Argyrios
Swift SVN r6716
2013-07-29 22:23:31 +00:00