Commit Graph

121 Commits

Author SHA1 Message Date
Dmitriy Novozhilov da581f38e1 [Test] Require specifying parser for FIR test. Unify names for FIR tests
Now all tests with `Fir` in name are named accordingly to parser which
  is used in them -- `FirPsi` or `FirLightTree`. This is needed to keep
  consistency between different types of tests, because there is no
  single default in parser mode between different scenarios of using FIR
2023-02-24 11:15:26 +00:00
Alexander Udalov d2938e732a IR: remove IrTypeOperatorCall.typeOperandClassifier 2023-02-22 22:40:34 +00:00
Vladimir Dolzhenko 3e99807436 Add ability to provide specific AbsentDescriptorHandler
#EA-457188

Merge-request: KT-MR-8900
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-02-22 12:44:46 +00:00
Alexander Korepanov 3c9d653595 [JS IR] Ignore unbound symbols in IC infrastructure
The IR linker is responsible for detecting unbound symbols,
 if it skips them for some reason, IC infrastructure must not fail
 with unbound symbols exceptions. Anyway, the IR validator
 verifies later if there are unbound symbols in
 reachable IR and generates the corresponding error.

^KT-56602 Fixed
2023-02-21 14:46:44 +00:00
Simon Ogorodnik 36c3d62ba1 Modularized tests. Fix java source scope for light tree mode
We should use appropriate java source scope for java files,
not kotlin files

^KT-56075
2023-02-15 15:43:30 +00:00
Ivan Kochurkin 6bdd0edd6c [FIR2IR] Add Fir2IrCommonMemberStorage, get rid of merge in Fir2Ir storages
Extract DescriptorSignatureComposerStub and WrappedDescriptorSignatureComposer to separate classes
2023-02-01 11:42:46 +00:00
Ivan Kochurkin 0f9107c153 [FIR2IR] Remove passing excess arguments to jvm backend functions and classes
generateModuleInFrontendIRMode, runBackend

FirJvmBackendExtension, ModuleCompilerIrBackendInput
2023-02-01 11:42:45 +00:00
Ivan Kochurkin e601b01be2 [FIR2IR] Use single IrBuiltInsOverFir for all MPP source modules
^KT-56229 Fixed
2023-02-01 11:42:45 +00:00
Ivan Kochurkin 001b11f285 [FIR2IR] Use single SymbolTable and SignatureComposer for all MPP modules
Merge createModuleFragmentWithSignaturesIfNeeded and createModuleFragmentWithoutSignatures
into the createModuleFragmentWithSignaturesIfNeeded
2023-02-01 11:42:44 +00:00
Mikhail Glukhikh ecc81098a6 Unbind FIR mangler from use-site session (by Simon Ogorodnik) 2023-01-13 12:56:01 +00:00
Mikhail Glukhikh 890e3d1c10 FIR2IR/MPP: use single SymbolTable during MPP compilation 2023-01-13 12:56:00 +00:00
Ivan Kochurkin f17e1314f6 [FIR2IR] Implement tables merging in Fir2Ir classes and SymbolTable
- Pass dependent (usually common code) components to further FIR2IR converters
- Don't reinitialize builtin
2023-01-13 12:55:57 +00:00
Ivan Kochurkin 5d273ce839 [FIR & FIR2IR] Prepare test and CLI infrastructure to support MPP
- Move out getAnalyzerServices from FirFrontendFacade to TestSetupUtils
- Simplify DependencyListForCliModule. Now it takes BinaryModuleData as input
- FirOutArtifact contains several FirOutputArtifactPart
- Simplify FirFrontendFacade
2023-01-13 12:55:57 +00:00
Pavel Mikhailovskii 38a56ba8e8 KT-55308, KT-55769 Sort InnerClasses entries. Add DONT_SORT_DECLARATIONS directive 2023-01-13 01:07:10 +00:00
pyos 3887c80816 FIR CFA: ensure on API level that graphs have enter & exit
What's going on with script graphs?..
2023-01-10 15:40:49 +02:00
pyos fa0ea1504e FIR CFA: remove CFGNode.outgoingEdges
If it's symmetric with incomingEdges, then what's the point?..
2023-01-10 15:40:47 +02:00
Dmitriy Novozhilov 5d6cb2b691 [Test] Use IrPluginContext for searching declarations for DUMP_EXTERNAL_CLASS check 2022-12-09 12:02:07 +00:00
Alexander Korepanov 9edaebf235 [JS IR] Enable DTS generation in IC
^KT-54398 Fixed
2022-12-07 18:05:53 +00:00
Nikolay Lunyak 2e9f9f987b [FIR] KT-44698: Print file:line:offset on K2 crash
^KT-44698 Fixed
2022-11-29 22:35:51 +00:00
Egor Kulikov 067036c162 RawFirBuilder refactoring
Second step for KT-52615
Get rid of PsiHandlingMode
Get rid of source in FirLazyBlock
Refactor lazy creation

