Tracy
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
||||
[submodule "modules/nbrutil"]
|
||||
path = modules/ncore
|
||||
url = git@git.nbross.com:nielsbross/NCore.git
|
||||
[submodule "modules/tracy"]
|
||||
path = modules/tracy
|
||||
url = https://github.com/rluba/jai-tracy.git
|
||||
|
||||
@@ -873,7 +873,7 @@ find_symbol :: (name : string, checker : *Semantic_Checker, containing_scope : *
|
||||
}
|
||||
|
||||
from_handle :: (variables : []Type_Variable, handle : Type_Variable_Handle) -> *Type_Variable {
|
||||
assert(handle > 0 && xx handle <= variables.count, tprint("Invalid handle: %. Range is: 1-%", handle, variables.count - 1));
|
||||
// assert(handle > 0 && xx handle <= variables.count, tprint("Invalid handle: %. Range is: 1-%", handle, variables.count - 1));
|
||||
return *variables[handle - 1];
|
||||
}
|
||||
|
||||
|
||||
65
first.jai
65
first.jai
@@ -1,6 +1,9 @@
|
||||
#import "Basic";
|
||||
#import "File";
|
||||
#import "Compiler";
|
||||
#import "Metaprogram_Plugins";
|
||||
|
||||
plugins: [..] *Metaprogram_Plugin;
|
||||
|
||||
build :: () {
|
||||
w := compiler_create_workspace("Ink Build");
|
||||
@@ -18,14 +21,45 @@ build :: () {
|
||||
|
||||
args := options.compile_time_command_line;
|
||||
|
||||
intercept_flags: Intercept_Flags;
|
||||
plugin_start_index := -1;
|
||||
|
||||
for arg : args {
|
||||
if arg == {
|
||||
case "check"; {
|
||||
options.output_type = .NO_OUTPUT;
|
||||
}
|
||||
}
|
||||
|
||||
it := args[it_index];
|
||||
|
||||
if !it continue;
|
||||
|
||||
if it[0] == #char "+" {
|
||||
plugin_start_index = it_index;
|
||||
}
|
||||
}
|
||||
|
||||
plugins_to_create: [..] Plugin_To_Create;
|
||||
tracy : Plugin_To_Create;
|
||||
tracy.name = "tracy";
|
||||
array_add(*plugins_to_create, tracy);
|
||||
// got_error := false;
|
||||
// if plugin_start_index >= 0 {
|
||||
// success:, plugins_to_create = parse_plugin_arguments(args, plugin_start_index);
|
||||
// if !success got_error = true;
|
||||
// }
|
||||
|
||||
// if got_error {
|
||||
// exit(1);
|
||||
// }
|
||||
|
||||
success := init_plugins(plugins_to_create, *plugins, w);
|
||||
if !success {
|
||||
log_error("A plugin init() failed. Exiting.\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
new_path: [..] string;
|
||||
array_add(*new_path, ..options.import_path);
|
||||
array_add(*new_path, "modules");
|
||||
@@ -35,18 +69,41 @@ build :: () {
|
||||
|
||||
wd := get_working_directory();
|
||||
|
||||
|
||||
set_build_options(options, w);
|
||||
|
||||
compiler_begin_intercept(w);
|
||||
for plugins {
|
||||
if it.before_intercept it.before_intercept(it, *intercept_flags);
|
||||
}
|
||||
|
||||
compiler_begin_intercept(w, intercept_flags);
|
||||
|
||||
for plugins if it.add_source it.add_source(it);
|
||||
|
||||
add_build_file(MAIN_FILE, w);
|
||||
|
||||
// Call message_loop(), which is a routine of ours below that will receive the messages.
|
||||
message_loop(w);
|
||||
|
||||
compiler_end_intercept(w);
|
||||
|
||||
for plugins if it.finish it.finish (it);
|
||||
for plugins if it.shutdown it.shutdown(it);
|
||||
|
||||
print("\nDone!\n\n");
|
||||
|
||||
set_build_options_dc(.{do_output=false});
|
||||
set_build_options_dc(.{do_output=false, write_added_strings=false});
|
||||
}
|
||||
|
||||
#run build();
|
||||
message_loop :: (w: Workspace) {
|
||||
while true {
|
||||
// We ask the compiler for the next message. If one is not available,
|
||||
// we will wait until it becomes available.
|
||||
message := compiler_wait_for_message();
|
||||
// Pass the message to all plugins.
|
||||
for plugins if it.message it.message(it, message);
|
||||
|
||||
if message.kind == .COMPLETE break;
|
||||
}
|
||||
}
|
||||
|
||||
#run, stallable build();
|
||||
|
||||
1
modules/tracy
Submodule
1
modules/tracy
Submodule
Submodule modules/tracy added at 9668d7b8ab
Reference in New Issue
Block a user