On Mon, Jul 29, 2019 at 4:39 AM Hans Wennborg via llvm-dev < llvm-dev at lists.llvm.org> wrote:> The arguments are unnamed, which means they will be implicitly named %0, > %1, %2. >OP's use case for the names aside, I think we should consider changing LLVM's IR printer to print unnamed arguments in function definitions as %0, %1, etc, like we do for instructions. We can skip the names for Function declarations since nothing can refer to them, but it's confusing to see %0 references with no definition. Unnamed BBs are another common source of confusion, but I'd leave that alone for now. Reid -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190729/af6342c8/attachment.html>
Bitcode parser doesn’t like “numerical” names for parameters: opt: <stdin>:1:22: error: expected ')' at end of argument list define void @foo(i32 %0) { ^ -- Krzysztof Parzyszek mailto:kparzysz at quicinc.com AI tools development From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Reid Kleckner via llvm-dev Sent: Monday, July 29, 2019 1:14 PM To: Hans Wennborg <hans at chromium.org> Cc: llvm-dev at lists.llvm.org; mohamed messelka <m14m at live.fr> Subject: [EXT] Re: [llvm-dev] Arguments name IR LLVM On Mon, Jul 29, 2019 at 4:39 AM Hans Wennborg via llvm-dev <mailto:llvm-dev at lists.llvm.org> wrote: The arguments are unnamed, which means they will be implicitly named %0, %1, %2. OP's use case for the names aside, I think we should consider changing LLVM's IR printer to print unnamed arguments in function definitions as %0, %1, etc, like we do for instructions. We can skip the names for Function declarations since nothing can refer to them, but it's confusing to see %0 references with no definition. Unnamed BBs are another common source of confusion, but I'd leave that alone for now. Reid
I don't think it makes the grammar ambiguous, so it seems like it could be fixed. On Mon, Jul 29, 2019 at 11:32 AM Krzysztof Parzyszek <kparzysz at quicinc.com> wrote:> Bitcode parser doesn’t like “numerical” names for parameters: > > opt: <stdin>:1:22: error: expected ')' at end of argument list > define void @foo(i32 %0) { > ^ > > -- > Krzysztof Parzyszek mailto:kparzysz at quicinc.com AI tools development > > From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Reid > Kleckner via llvm-dev > Sent: Monday, July 29, 2019 1:14 PM > To: Hans Wennborg <hans at chromium.org> > Cc: llvm-dev at lists.llvm.org; mohamed messelka <m14m at live.fr> > Subject: [EXT] Re: [llvm-dev] Arguments name IR LLVM > > On Mon, Jul 29, 2019 at 4:39 AM Hans Wennborg via llvm-dev <mailto: > llvm-dev at lists.llvm.org> wrote: > The arguments are unnamed, which means they will be implicitly named %0, > %1, %2. > > OP's use case for the names aside, I think we should consider changing > LLVM's IR printer to print unnamed arguments in function definitions as %0, > %1, etc, like we do for instructions. We can skip the names for Function > declarations since nothing can refer to them, but it's confusing to see %0 > references with no definition. Unnamed BBs are another common source of > confusion, but I'd leave that alone for now. > > Reid >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190729/4bb14513/attachment.html>
> OP's use case for the names aside, I think we should consider changing LLVM's IR printer to print unnamed arguments in function definitions as %0, %1, etc, like we do for instructions.I agree. I was thinking the same during the discussion. So: https://reviews.llvm.org/D65582. Tim.