[LLVMdev] Mod for using GAS with MS VC++
    Chris Lattner 
    sabre at nondot.org
       
    Mon Jul 11 16:04:36 PDT 2005
    
    
  
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/
    
    
More information about the llvm-dev
mailing list