Merge-request: KT-MR-7753
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2022-11-22 14:43:53 +00:00
Ilya Chernikov 30df65c321 FIR2IR: pass external builtins to module descriptor
to support scenario when builtins are deserialized from KLib
2022-11-12 14:34:07 +01:00
Dmitriy Dolovov 181809e2af [IR][tests] Support friend-dependencies in KLIB ABI compatibility tests 2022-10-20 10:18:56 +02:00
Ivan Kochurkin a4ad8d59b6 [FIR] Move createSessionForTests, createSessionForTests into FirTestSessionFactoryHelper 2022-10-13 18:11:49 +00:00
Ivan Kochurkin 40a01180ff [FIR] Move createSessionWithDependencies and createEmptySession into FirSessionFactoryHelper 2022-10-13 18:11:48 +00:00
Pavel Mikhailovskii ca221cc6f2 Unused import 2022-09-27 13:34:09 +02:00
Alexander Korepanov 47bbd5e8c1 [JS IR] Add work around in EnumEntriesList for JS IR to avoid name clashes
JS IR generates bridges with type checks for special class methods,
 however if parent and child type parameters are same,
 the JS signature for the generated brige will be clashed with
 the JS signature of original method.

 This patch changes type parameter name of EnumEntriesList to avoid the clash.

^KT-54011 Fixed
2022-09-16 07:19:20 +00:00
Alexander Udalov 87d3ce6ded Write a copy of SMAP to a new annotation
To make it available for dynamically attached JVMTI agents.

`@SourceDebugExtension` annotation value is equal to the
SourceDebugExtension attribute value, which is checked now for all box
tests. The difference is that the annotation stored in the constant
pool, which is available for dynamically attached JVMTI agents.

 #KT-53438 Fixed
2022-09-09 14:32:35 +02:00
Pavel Mikhailovskii a75d5ba4cf KT-53465, KT-53677 Get rid of unnecessary checkcasts to array of reified type 2022-09-06 18:33:38 +00:00
Pavel Mikhailovskii 18e61315f4 KT-27936 Generate InnerClasses attributes 2022-08-23 22:06:10 +00:00
Abduqodiri Qurbonzoda cf44753aed Remove :compiler:tests-common-jvm6 project and JvmTarget6OnBaseJvm tests 2022-08-13 01:33:48 +03:00
Vsevolod Tolstopyatov e32e5c26a4 [reflect] Fix flaky tests that depend on Reflection.clearCaches()
* Use ReflectionFactoryImpl as single point of synchronization
* Synchronize all cache-sensitive tests on it in order to be robust in parallel test runners
* Remove redundant cache clear after each test

