Commit Graph

2089 Commits

Author SHA1 Message Date
Mikhael Bogdanov 2ed0cb2a89 Support type annotations
#KT-35843 Fixed
2020-01-09 14:00:11 +01:00
Ilya Chernikov 995c6a32b8 Allow only single expression eval in cli compiler and kotlin runner
#KT-35740 fixed
also add tests and drop logger usage in the cli dependencies manager:
the logger is normally unitialized in the usage scenarios, but related
warnings are annoying.
2020-01-09 10:51:25 +01:00
Simon Ogorodnik 1715f1a864 [FIR] Refactoring: create use-site scopes via scope provider 2019-12-30 12:52:58 +03:00
Svyatoslav Kuzmich d74721716a [JS IR] Use short klib names instead of absolute paths 2019-12-25 13:44:57 +03:00
Svyatoslav Kuzmich 31c84e9ac4 [JS IR] Build stdlib using compiler from repo
Previously JS IR versions of stdlib and kotlin-test were build
by default using compiler previously built on a buildserver.

It had some issues:
 - This required us to advance bootstrap every time we made any
   incompatible IR changes. This happens often since IR ABI is
   not quite stable yet.

 - We never tested the exact combination of compiler and stdlib we publish

   We tested:
    - new compiler with new stdlib build by new compiler (in box tests)
    - old compiler with new stdlib build by old compiler (in stdlib tests)

   We published:
    - new compiler with new stdlib build by old compiler

After this change JS IR compiler tests, builds and publishes
single configuration:

    new compiler with new stdlib build by new compiler

JS IR stdlib and kotlin-test are now built using JavaExec of CLI instead
of Gradle plugin to avoid troubles of loading a freshly built plugin.

This also allows to have a granular dependencies: we don't rebuild klib
if we changed a lowering in a compiler backend, but we do rebuild it if
we changed IR serialization algorithm.
2019-12-25 13:44:57 +03:00
Sergey Igushkin ed6034e449 Support generating a klib from common code with K2MetadataCompiler 2019-12-25 12:09:08 +03:00
Michael Kuzmin 254dc8f71c Build: Drop IntelliJ 2018.3 and Android Studio 3.4 support
Delete *.183 and *.as34 bunch-files
2019-12-19 18:31:07 +03:00
Simon Ogorodnik 05308a3652 [FIR] Introduce module for all jvm extensions 2019-12-19 17:30:12 +03:00
Alexander Gorshenev dc8240c24e Expect/actual support in klibs under -Xklib-mpp 2019-12-18 19:29:56 +03:00
Alexander Udalov e009c7064e Add -Xopt-in command line argument
As per https://github.com/Kotlin/KEEP/pull/201
2019-12-17 18:17:48 +01:00
Alexander Udalov 33bc3db144 Deprecate -Xexperimental compiler argument
This option is not widely used and its implementation relies on a
complicated mechanism of a module-wide metadata, which is not properly
supported in the IDE (see IdeModuleAnnotationsResolver).

 #KT-34649 Fixed
