Commit Graph

242 Commits

Author SHA1 Message Date
Adrian Prantl
83fce2670e Revert "Adapt for Mach-O clang module container format transition."
This reverts commit 25995 (this commit was missing a few LLVM libraries).

Swift SVN r26020
2015-03-12 02:00:55 +00:00
Jordan Rose
c9eeed3e2d Remove staging option -enable-private-discriminators.
Private discriminators for everybody!

Swift SVN r25997
2015-03-11 23:07:44 +00:00
Adrian Prantl
ae3d758fa8 Adapt for Mach-O clang module container format transition.
NOTE: This may require deleting the Module Cache that build-script
       creates in the swift build dir.

Swift SVN r25995
2015-03-11 22:55:37 +00:00
Argyrios Kyrtzidis
c0810b0bc3 [IDE] Replace placeholders before doing structure annotation.
rdar://19893732

Swift SVN r25898
2015-03-09 23:02:57 +00:00
Argyrios Kyrtzidis
da2e6ad04a [IDE] Add array/dictionary literals in the document structure.
rdar:/19999295

Swift SVN r25874
2015-03-09 01:30:39 +00:00
Argyrios Kyrtzidis
8d4b0ed470 [IDE] Include control-flow statements in the syntax structure model.
rdar://19988592

Swift SVN r25868
2015-03-09 00:42:42 +00:00
Argyrios Kyrtzidis
865719c2b8 [IDE] Introduce SyntaxStructureElements which will provide more info about a syntactic structure.
Swift SVN r25866
2015-03-09 00:42:39 +00:00
Argyrios Kyrtzidis
f8e5b6b3e2 [IDE] Modify structure testing to tag the relevant ranges directly on the source,
instead of outputting the info with lines/columns.

This make the structure more clear and testing more convenient.

Swift SVN r25865
2015-03-09 00:42:38 +00:00
Xi Ge
95a431885b When printing the interfaces in a module, denit is not informative
. Thus, this change allows swift-ide-test to ignore deinit when printing
interfaces. Also, to ignore is the default setting. Attribut -skip-deinit
can switch it off.
rdar://19079711

Swift SVN r25608
2015-02-27 21:48:23 +00:00
Manman Ren
a43db3621f [Driver] add InputFileKind to FrontendOptions.
Separate InputFileKind from SourceFileKind, FrontendOptions will now use
InputFileKind, while Module will use SourceFileKind.

This is in preparation for adding an input file kind for LLVM IR.

rdar://19048891


Swift SVN r25555
2015-02-26 19:13:39 +00:00
Chris Lattner
99aa4352b2 remove upgrading support for the old @class_protocol attribute.
Swift SVN r25526
2015-02-25 02:04:06 +00:00
Dave Abrahams
1bc5f0eb29 ReST hacks: "handle" code blocks
This is at the expense of blockquotes, which we don't actually need at
the moment.  All blockquotes get interpreted as preformatted code.

Swift SVN r25459
2015-02-21 04:02:54 +00:00
Dave Abrahams
4f9e7b3c15 Add a ReST hacks mode that pretties up headlines
Swift SVN r25458
2015-02-21 04:02:53 +00:00
Jordan Rose
6e96e26a81 Add CompilerInvocation::loadFromSerializedAST.
This is mainly for the debugger's use, to set up CompilerInvocations that
match how a particular app was compiled in certain important ways. Today
that's the target (which is also in the binary), the SDK path (which in
the long run should probably be an SDK name), and any random -Xcc options
we need to pass (which we should probably attempt to minimize).

Because there's only one target and SDK per context, and because -Xcc
options can easily conflict, this is only intended to be used once per
CompilerInvocation.

Note that search paths are not covered by this; they are already being
added at the time the module is loaded. See r24545.

Completes rdar://problem/17670778.

Swift SVN r25227
2015-02-12 05:32:37 +00:00
Argyrios Kyrtzidis
f15d56b8aa [IDE] Mark the parens for string interpolation with a special syntax annotation.
Part of rdar://19655729

Swift SVN r24983
2015-02-05 00:53:57 +00:00
John McCall
6287d913c3 By default, hide the actual implementing accessors of properties
and subscripts when printing them; just print them as get/set.

The important thing here is that we don't want to show the
names of addressors and mutable addressors when pretty-printing
the stdlib, but hiding observers is also general goodness.

Swift SVN r24875
2015-01-31 05:03:51 +00:00
Argyrios Kyrtzidis
785eacf0b5 [swift-ide-test] Add option to allow providing -Xcc options.
Swift SVN r24860
2015-01-30 23:35:56 +00:00
David Farler
51f8070abe Serialize local types
Local type declarations are saved in the source file during parsing,
now serialized as decls. Some of these may be defined in DeclContexts
which aren't Decls and previously weren't serialized. Create four new
record kinds:

* PatternBindingInitializer
* DefaultArgumentInitializer
* AbstractClosureExpr
* TopLevelCodeDecl

