Commit Graph

948 Commits

Author SHA1 Message Date
Nate Begeman 0359e12208 OpenCL 1.0 Support, patch 1/N: upper case swizzle operator and hex element index.
llvm-svn: 74202
2009-06-25 21:06:09 +00:00
Douglas Gregor 6fa36b4246 Add -fblocks
llvm-svn: 73804
2009-06-20 00:29:46 +00:00
Douglas Gregor c9c02ed8f4 Keep track of when declarations are "used" according to C and
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.

This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.

llvm-svn: 73797
2009-06-19 23:52:42 +00:00
Fariborz Jahanian 3fd7310d70 Use QualType to represent block's implicit return type as
to not lose its 'const/volatile' qualifier.

llvm-svn: 73795
2009-06-19 23:37:08 +00:00
Eli Friedman 334046a134 PR4351: Add constant evaluation for constructs like "foo == NULL", where
foo has a constant address.

llvm-svn: 73321
2009-06-14 02:17:33 +00:00
Eli Friedman 9782caa369 Allow initializing a vector with a vector in addition to allowing a list
of the elements.  Issue reported on cfe-dev by Mattias Holm.

llvm-svn: 73292
2009-06-13 10:38:46 +00:00
Eli Friedman 9e81b02ec5 Don't allow defining a block with a non-prototype type. Remove a
hack which introduces some strange inconsistencies in compatibility 
for block pointers.

Note that unlike an earlier revision proposed on cfe-commits, this patch 
still allows declaring block pointers without a prototype.

llvm-svn: 73041
2009-06-08 04:24:21 +00:00
Eli Friedman 5f75ff84b7 Test changes to account for removed builtins.
llvm-svn: 73004
2009-06-06 18:15:42 +00:00
Eli Friedman 4a4fefcd29 PR4326: Handle constant evaluation for void* pointer subtraction
correctly.

llvm-svn: 72886
2009-06-04 20:04:03 +00:00
Eli Friedman 3d2c8fd3a6 Back out r72764; I should have looked more carefully before committing
this.  The correct replacement for "Y" and "Yt" is "x".

llvm-svn: 72765
2009-06-03 10:41:42 +00:00
Eli Friedman ffc8748faa PR3678: Add support for "Yt" asm register constraint.
llvm-svn: 72764
2009-06-03 10:33:05 +00:00
Eli Friedman 8246b6f889 PR4290: Handle vfprintf in a way that doesn't give any diagnostics for
valid declarations and doesn't give an error for autoconf-style invalid 
redeclarations.  This isn't quite ideal, but I don't see any other way 
easy way to handle it.  (The only thing I can think of that's reasonably 
general is adding a new builtin type FILETy which is only compatible 
with a type equivalent to FILE, and that seems like overkill.)

llvm-svn: 72760
2009-06-03 09:54:50 +00:00
Eli Friedman 9baa191f31 PR4142: Add %m format string specifier.
llvm-svn: 72726
2009-06-02 08:36:19 +00:00
Eli Friedman fcbf7d2baf PR4287: allow a variadic prototype to make a subsequent K&R style
definition variadic.  I'm not completely sure it's legal, but the 
standard can be interpreted as making it legal, and gcc seems to think 
it's legal, so I didn't add an extension warning.

llvm-svn: 72689
2009-06-01 09:24:59 +00:00
Chris Lattner 6e127a6d86 Downgrade an error about "return in a no-return function" from being
an error to being a warning that defaults to error.  If you want this to
be a warning, you have to explicitly pass -Winvalid-noreturn to clang to
map it back to a warning.

llvm-svn: 72669
2009-05-31 19:32:13 +00:00
Eli Friedman 42a8465518 Fix for PR4285: allow intializing a const wchar_t array with a wide
string.

llvm-svn: 72663
2009-05-31 10:54:53 +00:00
Eli Friedman bd32745978 Make sure we don't give the wrong warning, and make sure not to set
hadError (suppressing future diagnostics) if we didn't print an 
error.

