summaryrefslogtreecommitdiff
path: root/lib/Core/Core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Core/Core.cpp')
-rw-r--r--lib/Core/Core.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Core/Core.cpp b/lib/Core/Core.cpp
index 73d5c08..52aa280 100644
--- a/lib/Core/Core.cpp
+++ b/lib/Core/Core.cpp
@@ -4,3 +4,16 @@
LIBFLANG_ABI void libflang_stop() {
exit(0);
}
+
+LIBFLANG_ABI int32_t libflang_selected_int_kind(int32_t Range) {
+ if(Range <= 2)
+ return 1;
+ else if(Range <= 4)
+ return 2;
+ else if(Range <= 9)
+ return 4;
+ else if(Range <= 18)
+ return 8;
+ // NB: add Range <= 38 for Int16
+ return -1;
+}