Commit Graph

2364 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 2f1e4862e5 [Test] Enable builtin parallel tests execution form JUnit5 in :compiler:tests-common-new 2021-01-15 11:16:26 +03:00
Alexander Udalov 3be62dfc89 Build: enable -Werror in stdlib/core/compiler/plugins modules
Exclude modules where there are still warnings in an explicitly declared
variable `tasksWithWarnings`.

Also remove "-progressive" from compiler arguments in modules which are
built with non-latest language version, as the warning about that leads
to an error with -Werror.
2021-01-13 19:34:24 +01:00
Alexander Udalov b3d85e656e Fix warnings after update to 202 platform
#KT-44069 Fixed
2021-01-13 19:17:22 +01:00
Alexander Udalov ee7691f1ad Fix IntArrayList deprecation warning in JvmDependenciesIndexImpl
Copy relevant parts of deprecated IntelliJ's IntArrayList to a new util
class. Also fix some minor IDE inspections.
2021-01-13 19:17:21 +01:00
Dmitriy Novozhilov 065255adbe [Test] Support friend modules in new test infrastructure 2021-01-12 18:35:24 +03:00
Dmitriy Novozhilov e991c9d476 [CLI] Drop CommonCompilerArguments.coroutinesState 2021-01-12 16:47:54 +03:00
Alexander Udalov 0fef890d1a Minor refactoring in CompileEnvironmentUtil 2021-01-12 14:45:06 +01:00
scaventz 4374438ff1 Kotlinc: Exclude module-info.class from resulting jar when "-include-runtime" is specified 2021-01-12 14:45:06 +01:00
pyos f618763250 FIR: implement -Xfriend-paths 2021-01-12 10:33:45 +03:00
Alexander Udalov 12078666c2 Add warning if both -Xuse-ir and -Xuse-old-backend are passed 2021-01-11 12:57:03 +01:00
Alexander Udalov cb3191769d Enable JVM IR by default if language version is >= 1.5
#KT-44021 Fixed
2021-01-11 12:47:54 +01:00
Alexander Udalov 22d0e5eb65 Rename -Xno-use-ir -> -Xuse-old-backend, add Gradle option
As soon as JVM IR is enabled by default (in language version 1.5), use
the CLI argument `-Xuse-old-backend` or Gradle option `useOldBackend` to
switch to the old JVM backend.
2021-01-11 12:47:54 +01:00
Ilya Chernikov 0a8858fbfe [minor] document -compiler-path option for kotlin runner 2021-01-07 10:37:23 +01:00
Ilya Chernikov 979144157f Implement -howtorun option for kotlin runner
Implement -no-stdlib argument support in kotlin runner

#KT-43534 fixed
2021-01-07 10:37:22 +01:00
Ilya Chernikov edc730f70b Implement -no-stdlib argument support in kotlin runner
#KT-43294 fixed
2021-01-07 10:37:22 +01:00
Ilya Chernikov d2ecc1e361 Implement -X arguments passing from kotlin runner to compiler 2021-01-07 10:37:22 +01:00
Ilya Chernikov 9a7d1948a7 Implement support for -Xdefault-script-extension cli option 2021-01-07 10:37:22 +01:00
Alexander Udalov ee2ae0c471 JVM IR: remove obsolete -Xir-check-local-names
This flag was added a long time ago, at the time when we weren't sure if
we were going to keep the naming of local and anonymous classes
completely equal to the naming in the old backend. Now that we've
decided that we won't keep it equal and there are a lot of differences
already, it's not useful anymore.
2021-01-04 12:13:13 +01:00
Alexander Udalov 77a9d14f93 Capitalize/decapitalize only ASCII characters across project
Use {de,}capitalizeAsciiOnly and to{Lower,Upper}CaseAsciiOnly where
possible, and stdlib's functions with Locale.US everywhere else.

