|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| 
| | diagnosing this code as an error when it should, so I've filed
http://llvm.org/bugs/show_bug.cgi?id=7325. 
llvm-svn: 105683 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | - Refactored LengthModifier to be a class.
- Added toString methods in all member classes of FormatSpecifier.
- FixIt suggestions keep user specified flags unless incorrect.
Limitations:
- The suggestions are not conversion specifier sensitive. For example, if we have a 'pad with zeroes' flag, and the correction is a string conversion specifier, we do not remove the flag. Clang will warn us on the next compilation.
A    test/Sema/format-strings-fixit.c
M    include/clang/Analysis/Analyses/PrintfFormatString.h
M    lib/Analysis/PrintfFormatString.cpp
M    lib/Sema/SemaChecking.cpp
llvm-svn: 105680 | 
| | 
| 
| 
| 
| 
| | scattered throughout the project Makefiles.
llvm-svn: 105638 | 
| | 
| 
| 
| 
| 
| | - This eliminates most dependencies on how Clang is installed relative to LLVM.
llvm-svn: 105637 | 
| | 
| 
| 
| | llvm-svn: 105452 | 
| | 
| 
| 
| | llvm-svn: 105384 | 
| | 
| 
| 
| 
| 
| | reference. Patch by Jordy.
llvm-svn: 105383 | 
| | 
| 
| 
| 
| 
| 
| 
| | The macros required for DeclNodes use have changed to match the use of
StmtNodes. The FooFirst enumerator constants have been named firstFoo
to match usage elsewhere.
llvm-svn: 105165 | 
| | 
| 
| 
| 
| 
| 
| 
| | expressions
within the increment code of a for loop.
llvm-svn: 104375 | 
| | 
| 
| 
| 
| 
| 
| 
| | @synchronized statement is empty.
Fixes <rdar://problem/7979430>.
llvm-svn: 103717 | 
| | 
| 
| 
| | llvm-svn: 103077 | 
| | 
| 
| 
| 
| 
| | more resilient to bad code.
llvm-svn: 102793 | 
| | 
| 
| 
| | llvm-svn: 102576 | 
| | 
| 
| 
| | llvm-svn: 101236 | 
| | 
| 
| 
| | llvm-svn: 101127 | 
| | 
| 
| 
| 
| 
| | lvalue context.  Fixes <rdar://problem/7813989>.
llvm-svn: 100966 | 
| | 
| 
| 
| 
| 
| | be treated as indicating an lvalue.
llvm-svn: 100965 | 
| | 
| 
| 
| | llvm-svn: 100964 | 
| | 
| 
| 
| 
| 
| 
| 
| | This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.
llvm-svn: 99920 | 
| | 
| 
| 
| 
| 
| 
| | This patch moves some methods from QualType to Type and changes the users to
use -> instead of .
llvm-svn: 99805 | 
| | 
| 
| 
| | llvm-svn: 99479 | 
| | 
| 
| 
| 
| 
| 
| | are called (transitively) by regular functions/blocks within a
translation untion.
llvm-svn: 99233 | 
| | 
| 
| 
| 
| | Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)
llvm-svn: 98399 | 
| | 
| 
| 
| 
| 
| | by a block, also look at the contained blocks.
llvm-svn: 98111 | 
| | 
| 
| 
| | llvm-svn: 97654 | 
| | 
| 
| 
| 
| 
| 
| | If an initializer in a DeclStmt references the declared variable, that
extends the liveness of that variable.
llvm-svn: 97624 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | After discussion with Zhongxing, don't force the initializer of DeclStmts to be
block-level expressions.
This led to some interesting fallout:
[UninitializedValues]
Always visit the initializer of DeclStmts (do not assume they are block-level expressions).
[BasicStore]
With initializers of DeclStmts no longer block-level expressions, this causes self-referencing initializers (e.g. 'int x = x') to no longer cause the initialized variable to be live before the DeclStmt.  While this is correct, it caused BasicStore::RemoveDeadBindings() to prune off the values of these variables from the initial store (where they are set to uninitialized).  The fix is to back-port some (and only some) of the lazy-binding logic from RegionStore to
BasicStore.  Now the default values of local variables are determined lazily as opposed
to explicitly initialized.
llvm-svn: 97591 | 
| | 
| 
| 
| 
| 
| 
| | We may query their liveness because they are added to store when passing
argument values.
llvm-svn: 97562 | 
| | 
| 
| 
| 
| 
| | Fixes <rdar://problem/7700339>.
llvm-svn: 97482 | 
| | 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| | analysis needs this.
llvm-svn: 97014 | 
| | 
| 
| 
| | llvm-svn: 97005 | 
| | 
| 
| 
| 
| 
| | to libAnalysis (with only the error reporting in libSema).
llvm-svn: 96893 | 
| | 
| 
| 
| 
| 
| | and into libAnalysis.
llvm-svn: 96872 | 
| | 
| 
| 
| 
| 
| | not be guaranteed.
llvm-svn: 96782 | 
| | 
| 
| 
| | llvm-svn: 96772 | 
| | 
| 
| 
| | llvm-svn: 96471 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | analyze_printf::ArgTypeResult.
Implement printf argument type checking for '%s'.
Fixes <rdar://problem/3065808>.
llvm-svn: 96310 | 
| | 
| 
| 
| | llvm-svn: 95621 | 
| | 
| 
| 
| 
| 
| | referenced by blocks.
llvm-svn: 95459 | 
| | 
| 
| 
| 
| 
| | analyze_printf namespace.
llvm-svn: 95324 | 
| | 
| 
| 
| | llvm-svn: 95026 | 
| | 
| 
| 
| | llvm-svn: 94894 | 
| | 
| 
| 
| 
| 
| | <rdar://problem/6931734>.
llvm-svn: 94867 | 
| | 
| 
| 
| | llvm-svn: 94852 | 
| | 
| 
| 
| 
| 
| | that returns the expected type of the matching data argument.  It isn't complete, but should handle several of the important cases.
llvm-svn: 94851 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | - Add ConversionSpecifier::consumesDataArgument() as a helper method
  to determine if a conversion specifier requires a matching argument.
- Add support for glibc-specific '%m' conversion
- Add an extra callback to HandleNull() for locations within the
  format specifier that have a null character
llvm-svn: 94834 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 |