MSCV linker and OperandInfo constants

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

James_Clayton@scee.net writes:

[snip]

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

Please consider submitting your patch to llvm-commits mailing list,
which is the correct place for reviewing patches. Inline the patch in
your message, don't post links.

OTOH, you may be interested on the LLVM coding standards, although such
small shouldn't be a problem:

http://llvm.org/docs/CodingStandards.html

[BTW, anyone knows where is the document that used to explain how to
contribute to LLVM? (preparing and submitting patches, etc). The new
document structure with its intermediate pages is a step backwards
IMAO. The monolithic index is more convenient. After all, we have not so
many documents.]

http://llvm.org/docs/DeveloperPolicy.html .

-Eli

Eli Friedman <eli.friedman@gmail.com> writes:

[BTW, anyone knows where is the document that used to explain how to
contribute to LLVM? (preparing and submitting patches, etc). The new
document structure with its intermediate pages is a step backwards
IMAO. The monolithic index is more convenient. After all, we have not so
many documents.]

http://llvm.org/docs/DeveloperPolicy.html .

Thanks.

I see it is linked from "User guides", while maybe makes more sense to
put it into "Development Process Documentation".