2019-12-17 18:17:48 +01:00
Svyatoslav Kuzmich 3df8393ede [JS IR] Properly report compiler errors
Report compiler errors using message collector
Instead of crashing with stack trace
2019-12-17 15:33:43 +03:00
Juan Chen 15f6beed57 Fix Compose extension points in compiler.xml 2019-12-12 18:30:54 +03:00
Ilya Chernikov 354be2b14f [minor] Change expression evaluation cli argument to -Xexpression 2019-12-11 12:20:49 +01:00
Mikhail Glukhikh fbf1dbf2da FIR: introduce error message renderer 2019-12-10 12:58:38 +03:00
Alexander Udalov fd627603a0 Refactor CompilationErrorHandler
It only had one implementation THROW_EXCEPTION, inline it everywhere
with a call to a static method
2019-12-03 10:48:34 +01:00
Ilya Chernikov 49de5e19fb Implement repl, script and expressions evaluation support in kotlin runner 2019-12-02 16:46:54 +01:00
Ilya Chernikov 531ff92791 Implement support for expression evaluation in jvm cli compiler 2019-12-02 16:46:54 +01:00
Ilya Chernikov 02a71d2cda Save updated roots before a packagePartProvider is created
Since the function createPackagePartProvider uses initialRoots for
creating packagePartsProvider, if the updateClasspath function
was called before createPackagePartProvider, the provider was created
with incomplete list of roots, that leaded to the unresolved top-level
functions.
Now if no providers are created yet, the initialRoots is updated.
This still may lead to the inconsistencies, when/if we'll have several
providers.
2019-12-02 16:46:53 +01:00
Alexander Gorshenev a923e0d130 Only allow version triples for klib metadata and ir versions 2019-11-30 18:37:38 +03:00
Alexander Gorshenev b0f077ff4b Plumbing KlibMetadataVersion and KlibIrVersion values to klib manifest 2019-11-30 18:37:38 +03:00
Mikhail Glukhikh 178dbd3c5d Remove hacky re-initialization of PsiSubstitutor.KEY (branch 193)
After IDEA commit
https://github.com/JetBrains/intellij-community/commit/8b0af117241a074f5681fa93be74c6f1812497ba#diff-9b39aafa0a7b8d4f089100f3968931d0
this re-initialization is no more necessary. Moreover, it's harmful,
because this KEY is used as a map key in IDEA code,
and we cannot find information stored by this key.
This was a hidden reason of FIR / IR test failures in branch 193.

After this commit, FIR / IR tests in branch 193 should be fixed
2019-11-26 13:13:48 +03:00
Anton Bannykh 81699299f5 JS_IR: DCE
Could be enabled by toggling `-Xir-dce`

