Skip to content

Commit

Permalink
Delete no longer needed features from the Jou compiler written in C (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli authored Jan 9, 2025
1 parent 1aef25a commit 99ca7e9
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 92 deletions.
3 changes: 0 additions & 3 deletions bootstrap_compiler/jou_compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#include <llvm-c/TargetMachine.h>
#include "util.h"

void update_jou_compiler(void);

// don't like repeating "struct" outside this header file
typedef struct Location Location;
typedef struct Token Token;
Expand Down Expand Up @@ -627,7 +625,6 @@ Token *tokenize(FILE *f, const char *filename);
AstFile parse(const Token *tokens, const char *stdlib_path);
// Type checking happens between parsing and building CFGs.
CfGraphFile build_control_flow_graphs(const AstFile *ast, FileTypes *ft);
void simplify_control_flow_graphs(const CfGraphFile *cfgfile);
LLVMModuleRef codegen(const CfGraphFile *cfgfile, const FileTypes *ft);
char *compile_to_object_file(LLVMModuleRef module);
char *get_default_exe_path(void);
Expand Down
14 changes: 1 addition & 13 deletions bootstrap_compiler/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ static const char help_fmt[] =
"Usage:\n"
" <argv0> [-o OUTFILE] [-O0|-O1|-O2|-O3] [--verbose] [--linker-flags \"...\"] FILENAME\n"
" <argv0> --help # This message\n"
" <argv0> --update # Download and install the latest Jou\n"
"\n"
"Options:\n"
" -o OUTFILE output an executable file, don't run the code\n"
Expand Down Expand Up @@ -72,14 +71,9 @@ void parse_arguments(int argc, char **argv)
exit(0);
}

if (argc == 2 && !strcmp(argv[1], "--update")) {
update_jou_compiler();
exit(0);
}

int i = 1;
while (i < argc) {
if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "--update")) {
if (!strcmp(argv[i], "--help")) {
fprintf(stderr, "%s: \"%s\" cannot be used with other arguments", argv[0], argv[i]);
goto wrong_usage;
} else if (!strcmp(argv[i], "--verbose")) {
Expand Down Expand Up @@ -276,12 +270,6 @@ static char *compile_ast_to_object_file(struct FileState *fs)
if(command_line_args.verbosity >= 2)
print_control_flow_graphs(&cfgfile);

if(command_line_args.verbosity >= 1)
printf("Analyzing CFGs: %s\n", fs->path);
simplify_control_flow_graphs(&cfgfile);
if(command_line_args.verbosity >= 2)
print_control_flow_graphs(&cfgfile);

if (command_line_args.verbosity >= 1)
printf("Building LLVM IR: %s\n", fs->path);

Expand Down
76 changes: 0 additions & 76 deletions bootstrap_compiler/update.c

This file was deleted.

File renamed without changes.

0 comments on commit 99ca7e9

Please sign in to comment.