File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -7447,6 +7447,14 @@ static jl_llvm_functions_t
7447
7447
declarations.functionObject = needsparams ? " jl_fptr_sparam" : " jl_fptr_args" ;
7448
7448
}
7449
7449
7450
+ if (ctx.emission_context .debug_level >= 2 && lam->def .method && jl_is_method (lam->def .method ) && lam->specTypes != (jl_value_t *)jl_emptytuple_type) {
7451
+ ios_t sigbuf;
7452
+ ios_mem (&sigbuf, 0 );
7453
+ jl_static_show_func_sig ((JL_STREAM*) &sigbuf, (jl_value_t *)lam->specTypes );
7454
+ f->addFnAttr (" julia.fsig" , StringRef (sigbuf.buf , sigbuf.size ));
7455
+ ios_close (&sigbuf);
7456
+ }
7457
+
7450
7458
AttrBuilder FnAttrs (ctx.builder .getContext (), f->getAttributes ().getFnAttrs ());
7451
7459
AttrBuilder RetAttrs (ctx.builder .getContext (), f->getAttributes ().getRetAttrs ());
7452
7460
Original file line number Diff line number Diff line change @@ -363,6 +363,10 @@ class LineNumberAnnotatedWriter : public AssemblyAnnotationWriter {
363
363
void LineNumberAnnotatedWriter::emitFunctionAnnot (
364
364
const Function *F, formatted_raw_ostream &Out)
365
365
{
366
+ if (F->hasFnAttribute (" julia.fsig" )) {
367
+ auto sig = F->getFnAttribute (" julia.fsig" ).getValueAsString ();
368
+ Out << " ; Function Signature: " << sig << " \n " ;
369
+ }
366
370
InstrLoc = nullptr ;
367
371
DISubprogram *FuncLoc = F->getSubprogram ();
368
372
if (!FuncLoc) {
You can’t perform that action at this time.
0 commit comments