aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-07-28 00:41:31 +0100
committergingerBill <bill@gingerbill.org>2018-07-28 00:41:31 +0100
commitc3c783424604b14cdd86950bf4b0aaded1f97316 (patch)
treecf8eb6d5f40545bdd63c2b8f81ffa645119e8473 /src/main.cpp
parentd0e04bf569465196e0679bf068126988dcab5122 (diff)
BigInt support in the constant system
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 996d33089..d266bff09 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4,6 +4,7 @@
#include "timings.cpp"
#include "build_settings.cpp"
#include "tokenizer.cpp"
+#include "big_int.cpp"
#include "exact_value.cpp"
#include "parser.hpp"
@@ -408,7 +409,7 @@ bool parse_build_flags(Array<String> args) {
}
case BuildFlag_OptimizationLevel:
GB_ASSERT(value.kind == ExactValue_Integer);
- build_context.optimization_level = cast(i32)value.value_integer;
+ build_context.optimization_level = cast(i32)big_int_to_i64(&value.value_integer);
break;
case BuildFlag_ShowTimings:
GB_ASSERT(value.kind == ExactValue_Invalid);
@@ -416,7 +417,7 @@ bool parse_build_flags(Array<String> args) {
break;
case BuildFlag_ThreadCount: {
GB_ASSERT(value.kind == ExactValue_Integer);
- isize count = cast(isize)value.value_integer;
+ isize count = cast(isize)big_int_to_i64(&value.value_integer);
if (count <= 0) {
gb_printf_err("%.*s expected a positive non-zero number, got %.*s\n", LIT(name), LIT(param));
build_context.thread_count = 0;
@@ -716,6 +717,7 @@ int main(int arg_count, char **arg_ptr) {
init_string_buffer_memory();
init_global_error_collector();
+ global_big_int_init();
arena_init(&global_ast_arena, heap_allocator());
array_init(&library_collections, heap_allocator());