Box test output in js/js.translator/testData/out-min
2019-11-26 12:20:39 +03:00
Svyatoslav Kuzmich 42c4591df8 [JS IR] Add -Xgenerate-dts CLI argument 2019-11-12 18:19:06 +03:00
Alexander Udalov 57a674e9e6 Make fast class files reading mode default in compiler tests
This makes sense because this mode is the default in the production
compiler. Forgetting to enable it where necessary led to different
bizarre test failures, see for example changes around 3fee84b966 and
KT-34826
2019-11-11 15:40:49 +01:00
Dmitriy Novozhilov 45523a5767 Fix -Xuse-mixed-named-arguments compiler arg 2019-11-08 15:30:04 +03:00
Nikolay Krasko 155a760ee9 Revert "Revert [JS IR] commits that failed build"
This reverts commit 740f851a
2019-11-07 16:24:13 +03:00
Leonid Startsev 3b100e57f2 Change NO_EXPLICIT_VISIBILITY_IN_API_MODE diagnostic range to 'declaration modifiers + name'.
Motivation: missing visibility modifier is an error in visibility modifiers list, so we should highlight this list.
Including a name in the range is convenient for using alt+enter (you don't have to move cursor from name to fun/class/val keyword)

 Also change NO_EXPLICIT_RETURN_TYPE_IN_API_MODE diagnostic range to 'declaration name' to match corresponding IDE inspection.

Fix stylistic problems and typos after review
2019-11-06 19:54:00 +03:00
Leonid Startsev ebb7e434c8 Explicit Api mode: Renamings after design discussions
Change CLI flag to -Xexplicit-api=strict|warning. 'Disable' state and 'mode' suffix are left out as implementation details.

Change intention title to 'make X public explicitly'

Do not report 'no explicit visibility' on property accessors

Set DECLARATION_SIGNATURE as a range for report

Rename internal diagnostic from _MIGRATION to _WARNING
2019-11-06 19:53:59 +03:00
Leonid Startsev 7058492b55 Explicit Api mode: prototype with check for missing explicit visibility
Add cli flag with 3-state switch
2019-11-06 19:53:58 +03:00
Dmitriy Novozhilov 7f58162abc Add -Xuse-mixed-named-arguments compiler flag
That flags enables MixedNamedArgumentsInTheirOwnPosition feature
  (see #KT-7745) without experimental warning
2019-11-05 15:22:23 +03:00
Nikolay Krasko 740f851a10 Revert [JS IR] commits that failed build
Revert "[JS IR] Build hybrid versions of stdlib and kotlin.test"
This reverts commit b9f88350dd.

Revert "[JS IR] Add gradle plugin integration tests"
This reverts commit d872b27663.

Revert "Update bootstrap"
This reverts commit bc47594c7a.

Revert "[JS IR] Support generating both IR and pre-IR libraries"
This reverts commit 1b8df45bfe.
2019-11-05 13:58:39 +03:00
Svyatoslav Kuzmich 1b8df45bfe [JS IR] Support generating both IR and pre-IR libraries
Remove all previous -Xir options

Add:
 -Xir-produce-klib-dir
 -Xir-produce-klib-file
 -Xir-produce-js
 -Xir-only
2019-11-01 19:42:05 +03:00
Alexander Udalov df4ab4ed81 Add JVM bytecode target version 13
#KT-34119 Fixed
2019-10-29 12:54:24 +01:00
Pavel Semyonov c6f54b6412 Improve descriptions of compiler options 2019-10-25 19:26:19 +02:00
Kevin Bierhoff 5c9cbf7e77 allow relative friend paths matching relative classpaths 2019-10-24 14:56:46 +02:00
Stanislav Erokhin 352a4dc836 Added extension points to the second compiler.xml
This is a workaround for KT-34528.
Extension points from 26728711
2019-10-23 18:14:35 +03:00
Jim Sproch 383239aff6 Make useIR available from Gradle KotlinJvmOptions 2019-10-21 13:20:54 +03:00
Georgy Bronnikov 7f32f43a48 Pass isIR flag from KotlinToJVMBytecodeCompiler to GenerationState 2019-10-17 16:44:20 +03:00
Stanislav Erokhin 84aff5f630 Add some changes to introduced extension points 2019-10-17 04:41:29 +03:00
Jim 267287118b Frontend plugins to upstream
Change-Id: Id9203c92d0a711e4f21565bd225a465bd41db476
2019-10-17 04:41:27 +03:00
Alexander Udalov d0b241b681 Minor, fix typo in -include-runtime argument help
#KT-34240 Fixed
2019-10-16 15:00:03 +02:00
Ilya Gorbunov 941980c154 Cleanup FE analysis flag allowKotlinPackage
It was used to allow custom contracts when compiling stdlib
with the Kotlin 1.2 compiler. Since 1.3 compiler is used now, this
flag is no longer necessary.
2019-10-15 19:08:57 +03:00
Nikolay Krasko 79cb10a755 Patch initializing EmptySubstitutor service and fix null references
There's a cycle in service initialization and PsiSubstitutor 'clinit'
2019-10-14 16:55:25 +03:00
Ilya Chernikov 2568804eaa Instruct platform code to use NIO2 always
since we're not always use jna (means that we can get warnings about missing jna libs)
and according to the IDEA team, NIO2 works well enough to rely on it
2019-10-11 17:43:49 +02:00
Ilya Chernikov 2219b950f1 Implement resolve top-level functions and props from classloader
#KT-33892 fixed
2019-10-10 17:43:29 +02:00
Vitaliy.Tikhonov f59e393e37 [CLI] add support running scripts in js compiler, extract common code with jvm part 2019-10-10 12:52:06 +03:00
Leonid Startsev 395d595b22 Supply JVM and JS platforms when compile from CLI
To be able to check descriptor's platform in frontend during plugin processing.

This is needed for serialization plugin because some synthesized descriptors (annotation interface implementation) must be JVM-only (or the Native compilation fails).
2019-10-09 14:18:54 +03:00
Alexander Gorshenev c2c88a9ee6 Use MessageCollector.NONE as a dummy logger collector for js library resolver 2019-10-08 16:56:29 +03:00
Alexander Gorshenev 71eb413350 Attached library resolver to messge collector 2019-10-08 16:56:29 +03:00