[LLVMdev] X86AsmPrinter + MASM and NASM backends

Aaron Gray angray at beeb.net
Fri Jul 1 16:35:43 PDT 2005


> 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




More information about the llvm-dev mailing list