[LLVMdev] MSCV linker and OperandInfo constants

James_Clayton at scee.net James_Clayton at scee.net
Fri Aug 17 08:28:55 PDT 2012


Hello all,

I've managed to trace an awkward bug down to the MSVC linker incorrectly 
merging llvm::OperandInfo constants between various backend targets I was 
linking in to my compiler executable. The bug manifested itself by 
replacing the operand data structures for target A with the data 
structures for target B.
I have managed to work around this issue by moving the operand definitions 
from the llvm namespace to a sub-target namespace (i.e. llvm::OperandInfo5 
-> llvm::X86::OperandInfo5)

My work around changes the InstrInfoEmitter::run() function in 
TableGen/InstrInfoEmitter.cpp . A patch (from llvm 3.0 - it doesn't appear 
much has changed) can be found here: http://pastebin.com/pHmu1V63 
The whole modified function can be found here: 
http://pastebin.com/GN4Hh7BC 

This is a simple scoping change, there should be no change in application 
behaviour.

This is the first time I've made any patches to llvm - please let me know 
if you'd like any more information.

Kind regards,

James Clayton
Sony Computer Entertainment Europe Limited


**********************************************************************
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error please notify postmaster at scee.net
This footnote also confirms that this email message has been checked for 
all known viruses.
Sony Computer Entertainment Europe Limited
Registered Office: 10 Great Marlborough Street, London W1F 7LP, United 
Kingdom
Registered in England: 3277793
**********************************************************************

P Please consider the environment before printing this e-mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120817/6b276d23/attachment.html>


More information about the llvm-dev mailing list