Commit Graph

2140 Commits

Author SHA1 Message Date
Ilya Matveev ad25d3ca7c stdlib: Return a RandomAccess object from Array.toList() and emptyList() 2017-04-18 12:48:07 +07:00
Ilya Matveev 26c227ab3e stdlib: Remove all occurrences in Collection.removeAll method 2017-04-18 12:48:07 +07:00
Ilya Matveev 6549dda5fb stdlib: Uncomment extensions with reified parameters 2017-04-18 12:48:07 +07:00
Ilya Matveev 6fc7c3495a stdlib: Add List and MutableList functions 2017-04-18 12:48:07 +07:00
Ilya Matveev 569fb7e013 stdlib: Don't suppress internal call error for mapCapacity
This patch removes @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
annotation from mapCapacity() calls since it is annotated with
@PublishedApi
2017-04-18 12:48:07 +07:00
Ilya Matveev 78d6611a46 stdlib: Return NaN from average() if the collection is empty 2017-04-18 12:48:07 +07:00
Ilya Matveev 286e81992a stdlib: Add missing extensions for collections 2017-04-18 12:48:07 +07:00
Svyatoslav Scherbina 20d95ae4c8 Implement methods for conversions between Long and CPointer 2017-04-17 18:02:05 +03:00
Svyatoslav Scherbina 11ecf0c179 Adjust C interop stub names to prevent some symbol name clashes
Use `pkg_kni_name` instead of `kni_pkg_name`
2017-04-17 18:02:05 +03:00
Svyatoslav Scherbina 2b98f9bce6 Use more correct paths in interop stubs generator
*   Use absolute paths to C sources and artifacts because stub generator
    changes working directory when running clang.
*   Do not change working directory when running without def file.
2017-04-17 18:02:05 +03:00
enbandari bb8f04ab87 pkgName is from interop config "pkg" and in a format of "x.y.z", so we should replace "." with "_" instead of "/". Related Issue: https://github.com/JetBrains/kotlin-native/issues/490 2017-04-17 13:42:31 +03:00
enbandari a0e0644998 Use absoluteFile to avoid parentFile of defFile being null while the defFile is something like "-def interop.def". The parent of interop.def should be a existed dir. 2017-04-17 13:42:31 +03:00
Konstantin Anisimov 0f24850f3c Descriptor return type must coincide with expression return type 2017-04-17 16:01:02 +07:00
Konstantin Anisimov 5920e0d8ba Do not create new descriptors for "call" instructions. Calls for functions declared in inlineBody will be substituted in second pass 2017-04-17 16:01:02 +07:00
Konstantin Anisimov 42955526bf Use original DeepCopyIrTree algorithm in visitCall 2017-04-17 16:01:02 +07:00
Vasily Levchenko fa86ef5399 kotlin-compiler: 1.1-20170414.151645-464 2017-04-17 06:19:05 +03:00
Vasily Levchenko 89ebbaeb6c DEBUGINFO: initial C bindings to debug info llvm
- support DICompileUnit
- support DIFIle
- support DISubroutine
- support DIBasicType
- support DILocation
- added gradle build
- debug info bindings are involved in kotlin build
- added binding to DIGetSubprogramLinkName
- added binding to LLVMBuilderGetCurrentFunction
- added reset location
- simple demo added (buildable with gradle)
  produces folowing output:
    Following pseudo code in sources.
     0:123456789012345678901
     1: fun main():Int {
     2:   {foo()}()
     3:   return 0
     4: }
     5  fun foo() {}

    0:b-backend-dwarf:minamoto@unit-703(0)# ./demo
    ; ModuleID = 'test'
    source_filename = "test"

    define i32 @foo(i32) !dbg !3 {
    entry:
      ret i32 %0, !dbg !7
    }

    !llvm.dbg.cu = !{!0}

    !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "konanc", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
    !1 = !DIFile(filename: "1.kt", directory: "src")
    !2 = !{}
    !3 = distinct !DISubprogram(name: "foo", linkageName: "foo:link", scope: null, file: !1, line: 66, type: !4, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, variables: !2)
    !4 = !DISubroutineType(types: !5)
    !5 = !{!6}
    !6 = !DIBasicType(name: "int", size: 32, align: 4)
    !7 = !DILocation(line: 42, column: 15, scope: !3)