These new records are used to only preserve enough information for
remangling in the debugger, and parental context relationships.

Finally, provide a lookup API in the module to search by mangled name.
With the new remangling API, the debugging lifecycle for local types
should be complete.

The extra LOCAL_CONTEXT record will compressed back down in a
subsequent patch.

Swift SVN r24739
2015-01-27 01:49:54 +00:00
Argyrios Kyrtzidis
c41569c7a7 [IDE] Enhance SyntaxStructureKind with global/static/class variable nodes.
Swift SVN r24497
2015-01-18 03:47:26 +00:00
John McCall
bb675b6ac9 Add a basic "re-mangler", which turns a parsed
demangling tree back into a mangled string.

Also, extend the demangling API in a few obvious
ways, and simplify testing for failure in the
node-returning APIs by having them simply return
null instead of a spurious Failure node.

Also, preserve slightly more information in the
demangling tree.  The goal here is eventually to
always allow a perfect round-trip through the
demangler parse tree.  This patch gets us close,
but we're not quite there yet.

Tests to follow.

Swift SVN r24473
2015-01-16 06:33:08 +00:00
David Farler
cad9f99929 Revert "Serialize local types and provide a lookup API"
Changing the design of this to maintain more local context
information and changing the lookup API.

This reverts commit 4f2ff1819064dc61c20e31c7c308ae6b3e6615d0.

Swift SVN r24432
2015-01-15 00:33:10 +00:00
David Farler
fab3d491d9 Serialize local types and provide a lookup API
rdar://problem/18295292

Locally scoped type declarations were previously not serialized into the
module, which meant that the debugger couldn't reason about the
structure of instances of those types.

Introduce a new mangling for local types:
[file basename MD5][counter][identifier]
This allows the demangle node's data to be used directly for lookup
without having to backtrack in the debugger.

Local decls are now serialized into a LOCAL_TYPE_DECLS table in the
module, which acts as the backing hash table for looking up
[file basename MD5][counter][identifier] -> DeclID mappings.

New tests:
* swift-ide-test mode for testing the demangle/lookup/mangle lifecycle
of a module that contains local decls
* mangling
* module merging with local decls

Swift SVN r24426
2015-01-14 22:08:47 +00:00
Chris Lattner
a47e446965 add a missing dependency
Swift SVN r24361
2015-01-11 07:07:06 +00:00
Dmitri Hrybenko
0d30d24b73 swift-ide-test: link in LLVM targets
This is required to properly parse some command lines that use -Xllvm.

Swift SVN r24349
2015-01-10 03:02:46 +00:00
Dmitri Hrybenko
6670bb76ec Rewrite the CMake build system
Swift SVN r24124
2014-12-23 22:15:30 +00:00
Dmitri Hrybenko
83032291d2 Module API tool: add some comments
Swift SVN r23972
2014-12-17 02:43:36 +00:00
Dmitri Hrybenko
509bcb3829 Add a skeleton for a module API checker tool
This commit defines a schema and YAML serialization for a significant
portion of our AST.  The API ingestion is a work in progress.

See design discussion in ModuleAPIDiff.cpp.

Swift SVN r23938
2014-12-15 16:58:28 +00:00
Dmitri Hrybenko
1eea220932 Use one module cache directory for all the lit tests to speed them up
Doing so is safe even though we have mock SDK.  The include paths for
modules with the same name in the real and mock SDKs are different, and
the module files will be distinct (because they will have a different
hash).

This reduces test runtime on OS X by 30% and brings it under a minute on
a 16-core machine.

This also uncovered some problems with some tests -- even when run for
iOS configurations, some tests would still run with macosx triple.  I
fixed the tests where I noticed this issue.

rdar://problem/19125022

Swift SVN r23683
2014-12-04 11:21:48 +00:00
Dmitri Hrybenko
5c011f4dfd Remove an unused option from swift-ide-test
Swift SVN r23682
2014-12-04 09:36:20 +00:00
Argyrios Kyrtzidis
1552772a15 [AST] Move ModuleEntity from libIDE to libAST so that the ASTPrinter can use it.
Swift SVN r23680
2014-12-04 05:52:16 +00:00
Dmitri Hrybenko
1347b446c9 Stop using the MODULES_SDK variable in -D flags for the C++ compiler
Swift SVN r23097
2014-11-04 05:44:12 +00:00
Dmitri Hrybenko
db63818d57 Remove old-style API notes infrastructure
Swift SVN r23080
2014-11-03 05:59:30 +00:00
Jordan Rose
30c65eff7e [ClangImporter] Use Clang's driver to handle options, not its frontend.
This is most important for -Xcc options, which shouldn't be dependent on
the underlying Clang version, but it also affects things like target features
that Clang knows how to compute correctly and Swift, well, doesn't.

rdar://problem/17687572

