[llvm-commits] Fix opcodes in C bindings

Török Edwin edwintorok at gmail.com
Thu Oct 6 05:45:27 PDT 2011


On 2011-10-06 15:20, Duncan Sands wrote:
> 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.
> 

Thanks, committed.

--Edwin



More information about the llvm-commits mailing list