Commit Graph

28 Commits

Author SHA1 Message Date
Dmitry Petrov cb1b9c2ccf IR testData: IrSimpleFunction.isOperator 2019-11-29 13:53:05 +03:00
Steven Schäfer 733c7579aa Normalize names of temporary variables in IrTextTests 2019-11-05 14:58:47 +03:00
Dmitry Petrov 843fb88459 IR: 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
Dmitry Petrov bdec8b04e8 Minor: trim in RenderIrElementVisitor 2019-07-31 10:37:35 +03:00
Dmitry Petrov ffd9b45ef3 IrFunctionExpression: add 'origin'
This is actually either a LAMBDA or an ANONYMOUS_FUNCTION.
Not quite sure if it's really required, but some tools such as IR-based
decompiler might require this information.
2019-07-19 11:36:19 +03:00
Dmitry Petrov ed2b4a8bec Introduce IrFunctionExpression IR element
Use it to represent proper function expressions (lambdas and anonymous
functions).
2019-07-19 11:36:18 +03:00
Dmitry Petrov 11eea6e86a psi2ir: generate IrConstructorCall elements in IR builder helpers 2019-04-26 17:43:24 +03:00
Dmitry Petrov e3fd74a580 IR: annotations are represented as IrConstructorCall elements
Also, they are rendered somewhat nicer
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 a5c95275f0 IR: get rid of descriptors in DumpIrTree 2019-03-21 11:23:51 +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 6f97db81c8 Update testData after IR type rendering changes 2018-12-07 10:51:55 +03:00
Dmitry Petrov bd1491ac8a psi2ir: Merge constant entries in string template expressions
This is required to handle UCNs properly, see KT-28006.

 #KT-28006
2018-11-08 12:29:15 +03:00
Dmitry Petrov 799fcc2606 Fix IrType rendering, update testData 2018-06-29 11:24:46 +03:00
Roman Artemev 960fba3c4e Fix test failures 2018-06-15 16:23:06 +03:00
Dmitry Petrov ab455d6572 IR: IrSimpleFunction.correspondingProperty: IrProperty?
Non-null for a property accessor, points to a corresponding property.
2018-05-25 09:40:51 +03:00
Dmitry Petrov 729efaf912 IR: IrConstructor.isPrimary
NB this is required for Kotlin/JS.
2018-05-11 11:24:46 +03:00
Dmitry Petrov 9717345e3b IR: IrField.isFinal 2018-05-11 11:24:46 +03:00
Svyatoslav Scherbina 7a2d761a7d Add minor improvements to psi2ir and IR utilities:
* Generate missing IR parameter declarations in external stubs
* Use origin = FAKE_OVERRIDE in external IR stubs for fake overrides
* Set .parent in external IR stubs
* Set .parent in IR generated by some utility methods
2018-03-02 15:41:48 +03:00
Dmitry Petrov b206bf199f Add type operand symbol for type operator expression 2018-02-28 10:35:13 +03:00
Dmitry Petrov 02f01efaac Update testData 2018-02-28 10:35:13 +03:00
Dmitry Petrov e5295d0f78 Generate references to overridden declarations as a separate pass
NB currently it relies on overriddenDescriptors in a FunctionDescriptor,
thus maybe incorrect for transformed declarations.
2018-02-28 10:35:13 +03:00
Dmitry Petrov 6cb68531ae Minor: add missing "'" 2018-01-17 12:31:07 +03:00
Dmitry Petrov fdd000c94f Update testData to new format 2018-01-17 12:31:07 +03:00
Dmitry Petrov 978661c53d Do not generate default parameter values for synthetic functions
This causes a subtle issue with 'copy' function for data class,
which has parameters with source elements corresponding to
the data class primary constructor parameters: default value expression
for such parameters is generated second time (to be overwritten later),
which creates duplicate bindings if such expression included any
(possibly anonymous) declarations, such as lambdas or anonymous objects.

 #KT-18208 Fixed
2017-06-02 10:57:45 +03:00