Artem Kobzar
02a78051aa
[PSI2IR] Sync start and end offsets on PSI and FIR for an implicit return inside lambdas
2024-02-27 19:25:24 +00:00
Artem Kobzar
4f521aa05c
[K1] Fix string offsets to include quotes in the same way it's done in FIR
2024-02-02 14:43:46 +00:00
Roman Efremov
5cf33c3556
[IR] Render different quotes depending on IR constant type
...
This is needed for ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT diagnostic
message, but also seems to be good improvement for IR dumps in tests.
^KT-62559
2023-11-28 23:17:23 +00:00
Mikhail Glukhikh
3cb9396b20
K2: prefer derived class sources for callable copies (e.g. fake overrides)
2023-10-24 17:08:40 +00:00
Mikhail Glukhikh
4b2a122f80
FIR2IR: make delegate field/accessors sources closer to PSI2IR
...
#KT-59864 Fixed
2023-10-24 17:08:40 +00:00
Mikhail Glukhikh
920b0bfe63
FIR2IR: use SYNTHETIC_OFFSET for data class generated members
2023-10-24 17:08:40 +00:00
Mikhail Glukhikh
a9894b1842
K2: use derived class sources for callable copies if base callables have no sources
...
Related to KT-60155
2023-10-24 17:08:40 +00:00
Mikhail Glukhikh
4ed7504d87
FIR deserializer: apply attributes on type parameter-based types
...
#KT-62578 Fixed
2023-10-18 10:30:31 +00:00
Mikhail Glukhikh
0fb4c9b4fe
FIR2IR: generate specific sources for property accessors
...
Related to KT-60111
2023-10-13 15:42:58 +00:00
Mikhail Glukhikh
a5a8f6736b
Raw FIR: set source for setter parameter <set-?> access in delegated properties
...
Related to KT-59864
2023-10-10 13:38:52 +00:00
Mikhail Glukhikh
d321fa3fd9
K2: add partial reproduction of KT-59864
2023-10-10 13:38:52 +00:00
Mikhail Glukhikh
9d3bf69212
Raw FIR/LT: use similar sources for delegated constructor calls
...
After this commit all IR source range tests behave in the same way
for FIR/PSI and FIR/LT, test data is now consistent
2023-10-10 13:38:52 +00:00
Mikhail Glukhikh
4ed6ece78b
Test: IR source ranges: make line/column -1 for negative offsets
...
Before this commit, test data for 'synthesizedDataClassMembers' test
was different between PSI and LT, because we had SYNTHETIC_OFFSET = -2
for synthetic functions and NaiveSourceBasedFileEntryImpl calculated
line/column as 0 for LT. In this commit the dumper was edited to
count -1 as line -1 / column -1 independent of a file entry used.
2023-10-10 13:38:51 +00:00
Mikhail Glukhikh
1d631500f5
Test: add K2 version of IR source ranges test
...
After this commit there are three different versions of
IR source range tests: classic (K1), FIR/PSI (K2), FIR/LT (K2).
Since 5 tests behave differently for FIR/PSI and FIR/LT,
in this commit their test data was set to FIR/LT state,
so relevant 5 tests are failing for FIR/PSI right now.
They will be fixed in two subsequent commits
Related to KT-59864, KT-60111, KT-59584
2023-10-10 13:38:51 +00:00
Mikhail Glukhikh
072757cdde
Test: convert IR source ranges test to the new infrastructure
...
Related to KT-59864, KT-60111, KT-59584
2023-10-10 13:38:51 +00:00
Nikolay Lunyak
bcfafc601e
Add EnumEntries to minimal-stdlib-for-tests
...
This change allows to revert adding `WITH_STDLIB` directive
to tests which happened at `a9343aeb`.
Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com >
2023-03-02 10:23:38 +00:00
Sergej Jaskiewicz
5e34ae5e0d
[IR] Print annotations in source range compiler tests
2022-08-03 16:45:56 +00:00
Alexander Udalov
6f6bdd8aec
IR: change acceptChildren/transformChildren order in IrClass
...
Traverse properties of supertypes first, and then handle thisReceiver.
This will simplify transition to auto-generated IR.
2022-01-19 17:50:35 +01:00
Pavel Kunyavskiy
a40022efcd
Generate IR for annotation class constructors.
2021-09-23 06:59:33 +00:00
Alexander Udalov
ffe0d9de70
Psi2ir: do not sort descriptors for fake override generation
...
Descriptors are already supposed to be sorted in scopes. The problem is
that rendering descriptors for sorting takes a lot of time (~1.5% of
total compilation time of intellij with JVM IR), and simple heuristics,
like comparing by names first, don't fully help with it.
#KT-48233
2021-08-31 20:25:59 +02:00
Steven Schäfer
99a4779c6b
JVM IR: Don't produce line numbers in synthetic Enum members
2021-03-16 21:30:18 +01:00
Mads Ager
a37f16d7a2
[IR] Do not generate line numbers for synthesized data class members.
...
Fixes KT-41903.
2020-10-06 19:53:47 +02:00
Dmitry Petrov
5b53663eb8
PSI2IR KT-41181 don't generate deep trees in hashCode
2020-09-07 16:09:42 +03:00
Georgy Bronnikov
4ca98041cd
IR: update test data
2020-07-30 11:24:08 +03:00
Dmitry Petrov
cb1b9c2ccf
IR testData: IrSimpleFunction.isOperator
2019-11-29 13:53:05 +03:00
Jiaxiang Chen
0441e484a6
PSI2IR: For implicit function return, use expression's end offset as start offset of the IrReturn to generarate correct line number.
2019-11-26 17:59:28 +03:00
Dmitry Petrov
82c527c2cc
IR: IrProperty.isFakeOverride
2019-11-01 14:55:10 +03:00
Dmitry Petrov
2682057767
IR tests: update testData for IrSimpleFunction.isFakeOverride
2019-11-01 14:55:09 +03:00
Steven Schäfer
76ab631214
psi2ir: Optimize generated data class members
...
- Access underlying fields directly, instead of using accessors. This is
safe since data classes are always final.
- Don't generate a temporary variable in hashCode to use as the
accumulator.
Both optimizations are effectively present in the current JVM backend
and with these changes the generated code is much closer to what the
current backend generates.
2019-09-18 18:56:42 +02:00
Steven Schäfer
a90ac2438d
Set correct field visibility in psi2ir
2019-08-28 19:41:11 +02:00
Mads Ager
6c7a904663
Psi2Ir: Mark accessors with no bodies as default accessors.
...
They are currently marked as defined even when they get a
default implementation. That makes it hard to figure out
if the accessor should be removed when introducing a backing
field in the JVM_IR backend.
2019-08-28 19:25:13 +02:00
Dmitry Petrov
bdec8b04e8
Minor: trim in RenderIrElementVisitor
2019-07-31 10:37:35 +03:00
Dmitry Petrov
11eea6e86a
psi2ir: generate IrConstructorCall elements in IR builder helpers
2019-04-26 17:43:24 +03:00
Anton Bannykh
9c3e452396
IR: (update test data) NOT(Boolean) -> Boolean.not
2019-03-25 17:49:15 +03:00
Dmitry Petrov
9a82f926a1
IR: descriptor-less rendering of IR elements (work in progress)
2019-03-21 11:23:51 +03:00
Dmitry Petrov
e49eae528c
IR: don't use descriptors in rendering (work in progress)
...
There's some descriptor-based code remaining. Need some more work on IR.
2019-03-21 11:23:51 +03:00
Dmitry Petrov
4c3d0cd9d7
KT-29861 startOffset/endOffset for 'valueOf' function of enum class
2019-02-15 16:25:16 +03:00
Dmitry Petrov
1b0d410a6f
KT-29862 startOffset of class declaration
...
NB startOffset of primary class constructor declaration should still
point to the 'class' keyword (because of debugger requirements).
2019-02-15 16:25:16 +03:00
Dmitry Petrov
6f97db81c8
Update testData after IR type rendering changes
2018-12-07 10:51:55 +03:00
Dmitry Petrov
7dd906db44
KT-28324 More exact startOffset for function/constructor declarations
...
Function/constructor declaration start offset is the start offset of the
corresponding declaration token, if available.
2018-11-22 10:09:31 +03:00