Skip to content

Commit

Permalink
Rename Builder to IRBuilder.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Mar 24, 2023
1 parent 53cf34b commit 0348de0
Show file tree
Hide file tree
Showing 22 changed files with 166 additions and 166 deletions.
6 changes: 3 additions & 3 deletions examples/Kaleidoscope/codegen.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
mutable struct CodeGen
ctx::LLVM.Context
builder::LLVM.Builder
builder::LLVM.IRBuilder
current_scope::CurrentScope
mod::LLVM.Module

CodeGen(ctx::LLVM.Context) =
new(
ctx,
LLVM.Builder(ctx),
LLVM.IRBuilder(ctx),
CurrentScope(),
LLVM.Module("KaleidoscopeModule"; ctx),
)
Expand All @@ -23,7 +23,7 @@ Base.show(io::IO, cg::CodeGen) = print(io, "CodeGen")

function create_entry_block_allocation(cg::CodeGen, fn::LLVM.Function, varname::String)
local alloc
LLVM.@dispose builder=LLVM.Builder(cg.ctx) begin
LLVM.@dispose builder=LLVM.IRBuilder(cg.ctx) begin
# Set the builder at the start of the function
entry_block = LLVM.entry(fn)
if isempty(LLVM.instructions(entry_block))
Expand Down
2 changes: 1 addition & 1 deletion examples/constrained.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ meta(::Type{FPExceptStrict}) = "fpexcept.strict"
intrinsic_fun = LLVM.Function(mod, intrinsic, [typ])
ftype = LLVM.FunctionType(intrinsic,[typ])
# generate IR
@dispose builder=Builder(ctx) begin
@dispose builder=IRBuilder(ctx) begin
entry = BasicBlock(llvm_f, "entry"; ctx)
position!(builder, entry)
val = call!(builder, ftype, intrinsic_fun,
Expand Down
2 changes: 1 addition & 1 deletion examples/generated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ end
llvmf, _ = create_function(eltyp, paramtyps)

# generate IR
@dispose builder=Builder(ctx) begin
@dispose builder=IRBuilder(ctx) begin
entry = BasicBlock(llvmf, "entry"; ctx)
position!(builder, entry)

Expand Down
2 changes: 1 addition & 1 deletion examples/sum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ end
sum = LLVM.Function(mod, "sum", fun_type)

# generate IR
@dispose builder=Builder(ctx) begin
@dispose builder=IRBuilder(ctx) begin
entry = BasicBlock(sum, "entry"; ctx)
position!(builder, entry)

Expand Down
2 changes: 1 addition & 1 deletion examples/sum_integrated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ end
sum, _ = create_function(ret_type, param_types)

# generate IR
@dispose builder=Builder(ctx) begin
@dispose builder=IRBuilder(ctx) begin
entry = BasicBlock(sum, "entry"; ctx)
position!(builder, entry)

Expand Down
2 changes: 1 addition & 1 deletion examples/sum_orc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function codegen!(mod::LLVM.Module, name, tm)
sum = LLVM.Function(mod, name, ft)

# generate IR
@dispose builder=Builder(ctx) begin
@dispose builder=IRBuilder(ctx) begin
entry = BasicBlock(sum, "entry"; ctx)
position!(builder, entry)

Expand Down
2 changes: 1 addition & 1 deletion src/interop/asmcall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export @asmcall
inline_asm = InlineAsm(llvm_ft, String(asm), String(constraints), side_effects)

# generate IR
@dispose builder=Builder(ctx) begin
@dispose builder=IRBuilder(ctx) begin
entry = BasicBlock(llvm_f, "entry"; ctx)
position!(builder, entry)

Expand Down
8 changes: 4 additions & 4 deletions src/interop/pointer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using Core: LLVMPtr
llvm_f, _ = create_function(eltyp, param_types)

# generate IR
@dispose builder=Builder(ctx) begin
@dispose builder=IRBuilder(ctx) begin
entry = BasicBlock(llvm_f, "entry"; ctx)
position!(builder, entry)
if supports_typed_pointers(ctx)
Expand Down Expand Up @@ -59,7 +59,7 @@ end
llvm_f, _ = create_function(LLVM.VoidType(ctx), param_types)

# generate IR
@dispose builder=Builder(ctx) begin
@dispose builder=IRBuilder(ctx) begin
entry = BasicBlock(llvm_f, "entry"; ctx)
position!(builder, entry)
if supports_typed_pointers(ctx)
Expand Down Expand Up @@ -129,7 +129,7 @@ Base.signed(x::LLVMPtr) = Int(x)
llvm_f, _ = create_function(T_dest, [T_src])
mod = LLVM.parent(llvm_f)

@dispose builder=Builder(ctx) begin
@dispose builder=IRBuilder(ctx) begin
entry = BasicBlock(llvm_f, "entry"; ctx)
position!(builder, entry)

Expand Down Expand Up @@ -164,7 +164,7 @@ end
llvm_f, _ = create_function(T_ret, T_args)
mod = LLVM.parent(llvm_f)

@dispose builder=Builder(ctx) begin
@dispose builder=IRBuilder(ctx) begin
entry = BasicBlock(llvm_f, "entry"; ctx)
position!(builder, entry)

Expand Down
Loading

0 comments on commit 0348de0

Please sign in to comment.