Skip to content

Commit

Permalink
Change name of function
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaraldi committed Mar 20, 2023
1 parent 9782179 commit 2eac26a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/Kaleidoscope/codegen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function codegen(cg::CodeGen, expr::CallExprAST)
for v in expr.args
push!(args, codegen(cg, v))
end
ft = LLVM.FunctionType(func)
ft = LLVM.function_type(func)
return LLVM.call!(cg.builder, ft, func, args, "calltmp")
end

Expand Down
4 changes: 2 additions & 2 deletions src/core/function.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ export unsafe_delete!,
personality, personality!,
callconv, callconv!,
gc, gc!,
entry
entry, function_type

# forward declaration of Function in src/core/basicblock.jl
register(Function, API.LLVMFunctionValueKind)

Function(mod::Module, name::String, ft::FunctionType) =
Function(API.LLVMAddFunction(mod, name, ft))

FunctionType(Fn::Function) = FunctionType(API.LLVMGetFunctionType(Fn))
function_type(Fn::Function) = FunctionType(API.LLVMGetFunctionType(Fn))

Base.empty!(f::Function) = API.LLVMFunctionDeleteBody(f)

Expand Down
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function clone(f::Function; value_map::Dict{Value,Value}=Dict{Value,Value}())
end

# Create a new function type...
oldfty = FunctionType(f)
oldfty = function_type(f)
vararg = isvararg(oldfty)
fty = FunctionType(return_type(oldfty), argtypes; vararg)

Expand Down

0 comments on commit 2eac26a

Please sign in to comment.