Commit Graph

671 Commits

Author SHA1 Message Date
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
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
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
Connor Wakamo
6e6e20ab4b [test] Added an integrated "-test-createCompilerInvocation" tool to swift-ide-test.
This is very basic: it just sees whether, given a set of driver arguments, the
swift::driver::createCompilerInvocation API returns a non-null
CompilerInvocation.

Unlike other modes of swift-ide-test, this mode requires that
"-test-createCompilerInvocation" be the first argument passed to swift-ide-test.
This is because it is handled separately from llvm::cl::ParseCommandLineOptions
so the remaining arguments can be passed through directly to
swift::driver::createCompilerInvocation without any interference from that
parser.

Additionally, added a test which uses this tool to try to create a
CompilerInvocation for a handful of basic driver commands.

Swift SVN r20973
2014-08-03 19:04:27 +00:00
Ben Langmuir
40111a461a Fix module interface printing for submodules
Previously we only printed submodules that were imported by the
top-level module, which worked in the common case of inferred submodules
of frameworks (e.g. Foundation.NSArray), but fell over when the
submodules were explicit (e.g.  OpenGL.GL), or just not imported by the
top-level module.

Swift SVN r20855
2014-07-31 22:06:53 +00:00
Argyrios Kyrtzidis
3175251bb1 [IDE] Handle annotation of clang submodule imports properly.
rdar://17780613

Swift SVN r20595
2014-07-26 20:58:19 +00:00
Doug Gregor
ff92b5f007 Remove -[no]implicit-objc-with.
Toggling this option causes funny things to happen, and there's no
point in keeping it.

Swift SVN r20565
2014-07-25 22:13:46 +00:00
Doug Gregor
e9037bcfa7 Default swift-ide-test to -implicit-objc-with like the rest of the world.
We require some level of consistency between the way the overlays were
built and what we work with in our mock SDK. The IDE/sdk_sugar.swift
test failure was because the overlay referenced "init(coder:)" while
the test was looking for "init(withCoder:)". Hilarity ensued
<rdar://problem/17791048>.

This only impacts testing.

Swift SVN r20564
2014-07-25 22:13:43 +00:00
Doug Gregor
4d524d7b19 API notes: record the module name in the control block.
Swift SVN r20412
2014-07-23 16:32:05 +00:00
Dmitri Hrybenko
1007ef3f95 Module interface printing: add an option to filter declarations based on
access control

Swift SVN r20399
2014-07-23 15:03:58 +00:00
Doug Gregor
ec32bc044d API notes: separate classes from protocols in the binary representation.
Swift SVN r20277
2014-07-21 20:23:55 +00:00
Doug Gregor
2faeb84e0c Rename ObjCClassInfo to ObjCContextInfo, to also cover protocols.
Swift SVN r20262
2014-07-21 17:30:16 +00:00
Doug Gregor
076d310132 Remove -import-tighter-objc-types option; we're turning it on by default.
Swift SVN r20191
2014-07-18 23:25:38 +00:00
Doug Gregor
422fc4b00a API notes: factor 'unavailable' into a common base for methods/classes/properties.
Now that we have this, move the ban on NSInvocation into
KnownObjCMethods.def so that it's enforced via API notes.

Swift SVN r20190
2014-07-18 23:25:37 +00:00
Doug Gregor
bedb5f116a Move KnownObjCMethods.def into swift-ide-test; that's the only place using it.
Swift SVN r20121
2014-07-17 23:26:55 +00:00
Doug Gregor
31ced1260d Finish renaming "side car" to "API notes"
Swift SVN r20088
2014-07-17 15:05:40 +00:00
Doug Gregor
72a6ea1193 Rename SideCar library to the APINotes library
Swift SVN r20087
2014-07-17 15:05:39 +00:00
Dmitri Hrybenko
3f4436a272 Code completion: add simplistic support for keywords
rdar://15992120


Swift SVN r20082
2014-07-17 12:02:21 +00:00
Doug Gregor
d4e702dc47 Side car: simplify binary format by removing the module ID.
Since we'll be keeping per-module data, there is no need to index the
Objective-C class table via the module as well.


Swift SVN r20074
2014-07-17 05:16:11 +00:00
Doug Gregor
702ed73987 Side car: split "known Objective-C methods" by module.
Update the swift-ide-test harness to look at the data for specific
modules, rather than as one large model.


Swift SVN r20073
2014-07-17 05:11:33 +00:00
Doug Gregor
e804dabfe0 Fix spacing in diagnostic
Swift SVN r20060
2014-07-16 23:51:22 +00:00
Doug Gregor
a0f09b5ce3 Side car reader: wire up the Objective-C selector and method tables.
We can now round-trip all of KnownObjCMethods.def through the side-car
writer and reader.


Swift SVN r20059
2014-07-16 23:44:42 +00:00
Doug Gregor
b73b33ed8b Side car reader: load Objective-C property information.
Validate it against KnownObjCMethods.def.


Swift SVN r20056
2014-07-16 22:53:24 +00:00
Doug Gregor
84c5af60b2 Side car reader: wire up identifier table and Objective-C class table.
Verify this by round-tripping the class information in KnownObjCMethods.def.


Swift SVN r20054
2014-07-16 22:42:53 +00:00
Doug Gregor
b3a18ee2d4 Add a skeleton of a side-car reader, along with basic testing.
Swift SVN r20044
2014-07-16 21:46:53 +00:00
Doug Gregor
74f29fe955 Side car test: encode all method information in the side car data.
At this point, we should be capturing all of the information in
KnownObjCMethods.def within the binary side car data file.


Swift SVN r20017
2014-07-16 07:20:59 +00:00
Doug Gregor
b3d7c2e924 Side car test: handle data associated with Objective-C properties.
Swift SVN r20016
2014-07-16 07:14:30 +00:00
Doug Gregor
5a8b0f44ad Side car testing: start emitting Objective-C methods
Swift SVN r20015
2014-07-16 07:11:50 +00:00
Doug Gregor
4c7a1e598f Side car: clean up representation of Objective-C properties and methods.
We don't need module names for properties and methods, since they're
effectively unique within a class. Moreover, use all of the
distinguishing characteristics as the key for the stored
representation in the side car writer. No visible functionality
change; this is staging.



Swift SVN r20008
2014-07-16 05:58:37 +00:00