| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Update all of the testcases accordingly.
llvm-svn: 101795
|
| |
|
|
|
|
|
|
| |
checking into a single function and use that throughout. Remove some
now unnecessary diagnostics and update tests with now more accurate
diagnostics.
llvm-svn: 101610
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TryStaticImplicitCast (for references, class types, and everything
else, respectively) into a single invocation of
InitializationSequence.
One of the paths (for class types) was the only client of
Sema::TryInitializationByConstructor, which I have eliminated. This
also simplified the interface for much of the cast-checking logic,
eliminating yet more code.
I've kept the representation of C++ functional casts with <> 1
arguments the same, despite the fact that I hate it. That fix will
come soon. To satisfy my paranoia, I've bootstrapped + tested Clang
with these changes.
llvm-svn: 101549
|
| |
|
|
|
|
|
|
| |
both number seen and number expected.
Finishes fixing PR6501.
llvm-svn: 101442
|
| |
|
|
|
|
|
|
| |
of arguments both seen and expected.
Fixes PR6501.
llvm-svn: 101441
|
| |
|
|
|
|
| |
Fixes a spurious warning in LLVM.
llvm-svn: 100595
|
| |
|
|
| |
llvm-svn: 99615
|
| |
|
|
|
|
|
| |
gcc, and the common expectation seems to be that they are unused. If and when
someone cares we can add them back with well documented demantics.
llvm-svn: 99522
|
| |
|
|
|
|
|
|
|
| |
(1) Do not assume the data arguments start after the format string
(2) Do not use the fact that a function is variadic to treat it like a va_list printf function
Fixes PR 6697.
llvm-svn: 99480
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AnalysisBasedWarnings.
This object controls when the warnings are executed, allowing the client code
in Sema to selectively disable warnings as needed.
Centralizing the logic for analysis-based warnings allows us to optimize
when and how they are run.
Along the way, remove the redundant logic for the 'check fall-through' warning
for blocks; now the same logic is used for both blocks and functions.
llvm-svn: 99085
|
| |
|
|
|
|
| |
mostly during conditional expressions.
llvm-svn: 98975
|
| |
|
|
|
|
| |
const char*.
llvm-svn: 98630
|
| |
|
|
|
|
| |
and start simplifying the interfaces in SourceManager that can fail.
llvm-svn: 98594
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
SourceManager's getBuffer() (and similar) operations. This abstract
can be used to force callers to cope with errors in getBuffer(), such
as missing files and changed files. Fix a bunch of callers to use the
new interface.
Add some very basic checks for file consistency (file size,
modification time) into ContentCache::getBuffer(), although these
checks don't help much until we've updated the main callers (e.g.,
SourceManager::getSpelling()).
llvm-svn: 98585
|
| |
|
|
|
|
| |
Patch by mikem!
llvm-svn: 98279
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
which has the label map, switch statement stack, etc. Previously, we
had a single set of maps in Sema (for the function) along with a stack
of block scopes. However, this lead to funky behavior with nested
functions, e.g., in the member functions of local classes.
The explicit-stack approach is far cleaner, and we retain a 1-element
cache so that we're not malloc/free'ing every time we enter a
function. Fixes PR6382.
Also, tweaked the unused-variable warning suppression logic to look at
errors within a given Scope rather than within a given function. The
prior code wasn't looking at the right number-of-errors count when
dealing with blocks, since the block's count would be deallocated
before we got to ActOnPopScope. This approach works with nested
blocks/functions, and gives tighter error recovery.
llvm-svn: 97518
|
| |
|
|
|
|
| |
doing printf format string checking. This is a recent regression.
llvm-svn: 97318
|
| |
|
|
|
|
| |
Along the way, coelesce some of the diagnostics.
llvm-svn: 97297
|
| |
|
|
|
|
|
|
|
| |
index out of
Sema and into analyze_printf::ParseFormatString(). Also use a bitvector to determine
what arguments have been covered (instead of just checking to see if the last argument consumed is the max argument). This is prep. for support positional arguments (an IEEE extension).
llvm-svn: 97248
|
| |
|
|
|
|
| |
the result is integral. Fixes <rdar://problem/7676608>.
llvm-svn: 96970
|
| |
|
|
|
|
| |
to libAnalysis (with only the error reporting in libSema).
llvm-svn: 96893
|
| |
|
|
| |
llvm-svn: 96892
|
| |
|
|
|
|
| |
and into libAnalysis.
llvm-svn: 96872
|
| |
|
|
| |
llvm-svn: 96855
|
| |
|
|
| |
llvm-svn: 96848
|
| |
|
|
|
|
| |
No functionality change.
llvm-svn: 96847
|
| |
|
|
| |
llvm-svn: 96342
|
| |
|
|
|
|
|
|
|
|
| |
analyze_printf::ArgTypeResult.
Implement printf argument type checking for '%s'.
Fixes <rdar://problem/3065808>.
llvm-svn: 96310
|
| |
|
|
|
|
| |
for __builtin_isinf and friends. Part of PR6083.
llvm-svn: 96291
|
| |
|
|
| |
llvm-svn: 95906
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Enhance the printf format string checking when using the format
specifier flags ' ', '0', '+' with the 'p' or 's' conversions (since
they are nonsensical and undefined). This is similar to GCC's
checking.
Also warning when a precision is used with the 'p' conversin
specifier, since it has no meaning.
llvm-svn: 95869
|
| |
|
|
| |
llvm-svn: 95756
|
| |
|
|
| |
llvm-svn: 95487
|
| |
|
|
|
|
|
|
|
|
|
|
| |
follows (as conservatively as possible) gcc's current behavior: attributes
written on return types that don't apply there are applied to the function
instead, etc. Only parse CC attributes as type attributes, not as decl attributes;
don't accepet noreturn as a decl attribute on ValueDecls, either (it still
needs to apply to other decls, like blocks). Consistently consume CC/noreturn
information throughout codegen; enforce this by removing their default values
in CodeGenTypes::getFunctionInfo().
llvm-svn: 95436
|
| |
|
|
|
|
| |
analyze_printf namespace.
llvm-svn: 95324
|
| |
|
|
| |
llvm-svn: 95079
|
| |
|
|
|
|
| |
magnitude clearer.
llvm-svn: 95078
|
| |
|
|
|
|
| |
definition. With that in mind, rename getDefinition to getAnyInitializer (to distinguish it from getInit) and reimplement it in terms of isThisDeclarationADefinition. Update all code to use this new function.
llvm-svn: 94999
|
| |
|
|
| |
llvm-svn: 94994
|
| |
|
|
|
|
|
|
| |
when checking if the format specifier matches the type of the data
argument and the length modifier indicates the data type is 'char' or
'short'.
llvm-svn: 94992
|
| |
|
|
|
|
| |
definitions.
llvm-svn: 94972
|
| |
|
|
|
|
| |
arguments. Thanks to Cristian Draghici for his help with this patch!
llvm-svn: 94864
|
| |
|
|
|
|
|
| |
the field width and precision of a format specifier instead of just
'int'. This matches GCC, and fixes <rdar://problem/6079850>.
llvm-svn: 94856
|
| |
|
|
|
|
|
|
|
| |
checking. It passes all existing tests, and the diagnostics have been
refined to provide better range information (we now highlight
individual format specifiers) and more precise wording in the
diagnostics.
llvm-svn: 94837
|
| |
|
|
|
|
|
|
|
|
| |
specifiers.
In addition, move ParseFormatString() and FormatStringHandler() from
the clang::analyze_printf to the clang namespace. Hopefully this will
resolve some link errors on Linux.
llvm-svn: 94794
|
| |
|
|
|
|
| |
specifiers.
llvm-svn: 94792
|
| |
|
|
| |
llvm-svn: 94787
|
| |
|
|
|
|
| |
exceeds the number of arguments.
llvm-svn: 94785
|
| |
|
|
| |
llvm-svn: 94782
|
| |
|
|
| |
llvm-svn: 94774
|