llvm-svn: 72588
2009-05-29 20:20:05 +00:00
Eli Friedman 893abe482d Revert r72575, which isn't really right, and fix up other code to
handle the construct in question correctly.

llvm-svn: 72581
2009-05-29 18:22:49 +00:00
Mike Stump fc30bf9b16 Avoid dumping during semantic analysis when checking array types when
a vla is used.

llvm-svn: 72575
2009-05-29 16:34:15 +00:00
Eli Friedman 259109f9df restrict is not a keyword in gnu89 mode. Change TokenKinds.def to
reflect that.

llvm-svn: 72500
2009-05-27 22:48:34 +00:00
Eli Friedman 7ab09572c6 Extend getPreferredTypeAlign to handle _Complex double and long long
correctly.

llvm-svn: 72401
2009-05-25 21:27:19 +00:00
Chris Lattner ae5342094a merge two tests.
llvm-svn: 72392
2009-05-25 18:20:11 +00:00
Chris Lattner c7516835c3 reword a warning for clarity
llvm-svn: 72391
2009-05-25 18:18:56 +00:00
Argyrios Kyrtzidis c996521508 Add -fblocks for the test.
llvm-svn: 72280
2009-05-22 21:10:04 +00:00
Argyrios Kyrtzidis f5cc7ac4d5 Parse typeof-specifier the same way as sizeof/alignof are parsed.
-Makes typeof consistent with sizeof/alignof
-Fixes a bug when '>' is in a typeof expression, inside a template type param:
  A<typeof(x>1)> a;

llvm-svn: 72255
2009-05-22 10:22:18 +00:00
Fariborz Jahanian cd1a88da02 Check on null arguments in the presense of nonnull attribute.
llvm-svn: 72219
2009-05-21 18:48:51 +00:00
Fariborz Jahanian 960910a159 Patch finishes off application of printf attribute on blocks.
llvm-svn: 72111
2009-05-19 17:08:59 +00:00
Eli Friedman 45966b4671 Remove the -arch option from clang-cc: for all practical purposes, it's
redundant with -triple.

llvm-svn: 72108
2009-05-19 11:12:40 +00:00
Eli Friedman e2cad65015 Add stricter checking for va_arg.
llvm-svn: 71942
2009-05-16 12:46:54 +00:00
Eli Friedman 54135838e2 PR2044: reject declarations of functions returning variably modified
types.

llvm-svn: 71941
2009-05-16 12:15:55 +00:00
Eli Friedman 0b4af8f755 PR3009: Get rid of bogus warning for scalar compound literals.
This patch isn't quite ideal in that it eliminates the warning for 
constructs like "int a = {1};", where the braces are in fact redundant.  
However, that would have required a bunch of refactoring, and it's 
much less likely to cause confusion compared to redundant nested braces.

llvm-svn: 71939
2009-05-16 11:45:48 +00:00
Fariborz Jahanian 6802ed9968 improved on diagnosing misplacement of sentinel attributes.
No change in functionality.

llvm-svn: 71894
2009-05-15 21:18:04 +00:00
Fariborz Jahanian 5e15186c9a added -fblocks to the test.
llvm-svn: 71890
2009-05-15 20:49:33 +00:00
Fariborz Jahanian 0aa5c4565d This patch finishes off the sentinel attribute handling for
blocks and function pointers.

llvm-svn: 71888
2009-05-15 20:33:25 +00:00
Fariborz Jahanian 6607b21156 Adds recognition of sentinel attribute on block declarations.
llvm-svn: 71788
2009-05-14 20:53:39 +00:00
Fariborz Jahanian 4a528035fd Diagnose missing sentinel argument on a funciton call
with sentinel attribute.

llvm-svn: 71778
2009-05-14 18:00:00 +00:00
Daniel Dunbar 0aef72c697 Add a test case to showcase a difference in #pragma pack handling
compared to gcc. This is worrisome, but I believe we are doing the
"correct" thing, and if I recall correctly I previously verified this
versus MSVC.

