aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-05-27 18:02:40 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-05-27 18:02:40 -0400
commitcb634f61f78bb629164f98ea04ab04a8e5c5b67d (patch)
tree0dde5e2c4bb60fad30f42f71097f5cce786f4598
parentc9889582a7f56b3bfdca455a8d84167f688cd3c8 (diff)
Remove unused code
-rw-r--r--compile.c4
-rw-r--r--compile.h2
-rw-r--r--tomo.c2
3 files changed, 2 insertions, 6 deletions
diff --git a/compile.c b/compile.c
index d8a6f445..d03bd875 100644
--- a/compile.c
+++ b/compile.c
@@ -833,13 +833,10 @@ CORD compile_statement(env_t *env, ast_t *ast)
case Use: {
auto use = Match(ast, Use);
const char *path = use->raw_path;
- const char *name = file_base_name(path);
if (strncmp(path, "./", 2) == 0 || strncmp(path, "../", 3) == 0) {
env->code->imports = CORD_all(env->code->imports, "#include \"", path, ".h\"\n");
- env->code->object_files = CORD_all(env->code->object_files, "'", path, ".o' ");
} else {
env->code->imports = CORD_all(env->code->imports, "#include <", path, ".h>\n");
- env->code->object_files = CORD_all(env->code->object_files, "-l", name, " ");
}
return CORD_EMPTY;
}
@@ -2246,7 +2243,6 @@ module_code_t compile_file(ast_t *ast)
return (module_code_t){
.module_name=name,
.env=env,
- .object_files=env->code->object_files,
.header=CORD_all(
// "#line 1 ", Text$quoted(ast->file->filename, false), "\n",
"#include <tomo/tomo.h>\n",
diff --git a/compile.h b/compile.h
index 205d5517..a868b124 100644
--- a/compile.h
+++ b/compile.h
@@ -12,7 +12,7 @@
typedef struct {
const char *module_name;
env_t *env;
- CORD header, c_file, object_files;
+ CORD header, c_file;
} module_code_t;
CORD expr_as_text(env_t *env, CORD expr, type_t *t, CORD color);
diff --git a/tomo.c b/tomo.c
index 0f623418..daf901a1 100644
--- a/tomo.c
+++ b/tomo.c
@@ -242,7 +242,7 @@ int transpile(const char *filename, bool force_retranspile, module_code_t *modul
ast_t *ast = parse_file(f, NULL);
if (!ast)
- errx(1, "Could not compile!");
+ errx(1, "Could not compile %s", f);
if (verbose) {
FILE *out = popen(heap_strf("bat -P --file-name='%s'", filename), "w");