Otherwise, if the default system locale is Turkish, the capital latin
letter "I" is transformed in toLowerCase to "ı" (see
https://github.com/JetBrains/kotlin/blob/66bc142f92085047a1ca64f9a291f0496e33dd98/libraries/stdlib/jvm/test/text/StringJVMTest.kt#L119),
which for example breaks the codegen for `intArrayOf` in
KT-25400/KT-43405.

Similarly, lower case latin letter "i" is transformed to "İ".

 #KT-13631 Fixed
 #KT-25400 Fixed
 #KT-43405 Fixed
2020-12-28 16:10:30 +01:00
Denis.Zharkov 5e5b236ef8 Extract record related parts into smaller bunch files for 201 2020-12-22 14:58:05 +03:00
Alexander Udalov eef06cded3 JVM IR: output stable ABI binaries by default
#KT-43592 Fixed
2020-12-20 23:14:54 +01:00
Alexander Udalov e0593ff70f Minor, extract CompilerConfiguration.messageCollector to extension property 2020-12-20 23:14:49 +01:00
Alexander Udalov 691b20a685 JVM IR, FIR: set IR configuration key to true if FIR is enabled 2020-12-20 23:14:41 +01:00
Alexander Udalov 06805ffbaa Change CLI flags for controlling diagnostics for ABI of FIR and JVM IR
- Use a more generic `-Xallow-unstable-dependencies` instead of
  `-Xallow-jvm-ir-dependencies`
- Change `-Xir-binary-with-stable-abi` to `-Xabi-stability=stable`, with
  an additional option to specify `unstable` after a subsequent commit
  where JVM IR becomes stable by default

 #KT-43592
2020-12-20 23:14:32 +01:00
Alexander Udalov 3f517d7e8d Add new metadata flag for class files compiled with FIR
Report a separate error when class files compiled with FIR are in
dependencies, in addition to the one for class files compiled with FE
1.0 + JVM IR.

 #KT-43592
2020-12-20 23:14:30 +01:00
Alexander Udalov cbd90c3af5 Refactor boolean IR ABI stability flag to enum
Introduce an enum DeserializedContainerAbiStability with two values.
This is needed in order to support another reason for ABI instability in
a subsequent commit, namely "unstable because compiled by FIR".

 #KT-43592
2020-12-20 23:14:12 +01:00
Alexander Udalov b7d32a8754 Minor, invert analysis flag that allows unstable dependencies 2020-12-20 23:13:50 +01:00
Alexander Udalov 7d37030095 JVM IR, FIR: add JvmBackendExtension instead of MetadataSerializerFactory
This might be a better place for future behavior that should be
abstracted between FE 1.0 and FIR, in JVM IR.
2020-12-20 23:13:48 +01:00
Dmitriy Novozhilov cb5183ab4d [TEST] Add implementation of new infrastructure services for compiler tests
All of new classes lays in lays in :compiler:tests-common-new module
  which includes classes for FE 1.0 and FIR diagnostics tests and
  JVM black boxtests
2020-12-16 19:52:23 +03:00
Dmitriy Novozhilov 35437e6da9 [FE] Allow explicitly specify dependent modules fin TopDownAnalyzerFacade 2020-12-16 19:52:22 +03:00
pyos 41f56729f9 FIR: serialize correct fqnames for local classes 2020-12-10 20:52:48 +03:00
Mikhail Glukhikh bf8de487a0 CliTrace: rewrite smart cast-vulnerable piece of code 2020-12-10 13:02:49 +03:00
Jiaxiang Chen 1a377069dd Allow AnalysisHandlerExtension to provide additional classpath on retry 2020-12-09 22:15:36 +03:00
Jiaxiang Chen a6cb156ce9 Allow multiple retry for AnalysisHandlerExtension 2020-12-09 22:15:36 +03:00
Denis.Zharkov 2d8a8d252b Add 201 bunch files for JavaClass implementations
In 201, there's an old ASM version and PSI doesn't have record-related API
2020-12-09 16:47:25 +03:00
Denis.Zharkov 92b402759b Report incorrect JVM target only when @JvmRecord is actually used 2020-12-09 16:47:25 +03:00
Denis.Zharkov 46c3979acd Separate JVM target option from javac's --enable-preview analogue 2020-12-09 16:47:24 +03:00
Denis.Zharkov f64980a597 Add check for bytecode target when @JvmRecord is used
^KT-43677 In Progress
2020-12-09 16:47:23 +03:00
Denis.Zharkov b860a0c664 Separate JvmTarget::bytecodeVersion version into major/minor parts 2020-12-09 16:47:22 +03:00
Denis.Zharkov 430da22b4b Setup 15_PREVIEW LanguageLevel for Java sources in CLI
It's necessary to read preview-features related Java PSI parts
It should be OK to set it unconditionally because we don't compile Java
sources, only obtain declaration structure from them
2020-12-09 16:29:02 +03:00
Ivan Gavrilovic 078aa18479 Fix KAPT cli tests on windows
- Fix line separator issue
- Always quote args with delimiters (=, :)
- fix one of args files by removing obsolete stdlib reference
- Fix kotlinc.bat to ensure lazy evaluation of additional classpath
2020-12-07 12:36:59 +01:00
Nikita Bobko 0d8cdb7bdb Fix double registered "com.intellij.psi.classFileDecompiler" for 203 platform
This commit addresses 1243c641296e74a572a4f274df72a4cda60635c6 in intellij
In intellij they added registration of "com.intellij.psi.classFileDecompiler" in
`JavaCoreApplicationEnvironment`. And because the `KotlinCoreApplicationEnvironment` inherits
`JavaCoreApplicationEnvironment` we don't need to register this EP ourselves.

This commit fixes in 203 tests + 1.4.30 compiler:
```
java.lang.RuntimeException: Duplicate registration for EP 'com.intellij.psi.classFileDecompiler': first in com.intellij.openapi.extensions.DefaultPluginDescriptor@44f464d1, second in PluginDescriptor(name=org.jetbrains.kotlin, id=org.jetbrains.kotlin, path=/home/builduser/.m2/repository/org/jetbrains/kotlin/kotlin-compiler-for-ide/1.4.30-M1-30/kotlin-compiler-for-ide-1.4.30-M1-30.jar, version=1.2)
	at com.intellij.openapi.components.ComponentManager.createError(ComponentManager.java:167)
	at com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.registerExtensionPoints(ExtensionsAreaImpl.java:262)
	at com.intellij.ide.plugins.PluginManagerCore.registerExtensionPointAndExtensions(PluginManagerCore.java:1334)
	...
```
2020-12-07 10:18:38 +03:00
Dmitriy Novozhilov 406e863a73 [FE] Fix creating location of compiler errors in CLI 2020-11-28 14:25:56 +03:00
Dmitriy Novozhilov bf1abed246 Build: add shadowing processor for core.xml in embeddable compiler 2020-11-28 14:25:54 +03:00
Dmitriy Novozhilov dc35a13008 Build: remove useless bunch files 2020-11-28 14:25:51 +03:00
Dmitriy Novozhilov 46fcc7d59d Build: fix registration of ClassFileDecompilers extension 2020-11-28 14:25:51 +03:00
Dmitriy Novozhilov eeb9b3214c Switch to 202 platform 2020-11-28 14:25:19 +03:00
Mikhail Glukhikh 037c505069 Unbind general FirDiagnostic from PsiFile & PsiElement 2020-11-26 08:37:49 +03:00
Mikhail Glukhikh 1795c4f3e5 Implement common Diagnostic(Factory/Renderer) in related FIR classes 2020-11-26 08:37:46 +03:00
Alexander Udalov ca78261d7f Minor, fix "unknown -Xstring-concat mode" error message 2020-11-24 11:50:31 +01:00