Commit Graph

574 Commits

Author SHA1 Message Date
Dmitri Hrybenko
849ad1a14d libFrontend, swift-ide-test: add -F option to specify framework search paths
Swift SVN r6950
2013-08-06 21:12:05 +00:00
Sean Callanan
f9a446b410 Added the option to override Clang's resource
directory when constructing a ClangImporter.
This is for lldb, which keeps Clang's resource
directory inside its own framework bundle.


Swift SVN r6833
2013-08-02 02:25:42 +00:00
Dmitri Hrybenko
7684d6dc2a Add a good diagnostic for a hashbang line when it is not allowed
Also centralizes the knowledge about whether the hashbang is allowed in the
SourceManager.  This fixes a bug in tokenize() because previously it just had
to guess.


Swift SVN r6822
2013-08-01 23:07:43 +00:00
Dmitri Hrybenko
5cea4ebf41 Code completion: put CodeCompletionOffset on SourceManager instead of passing
around everywhere

Fixes:
rdar://14585108 Code completion does not work at the beginning of the file
rdar://14592634 Code completion returns zero results at EOF in a function
                without a closing brace


Swift SVN r6820
2013-08-01 22:08:58 +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
f92237b12a tools/swift: Refactor REPLEnvironment so that it uses libFrontend to create
the TranslationUnit


Swift SVN r6789
2013-08-01 00:03:36 +00:00
Jordan Rose
ecc47bad85 Frontend no longer depends on ClangImporter. Weakly link the entry point.
This closes out <rdar://problem/14513108> -- sil-opt no longer depends on
ClangImporter or any Clang libraries. In theory, however, forcing a load
of a libSwiftClangImporter.dylib would allow sil-opt to process SIL files
containing Clang imports.

Swift SVN r6700
2013-07-29 18:57:10 +00:00
Dmitri Hrybenko
497ec93ec9 Code completion: generate a tok::code_complete token during the first pass of
parsing

No functionality change, this will be used by next commits.


Swift SVN r6637
2013-07-26 01:40:47 +00:00
Argyrios Kyrtzidis
66d1e516c8 Refactor how multiple parsing passes and delayed parsing works.
-Introduce PersistentParserState to represent state persistent among multiple parsing passes.
  The advantage is that PersistentParserState is independent of a particular Parser or Lexer object.
-Use PersistentParserState to keep information about delayed function body parsing and eliminate parser-specific
  state from the AST (ParserTokenRange).
-Introduce DelayedParsingCallbacks to abstract out of the parser the logic about which functions should be delayed
  or skipped.

Many thanks to Dmitri for his valuable feedback!

Swift SVN r6580
2013-07-25 01:40:16 +00:00
Argyrios Kyrtzidis
5536e61e59 [Frontend] Keep a list of input files in CompilerInvocation and create input buffer IDs as part of CompilerInstance::setup().
Swift SVN r6497
2013-07-23 14:49:31 +00:00
Argyrios Kyrtzidis
200e64d8c2 [Frontend] Refactor CompilerInvocation to be a pure settings object.
This mainly removes the extraneous DiagnosticEngine and SourceMgr from CompilerInvocation.
Instances of these can be found via the CompilerInstance object.

Swift SVN r6496
2013-07-23 14:49:29 +00:00
Chris Lattner
e0f19cfb4e Feedback from Dmitri
Swift SVN r6466
2013-07-22 20:42:11 +00:00
Chris Lattner
2f94493ff3 pass a variety of things by reference instead of by value in the invocation's setters.
Add a little dance in the setup of the Clang importer.  Now, clients that don't care
about the clang importer don't have to link it in, just don't call setSDKPath()


Swift SVN r6462
2013-07-22 19:51:08 +00:00
Dmitri Hrybenko
3c5b12fc0f Code completion: add a lot of infrastructure code
* Added a mode in swift-ide-test to test code completion.  Unlike c-index-test,
  the code completion token in tests is a real token -- we don't need to
  count lines and columns anymore.

* Added support in lexer to produce a code completion token.

* Added a parser interface to code completion.  It is passed down from the
  libFrontend to the parser, but its functions are not called yet.

* Added a sketch of the interface of code completion consumer and code
  completion results.

Note: all this is not doing anything useful yet.


Swift SVN r6128
2013-07-10 20:53:40 +00:00
Dmitri Hrybenko
fc0d478220 Inline buildSingleTranslationUnit() into its only caller
Swift SVN r6107
2013-07-10 01:38:50 +00:00
Dmitri Hrybenko
cb98234d67 Allow the parser to persist after parseIntoTranslationUnit() returns
Swift SVN r6102
2013-07-10 00:25:37 +00:00
Dmitri Hrybenko
5be7592574 Make buildSingleTranslationUnit() an implementation detail of libFrontend
Swift SVN r6070
2013-07-08 22:24:40 +00:00
Dmitri Hrybenko
c7421211a3 Factor out logic that creates and configures all objects required for
compilation into a 'Frontend' library.

This library is still not in its best shape, but now it can be reused in
swift-index-test.


Swift SVN r6040
2013-07-06 00:46:19 +00:00
Dmitri Hrybenko
b676295e8e Add a comment for r6001
Swift SVN r6011
2013-07-05 17:13:38 +00:00
Dmitri Hrybenko
16d8ddc093 Revert wrong changes, did not intend to commit all that
Swift SVN r6010
2013-07-05 17:13:07 +00:00
Dmitri Hrybenko
b1b1c63be5 Add a comment for r6001
Swift SVN r6009
2013-07-05 17:11:38 +00:00
Argyrios Kyrtzidis
1406566e6f If just doing non-type-checking parse, no need to auto import libraries.
Swift SVN r6003
2013-07-05 15:02:37 +00:00
Chris Lattner
2ad6f72478 fix -dump-parse to not run type checking in the single translation unit case.
Swift SVN r5978
2013-07-03 22:20:00 +00:00
Dmitri Hrybenko
70246e8b89 Move swift::buildSingleTranslationUnit to a new library, libFrontend
It should be split and/or generalized in order to become reusable.


Swift SVN r5974
2013-07-03 20:50:21 +00:00