- demo sharing debug information between several bitcode artifacts
    0:b-backend-dwarf:minamoto@unit-703(0)# llvmDebugInfoC/build/exe/demogenerated/demogenerated
    ; ModuleID = 'test'
    source_filename = "test"

    define void @foo() !dbg !3 {
    entry:
      ret void, !dbg !5
    }

    define void @"main$caller$foo"() !dbg !6 {
    entry:
      call void @foo(), !dbg !7
      ret void
    }

    define void @main() !dbg !8 {
    entry:
      call void @"main$caller$foo"(), !dbg !9
      ret void, !dbg !10
    }

    !llvm.dbg.cu = !{!0}

    !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "konanc", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
    !1 = !DIFile(filename: "<stdin>", directory: "")
    !2 = !{}
    !3 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: null, file: !1, line: 5, type: !4, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, variables: !2)
    !4 = !DISubroutineType(types: !2)
    !5 = !DILocation(line: 5, column: 14, scope: !3)
    !6 = distinct !DISubprogram(name: "main$caller$foo", linkageName: "main$caller$foo", scope: null, file: !1, line: 2, type: !4, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, variables: !2)
    !7 = !DILocation(line: 5, column: 2, scope: !6)
    !8 = distinct !DISubprogram(name: "main", linkageName: "main", scope: null, file: !1, line: 1, type: !4, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, variables: !2)
    !9 = !DILocation(line: 2, column: 12, scope: !8)
    !10 = !DILocation(line: 3, column: 4, scope: !8)
- local variables support
- demo for local variable suppor (TBD some out put here).
    ; ModuleID = 'test'
    source_filename = "test"

    define i32 @main() !dbg !3 {
    entry:
    %0 = alloca i32
    call void @llvm.dbg.declare(metadata i32* %0, metadata !5, metadata !7), !dbg !8
    store i32 42, i32* %0, !dbg !8
    %1 = load i32, i32* %0, !dbg !8
    ret i32 %1, !dbg !8
    }

    ; Function Attrs: nounwind readnone
    declare void @llvm.dbg.declare(metadata, metadata, metadata) #0

    attributes #0 = { nounwind readnone }

    !llvm.dbg.cu = !{!0}

    !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "konanc", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
    !1 = !DIFile(filename: "<stdin>", directory: "")
    !2 = !{}
    !3 = distinct !DISubprogram(name: "main", linkageName: "main", scope: null, file: !1, line: 1, type: !4, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, variables: !2)
    !4 = !DISubroutineType(types: !2)
    !5 = !DILocalVariable(name: "a", scope: !3, file: !1, line: 2, type: !6)
    !6 = !DIBasicType(name: "int", size: 32, align: 4)
    !7 = !DIExpression()
    !8 = !DILocation(line: 2, column: 1, scope: !3)
