> Patch committed here:Just looked at the WebCVS.> I made a couple of changes to the code you submitted. The most important > is that I converted this (in the .h files): > > using namespace llvm; > namespace x86 { > ... > > into: > > namespace llvm { > namespace x86 { > ...Right, that is how I had it in the beggining, obviously I miss understood your request regarding the namespaces.> The former defines the "..." stuff in the x86 namespace, the later defines > it in the llvm::x86 namespace.Great :)> In addition to this, I changed some other minor things, e.g. I changed > the tabs in the files to spaces. Also, I reduced the number of #include's > in the headers and .cpp files to the minimum. In the future, please be > aware of these issues.Okay, sorry I missed doing the inlines. Thought I had taken care of using spaces rather than tabs, I'll check my editor preferences.> Otherwise, the patch looks great!Good. Its not exactly that big a job though :)>> The only thing I did not like was a clsh between the enum X86 and the new >> namespace X86, which I had to rename as x86 :( >> >> Anyway, I suppose the lower case 'x' in 'x86' fits in with the lowercase >> 'llvm' namespace. > > I'm not sure I follow. X86 is a namespace. I assume you're running into > some strange VC thing or something (?). If not, please submit a patch to > change the x86 namespaces to the X86 namespace. It's possible that the > problem I described above was causing this issue for you.No dont worry about that now. Just the X86 namespace was clashing with the X86 instruction enum when it was not nested under the LLVM namespace. I have written the X86MASMPrinter and will test it tommorow. It had to override behaviour right back to the AsmPrinter class as it had to override the basic 'gas' behaviour of the AsmPrinter class. I am not really sure whether to do a X86NASMPrinter or whether to bypass that for now and work on an X86COFFWriter which would be more useful to me ? Also looking at your ELF code I do not know how to fit it in exactly with the command line switches etc. Thanks, Aaron
> Okay, sorry I missed doing the inlines. Thought I had taken care of usingI ment headers not inlines. Yes I should have checked there usage. Aaron
On Sat, 2 Jul 2005, Aaron Gray wrote:>>> The only thing I did not like was a clsh between the enum X86 and the new >>> namespace X86, which I had to rename as x86 :( >>> >>> Anyway, I suppose the lower case 'x' in 'x86' fits in with the lowercase >>> 'llvm' namespace. >> >> I'm not sure I follow. X86 is a namespace. I assume you're running into >> some strange VC thing or something (?). If not, please submit a patch to >> change the x86 namespaces to the X86 namespace. It's possible that the >> problem I described above was causing this issue for you. > > No dont worry about that now. Just the X86 namespace was clashing with the > X86 instruction enum when it was not nested under the LLVM namespace.Ok.> I have written the X86MASMPrinter and will test it tommorow. It had to > override behaviour right back to the AsmPrinter class as it had to override > the basic 'gas' behaviour of the AsmPrinter class.Ok.> I am not really sure whether to do a X86NASMPrinter or whether to bypass that > for now and work on an X86COFFWriter which would be more useful to me ?I wouldn't suggest writing an X86NASMPrinter: just change the current Intel printer to do what you want. Noone is currently using the intel printer, so you can do what you wish to it.> Also looking at your ELF code I do not know how to fit it in exactly with the > command line switches etc.I don't know which you would prefer. I'm actively (but slowly) hacking on the ELF writer in my spare time. It will probably be a lot easier to write the COFF writer after the ELF write is done, so you can use it as an example. In any case, getting the nasm writer working will be much easier still. -Chris -- http://nondot.org/sabre/ http://llvm.org/
>> I am not really sure whether to do a X86NASMPrinter or whether to bypass >> that for now and work on an X86COFFWriter which would be more useful to >> me ? > > I wouldn't suggest writing an X86NASMPrinter: just change the current > Intel printer to do what you want. Noone is currently using the intel > printer, so you can do what you wish to it.Once I have finished rewriting the MASM printer then a NASM one should take no time at all, he says :) The NASM like the MASM does not have % symbols on the register names so will either inherit from the MASM printer or have its own TableGen class.>> Also looking at your ELF code I do not know how to fit it in exactly with >> the command line switches etc. > > I don't know which you would prefer. I'm actively (but slowly) hacking on > the ELF writer in my spare time. It will probably be a lot easier to > write the COFF writer after the ELF write is done, so you can use it as an > example.Yes I will wait till you have done the ELF writer.> In any case, getting the nasm writer working will be much easier still.I am probably going to do a NASM version after a bit of a break. Aaron