Swift SVN r22448
2014-10-01 23:55:35 +00:00
Doug Gregor
e0afb13abb Remove the APINotes library; it lives in Clang, now.
Swift SVN r22286
2014-09-25 18:48:43 +00:00
Jordan Rose
595376df33 Add an option to swift-ide-test to test the debugger's handling of 'private'.
Specifically, to simulate the debugger's expression evaluation, where
declarations from a certain file are /preferred/ but not /required/.
This allows the debugger to reference private declarations unambiguously
based on its notion of the "current" source file.

This is the test case for r22034, which fixed rdar://problem/18296639.

Swift SVN r22271
2014-09-25 00:15:35 +00:00
John McCall
16cb523c3a AST support for accessors.
Swift SVN r22228
2014-09-23 20:34:19 +00:00
Doug Gregor
6559392293 Start re-namespacing APINotes and its dependencies.
FixNum.h and BCRecordLayout.h will move down into LLVM, APINotes
will move into Clang. Get the namespaces right before we start to move
files around.

Swift SVN r22218
2014-09-23 17:52:17 +00:00
John McCall
75050f8166 Generate an implicit 'materializeForSet' accessor
along with getters and setters.

Just generate it for now.

Swift SVN r22011
2014-09-17 08:08:03 +00:00
Argyrios Kyrtzidis
479dca95ae [IDE] Add '-debug-forbid-typecheck-prefix' option to swift-ide-test.
Swift SVN r22004
2014-09-17 04:17:51 +00:00
Jordan Rose
7b6a0dd185 [ClangImporter] Add a mode where @class decls are imported as empty classes.
This can be used by SourceKit's interface printer to display modules with
forward declarations of classes in dependent modules, e.g. ObjectiveC
forward-declaring Foundation's NSString for use in NSObject. We can consider
doing something similar for C tag types (structs and enums).

Part of rdar://problem/18273845

Swift SVN r21828
2014-09-10 02:32:53 +00:00
Jordan Rose
94ed6a1fb3 Teach private-discriminator lookup to handle lookup into nominals.
This works using the nominal's normal lookupDirect to gather decls from the
original declaration and all its extensions, then filters them by module and
private-discriminator. This does not yet do the right thing for extensions
because we don't include the extension's module in a member's mangling except
in very specific circumstances. In order to make this work in general we'll
have to start doing this more generally.

Part of rdar://problem/17632175

Swift SVN r21785
2014-09-08 20:37:41 +00:00
Jordan Rose
cacec395db Drop the separate "LookupName" type for discriminated lookup.
Now that there's just one entry point for discriminated lookup, there's not
really a need for this extra abstraction.

One thing still up in the air is unqualified lookup support for discriminator
preferences (for, say, breakpoint conditions), but we'll cross that bridge
when we come to it.

Part of rdar://problem/17632175

Swift SVN r21755
2014-09-06 00:18:05 +00:00
Jordan Rose
9aa8c5c133 Push lookup with private-discriminators into the AST as Module::lookupMember.
Since the primary purpose here is to go from a mangled name to a decl, and
discriminators are only valid in the context of a particular module, it
makes sense to make this an API on Module. Eventually this will also support
lookup into a type or its extensions, limited by module and discriminator.

Swift SVN r21754
2014-09-06 00:18:04 +00:00
Jordan Rose
c644c9a538 [swift-ide-test] Consolidate -print-ast-typechecked and ...-non-typechecked.
Also, don't access options::MangledNameToFind directly from doPrintAST;
pass it in instead.

Swift SVN r21734
2014-09-05 00:31:12 +00:00
Doug Gregor
29d2f6375c Make swift-ide-test's options respect the defaults.
Swift SVN r21705
2014-09-04 15:48:23 +00:00
Doug Gregor
b6248c8342 Remove the -enable-objc-failable-initializers option.
As part of this, failable initializers get enabled by default for
swift-ide-test.


Swift SVN r21704
2014-09-04 15:31:02 +00:00
Jordan Rose
1f5d81d5dc Teach swift-ide-test to look up entities by mangled name.
Currently this only handles top-level nominal types. We're just trying to
emulate what the debugger does when it needs to go from a mangled name to
an AST node, so it's okay that the cases handled here are very restricted.
We just want to make sure that the debugger is /able/ to do what it needs
to do.

This does not yet handle nested (non-top-level) values; that will require
changes to DeclContext::lookupQualified.

Part of rdar://problem/17632175

Swift SVN r21690
2014-09-03 23:42:13 +00:00
Dmitri Hrybenko
ccffa87623 Fix comment header
Swift SVN r21641
2014-09-02 15:00:59 +00:00
Andrew Trick
9ce5894db1 Fix raw_fd_ostream calls for ToT constructor changes
Swift SVN r21447
2014-08-25 23:29:36 +00:00
Doug Gregor
5709a86f2f Start importing Objective-C initializers and factory methods using failable initializers.
In this mode, use nullability information on the result type of the
initializer or factory method to determine failability of the
initializer. This is behind the flag
-enable-objc-failable-initializers until we have the SILGen support in
place.



Swift SVN r21341
2014-08-21 04:50:20 +00:00