Commit Graph

14 Commits

Author SHA1 Message Date
Richard Trieu 553b2b2e5d Modify how the -verify flag works. Currently, the verification string and
diagnostic message are compared.  If either is a substring of the other, then
no error is given.  This gives rise to an unexpected case:

  // expect-error{{candidate function has different number of parameters}}

will match the following error messages from Clang:

  candidate function has different number of parameters (expected 1 but has 2)
  candidate function has different number of parameters

It will also match these other error messages:

  candidate function
  function has different number of parameters
  number of parameters

This patch will change so that the verification string must be a substring of
the diagnostic message before accepting.  Also, all the failing tests from this
change have been corrected.  Some stats from this cleanup:

87 - removed extra spaces around verification strings
70 - wording updates to diagnostics
40 - extra leading or trailing characters (typos, unmatched parens or quotes)
35 - diagnostic level was included (error:, warning:, or note:)
18 - flag name put in the warning (-Wprotocol)

llvm-svn: 146619
2011-12-15 00:38:15 +00:00
Anton Yartsev 3f8f2886c1 comparison of AltiVec vectors now gives bool result (fix for 7533)
llvm-svn: 119678
2010-11-18 03:19:30 +00:00
John Thompson 9a587aaaa9 Add more error checking to attribute vecreturn
llvm-svn: 114251
2010-09-18 01:12:07 +00:00
John Thompson cdb847ba16 Added vecreturn attribute parsing.
llvm-svn: 110609
2010-08-09 21:53:52 +00:00
John Thompson 781ad17ba9 Fix vector literal/cast confusion - bug 6895.
llvm-svn: 107347
2010-06-30 22:55:51 +00:00
Chris Lattner 37141f4fb4 improve altivec vector bool/pixel support, patch by Anton Yartsev
with several tweaks by me.

llvm-svn: 106619
2010-06-23 06:00:24 +00:00
Chris Lattner b596ac718e reapply john's patch, he broke mainline again by changing the test.
llvm-svn: 101871
2010-04-20 05:19:10 +00:00
Chris Lattner 3da9a2a3a9 revert r101863, whcih is causing Sema/altivec-init.c to fail on a ton
of buildbots with:

error: 'error' diagnostics expected but not seen: 
  Line 9: too few elements in vector initialization (expected 8 elements, have 2)
1 warning and 1 error generated.

llvm-svn: 101864
2010-04-20 04:31:55 +00:00
John Thompson f351b2c2b4 Altivec vector literal initializer count mismatch error removed.
llvm-svn: 101863
2010-04-20 03:58:33 +00:00
Chris Lattner dd6697b4fa improve altivec c++ support by adding casts, patch by
Anton Yartsev!

llvm-svn: 101281
2010-04-14 20:35:39 +00:00
Chris Lattner dad4062b4d implement altivec.h and a bunch of support code, patch by Anton Yartsev!
llvm-svn: 101215
2010-04-14 03:54:58 +00:00
Douglas Gregor c68e140657 Improve diagnostics when we fail to convert from a source type to a
destination type for initialization, assignment, parameter-passing,
etc. The main issue fixed here is that we used rather confusing
wording for diagnostics such as

t.c:2:9: warning: initializing 'char const [2]' discards qualifiers,
      expected 'char *' [-pedantic]
  char *name = __func__;
        ^      ~~~~~~~~

We're not initializing a 'char const [2]', we're initializing a 'char
*' with an expression of type 'char const [2]'. Similar problems
existed for other diagnostics in this area, so I've normalized them all
with more precise descriptive text to say what we're
initializing/converting/assigning/etc. from and to. The warning for
the code above is now:

t.c:2:9: warning: initializing 'char *' from an expression of type
      'char const [2]' discards qualifiers [-pedantic]
  char *name = __func__;
        ^      ~~~~~~~~

Fixes <rdar://problem/7447179>.

llvm-svn: 100832
2010-04-09 00:35:39 +00:00
Chris Lattner 0a65574ccb implement support for -Wno-deprecated, PR6534. While
I'm in there, change the altivec diagnostics to use 'double' 
instead of "double" for consistency.

llvm-svn: 97919
2010-03-07 18:50:21 +00:00
John Thompson 2233460de6 First stage of adding AltiVec support
llvm-svn: 95335
2010-02-05 00:12:22 +00:00