Skip to content

Commit 12f89c7

Browse files
authored
Convert repr to string(nameof( )) (#133)
1 parent 4b59c71 commit 12f89c7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/StaticCompiler.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ include("code_loading.jl")
2525
include("optimize.jl")
2626
include("quirks.jl")
2727

28-
fix_name(f::Function) = fix_name(repr(f))
28+
fix_name(f::Function) = fix_name(string(nameof(f)))
2929
fix_name(s) = String(GPUCompiler.safe_name(s))
3030

3131
"""
@@ -199,7 +199,7 @@ end
199199

200200
"""
201201
```julia
202-
compile_executable(f::Function, types::Tuple, path::String, [name::String=repr(f)];
202+
compile_executable(f::Function, types::Tuple, path::String, [name::String=string(nameof(f))];
203203
filename::String=name,
204204
cflags=``, # Specify libraries you would like to link against, and other compiler options here
205205
also_expose=[],
@@ -294,7 +294,7 @@ end
294294

295295
"""
296296
```julia
297-
compile_shlib(f::Function, types::Tuple, [path::String="./"], [name::String=repr(f)]; filename::String=name, cflags=``, kwargs...)
297+
compile_shlib(f::Function, types::Tuple, [path::String="./"], [name::String=string(nameof(f))]; filename::String=name, cflags=``, kwargs...)
298298
compile_shlib(funcs::Array, [path::String="./"]; filename="libfoo", demangle=true, cflags=``, kwargs...)
299299
```
300300
As `compile_executable`, but compiling to a standalone `.dylib`/`.so` shared library.
@@ -355,7 +355,7 @@ end
355355

356356
"""
357357
```julia
358-
compile_wasm(f::Function, types::Tuple, [path::String="./"], [name::String=repr(f)]; filename::String=name, flags=``, kwargs...)
358+
compile_wasm(f::Function, types::Tuple, [path::String="./"], [name::String=string(nameof(f))]; filename::String=name, flags=``, kwargs...)
359359
compile_wasm(funcs::Union{Array,Tuple}, [path::String="./"]; filename="libfoo", demangle=true, flags=``, kwargs...)
360360
```
361361
As `compile_shlib`, but compiling to a WebAssembly library.

src/pointer_patching.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ llvmeltype(x::LLVM.Value) = eltype(LLVM.value_type(x))
157157

158158
function pointer_patching_diff(f, tt, path1=tempname(), path2=tempname(); show_reloc_table=false)
159159
tm = GPUCompiler.llvm_machine(NativeCompilerTarget())
160-
job, kwargs = native_job(f, tt, false; name=fix_name(repr(f)))
160+
job, kwargs = native_job(f, tt, false; name=fix_name(string(nameof(f))))
161161
#Get LLVM to generated a module of code for us. We don't want GPUCompiler's optimization passes.
162162
mod, meta = GPUCompiler.JuliaContext() do context
163163
GPUCompiler.codegen(:llvm, job; strip=true, only_entry=false, validate=false, optimize=false, ctx=context)

0 commit comments

Comments
 (0)