Commit Graph

60 Commits

Author SHA1 Message Date
Alexander Gorshenev 5effdcb1d2 Pass linkerOpts from .def to klib manifest. 2017-07-04 17:58:30 +03:00
Alexander Gorshenev edde21827c A little bit more of utils abstracting us from java api. 2017-07-04 17:58:30 +03:00
Alexander Gorshenev fb20eb9a37 Produce a message and a non-zero exit code if no source argumens have been provided. 2017-06-20 20:00:08 +03:00
alexander-gorshenev d3c24bb387 Different extensions (and KonanTarget communalization). (#665) 2017-06-19 12:45:57 +03:00
vvlevchenko 00dc4524ca [Kotlin compiler][update] 1.1.4-dev-600 (#639) 2017-06-06 21:56:31 +03:00
Alexander Gorshenev 5192bd1313 Entry point selection.
$ kotlinc -entry foo.bar.qux ...

selects `qux(args: Array<String>):Unit` in the package `foo.bar` as an entry point.

The short flag is `-e`.
2017-06-05 20:56:10 +03:00
Alexander Gorshenev f9d0d6d563 Converted K2NativeCompilerArguments from Java to Kotlin. 2017-06-01 23:37:22 +03:00
Nikolay Igotti 79588716d6 Fix build 2017-05-29 15:42:11 +03:00
Nikolay Igotti ff8bce79d5 Uniform compiler/linker options treatment (#614) 2017-05-29 15:37:15 +03:00
Alexander Gorshenev c9ce175224 A bit simple file name suffix management. 2017-05-29 15:01:42 +03:00
Alexander Gorshenev 1970af042f Introduce '-p' as a short name for '-produce'.
-p program // The default.

    -p library

    -p bitcode
2017-05-29 15:01:42 +03:00
Alexander Gorshenev 380010d1ee -produce program|library|bitcode
'program' makes a kexe.

    'library' makes a klib.

    'bitcode' makes just a bare bitcode file.

    The default is 'program'.
2017-05-29 15:01:42 +03:00
Alexander Gorshenev 34491cfb01 Lexically sort compiler option definitions. 2017-05-29 15:01:42 +03:00
Nikolay Igotti 42197a2bec Android NDK support and build system refactoring (#585) 2017-05-24 00:20:19 +03:00
Alexander Gorshenev 48742b7f3f Library search path resolution. 2017-05-23 16:40:48 +03:00
Alexander Gorshenev 3b5ce031f8 Initial checkin of klib support.
The libraries exist in two incarnations:
    packed foo.klib and unpacked foo/ .
The compiler when given '-library foo' expects to find either
a foo.klib file and unpack it, or an already unpacked foo/ directory.

The stdlib is always unpacked in dist/klib .

The semantics of -o has changed slightly.
It now accepts '-o foo' and the compiler
either produces foo.kexe or foo.klib .
2017-05-18 04:13:35 +03:00
Igor Chevdar 8f53018653 Disabled warning that coroutines are experimental 2017-05-11 12:51:05 +03:00
Ilya Matveev adb6e17b60 backend: Implement executableScriptFileName method in K2Native 2017-05-03 22:06:26 +07:00
Vasily Levchenko 92964e1eae kotlin-compiler:1.1-20170424.172927-491 2017-04-24 22:35:39 +03:00
Vasily Levchenko 7e9a01b6ba DRIVER: added '-g' key to enable emitting debug information 2017-04-19 09:52:05 +03:00
Alexander Udalov a4eceb3e3a kotlin-compiler:1.1-20170417.154352-466
- Fix usage of new Kotlin command line arguments API
(cherry picked from commit fb8534d05d2f69902fd1add631754f7cdfb75c89)
2017-04-18 19:36:00 +03:00
Igor Chevdar f389afee16 Added compiler arg --print_ir_with_descriptors
Sometimes it would be useful to see IR with all corresponding
descriptors - now it is possible.
2017-04-10 14:45:55 +03:00
SvyatoslavScherbina 058bb728df kotlin-compiler: 1.1-20170403.193854-443 (#452) 2017-04-05 20:48:58 +03:00
Svyatoslav Scherbina f564bd7707 Always link bitcode files specified with -nativelibrary 2017-03-30 15:55:39 +03:00
Nikolay Igotti 0cbd34086e Added JB copyright (#417) 2017-03-30 09:51:58 +03:00
Alexander Gorshenev 89ea6396f6 It should be --time, not -time.
It should be -list_targets, not --list_targets.
The -list should better be -list_phases now that we have several sets to list.
2017-03-29 12:10:41 +03:00
Ilya Matveev 6dea5e5c79 tools: Don't use Distribution class in helpers 2017-03-29 14:42:48 +07:00
Vasily Levchenko d106e9e8d9 FLAGS: added --print_locations flag (boolean) for printing lines/column information
(cherry picked from commit 9decbaadfb3ef7ca946a732a03e475b576f4f1be)
2017-03-28 15:56:14 +03:00
Ilya Matveev fbc14becfc tools: Add dependecy download helpers
This patch adds 2 helpers to download dependencies for compiler and
stub generator during their execution.

They take list of external dependencies as a parameter and directory
where they must be located. Helpers check if these dependencies exist
in the given directory and download not existing ones.
2017-03-24 19:31:23 +07:00
Alexander Gorshenev c06eeb096a Removed -compile_as_stdlib mode, as it is not needed anymore.
Moved "compiler hacker" options to use double dash. Like "--verbose linker".
2017-03-22 16:16:50 +04:00
Alexander Gorshenev 2d0aa9dcbb Introduced -nomain flag to disable generation of main(),
in assumption that it is provided by one of the libraries.
2017-03-21 18:05:03 +04:00
Nikolay Igotti c6845cf929 Implement on-load helper (#364) 2017-03-21 11:44:34 +03:00
Nikolay Igotti f3794aa206 Improve interop user experience and docs (#342) 2017-03-15 17:25:10 +03:00
Ilya Matveev 97b5bb527d backend: Generate assert call depending on the compiler key 2017-03-13 16:25:48 +03:00
Svyatoslav Scherbina 7ad36ac035 backend: implement '-linkerArg' to pass arguments to the linker 2017-03-13 11:00:33 +07:00
Nikolay Igotti 526c0dc924 Speed up large file compilation. (#308) 2017-03-07 13:40:25 +03:00
Svyatoslav Scherbina 093671f549 backend: rework builtIns configuration
* Do not create separate builtIns for analyzer.
* Make builtInsModule synthetic but depending on stdlib.
2017-02-28 17:44:22 +07:00
Ilya Matveev 489723721f frontend: Stop compilation in case of frontend error 2017-02-22 16:16:57 +03:00
Svyatoslav Scherbina 97cd2b4d5f backend: implement '-nativelibrary' command line argument 2017-02-06 11:58:10 +07:00
Alexander Gorshenev afaa50ce34 Introduced -target and -list_targets flags.
Use it like

    $ konanc hello.kt -target iphone
2017-01-23 00:17:39 +04:00
Alexander Gorshenev c15fb6833d Profiling machinery. 2016-12-29 16:07:43 +04:00
Alexander Gorshenev 413f47fda5 Removed 'clang' invocations in favour of llvm tools and 'ld'.
Introduced LinkStage in the compiler.

Removed the link stage from 'konanc'.

Removed duplicate :stdlib and :start targets.

Simplified test run task a lot.
2016-12-28 02:13:07 +04:00
Alexander Gorshenev a1786614ea Removed Javascript serializer from Konan.
Introduced our own serializer.
2016-12-20 19:32:27 +04:00
Alexander Gorshenev 35668cc7e1 Added phase control flags.
-print_descriptors
-print_ir
-print_bitcode

-verify_descriptors
-verify_ir
-verify_bitcode

-list

-enable <phase name>
-disable <phase name>
-verbose <phase name>
2016-12-13 21:31:47 +04:00
Konstantin Anisimov 8496a0f2a9 CODEGEN: naive implementation of string_concatination (not tested)
(cherry picked from commit 8e0e9480d7cbec6e640f1b5a8a15af0d2f1bc278)
2016-11-25 23:37:49 +03:00
Alexander Gorshenev 1d265bc50c Here goes stdlib separation.
$ gradlew backend.native:stdlib

builds you stdlib.kt.bc now.

The test runs are taught to supply
-library stdlib.kt.bc to kotlin compiler for proper imports resolution,
and then later stdlib.kt.bc is provided to clang for the final link step.
2016-11-18 19:11:38 +04:00
Alexander Gorshenev b0d10e45d8 changed DynamicTypesAllowed() to DynamicTypesSettings() in KonanPlatformConfigurator.kt 2016-11-18 19:11:38 +04:00
Alexander Gorshenev 8321c14e36 Introduced KonanPlatform, KonanConfig, TopDownAnalyzerFacadeForKonan
and several other supporting facilities
2016-11-17 18:16:15 +04:00
Vasily Levchenko 5b7d0257e8 upgrade kotlin-compiler: 20161108.133759-248 2016-11-08 17:38:09 +03:00
Alexander Udalov a7bef2d0ee Lower priority of compiler built-ins in resolution (#43)
* Remove unneeded module context creation in K2Native

Calling this method is useful only when its result is used

* Use JvmAbi from compiler instead of reflection implementation

Package "kotlin.reflect.jvm.internal.impl" is internal implementation detail of
kotlin-reflect and should not be used

* Run native back-end with "-ea"

This allows to get more detailed messages in case something fails

* Lower priority of compiler built-ins in resolution

CREATE_BUILT_INS_FROM_MODULE_DEPENDENCIES makes sure that the "built-ins" that
the compiler front-end uses during the resolution are loaded from the module
being resolved itself, i.e. from its sources and/or dependencies. E.g. if
there's a class named kotlin.Any in module sources, it'll become the default
supertype for any class without an explicit supertype.

ADD_BUILT_INS_FROM_COMPILER_TO_DEPENDENCIES adds the built-ins from the
compiler jar to the end of the dependencies list of the module being resolved.
This option makes sure that if there's no built-in class in module
sources/dependencies and it is required by the front-end, the class definition
from the compiler jar will be taken instead of failing with an exception.

If both of these options are turned on, the effect is basically that compiler
built-ins are still there in the classpath, but have a lower priority than
classes explicitly declared in sources
2016-11-08 16:20:33 +03:00