On Thu, Sep 02, 2010 at 01:01:00PM -0700, Douglas Gregor wrote:
> > Reverting rev 112791 - apparently -fborland-extensions is on all the time?!
> 
> This is a "gotcha" with hasFlag. Fix suggestion is below...
> 
> > Modified: cfe/trunk/lib/Driver/Tools.cpp
> > URL: 
> > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=112797&r1=112796&r2=112797&view=diff
> > ==============================================================================
> > --- cfe/trunk/lib/Driver/Tools.cpp (original)
> > +++ cfe/trunk/lib/Driver/Tools.cpp Wed Sep  1 21:18:55 2010
> > @@ -1215,11 +1215,6 @@
> >                    getToolChain().getTriple().getOS() == 
> > llvm::Triple::Win32))
> >     CmdArgs.push_back("-fms-extensions");
> > 
> > -  // -fborland-extensions=0 is default.
> > -  if (Args.hasFlag(options::OPT_fborland_extensions,
> > -              options::OPT_fno_borland_extensions))
> > -    CmdArgs.push_back("-fborland-extensions");
> 
> hasFlag has a third argument, which is a boolean that specifies the result of 
> hasFlag if neither of the options is specified. It defaults to "true", which 
> explains why -fborland-extensions was on all the time.
> 
> I don't know if you'll want to add a new triple kind for Borland (e.g., so we 
> can have a x86_64-borland-pc target triple), but this argument would be the 
> place to tie Borland extensions to the triple. My guess is that, if you're 
> going to implement the Borland C++ ABI, you'll want a triple to signal it.

Many thanks for your explanation!  
I didn't really want a new tripple for Borland.  Hoping to just adopt whatever
C++ ABI clang will default to.  There could be some areas where we might run
into problems in the future, but I'll bring those up in cfe-dev.

> When you re-commit, could you intent the second line of the hasFlag call so 
> that the two "options::"'s line up?

Huh.  They're lining up for me - let me check for tabs.  Yup - a tab
slipped in.  I've since set up a vim project for clang so hopefully that
won't happen again.  Will recheck my patches for tabs too.

-Dawn

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to