Commit Graph

9 Commits

Author SHA1 Message Date
Dario Domizioli 6260cceec7 [TEST] Improve tests for #pragma clang optimize off/on
Added coverage for:
* More than one "off region" in the same file
* An "off region" falling off the end of an included file

llvm-svn: 214086
2014-07-28 14:33:17 +00:00
Alp Toker 9c5ae47c94 Ignore test Inputs globally and remove redundant lit.local.cfg files
By adding a default config.excludes pattern we can avoid individual
suppressions in subdirectories.

This matches LLVM's lit.cfg which also excludes a few other common non-test
filenames for consistency.

llvm-svn: 194814
2013-11-15 13:37:49 +00:00
Eli Friedman 5ef2175866 Make -Wunused warning rules more consistent.
This patch does a few different things.

This patch improves unused var diags for const vars: we no longer
unconditionally suppress diagnostics for const vars, instead only suppressing
the diagnostic when the declaration appears to be useful.

This patch also makes us more consistently use whether a variable/function
is declared in the main file to suppress diagnostics where appropriate.

Fixes <rdar://problem/14907887>.

llvm-svn: 190382
2013-09-10 03:05:56 +00:00
Richard Smith ab2436ee83 Suppress the c++11 -Wdeprecated warning for 'register' if it is expanded from a
macro defined in a system header. glibc uses it in macros, apparently.

llvm-svn: 184005
2013-06-14 21:05:24 +00:00
Matt Beaumont-Gay e1368a107a Suppress -Wunused-variable for variables declared in headers, which may in
fact be defined and used in another TU.

Reshuffle some test cases because we suppress -Wunused-variable after we've
emitted an error.

This fixes PR15558.

llvm-svn: 179138
2013-04-10 00:47:10 +00:00
Nick Lewycky 96ed7b62f9 Don't warn on use of default allocator with an over-aligned type when the
allocator is given the pointer to allocate into.

llvm-svn: 149760
2012-02-04 03:30:14 +00:00
Nick Lewycky 411fc65b45 Add a new warning, -Wover-aligned, which detects attempts to use the default
allocator to construct an object which declares more alignment than the default
allocator actually provides. Fixes PR9527!

llvm-svn: 148857
2012-01-24 21:15:41 +00:00
Matt Beaumont-Gay 9d570c438c Suppress -Warray-bounds in certain cases involving macros from system headers.
The motivation here is a "clever" implementation of strncmp(), which peels the first few comparisons via chained conditional expressions which ensure that the input arrays are known at compile time to be sufficiently large.

llvm-svn: 146430
2011-12-12 22:35:02 +00:00
Douglas Gregor f40863caff Work around an annoying, non-standard optimization in the glibc
headers, where malloc (and many other libc functions) are declared
with empty throw specifications, e.g.,  

  extern void *malloc (__SIZE_TYPE__ __size) throw () __attribute__
  ((__malloc__)) ;

The C++ standard doesn't seem to allow this, and redeclaring malloc as
the standard permits (as follows) resulted in Clang (rightfully!)
complaining about mis-matched exception specifications.

  void *malloc(size_t size);

We work around this by silently propagating an empty throw
specification "throw()" from a function with C linkage declared in a
system header to a redeclaration that has no throw specifier.

Ick.

llvm-svn: 95969
2010-02-12 07:32:17 +00:00