Commit Graph

169 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis
2380966931 [IDE] Enhance ide::isSourceInputComplete() function to also return indentation information.
Patch provided by GregC.

Swift SVN r16552
2014-04-18 22:12:40 +00:00
Dmitri Hrybenko
236c581de7 Code completion: complete "?.member" on T?, and ".member" on @unchecked T?
In order for Xcode to use these completions, we complete "?.member" when the
user has typed "anOptional.", but we also say that in order to apply this
result, N bytes to the left of the cursor should be erased first.

rdar://16579657 rdar://15233283


Swift SVN r16409
2014-04-16 10:50:14 +00:00
Jordan Rose
100f500acb [REPL] Put REPL directives into the REPL history.
<rdar://problem/16077929>

Swift SVN r15969
2014-04-05 00:50:32 +00:00
Enrico Granata
34209113fb The REPL currently tries to "warm up" by running an harmless expression, Void(), before giving the user control
This works, except when you launch it in -parse-stdlib mode, where running that expression fails, because Swift.Void wasn't pulled in, and that failure causes the REPL to quit

This patch passes down the -parse-stdlib flag to the REPL initialization code, such that it does not try to run any warm up code in -parse-stdlib mode



Swift SVN r15968
2014-04-05 00:28:55 +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
Dmitri Hrybenko
f232267f23 Replace llvm::OwningPtr with std::unique_ptr
It looks like llvm::OwningPtr is going to be removed soon.


Swift SVN r14729
2014-03-06 09:47:17 +00:00
Jordan Rose
230443ae9a [REPL] Don't recursively IRGen imported modules if source imports are off.
This was causing all the external definitions to go from SILGen through
IRGen multiple times per REPL statement. Since this only matters if we
have source modules enabled, just turn it off.

We still generate all the external definitions for every REPL /line/, which
is the cause of <rdar://problem/16164076>.

Swift SVN r14467
2014-02-27 19:28:38 +00:00
Dmitri Hrybenko
3d0e7ec09d Track upstream LLVM API change. DataLayout is not a Pass anymore
Swift SVN r14390
2014-02-26 10:03:45 +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
Jordan Rose
93b87edcbe Add -resource-dir option to find lib/swift directory.
This is equivalent to Clang's -fresource-dir; it provides the location of
compiler modules and libraries.

No end-user-visible changes, but the iOS build will no longer have to use
-I to build and test its own standard libraries.

Swift SVN r13888
2014-02-14 01:27:15 +00:00
Argyrios Kyrtzidis
d073e3026c [IDE] Add a convenient overload for ide::isSourceInputComplete that accepts a StringRef.
Swift SVN r13318
2014-02-02 06:49:59 +00:00
Argyrios Kyrtzidis
caaaaf845c [REPL] Utilize the more accurate ide::isSourceInputComplete in the REPL in order to
figure out if we should continue reading lines or not.

Swift SVN r13316
2014-02-02 03:14:36 +00:00
Mark Lacey
5c696fda8b Make IR generation take an explicit LLVMContext.
Prior to r13134, the modules being constructed for IRGen always used the
LLVM global context due to <rdar://problem/15283227>, but the interface
should really take this as a parameter rather than baking the behavior
into IRGen.

Swift SVN r13260
2014-02-01 01:07:14 +00:00
Michael Gottesman
10efd0b073 Add SILOptions as an argument to runSILDiagnosticPasses.
I am going to use this in a forthcoming patch which creates a special mode
called "ParanoidVerification" which runs the verifier after all passes.
"ParanoidVerification" will be by default off and will be used on the swift-fast
buildbot to help catch bugs which might be hidden by optimizations being run.

Swift SVN r13256
2014-02-01 00:30:53 +00:00
Mark Lacey
d69b305200 Generate IR for inline functions from Clang modules.
Currently only inline functions referenced from Swift source files, or
from the REPL, will get IR generated for them. Inline functions
referenced by other inline functions will require additional effort to
generate properly.

With this change we use the clang::CodeGenerator-created llvm::Module
for all IR generation in Swift. This is perhaps undesirable, but
unavoidable given the interface the public Clang APIs expose, which do
not allow for building a ModuleBuilder that borrows an existing
llvm::Module.

Also unfortunate is the hack to generate a UsedAttr for each imported
inline function, but the public Clang APIs do not provide a way to only
emit deferred decls without emitting other things (e.g. module flags
that conflict with what the Swift IRGen emits). Note that we do not do
IRGen for every inline function in the module - only the ones that the
importer pulls in, which appears to be only those transitively
referenced from Swift code.

Swift SVN r13134
2014-01-30 02:33:37 +00:00
Mark Lacey
9fde7f17cc Add DisableFPElim to IRGenOptions.
Use this to initialize the llvm::TargetOptions for code generation.

Swift SVN r13130
2014-01-30 00:26:57 +00:00
Jordan Rose
81e13fb60d When autolinking in immediate mode, make sure we're checking private imports...
...since all imports are private by default, and we rely on "import Cocoa"
bringing in AppKit. (If you say "import AppKit" directly, you get an
immediate call to IRGenImportedModules, so everything works.)

Swift SVN r12617
2014-01-20 23:25:05 +00:00
Chris Lattner
bb3c0d52dc Unfortunately, two conflated NFC patches:
1) Revert my change to give DeclContext a dump method, it confuses the debugger.
2) Refactor SILGen::requiresObjCPropertyEntryPoints out to 
   VarDecl::usesObjCGetterAndSetter.


Swift SVN r12526
2014-01-18 02:00:23 +00:00
Connor Wakamo
8fc6a6d599 [immediate] Moved the support for immediate and REPL modes into a new swiftImmediate library.
In order to implement immediate and REPL modes in swift_driver, this functionality
needs to be in a library (instead of directly in the swift executable).

Swift SVN r12519
2014-01-18 00:55:45 +00:00