Merge-request: KT-MR-6842
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2022-08-12 14:10:08 +00:00
Mikhail Glukhikh 9add6f3d55 K2: add more accurate & more automatic control of diagnostic suppression
#KT-51363 Fixed
2022-07-22 11:35:26 +00:00
Mikhail Glukhikh 7bbd8d3b95 FIR2IR entry points: don't create JvmDescriptorMangler if not needed 2022-07-13 13:11:49 +00:00
Mikhail Glukhikh 45eb9238b3 Fir2IrClassifierStorage: don't calculate signature in registerClass 2022-07-06 10:02:09 +00:00
mvicsokolova 8053746ae0 kotlinx.atomicfu JVM/IR compiler plugin support
Merge-request: KT-MR-6541
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2022-06-26 07:17:06 +00:00
Alexander Udalov a52017a130 Rewrite light analysis mode test class filter
Instead of filtering local/synthetic classes based on ClassDescriptor
instances, do it by interpreting kotlin.Metadata. This is needed to
enable these tests for JVM IR, where descriptors are not available in
this way.
2022-06-17 16:51:06 +02:00
Alexander Udalov 7e9d7c895a Kapt: add flag kapt.use.jvm.ir for enabling JVM IR support
#KT-49682
2022-06-17 16:51:06 +02:00
Alexander Korepanov 9e780afdca [JS IR] Rework incremental cache invalidation
Replace loading the whole world IR with loading only exported (reachable) IR.

 For that purpose the direct and inverse dependency graph is used.
 It is stored in a cache directory and the cache updater keeps it up to date.
 If after loading it is found that other files must be also implicitly rebuilt
 (see rebuilt reasons below), IR for that files also will be loaded.
 This algorithm repeats until the number of implicitly rebuilt files is not 0.

 More rebuilt reasons (dirty state) have been added:
  - added file: this is a new file;
  - modified ir: ir of the file has been updated;
  - updated exports: exports from the file have been added or removed
    (e.g. a function has been used from another file);
  - updated inline imports: imported inline function has been modified
    (transitively);
  - removed inverse depends: a dependent file has been removed;
  - removed direct depends: a dependency file has been removed;
  - removed file: this file has been removed.

 Incremental cache tests has been refactored:
  - The supporting of all rebuilt reasons (dirty states) has been added;
  - New file name format "*.$suffix.kt" for the test steps has been allowed,
    so the syntax highlight works now;
  - Explicit stdlib dependency usage has been removed.
2022-06-13 20:04:05 +00:00
Alexander Udalov ec9d929532 Remove dependency of fir2ir:jvm-backend on backend.jvm.entrypoint
Extract JvmIrDeserializer(Impl), similarly to the existing
JvmIrSerializer(Impl). Remove `allowErrorNodes` which is always false
anyway.
2022-06-13 12:35:51 +00:00
Georgy Bronnikov ffe1615e9c Fir: simplify IrBuiltInsOverFir 2022-05-19 12:02:42 +02:00
Georgy Bronnikov e0c175bb50 Fir2Ir: remove symbolTable as separate component from FirResult
It's already in components.
2022-05-19 12:02:41 +02:00
Georgy Bronnikov 3f66b31a47 Fir2Ir: add irProviders to Fir2IrComponents
Removes the last use of DeclarationStubGenerator in the FIR pipeline.
2022-05-19 12:02:41 +02:00
Georgy Bronnikov 13d4d60afa Fir2Ir: pass Fir2IrExtensions to backend 2022-05-19 12:02:41 +02:00
Georgy Bronnikov 3c3c1be543 Fir2Ir: introduce Fir2IrExtensions
This allows us to remove DeclarationStubGenerator from Fir2IrConverter,
thus reducing dependency on descriptor-based code.
2022-05-19 12:02:41 +02:00
Aleksei.Cherepanov 3d8f140d6b [JPS] Fix incremental build after changing Java enum used in Kotlin when
EnumWhenTracker implemented for tracking changed java enum class items, that used in kotlin when expression.

#KT-47824 Fixed
2022-04-19 18:39:41 +00:00
Dmitry Gridin e737015d5f [jps][tests] remove hardcoded dist path
^KTIJ-20456
2022-04-15 22:00:19 +07:00
Dmitry Gridin 57b9648041 make jps-plugin testable from IJ infrastructure
^KTIJ-20456
2022-04-14 11:17:47 +07:00
Denis.Zharkov 55159eba45 FIR: Do not verify descriptors consistency for FIR-based IR functions 2022-04-06 16:05:40 +00:00
Alexander Korepanov 9952d43252 [JS IR] IC improvements
- Reuse a built fragment
  - Use cache for saving built JS code
2022-04-04 17:42:04 +00:00
Ilya Chernikov 03cbfea737 FIR LT: Introduce source file abstraction, carry it from parsing to IR
along with source lines mapping, allows to "emulate" usage of the
PSI files which allows to extract source file and line mapping info
on every stage from source element.
It makes sense to use this mapping for the error reporting too.
2022-03-30 08:34:30 +00:00