[llvm-commits] Fix opcodes in C bindings

Duncan Sands baldrick at free.fr
Thu Oct 6 05:20:30 PDT 2011


On 10/06/11 14:13, Török Edwin wrote:
> On 2011-10-03 16:38, Török Edwin wrote:
>> Hi,
>>
>> LLVMOpcode is out of sync with getOpcode() right now (was ok in 2.9 AFAICT).
>>
>> Attached patch introduces a function to map between Instruction::* opcodes and the opcodes declared in llvm-c/Core.h.
>> It does that by using the macros in Instruction.def, so that it will always be up-to-date as internal opcodes change.
>> When a new opcode is introduced you'll get a compile error in Core.cpp and will have to add it to llvm-c/Core.h
>> as well (at the end of the other opcodes). This way the C API opcodes can't get out-of-sync.
>>
>> The 2nd patch adds an LLVMGetInstructionOpcode to the C API, to allow it to inspect, not just create instructions.
>
> Ping?

It looks OK to me.

Ciao, Duncan.



More information about the llvm-commits mailing list