Issue 131829
Summary [flang][debug] Number function arguments in FIR
Labels flang:ir, flang, flang:fir-hlfir
Assignees
Reporter vzakhari
    AddDebugInfo pass uses fragile logic for figuring out the positional number of a dummy argument in the list of function arguments. This causes issues like https://github.com/llvm/llvm-project/pull/131672

It seems that we need to number the dummy arguments in a more reliable way, e.g. attribute `[hl]fir.declare` operations with the proper number early in the pipeline (maybe even during lowering).

There are some questions that I do not know answers for.  @abidh please feel free to comment, if you know the answers.

1. How is the numbering affected by AbstractResultOpt pass that may introduce a new function argument for the result of function? E.g. let's say we set number 1 for the first Fortran dummy argument of a function.  Then AbstractResultOpt adds a new dummy argument before the first one.  Should all the numbers shift at this time?
2. How is the numbering affected by MLIR inlining? E.g. when a callee with dummy arguments is inlined into the caller, should we still attribute those used to be dummy arguments with `arg = ...`?
3. How is the numbering affected by ABI handling.  E.g. if a single Fortran dummy argument is received by a function via two low-level function arguments, does it mean the positional numbers should be shifted at this point?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to