Using a generic variable as list index was throwing an error
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
To provide more context: I use this tool to generate the intrinsics list for the rustc_codegen_gcc project to automatically generate the list of intrinsics used by LLVM so they can be translated to GCC's. Currently, when running it, it fails because of this error:
llvm/IR/Intrinsics.td:225:21: error: Variable not defined: 'al' int num = Mapping[al]; ^ llvm/IR/Intrinsics.td:225:23: error: expected integer or bitrange int num = Mapping[al]; ^ llvm/IR/Intrinsics.td:225:23: error: expected ';' after declaration int num = Mapping[al]; ^
This patch fixes this bug.
@GuillaumeGomez Thanks for catching this. Seems reasonable to me.
I think the test may be put into ListSlices.td.
Excuse me, let me delegate the acceptance.
llvm/test/TableGen/var-index.td | ||
---|---|---|
2 | Can you add checks for the expanded output? |
llvm/test/TableGen/var-index.td | ||
---|---|---|
2 | Sorry but what is the option for doing that? The only two for expansion I see are --print-sets and --instr-info-expand-mi-operand-info and they don't seem to match what you expect. |
I don't see this issue from the main branch. In fact, https://reviews.llvm.org/D149016 solves the issue and should not be "fixed". Could you double-check whether the main branch could reproduce this issue?
Add @pcwang-thead
Can you add checks for the expanded output?