Here is a mod to X86 that allows GAS to be used with MS Visual C++. I introduces a 'forWindows' variable like 'forCygwin' in th X86SharedAsmPrinter class. This may prompt thurther normalization, on the otherhand it may not :) Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050711/17d090a4/attachment.html> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: X86AsmPrinter.cpp URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050711/17d090a4/attachment.ksh> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: X86AsmPrinter.h URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050711/17d090a4/attachment.h> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: X86ATTAsmPrinter.cpp URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050711/17d090a4/attachment-0001.ksh> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: X86IntelAsmPrinter.cpp URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050711/17d090a4/attachment-0002.ksh>
I have accidently left a '#include <set>' in X86AsmPrinter.h Aaron ----- Original Message ----- From: Aaron Gray To: LLVM Developers Mailing List Sent: Monday, July 11, 2005 7:44 PM Subject: [LLVMdev] Mod for using GAS with MS VC++ Here is a mod to X86 that allows GAS to be used with MS Visual C++. I introduces a 'forWindows' variable like 'forCygwin' in th X86SharedAsmPrinter class. This may prompt thurther normalization, on the otherhand it may not :) Aaron ------------------------------------------------------------------------------ _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050711/c129bc44/attachment.html>
On Mon, 11 Jul 2005, Aaron Gray wrote:> Here is a mod to X86 that allows GAS to be used with MS Visual C++. > > I introduces a 'forWindows' variable like 'forCygwin' in th > X86SharedAsmPrinter class. >A couple of comments: 1. Please send patches instead of full files. The best way to do this is to use CVS like this: 'cvs diff -u' in the directory that you care about. You can also specify specific files to diff as well. 2. Please update to the latest CVS bits. 3. You need to invent a target triple for your new configuration. You'll notice that the forCygwin/forDarwin variables are set based on the target triple of the module... as you coded it, forWindows is only ever set if the t-t is empty. 4. The name forWindows isn't very specific, as there are multiple dev systems available on windows (including cygwin, mingw, masm, nasm, etc). Please use something more specific. 5. I notice that the stuff you are controlling enables/disables the exact same stuff as needed for cygwin. Will this change in the future?> This may prompt thurther normalization, on the otherhand it may not :)Yes, I think it will. :) In particular, instead of a bunch of checks based on the target, what we really want is something like this: ... in the AsmPrinter ctor... if (isDarwin) { TargetUsesFooFeature = true; TargetUsesBarFeature = true; TargetUsesBazFeature = false; } else if (isCygwin) { ... } etc. Then instead of code that looks like this: if (!forCygwin && !forDarwin && !forWindows && I->hasInternalLinkage()) O << "\t.local " << name << "\n"; We would have: if (TargetUsesSymbolsMarkedLocal && I->hasInternalLinkage()) O << "\t.local " << name << "\n"; ... or something. -Chris -- http://nondot.org/sabre/ http://llvm.org/
>> Here is a mod to X86 that allows GAS to be used with MS Visual C++. >> >> I introduces a 'forWindows' variable like 'forCygwin' in th >> X86SharedAsmPrinter class. >> > > A couple of comments: > > 1. Please send patches instead of full files. The best way to do this is > to use CVS like this: 'cvs diff -u' in the directory that you care > about. You can also specify specific files to diff as well.Okay, I will do this in future, our posts crossed so I have not done that for the MASM backend. I will do this in future. If you want me to redo the MASM Printer as diff's I can do so tommorow as it is late now.> 2. Please update to the latest CVS bits.Okay I may have been behind but am still not used to using CVS and how to reintegrate changes that go cross purpose with stuff I already have written but do not want to release yet. So I may have gotten out of sync here. I resync'ed and make the changes for the MASM Printer again earlier, but did not do diff's.> 3. You need to invent a target triple for your new configuration. You'll > notice that the forCygwin/forDarwin variables are set based on the > target triple of the module... as you coded it, forWindows is only > ever set if the t-t is empty.Right, presumably Wndows does not set the TT. Should Windows or MSVC++ have one ? If so how do I go about it. Maybe Jeff should be involved ?> 4. The name forWindows isn't very specific, as there are multiple dev > systems available on windows (including cygwin, mingw, masm, nasm, > etc). Please use something more specific.Maybe it should be MSVC specific then ?> 5. I notice that the stuff you are controlling enables/disables the exact > same stuff as needed for cygwin. Will this change in the future?Same as Cygwin, so MSVC++ build, gas generated code, can be run on gas.>> This may prompt thurther normalization, on the otherhand it may not :) > > Yes, I think it will. :) In particular, instead of a bunch of checks > based on the target, what we really want is something like this: > > ... in the AsmPrinter ctor... > if (isDarwin) { > TargetUsesFooFeature = true; > TargetUsesBarFeature = true; > TargetUsesBazFeature = false; > } else if (isCygwin) { > ... > } > etc. > > Then instead of code that looks like this: > > if (!forCygwin && !forDarwin && !forWindows && I->hasInternalLinkage()) > O << "\t.local " << name << "\n"; > > We would have: > > if (TargetUsesSymbolsMarkedLocal && I->hasInternalLinkage()) > O << "\t.local " << name << "\n"; > > ... or something.Yes that would be much better and more normalized. Aaron