r197164 - Switch to the new MingW ABI.
Richard Smith
richard at metafoo.co.uk
Thu Dec 12 12:24:12 PST 2013
On Thu, Dec 12, 2013 at 9:31 AM, Reid Kleckner <rnk at google.com> wrote:
> Summarizing a conversation on IRC, I think we can keep this in for now and
> try to improve diagnostics other ways.
>
> MSVC *always* includes the calling convention in its diagnostics, so
> unless we have the smarts to know it's irrelevant, I think we should keep
> it for the time being.
>
I'm not sure what argument you're presenting here. "MSVC diagnoses it this
way" doesn't pass muster for me. It's our general policy to try to print
out the type as the user wrote it. I don't see that this case is an
exception.
> There's a few things we can do:
>
> 1. Thread an ASTContext into TypePrinter, so it knows the default method
> CC. Then it should suppress it, but probably *only* on member function
> pointer types, since it's implied. Anywhere else it might be important.
>
> 2. Strengthen the test patterns to match only __attribute__((thiscall)) if
> you're worried about overmatching qualifiers
>
> 3. Print "void (__thiscall identifier)()" instead of "void identifier()
> __attribute__((thiscall))" to reduce the diagnostic length. That keyword
> only works with -fms-extensions, though, which I believe is off for mingw
> by default.
>
I'd like:
4. Track the type as written (adding AdjustedType nodes as necessary, in
places where they're missing) and teach AdjustedType to print the original
type, not the adjusted one.
> On Thu, Dec 12, 2013 at 9:02 AM, Rafael EspĂndola <
> rafael.espindola at gmail.com> wrote:
>
>> > Added:
>> > cfe/trunk/test/CodeGenCXX/mingw-new-abi.cpp
>> > Modified:
>> > cfe/trunk/docs/ReleaseNotes.rst
>> > cfe/trunk/lib/AST/ItaniumCXXABI.cpp
>> > cfe/trunk/test/CXX/class.access/p6.cpp
>> > cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp
>> > cfe/trunk/test/CXX/expr/expr.const/p3-0x.cpp
>> > cfe/trunk/test/CXX/expr/expr.mptr.oper/p5.cpp
>> > cfe/trunk/test/CXX/expr/expr.mptr.oper/p6-0x.cpp
>> > cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm
>> > cfe/trunk/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp
>> > cfe/trunk/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp
>> >
>> >
>> > These frontend tests really benefit from having precise matches:
>> >
>> > Consider a change like this:
>> >
>> >
>> > -int n = Val<bool, &S::operator int>::value; // expected-error
>> {{conversion
>> > from 'int (S::*)() const' to 'bool' is not allowed in a converted
>> constant
>> > expression}}
>> > +int n = Val<bool, &S::operator int>::value; // expected-error-re
>> > {{conversion from 'int (S::*)() {{.*}}const' to 'bool' is not allowed
>> in a
>> > converted constant expression}}
>> >
>> >
>> > Now there's no testing at all for the qualifiers. Not good.
>> >
>> > They've had stable output across several OS and hardware configurations
>> and
>> > major versions for years.
>> >
>> > So if an ABI point release switch on MinGW suddenly caused dozens of
>> stable
>> > tests to break, I'd say that's a problem with the patch, rather than a
>> case
>> > for editing all the tests.
>> >
>> > It's best to revert this until the pretty printer is fixed to display
>> > calling conventions only if they differ from the platform default.
>> >
>>
>> I am happy to revert the test changes and add a -triple instead for now.
>>
>> I will just let Reid comment on it since he suggested relaxing the tests.
>>
>> Cheers,
>> Rafael
>>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131212/e9590953/attachment.html>
More information about the cfe-commits
mailing list