Chris, Okay, I have done as you have requested. 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. Build tested on MS VC2003 and Linux. Aaron -------------- next part -------------- A non-text attachment was scrubbed... Name: NewX86AsmPrinter.tar.gz Type: application/x-gzip Size: 5810 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050701/3cda425e/attachment.bin>
On Fri, 1 Jul 2005, Aaron Gray wrote:> Okay, I have done as you have requested.Patch committed here: 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 { ... The former defines the "..." stuff in the x86 namespace, the later defines it in the llvm::x86 namespace. 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. Otherwise, the patch looks great!> 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. Thanks again, -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/
> 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
I am now getting the following link errors on all executables: x86.lib(X86AsmPrinter.obj) : error LNK2001: unresolved external symbol "public: virtual bool __thiscall llvm::x86::X86ATTAsmPrinter::runOnMachineFunction(class llvm::MachineFunction &)" (?runOnMachineFunction at X86ATTAsmPrinter@x86 at llvm@@UAE_NAAVMachineFunction at 3@@Z) x86.lib(X86AsmPrinter.obj) : error LNK2001: unresolved external symbol "public: virtual bool __thiscall llvm::x86::X86IntelAsmPrinter::runOnMachineFunction(class llvm::MachineFunction &)" (?runOnMachineFunction at X86IntelAsmPrinter@x86 at llvm@@UAE_NAAVMachineFunction at 3@@Z) x86.lib(X86AsmPrinter.obj) : error LNK2001: unresolved external symbol "public: virtual bool __thiscall llvm::x86::X86IntelAsmPrinter::doInitialization(class llvm::Module &)" (?doInitialization at X86IntelAsmPrinter@x86 at llvm@@UAE_NAAVModule at 3@@Z) Aaron Gray wrote:> Chris, > > Okay, I have done as you have requested. > > 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. > > Build tested on MS VC2003 and Linux. > > Aaron > >------------------------------------------------------------------------ > >_______________________________________________ >LLVM Developers mailing list >LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev > >
Fixed it. You did not add the new files to Visual Studio (or at least forgot to include x86.vcproj with the other files). Jeff Cohen wrote:> I am now getting the following link errors on all executables: > > x86.lib(X86AsmPrinter.obj) : error LNK2001: unresolved external symbol > "public: virtual bool __thiscall > llvm::x86::X86ATTAsmPrinter::runOnMachineFunction(class > llvm::MachineFunction &)" > (?runOnMachineFunction at X86ATTAsmPrinter@x86 at llvm@@UAE_NAAVMachineFunction at 3@@Z) > > x86.lib(X86AsmPrinter.obj) : error LNK2001: unresolved external symbol > "public: virtual bool __thiscall > llvm::x86::X86IntelAsmPrinter::runOnMachineFunction(class > llvm::MachineFunction &)" > (?runOnMachineFunction at X86IntelAsmPrinter@x86 at llvm@@UAE_NAAVMachineFunction at 3@@Z) > > x86.lib(X86AsmPrinter.obj) : error LNK2001: unresolved external symbol > "public: virtual bool __thiscall > llvm::x86::X86IntelAsmPrinter::doInitialization(class llvm::Module &)" > (?doInitialization at X86IntelAsmPrinter@x86 at llvm@@UAE_NAAVModule at 3@@Z) > > > Aaron Gray wrote: > >> Chris, >> >> Okay, I have done as you have requested. >> >> 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. >> >> Build tested on MS VC2003 and Linux. >> >> Aaron >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev > > >