Commit Graph

448 Commits

Author SHA1 Message Date
Dmitry Petrov 3bae430d49 Resolve lateinit variables
Do not report UNINITIALIZED_VARIABLE on lateinit variables
Provide delegating constructors for descriptors for compatibility.
2017-08-31 11:28:08 +03:00
Mikhael Bogdanov 68522b9f1e Use lazy logging in lowers 2017-08-30 10:41:55 +02:00
Mikhail Glukhikh 9dc5354f24 Eliminate some warnings (mostly redundant is checks in whens) 2017-08-18 15:16:59 +03:00
Mikhail Glukhikh 3623f581b8 Eliminate a set of warnings, mostly nullability ones 2017-08-18 15:10:27 +03:00
e5l 5fd8f93b0e Fix a typo: Defaul -> Default 2017-08-15 11:01:08 +03:00
Mikhael Bogdanov 82c3637d91 Wide visibility in ir common stuff 2017-08-09 12:07:38 +02:00
Valentin Kipyatkov 9361cd895c Support for import aliases in code completion
#KT-8848 Fixed
2017-08-08 22:06:04 +03:00
Mikhael Bogdanov 3ae084b1b3 Get rid of reification from 'deepCopyWithVariables' 2017-08-08 13:33:20 +02:00
Mikhael Bogdanov 49612063dc Wide visibility in ir common stuff 2017-08-08 13:25:49 +02:00
Mikhael Bogdanov 6e4b02a94b Disable 'areEqualByValue' 2017-08-08 13:09:48 +02:00
Mikhael Bogdanov 6305abdf9f Wide visibility in ir common stuff 2017-08-08 13:09:47 +02:00
Dmitry Petrov ba068c2d65 Use original descriptor for enum constructor symbol 2017-08-07 18:00:31 +03:00
Mikhail Glukhikh c5a81691fb Partial code cleanup: can be private and some others applied 2017-08-01 17:08:56 +03:00
Mikhael Bogdanov 42f8a3e65b Generify Symbols class to be able support jvm specific implementation 2017-08-01 15:52:29 +02:00
Mikhael Bogdanov 4dbb82a789 Copy ununsed lowers 2017-08-01 15:52:28 +02:00
Mikhael Bogdanov df56ef5e3f Copy common lowers 2017-08-01 15:52:28 +02:00
Mikhael Bogdanov 27365dc4be Copy common utils from Native 2017-08-01 15:52:27 +02:00
Mikhail Glukhikh 951e8cd91a Code cleanup: unnecessary local variable applied 2017-07-21 18:58:48 +03:00
Alexander Udalov 41ea0e8ef8 Introduce AnnotationDescriptor.fqName
Could be used instead of ".annotationClass.fqName" to avoid the unneeded
resolution of the annotation class descriptor
2017-07-20 13:25:38 +03:00
Dmitry Petrov a687dea898 Introduce special IrDeclarationOrigin's for for-loop variables
FOR_LOOP_ITERATOR
 - temporary variable for for-loop iterator

FOR_LOOP_VARIABLE
 - `x` in `for (x in xs)`

FOR_LOOP_IMPLICIT_VARIABLE
 - temporary variable for for-loop with destructuring, e.g.:
   for ((x, y) in xys)
   =>
   for (tmp in xys) {
     val (x, y) = tmp
   }