llvm-svn: 71723
2009-05-13 21:34:08 +00:00
Ted Kremenek 4554f9b134 Fix <rdar://problem/6880975> [format string] Assertion failed: (Arg < NumArgs && "Arg access out of range!").
For format string checking, only check the type of the format
specifier for non-vararg functions.

llvm-svn: 71672
2009-05-13 16:06:05 +00:00
Chris Lattner b70f3de625 Fix rdar://6880951 by rejecting vectors of vectors.
It seems dubious to me that isIntegerType() returns true for
vectors of integers, but not complex integers.  This should 
probably be rethought, I'll file a bugzilla.

llvm-svn: 71640
2009-05-13 05:13:44 +00:00
Chris Lattner df24298b40 reject use of the GNU _Decimal32 extension with a diagnostic, not an abort.
rdar://6880104

llvm-svn: 71639
2009-05-13 05:02:08 +00:00
Chris Lattner e2df3f9fe5 Fix rdar://6880874 - [sema] crash on array types with different index sizes
llvm-svn: 71634
2009-05-13 04:12:56 +00:00
Chris Lattner 851eb927d7 Fix rdar://6881069, a crash on a form of vector_size that we
don't support.  While it would be nice to support this eventually,
this form is not common at all (just seen in gcc testsuite) and
it might be better to model vector_size as a type attribute anyway.
For now just emit a nice error on it.

llvm-svn: 71633
2009-05-13 04:00:12 +00:00
Chris Lattner d98e7cf7c1 improve the diagnostic for uses of the GCC "global variable in a register" extension.
This implements rdar://6880449 - improve diagnostic for usage of "global register variable" GCC extension

llvm-svn: 71599
2009-05-12 21:44:00 +00:00
Chris Lattner 5b9241b2a6 Fix the atomics sema code to convert operands to the argument types
of the underlying _N builtin, not the the type of the pointee of the
actual type.  This ensures that atomics involving pointers end up
using the correct integer type when they are resolved, avoiding
aborts in codegen.

llvm-svn: 71218
2009-05-08 15:36:58 +00:00
Chris Lattner dc04654697 reimplement __sync_* builtins to be variadic and to follow the same
semantic rules that gcc and icc use.  This implements the variadic
and concrete versions as builtins and has sema do the 
disambiguation.  There are probably a bunch of details to finish up
but this seems like a large monotonic step forward :)

llvm-svn: 71212
2009-05-08 06:58:22 +00:00
Mike Stump 5e16a0d9e7 Allow qualifiers on blocks. Radar 6441502
llvm-svn: 71183
2009-05-07 21:56:17 +00:00
Mike Stump f70bcf7d1a Tighten up relationals with blocks and ints. Radar 6441502
llvm-svn: 71171
2009-05-07 18:43:07 +00:00
Mike Stump 1b821b4fc5 Improve semantic checking for blocks. Radar 6441502
llvm-svn: 71145
2009-05-07 03:14:14 +00:00
Daniel Dunbar 4dbaaa6f43 Improve handling of (X86) target features.
- This is a WIP...

 - This adds -march= handling to the driver, and fixes the defaulting
   of -mcpu on Darwin (which was using the wrong test).

Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as
 -target-feature [+-]name

In clang-cc, communicate with the (clang) target to discover the legal
features of a target, and the features which are enabled based on
-mcpu. This is currently hardcoded just enough to not be a feature
regression, we need to get this information from the backend's
TableGen information somehow.

This is used to construct the full list of features which are being
used, which is in turn used to initialize the predefines.

llvm-svn: 71061
2009-05-06 03:16:41 +00:00
Eli Friedman b8c4fd8cfd PR2524: downgrade taking address of expression of type 'void' to an
extension warning.

llvm-svn: 70805
2009-05-03 22:36:05 +00:00