Alexander Udalov
cad4b6973c
Introduce and use JSConfigurationKeys similar to JVMConfigurationKeys
...
Use type-safe keys in CompilerConfiguration instead of multiple parameters,
duplicated in the base class (JsConfig), derived class (LibrarySourcesConfig)
and its builder (LibrarySourcesConfig.Builder)
2016-05-26 11:47:30 +03:00
Alexander Udalov
b65980f3b7
Drop JsConfig#inlineEnabled flag
...
Use CommonConfigurationKeys#DISABLE_INLINE flag (moved from
JVMConfigurationKeys) in CompilerConfiguration instead, similarly to the JVM
compiler
2016-05-26 11:47:30 +03:00
Alexander Udalov
6889bdbef8
Add CompilerConfiguration to JsConfig
...
Will be used to store common compiler options (such as source version, inline
disabled, etc) as well as JS-specific options, to unify the logic of compiler
option initialization between JS and JVM compilers
2016-05-26 11:47:30 +03:00
Alexander Udalov
116e4a5ced
Rename Config -> JsConfig
2016-05-26 11:47:30 +03:00
Alexander Udalov
2bd3211ba8
Get rid of unnecessary exceptions in JS translator
...
Before this commit, an internal error during JS translation resulted in the
actual exception wrapped in TranslationRuntimeException wrapped in
TranslationInternalException wrapped in RuntimeException being thrown. This
change gets rid of the two latter wrappings.
Also delete unthrown MainFunctionNotFoundException and related unused
constructors in TranslationException
2016-05-26 11:47:30 +03:00
Alexander Udalov
9418311bda
Pass CompilerConfiguration to CLICompiler#doExecute
...
Extract common CompilerConfiguration setup code to a separate method
2016-05-26 11:47:30 +03:00
Alexander Udalov
3c81bb4bfc
Add MessageCollector#hasErrors, get rid of MessageSeverityCollector
...
Also fix duplicated wrapping of a message collector into a message severity
collector (in CLICompiler and in the beginning of doExecute in
K2JVMCompiler/K2JSCompiler)
2016-05-26 11:47:30 +03:00
Alexander Udalov
c5e2f55ea7
Get rid of getModuleName(), pass configuration to createContextWithSealedModule
...
Add KotlinTestUtils.newConfiguration() which creates a configuration and sets
the module name to the default test one ("test-module")
2016-05-26 11:47:30 +03:00
Alexander Udalov
3ca77de924
Remove traces of old compiler plugin architecture
...
It was retired with the deprecation and subsequent removal of the old KDoc, and
is now unused
2016-05-26 11:47:30 +03:00
Alexander Udalov
0fe39a186e
Simplify public methods of KotlinToJVMBytecodeCompiler
...
Pass as much as possible in the single CompilerConfiguration instance instead
of in separate function parameters. Add corresponding keys to
JVMConfigurationKeys.
Re changes in compileModules: since output directory (stored now under the key
OUTPUT_DIRECTORY) is different for each module, the configuration of the whole
project is no longer applicable when compiling individual modules. Thus we copy
the project configuration for each module and add the output directory value
2016-05-26 11:47:30 +03:00
Alexander Udalov
8c0f78db50
Introduce CompilerConfiguration#getNotNull and getBoolean
...
To reduce boilerplate at call sites
2016-05-26 11:47:30 +03:00
Alexander Udalov
81a0fa5f47
Minor, fix warnings and improve style in KotlinToJVMBytecodeCompiler
2016-05-26 11:47:30 +03:00
Pavel V. Talanov
dcd7e6d767
Move ReplState to frontend
2016-05-24 15:42:00 +03:00
Pavel V. Talanov
5058e9b4e6
Fix import resolution in Repl
...
#KT-11428 Fixed
Refactor ReplState to be a component
2016-05-24 15:41:56 +03:00
Pavel V. Talanov
27bd74f4c5
Refactor: replace LastLineScopeProvider with ReplState, extract FileScopeFactory from FileScopeProviderImpl
2016-05-24 15:41:30 +03:00
Pavel V. Talanov
3b4ade2ca0
Refactor: extract resolve related code from ReplInterpreter to CliReplAnalyzerEngine
2016-05-24 15:36:12 +03:00
Alexander Udalov
cf19166eca
Move IC-related initialization logic to GenerationState
...
To further reduce number of parameters of GenerationState's constructor
2016-05-23 14:50:06 +03:00
Alexander Udalov
29c5e655ab
Drop several more parameters of GenerationState's constructor
...
INCREMENTAL_COMPILATION_COMPONENTS and DECLARATIONS_JSON_PATH are already in
the configuration, and Progress was unused
2016-05-23 14:50:06 +03:00
Alexander Udalov
f8816b5d67
Pass CompilerConfiguration to GenerationState instead of ton of parameters
2016-05-23 14:49:26 +03:00
Alexander Udalov
a85e98a078
Minor, inline unnecessary method of TopDownAnalyzerFacadeForJVM
...
The TopDownAnalysisMode parameter was TopLevelDeclarations everywhere
2016-05-23 14:47:00 +03:00
Alexander Udalov
6d6488e795
Pass CompilerConfiguration to TopDownAnalyzerFacadeForJVM
...
In most cases, the configuration can be loaded from KotlinCoreEnvironment. In
other cases, such as IDE tests, there's no environment, so we pass EMPTY. Since
currently the configuration is only used to load incremental compilation
components and module information, it's fine to pass EMPTY
2016-05-23 14:47:00 +03:00
Alexander Udalov
6c0ff40197
Move JVMConfigurationKeys to frontend.java
...
Similarly to K2JVMCompilerArguments, they will soon be needed in the IDE code.
Move COMPILER_JAR_LOCATOR to CLIConfigurationKeys because it's used both in JVM
and JS, and only in CLI. Other keys, non-relevant in the IDE, may be moved out
soon as well, such as incremental compilation components
2016-05-23 14:47:00 +03:00
Alexander Udalov
dcb2d7b4f6
Minor, break the line in "kotlinc -help" if it's too long
...
To improve description of the "pluginOptions" flag
2016-05-23 14:47:00 +03:00
Dmitry Petrov
a4406687f1
KT-11588 Type aliases
...
Resolution & expansion for type aliases.
NB: Nested type aliases capturing type parameters of outer classes are not supported yet.
2016-05-20 14:17:24 +03:00
Mikhail Glukhikh
733f3e8025
Code cleanup: type parameters can have in / out variance
2016-05-13 17:57:02 +03:00
Valentin Kipyatkov
b551886889
Code cleanup: removed redundant semicolons
2016-04-29 11:26:25 +03:00
Alexander Udalov
a8629b3836
Do not fail on unknown -X flags
...
For better compatibility if we add experimental stuff in 1.0.X compilers
2016-04-12 20:03:51 +03:00
Alexey Sedunov
962b312fb7
[RESTORED] Light Classes: Constant expression evaluator for light annotation arguments
2016-04-08 21:11:16 +03:00
Nikolay Krasko
6291bb92bd
Create own disposable for building separated modules
...
There's a new check that assert disposer hasn't be disposed yet.
2016-04-05 00:39:46 +03:00
Dmitry Petrov
92ddbb271a
KT-11410: generate light classes from multifile class parts in binaries
...
if explicitly requested by fqName
2016-04-01 10:13:22 +03:00
Dmitry Petrov
0ccaf43e2c
KT-11410: Add Xmultifile-parts-inherit CLI option.
2016-04-01 10:13:21 +03:00
Alexey Sedunov
95f6acdddf
[REVERTED] 8c72b02 Alexey Sedunov on 3/21/2016 at 19:14 (committed on 3/24/2016 at 18:42)
...
Light Classes: Constant expression evaluator for light annotation arguments
2016-03-29 19:17:05 +03:00
Alexander Udalov
f31dca32a4
Flush stdout and stderr before shutdown in scripts
...
Although a test is present, it doesn't check the behavior because it seems that
in the test environment both streams are necessarily flushed
#KT-9546 Fixed
2016-03-29 17:53:18 +03:00
Ilya Gorbunov
e7d75fccd6
Introduce compiler option to dump declaration mapping.
2016-03-29 13:49:34 +03:00
Ilya Gorbunov
4e49187549
Dump declaration mapping during codegen process.
2016-03-29 13:49:33 +03:00
Alexey Sedunov
8c72b02c9b
Light Classes: Constant expression evaluator for light annotation arguments
2016-03-24 17:42:10 +03:00
Alexey Sedunov
fefa0baeee
Light Classes: Generate light wrappers for annotation entries
2016-03-24 17:41:58 +03:00
Ilya Gorbunov
02bb7f2f0d
Remove the compiler option "Xmultifile-facades-open"
2016-03-15 14:10:33 +03:00
Nikolay Krasko
d45fc3bad7
Avoid warnings from idea core during file system initialization on Windows.
...
Do not use idea custom file system for now.
See FileSystemUtil.java and IdeaWin32.java files for details.
2016-03-10 13:32:08 +03:00
Ilya Chernikov
66f1f87757
Additional check of analyze resul, prevents a problem of passing BindingContext.EMPTY to the generation stage, fixes kapt tests in gradle plugins
...
KT-8487
2016-03-03 16:45:12 +03:00
Denis Zharkov
26ebf46e3e
Do not read module mappings more than once
2016-03-02 13:38:46 +03:00
Denis Zharkov
3652cd9c18
Optimize top level class searching in LazyJavaPackageScope
...
Do not try to search something, that is known not to exist
2016-03-02 13:38:46 +03:00
Denis Zharkov
bc5110550a
Release generated bytecode after each processed part
...
Part here means separate '.kt' file or multi-file facade
Now this memory optimization doesn't work with jar's,
because there is no simple way to write them incrementally.
2016-02-18 21:22:04 +03:00
Denis Zharkov
b87cc5712c
Minor. Weaken value parameter types: ClassFileFactory -> OutputFileCollection
2016-02-18 21:22:04 +03:00
Alexander Udalov
7a6cc71454
CLI: disable colors on platforms unsupported by jansi
...
#KT-10605 Fixed
2016-02-17 20:51:48 +03:00
Alexander Udalov
2e13377d4a
J2K ReplInterpreter: prettify
2016-02-17 20:51:11 +03:00
Alexander Udalov
5670e7f750
J2K ReplInterpreter: convert
2016-02-17 20:51:11 +03:00
Alexander Udalov
2b2c4b3610
J2K ReplInterpreter: move .java -> .kt
2016-02-17 20:51:11 +03:00
Pavel V. Talanov
f59a4c537e
Minor: remove some dead code
2016-02-08 16:45:46 +03:00
Zalim Bashorov
ba6c738cb5
Minor: don't init AnsiConsole when coloring is disabled
2016-02-04 14:36:31 +03:00