Commit Graph

367 Commits

Author SHA1 Message Date
Alexander Udalov 0f003802fe Introduce -Xcommon-sources and pass it correctly from build tool plugins
#KT-25196 In Progress
2018-08-21 12:49:10 +02:00
Mikhail Zarechenskiy b1985ee422 Enable SAM conversion for Kotlin functions by default in new inference
KT-25686
2018-08-10 17:24:18 +03:00
Sergey Rostov 59c41e111d K2JSCompilerArguments: sourceMapEmbedSources should be null by default.
When sourceMapEmbedSources are not null and source maps is disabled warning is reported, since it has effect only when source maps are enabled. Also this fixes some JPS JS with warnings count assertions.
2018-08-10 12:23:40 +03:00
Alexey Sedunov abbac067b8 Configuration: Collapse empty nullable strings to null 2018-08-09 10:06:30 +03:00
Alexey Sedunov ecf607d4fa Gradle: Implement new MPP model import 2018-08-07 15:59:41 +03:00
Alexander Udalov 4bd66d5aa8 Add compiler argument -Xfriend-paths for kotlinc-jvm
#KT-21910 Fixed
2018-07-27 18:51:42 +02:00
Dmitry Petrov 566b5856ec Constructor call normalization mode depends on language version 2018-07-27 09:52:29 +03:00
Dmitry Savvinov 6dacd1011f Do not report warning if -XXLanguage turns on bugfix
KT-25554 Fixed
2018-07-20 14:24:42 +03:00
Alexander Udalov 871b896a21 Add internal compiler argument to change metadata version
Will be used in tests to check how we behave on binaries produced by a
"future" compiler
2018-07-18 17:59:37 +02:00
Georgy Bronnikov 8ce658ab54 Introduce -Xuse-ir flag for cli compiler 2018-07-10 10:05:06 +02:00
Ilya Chernikov ec58929e39 Allow multiple same jsr305 options in the command-line
do not report duplicate jsr305 entries if options are the same
2018-07-10 08:43:51 +02:00
Alexander Udalov 0c45f20515 Minor, fix several CLI argument descriptions 2018-06-27 13:25:30 +02:00
Sergey Rostov 0eee2729cd jps: support multiplatform incremental compilation for jvm and js
- support common modules metadata compilation under flag (it is not required since all common source roots are included transitively for now)
- introduce expect actual tracker in jps: move implementation from gradle to build-common
- support js incremental compilation: move implementation from gradle to build-common
2018-06-08 09:46:37 +03:00
Mikhael Bogdanov 419218b9cf Rename 'jvm-default-mode' to 'jvm-default'. Add description 2018-05-29 11:26:36 +02:00
Mikhael Bogdanov 7f4bd549aa Minor. Fix rebase 2018-05-29 09:28:46 +02:00
Mikhael Bogdanov 065780de4c Switch enableJvmDefault to jvmDefaultMode 2018-05-28 22:15:42 +02:00
Dmitry Savvinov da7b59984f Move importsDumper to compiler plugin 2018-05-28 13:02:48 +03:00
Alexander Udalov 06d97cce51 Fix multiple issues when expanding argfiles
- treat a contiguous whitespace sequence as a single argument separator,
  not as several empty-string arguments separated by whitespaces
- fix infinite loop when reading unfinished quoted argument
- do not attempt to perform escape if the backslash is the last
  character in the file
2018-05-28 11:23:32 +03:00
Alexander Udalov 61902e1fd5 Support -Xargfile in all scenarios; refactor & prettify code
Perform command line argument preprocessing in the beginning of
parseCommandLineArguments, so that argfiles are expanded in all
scenarios, not just when the compiler is invoked via
K2{JVM,JS}Compiler.exec
2018-05-28 11:23:32 +03:00
Dmitry Savvinov 43467516ef Support argfiles in kotlin compiler
Using '-Xargfile=path/to/argfile' will substitute
that argument with the content of argfile.

See KT-24472
2018-05-28 11:23:32 +03:00
Ilmir Usmanov df4dcc0f8e Ignore data flow info from assert calls
if assertions mode is not LEGACY.

This is done since assertions can be disabled (in both compile time and
runtime) and thus, the data flow info is not reliable anymore.
 #KT-24529: Fixed
2018-05-25 18:58:49 +03:00
Ilmir Usmanov f568149863 Implement new assert semantics in back-end
Previously, assert was just a regular function and its argument used to
be computed on each call (even if assertions are disabled on JVM).
This change adds support for 3 new behaviours of assert:
* always-enable (independently from -ea on JVM)
* always-disable (independently from -ea JVM)
* runtime/jvm (compile the calls like javac generates assert-operator)
* legacy (leave current eager semantics) - this already existed

Default behaviour is legacy for now.

The behavior is changed based on -Xassertions flag.
 #KT-7540: Fixed
2018-05-21 20:43:37 +03:00
Dmitry Savvinov 68dbeeac7a Introduce LanguageFeature.Kind
Mainly, Kind affects 'forcesPreReleaseBinaries' and
'enabledInProgressiveMode' flags, and allows to cover common
combinations of those flags.
2018-05-18 16:16:23 +03:00
Dmitry Savvinov c33b7377da Add support of internal arguments for language feature settings
Arguments are passed in form '-XXLanguage:+LanguageFeatureName' for enabling
LanguageFeature.LanguageFeatureName, and '-XXLanguage:-LanguageFeatureName'
for disabling.

