Skip to content

Commit 1898147

Browse files
committed
renamed 'scope.h' to 'cfg.h'
1 parent 2605935 commit 1898147

24 files changed

+294
-302
lines changed

include/shady/ir.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ typedef struct {
347347

348348
void emit_c(CompilerConfig compiler_config, CEmitterConfig emitter_config, Module*, size_t* output_size, char** output, Module** new_mod);
349349

350-
void dump_cfg(FILE* file, Module*);
350+
void dump_cfgs(FILE* output, Module* mod);
351351
void dump_loop_trees(FILE* output, Module* mod);
352352

353353
void free_output(char* output);

src/driver/driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ ShadyErrorCodes driver_compile(DriverConfig* args, Module* mod) {
125125
if (args->cfg_output_filename) {
126126
FILE* f = fopen(args->cfg_output_filename, "wb");
127127
assert(f);
128-
dump_cfg(f, mod);
128+
dump_cfgs(f, mod);
129129
fclose(f);
130130
debug_print("CFG dumped\n");
131131
}

src/frontends/llvm/l2s_postprocess.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
#include "../shady/rewrite.h"
88
#include "../shady/type.h"
99
#include "../shady/ir_private.h"
10-
#include "../shady/analysis/scope.h"
10+
#include "../shady/analysis/cfg.h"
1111

1212
typedef struct {
1313
Rewriter rewriter;
1414
const CompilerConfig* config;
1515
Parser* p;
16-
Scope* curr_scope;
16+
CFG* cfg;
1717
const Node* old_fn_or_bb;
1818
struct Dict* controls;
1919
} Context;
@@ -127,7 +127,7 @@ static const Node* process_op(Context* ctx, NodeClass op_class, String op_name,
127127
}
128128
case Function_TAG: {
129129
Context fn_ctx = *ctx;
130-
fn_ctx.curr_scope = new_scope(node);
130+
fn_ctx.cfg = build_fn_cfg(node);
131131
fn_ctx.old_fn_or_bb = node;
132132
Controls controls;
133133
initialize_controls(ctx, &controls, node);
@@ -165,7 +165,7 @@ static const Node* process_op(Context* ctx, NodeClass op_class, String op_name,
165165
});
166166
} else
167167
decl->payload.fun.body = rewrite_node(&fn_ctx.rewriter, node->payload.fun.body);
168-
destroy_scope(fn_ctx.curr_scope);
168+
destroy_cfg(fn_ctx.cfg);
169169
return decl;
170170
}
171171
case BasicBlock_TAG: {
@@ -198,9 +198,9 @@ static const Node* process_op(Context* ctx, NodeClass op_class, String op_name,
198198
} else if (lexical_scope_is_nested(*src_lexical_scope, *dst_lexical_scope)) {
199199
debug_print("Jump from %s to %s exits one or more nested lexical scopes, it might reconverge.\n", get_abstraction_name(src), get_abstraction_name(dst));
200200

201-
CFNode* src_cfnode = scope_lookup(ctx->curr_scope, src);
201+
CFNode* src_cfnode = cfg_lookup(ctx->cfg, src);
202202
assert(src_cfnode->node);
203-
CFNode* target_cfnode = scope_lookup(ctx->curr_scope, dst);
203+
CFNode* target_cfnode = cfg_lookup(ctx->cfg, dst);
204204
assert(src_cfnode && target_cfnode);
205205
CFNode* dom = src_cfnode->idom;
206206
while (dom) {

src/shady/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ set(SHADY_SOURCES
3838
annotation.c
3939
module.c
4040

41-
analysis/scope.c
42-
analysis/scope_dump.c
41+
analysis/cfg.c
42+
analysis/cfg_dump.c
4343
analysis/free_variables.c
4444
analysis/verify.c
4545
analysis/callgraph.c

0 commit comments

Comments
 (0)