2017-07-13 10:59:51 +03:00
Mikhail Glukhikh dfe2c16bc7 More cleanup: lift return / assignment out 2017-07-10 12:59:58 +03:00
Mikhail Glukhikh 1d2017b0fc Cleanup: apply "cascade if..." inspection (+ some others) 2017-07-07 18:15:32 +03:00
Mikhail Glukhikh 9c06739594 Cleanup: apply "lift out..." inspection (+ some others) 2017-07-07 18:15:30 +03:00
Mikhail Glukhikh 840847e47c Code cleanup: several inspections applied 2017-06-29 16:25:57 +03:00
Dmitry Petrov a84c2a6f31 Improve string concatentation & string templates code generation
Reuse StringBuilder instances for nested subexpressions.
(NB StringBuilder instance for string template with a string
concatenation inside an expression entry, such as `"${"a" + "b"}"`,
will not be reused, although that doesn't seem to be a real-life issue).

 #KT-18558 Fixed Target versions 1.1.4
 #KT-13682 Fixed Target versions 1.1.4

Join adjacent strings literals, escaped strings, and constant values
(in a language version that supports const val inlining).
Use StringBuilder#append(char) for single-character constants
(e.g., " " in "$a $b").

 #KT-17280 Fixed Target versions 1.1.4
 #KT-15235 Fixed Target versions 1.1.4
2017-06-27 14:28:42 +03:00
Dmitry Petrov ae71833a12 Use original descriptors for functions when generating stubs
Descriptors for builtin class members on JVM are substituted.
2017-06-27 13:00:10 +03:00
Dmitry Petrov 2b3043bf9f Fix CFG problem for 'when' in Konan
If type of 'when' expression is 'Nothing', it should be kept that way
even if the expression itself is implicitly coerced to Unit.
2017-06-22 10:21:54 +03:00
Mikhael Bogdanov 8ca82c8e99 Add missed common parts 2017-06-20 11:08:53 +02:00
Mikhael Bogdanov 956cc0dbfd Support IMPLICIT_INTEGER_COERCION 2017-06-20 11:01:10 +02:00
Mikhael Bogdanov d888addba0 Add KCallableNamePropertyLowering 2017-06-20 11:00:38 +02:00
Mikhael Bogdanov 8ab705a14c Introduce IrInliner 2017-06-20 10:26:37 +02:00
Mikhael Bogdanov 5dfe77b7c3 Fix array element processing 2017-06-08 09:23:50 +02:00
Mikhael Bogdanov 5bba5b2fb7 Bind annotation methods via primary constructor 2017-06-08 09:23:45 +02:00
Mikhael Bogdanov 514d25bdd4 Fix FAKE_OVERRIDE processing 2017-06-08 09:23:39 +02:00
Alexander Udalov e6001f57fa Remove dependency of module 'backend' on 'backend.jvm' and 'ir.tree'
This breaks the circular dependency between 'backend' and 'backend.jvm'
2017-06-06 19:55:06 +03:00
Alexander Udalov cbaa676c3d Move some declarations between 'descriptors' and 'deserialization'
- Move the following from 'deserialization' to 'descriptors':
  NotFoundClasses.kt
  AdditionalClassPartsProvider.kt
  ClassDescriptorFactory.kt
  PlatformDependentDeclarationFilter.kt
  findClassInModule.kt
- Move the following form 'descriptors' to 'deserialization':
  BuiltInSerializerProtocol.kt
  builtInsPackageFragmentProvider.kt
- Extract a marker interface from BuiltInsPackageFragment and move its
  implementation to 'deserialization'
- Change the type of parameters in PlatformDependentDeclarationFilter
  and AdditionalClassPartsProvider to ClassDescriptor

This will help in getting rid of the circular dependency of
'descriptors' <-> 'deserialization'
2017-06-06 14:29:18 +03:00
Dmitry Petrov fd1866b838 Do not check argumentMapping.isError()
Argument matching status can be considered an "error" in resolve,
even though it is not a compilation error and doesn't prevent code
from being generated.
Actually, we should only check if the argument matching status is
ArgumentMatch.

 #KT-18294 Fixed
2017-06-06 10:19:18 +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
Dmitry Petrov 30182c38ce Fix toString and hashCode for array members of data classes
Generate them as special intrinsics that would be mapped to proper
platform-specific calls by BEs.

 #KT-16945 Fixed
2017-05-26 09:32:29 +03:00
Dmitry Petrov 1420926a9b Generate receivers for callable references in the same way as for calls
Properly handle callable members imported from objects
and other related corner cases.

 #KT-18084 Fixed
2017-05-26 09:32:29 +03:00
Dmitry Petrov 425c66b0cd Separate stub generation for external dependencies from PSI2IR 2017-05-24 11:18:52 +03:00
Dmitry Petrov 952f53d37c Use DeclarationStubGenerator for built-ins initialization 2017-05-24 11:18:52 +03:00
Dmitry Petrov ec9427a36b Minor: make DeepCopySymbolsRemapper open 2017-05-24 11:18:52 +03:00
Dmitry Petrov e7eb078c3f Minor: remove always true is-check 2017-05-24 11:18:52 +03:00
Dmitry Petrov 6fd762cfce Provide DeclarationStubGenerator as a separate class in IR utilities 2017-05-24 11:18:52 +03:00
Dmitry Petrov 7204a929f3 Move SymbolTable to common IR utilities 2017-05-24 11:18:52 +03:00
Denis Zharkov 52b2e632df Simplify generated code for rangeTo/concat intrinsics
The main reason is avoiding complicated operations like
dup + dup_x2 + pop2 for instances obtained by NEW instruction.

Otherwise it leads to problems in performRefinedTypeAnalysis
because code there has a sensible assumption that NEW instances
can be only dupped or stored into a local (rare cases)

 #KT-17457 Fixed
2017-05-22 14:51:04 +03:00
Dmitry Petrov 2cda5aaeb5 Additional customization for DeepCopyIrTreeWithSymbols
1. Allow overriding 'getNonTransformedLoop'
2. Allow descriptor remapping on deep copy
2017-05-19 14:49:34 +03:00
Dmitry Petrov b9dee7fcf3 Extract SymbolRemapper interface for DeepCopy customization 2017-05-19 14:49:34 +03:00
Mikhael Bogdanov daf6768181 Add proper DefaultLambda initialization,
patch lambda related instructions in default method

Remove default lambda linked instructions from default method
2017-05-11 11:06:46 +02:00