Note that they do override other settings, including 'language-version'
or extra ('-X') args.
2018-05-18 16:16:23 +03:00
Dmitry Savvinov ae119a09eb Minor: reformat CommonToolArguments 2018-05-18 16:16:23 +03:00
Dmitry Savvinov 9ba450ffc5 Minor: reformat parseCommandLineArguments, apply intentions 2018-05-18 16:16:23 +03:00
Dmitry Savvinov 9876ecd6df Minor: reformat CommonCompilerArguments 2018-05-18 16:16:23 +03:00
Dmitry Savvinov e8181c0473 Introduce -Xprogressive 2018-05-18 16:16:23 +03:00
Dmitry Savvinov 70622ff668 Introduce -Xoutput-imports mode of JVM compiler
In this mode, instead of analyzing files and generating bytecode for
them, compiler just saves imports of each file in JSON map of form

'<path to file> -> [<import1>, <import2>, ...]'

It is needed for some external tools, notably for Google3 toolchain.
2018-05-15 15:36:14 +03:00
Dmitry Savvinov 97d455729b Add -Xdump-perf 2018-05-04 15:00:43 +03:00
Dmitry Savvinov 9996a1bc7e Rewrite performance statistics collection
This commit introduces notion of 'PerformanceManager' in CLI, suitable
for collecting performance metrics of the compiler. It:

- provides `notifyX{Started/Finished}` API, where 'X' is some
measurable event (previously there were just ad hoc manual time
measurements using System.nanoTime() and stuff)

- collects measurements, so that later they can be reported in an
appropriate way (previously measurements were reported immediately to
MessageCollector as plain strings)

- allows overriding to collect metrics, specific for just one target
platform compilation

Also, common logic of compiler performance statistics collection was
extracted from platform-compilers (K2JVMCompiler) to common classes
(CLICompiler), to allow other platform-compilers (e.g. K2JSCompiler)
re-use it.
2018-05-04 15:00:43 +03:00
Dmitry Savvinov c3745c9040 Drop -Xrepeat flag
This flag hadn't been maintained for a long time and isn't working
properly at the moment.
2018-05-04 15:00:43 +03:00
Ilya Chernikov a29411a211 Process script templates everywhere properly:
- add options to disable scripting plugin and standard script definition
- move standard definition adding logic into appropriate place
- fix logic of scripting plugin loading
- add standard script definition on the environment creation to
  ensure compatibility with all usages
- fix testdata
- some minor fixes
2018-05-03 22:15:09 +02:00
Anton Bannykh 703611a15c Revert "JS: remove -XtypedArraysEnabled flag (always true now)"
This reverts commit 4a5e9bb
2018-04-10 20:45:07 +03:00
Ilya Chernikov cc2b244484 Add a compiler option to disable default scripting plugin 2018-04-06 08:53:31 +02:00
Mikhael Bogdanov 23e8adb793 Add custom diagnostic checker for @JvmDefault annotation 2018-04-03 19:18:17 +02:00
Alexey Tsvetkov 8a82c1618c Use Plugins DSL in Kotlin Gradle scripts
When plugins DSL is used, there is no need to
manually generate typesafe accessors for extensions and
conventions (by running `./gradlew kotlinDslAccessorsSnapshot`).
2018-03-26 16:09:29 +03:00
Nikolay Krasko 875e0a64e7 Add -Xuse-type-table to jvm compiler options 2018-03-22 11:54:01 +03:00
Ilya Chernikov 643e81f0ae Refactor language feature settings processing for exposing it outside of the CLI compiler 2018-03-19 11:45:09 +01:00
Yan Zhulanow 34d1611ed4 Add Pill support to compiler and IDE modules 2018-03-02 03:15:17 +03:00
Yan Zhulanow 0ebcd0ad40 Remove inline function usages that break JPS compilation 2018-03-01 21:30:51 +03:00
Anton Bannykh 4a5e9bbc7f JS: remove -XtypedArraysEnabled flag (always true now) 2018-03-01 14:26:13 +03:00
Anton Bannykh ed80252ba8 JS: fix double compareTo behaviour for NaN and +-0 (KT-22723) 2018-02-28 15:01:58 +03:00
Dmitry Petrov 839ebba157 ProperNumberComparisons is disabled by default (until LDC decision) 2018-02-13 09:26:00 +03:00
Dmitry Petrov af79bbd247 Minor: reformat code 2018-02-13 09:25:40 +03:00
Yan Zhulanow 310ee67c35 REPL, minor: Ignore empty lines (#KT-21611) 2018-02-09 19:24:57 +03:00
Alexander Udalov 77625831f7 Support -Xexperimental and -Xuse-experimental, validate their values
#KT-22759 In Progress
2018-02-08 17:07:22 +01:00
Alexander Udalov f4e2102787 Minor, remove extra empty lines from -X arguments help 2018-02-01 19:38:32 +01:00
Alexander Udalov f9e195351a Minor, rephrase usage help for -no-stdlib/-no-reflect compiler arguments 2018-02-01 19:38:30 +01:00
Ilya Chernikov 4eb557724c Convert compiler projects to the new intellij deps 2018-01-30 17:06:13 +03:00