2017-04-14 11:39:51 +03:00
Konstantin Anisimov 6e7eff4c03 No visitor with context needed to lookup for descriptors. Containing declaration must already be in descriptorSubstituteMap or to be left unchanged 2017-04-13 19:38:34 +07:00
Konstantin Anisimov 00a3dfc4b7 Get rid of warnings in inliner code
Fix problem with "Duplicate IR node" warning
2017-04-13 19:38:34 +07:00
Konstantin Anisimov 9830454b58 Associate copyIrElement with inlining target context 2017-04-13 19:38:34 +07:00
Konstantin Anisimov 90a43a4c62 Code refactoring 2017-04-13 19:38:34 +07:00
Konstantin Anisimov 1f1de99878 Move call site descriptor substitutor to main algotithm 2017-04-13 19:38:34 +07:00
Nikolay Igotti bc2d635ce7 Optimize memory management (#480) 2017-04-13 15:26:51 +03:00
Ilya Matveev ec64fd0477 stdlib: Make toIndex exclusive in sortArrayWith method
This patch makes toIndex parameter exclusive in sortArrayWith method
in order to make this method corresponding to the other ones (e.g.
copyOfRange, Array.sortWith extension etc).
It also improves the external sortBy test in order to use it with
different sort algorithms.
2017-04-13 18:27:08 +07:00
Ilya Matveev 0a01f513be tests: Show finished tests cout 2017-04-13 18:27:08 +07:00
Ilya Matveev 113b97dda3 stdlib: Add remaining extensions for arrays 2017-04-13 18:27:08 +07:00
Ilya Matveev 1e7a5d45e0 stdlib: Add sort functions for primitive arrays 2017-04-13 18:27:08 +07:00
Ilya Matveev bd27d68906 stdlib: Fix contentDeepToString 2017-04-13 18:27:08 +07:00
Ilya Matveev 230e3235af stdlib: Remove some inlines 2017-04-13 18:27:08 +07:00
Ilya Matveev 7d216dcb47 stdlib: Add deep array operations 2017-04-13 18:27:08 +07:00
Ilya Matveev 697cc88001 stdlib: Fix constructors for arrays 2017-04-13 18:27:08 +07:00
Ilya Matveev 0e302d26a8 stdlib: Add contentEquals extension for arrays 2017-04-13 18:27:08 +07:00
Ilya Matveev 01401cf799 stdlib: Add array constructors with initializers 2017-04-13 18:27:08 +07:00
Ilya Matveev f4c0efdbd8 stdlib: Add Array.average 2017-04-13 18:27:08 +07:00
Ilya Matveev 69d2cf5c47 stdlib: Add toList method for arrays of value types 2017-04-13 18:27:08 +07:00
Ilya Matveev ca5418ad15 Fix license position in dependencies/build.gradle 2017-04-13 18:27:08 +07:00
Svyatoslav Scherbina c8f070f90d Automatically exclude interop functions having non-compilable C stubs 2017-04-13 14:08:47 +03:00
Svyatoslav Scherbina 05dae83185 Refactor interop stub generation
Explicitly group stub lines related to the single declaration
2017-04-13 14:08:47 +03:00
Vasily Levchenko eadcd98740 kotlin-compiler: 1.1-20170412.175827-457 2017-04-13 12:21:04 +03:00
Ilya Matveev bd747b54bd build: Use a property to provide an URL for dependency downloading
This patch adds baseUrl property to store a dependency downloading
path. The property may be set for each downloading task separately.
2017-04-12 18:50:23 +07:00
Konstantin Anisimov 78c043f15f All FunctionDescriptors on call sites must be copied 2017-04-11 19:12:00 +07:00
Svyatoslav Scherbina 2a3450047c Add interop test for returning struct by value 2017-04-10 17:28:25 +03:00
Svyatoslav Scherbina 208d568e3e Update INTEROP.md
Describe working with `CValue`.
2017-04-10 17:28:25 +03:00
Svyatoslav Scherbina 716efe7310 Workaround incomplete inline for interop's readValue 2017-04-10 17:28:25 +03:00
Svyatoslav Scherbina c4cc91d880 Improve quoting in interop stubs for variadic functions
#KT-17321 Fixed
2017-04-10 17:28:25 +03:00
Svyatoslav Scherbina 6cf55ce20d Fix building dist without system toolchain 2017-04-10 17:28:25 +03:00
Svyatoslav Scherbina a9ebb44c6d Fix interop with SDL on iOS 2017-04-10 17:28:25 +03:00
Nikolay Igotti 2227415448 Remove remnants of concurrent memory model (#467) 2017-04-10 16:49:46 +03:00
Nikolay Igotti 4f13da844f Fix iphone build (#465) 2017-04-10 16:14:53 +03:00
Vasily Levchenko b54ff99fc7 --print_locations: don't print null, please name instead.
(cherry picked from commit 55a96696179dc8854d25f9c4ab429abab604e200)
2017-04-10 16:14:29 +03:00