diff --git a/driver/main.cpp b/driver/main.cpp index 47d851feb1..e2db534f8a 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -935,7 +935,7 @@ void registerPredefinedVersions() { // `D_ObjectiveC` is added by the ddmd.objc.Supported ctor if (opts::enableRuntimeCompile) { - VersionCondition::addPredefinedGlobalIdent("LDC_RuntimeCompilation"); + VersionCondition::addPredefinedGlobalIdent("LDC_DynamicCompilation"); } // Define sanitizer versions. diff --git a/runtime/jit-rt/d/ldc/runtimecompile.d b/runtime/jit-rt/d/ldc/dynamic_compile.d similarity index 90% rename from runtime/jit-rt/d/ldc/runtimecompile.d rename to runtime/jit-rt/d/ldc/dynamic_compile.d index 699437b31f..9d4ed201ae 100644 --- a/runtime/jit-rt/d/ldc/runtimecompile.d +++ b/runtime/jit-rt/d/ldc/dynamic_compile.d @@ -1,13 +1,13 @@ /** - * Contains jit API. + * Contains dynamic compilation API. * * Copyright: Authors 2017 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) */ -module ldc.runtimecompile; +module ldc.dynamic_compile; -version(LDC_RuntimeCompilation): +version(LDC_DynamicCompilation): /// Dump handler stage enum DumpStage : int @@ -45,8 +45,8 @@ struct CompilerSettings /++ + Compile all dynamic code. - + This function must be called before any calls to @runtimeCompile functions and - + after any changes to @runtimeCompile variables + + This function must be called before any calls to @dynamicCompile functions and + + after any changes to @dynamicCompileConst variables + + Consecutive calls to this function do nothing + @@ -54,9 +54,9 @@ struct CompilerSettings + + Example: + --- - + import ldc.attributes, ldc.runtimecompile, std.stdio; + + import ldc.attributes, ldc.dynamic_compile, std.stdio; + - + @runtimeCompile int foo() { return value * 42; } + + @dynamicCompile int foo() { return value * 42; } + + void main() { + compileDynamicCode(); diff --git a/tests/runtimecompile/array.d b/tests/runtimecompile/array.d index 4c566c0fbb..1688f9bfe2 100644 --- a/tests/runtimecompile/array.d +++ b/tests/runtimecompile/array.d @@ -3,7 +3,7 @@ import std.exception; import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; __gshared int[555] arr1 = 42; __gshared int[555] arr2 = 42; diff --git a/tests/runtimecompile/calls.d b/tests/runtimecompile/calls.d index 381dcfbf71..7a09cf7263 100644 --- a/tests/runtimecompile/calls.d +++ b/tests/runtimecompile/calls.d @@ -2,7 +2,7 @@ // RUN: %ldc -enable-dynamic-compile -run %s import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; @dynamicCompile int foo() { diff --git a/tests/runtimecompile/classes.d b/tests/runtimecompile/classes.d index 15b0010ecb..1d02b4fd1d 100644 --- a/tests/runtimecompile/classes.d +++ b/tests/runtimecompile/classes.d @@ -2,7 +2,7 @@ // RUN: %ldc -enable-dynamic-compile -run %s import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; interface IFoo { diff --git a/tests/runtimecompile/dump_handler.d b/tests/runtimecompile/dump_handler.d index b5dc09ea57..745fd5a653 100644 --- a/tests/runtimecompile/dump_handler.d +++ b/tests/runtimecompile/dump_handler.d @@ -2,7 +2,7 @@ // RUN: %ldc -enable-dynamic-compile -run %s import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; @dynamicCompile int foo() { diff --git a/tests/runtimecompile/empty_jit_modules.d b/tests/runtimecompile/empty_jit_modules.d index c0962c49fb..025ab589f3 100644 --- a/tests/runtimecompile/empty_jit_modules.d +++ b/tests/runtimecompile/empty_jit_modules.d @@ -1,7 +1,7 @@ // RUN: %ldc -enable-dynamic-compile -run %s -import ldc.runtimecompile; +import ldc.dynamic_compile; void main(string[] args) { diff --git a/tests/runtimecompile/globals.d b/tests/runtimecompile/globals.d index c841188d63..4068059d65 100644 --- a/tests/runtimecompile/globals.d +++ b/tests/runtimecompile/globals.d @@ -2,7 +2,7 @@ // RUN: %ldc -enable-dynamic-compile -run %s import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; @dynamicCompileConst __gshared int foovar = 0; diff --git a/tests/runtimecompile/globals_types.d b/tests/runtimecompile/globals_types.d index 014500b907..ca9840e18b 100644 --- a/tests/runtimecompile/globals_types.d +++ b/tests/runtimecompile/globals_types.d @@ -2,7 +2,7 @@ // RUN: %ldc -enable-dynamic-compile -run %s import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; struct Foo { diff --git a/tests/runtimecompile/lambdas.d b/tests/runtimecompile/lambdas.d index 404a578d3f..69130eeeb0 100644 --- a/tests/runtimecompile/lambdas.d +++ b/tests/runtimecompile/lambdas.d @@ -2,7 +2,7 @@ // RUN: %ldc -enable-dynamic-compile -run %s import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; void main(string[] args) { diff --git a/tests/runtimecompile/library.d b/tests/runtimecompile/library.d index 247557172d..c911b15215 100644 --- a/tests/runtimecompile/library.d +++ b/tests/runtimecompile/library.d @@ -7,7 +7,7 @@ // RUN: %ldc -enable-dynamic-compile -Os -I%S %s %t2%lib %t3%lib %t4%lib -run import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; import inputs.module1; import inputs.module2; diff --git a/tests/runtimecompile/multiple_modules.d b/tests/runtimecompile/multiple_modules.d index 015e50c25d..d567cc03eb 100644 --- a/tests/runtimecompile/multiple_modules.d +++ b/tests/runtimecompile/multiple_modules.d @@ -3,7 +3,7 @@ // RUN: %ldc -enable-dynamic-compile -singleobj -I%S %s %S/inputs/module1.d %S/inputs/module2.d %S/inputs/module3.d -run import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; import inputs.module1; import inputs.module2; diff --git a/tests/runtimecompile/multiple_modules_rtconst.d b/tests/runtimecompile/multiple_modules_rtconst.d index d445e0437b..718d32eebb 100644 --- a/tests/runtimecompile/multiple_modules_rtconst.d +++ b/tests/runtimecompile/multiple_modules_rtconst.d @@ -2,7 +2,7 @@ // RUN: %ldc -enable-dynamic-compile -I%S %s %S/inputs/rtconst_owner.d %S/inputs/rtconst_user.d -run // RUN: %ldc -enable-dynamic-compile -singleobj -I%S %s %S/inputs/rtconst_owner.d %S/inputs/rtconst_user.d -run -import ldc.runtimecompile; +import ldc.dynamic_compile; import inputs.rtconst_owner; import inputs.rtconst_user; diff --git a/tests/runtimecompile/params_ctors.d b/tests/runtimecompile/params_ctors.d index 1989fc9931..00c9bf0520 100644 --- a/tests/runtimecompile/params_ctors.d +++ b/tests/runtimecompile/params_ctors.d @@ -2,7 +2,7 @@ // RUN: %ldc -enable-dynamic-compile -run %s import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; __gshared int ctorsCalled = 0; __gshared int dtorsCalled = 0; diff --git a/tests/runtimecompile/recursive_call.d b/tests/runtimecompile/recursive_call.d index 77aed9105c..a5b9847252 100644 --- a/tests/runtimecompile/recursive_call.d +++ b/tests/runtimecompile/recursive_call.d @@ -2,7 +2,7 @@ // RUN: %ldc -enable-dynamic-compile -run %s import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; @dynamicCompile int foo(int i) { diff --git a/tests/runtimecompile/simple.d b/tests/runtimecompile/simple.d index 0a2c3eff9c..e751b20520 100644 --- a/tests/runtimecompile/simple.d +++ b/tests/runtimecompile/simple.d @@ -3,14 +3,14 @@ import std.stdio; import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; -version(LDC_RuntimeCompilation) +version(LDC_DynamicCompilation) { } else { -static assert(false, "LDC_RuntimeCompilation is not defined"); +static assert(false, "LDC_DynamicCompilation is not defined"); } @dynamicCompile int foo() diff --git a/tests/runtimecompile/struct_init.d b/tests/runtimecompile/struct_init.d index 0e2f431c91..ab6eeb9e9c 100644 --- a/tests/runtimecompile/struct_init.d +++ b/tests/runtimecompile/struct_init.d @@ -4,7 +4,7 @@ // XFAIL: Windows_x86 // RUN: %ldc -enable-dynamic-compile -run %s -import ldc.runtimecompile; +import ldc.dynamic_compile; import ldc.attributes; import std.stdio; diff --git a/tests/runtimecompile/thread_local.d b/tests/runtimecompile/thread_local.d index addacb94be..11ab8039be 100644 --- a/tests/runtimecompile/thread_local.d +++ b/tests/runtimecompile/thread_local.d @@ -3,7 +3,7 @@ import core.thread; import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; ThreadID threadId; //thread local diff --git a/tests/runtimecompile/throw.d b/tests/runtimecompile/throw.d index 67cd2abf41..2071872092 100644 --- a/tests/runtimecompile/throw.d +++ b/tests/runtimecompile/throw.d @@ -6,7 +6,7 @@ import std.exception; import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; @dynamicCompile void foo() { diff --git a/tests/runtimecompile/tls_workaround_opt.d b/tests/runtimecompile/tls_workaround_opt.d index 6ad14a2270..71410fcd69 100644 --- a/tests/runtimecompile/tls_workaround_opt.d +++ b/tests/runtimecompile/tls_workaround_opt.d @@ -5,7 +5,7 @@ // RUN: %ldc -enable-dynamic-compile -dynamic-compile-tls-workaround=1 -run %s import ldc.attributes; -import ldc.runtimecompile; +import ldc.dynamic_compile; @dynamicCompile void foo() {