| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
| |
reduction stage in IdempotentOperationChecker.
- Renamed IdempotentOperationChecker::isConstant to isConstantOrPseudoConstant to better reflect the function
- Changed IdempotentOperationChecker::PreVisitBinaryOperator to only run 'CanVary' once on undefined assumptions
- Created new PsuedoConstantAnalysis class and added it to AnalysisContext
- Changed IdempotentOperationChecker to exploit the new analysis
- Updated tests with psuedo-constants
- Added check to IdempotentOperationChecker to see if a Decl is const qualified
llvm-svn: 111426
|
|
|
|
|
|
|
|
| |
beginning of a do...while loop. This would cause
the body of the DoStmt to be disconnected from the preceding code.
llvm-svn: 111283
|
|
|
|
|
|
| |
edge can never be taken.
llvm-svn: 111282
|
|
|
|
|
|
| |
CFGBlock in CFGStmtMap::getBlock.
llvm-svn: 110881
|
|
|
|
| |
llvm-svn: 110288
|
|
|
|
|
|
| |
CaseStmts. Fixes <rdar://problem/8268753>.
llvm-svn: 110286
|
|
|
|
|
|
| |
immediate intended use is in the unreachable code analysis.
llvm-svn: 110230
|
|
|
|
|
|
| |
analysis) that doesn't prune CFG edges.
llvm-svn: 110087
|
|
|
|
|
|
|
|
| |
the original
CFG without any edges pruned out because of trivially solvable conditions (e.g., 'if (0)').
llvm-svn: 110085
|
|
|
|
|
|
|
|
| |
is prep for scanf format"
Got errors about ASTContext being undefined with Visual Studio 2010.
llvm-svn: 109491
|
|
|
|
| |
llvm-svn: 109440
|
|
|
|
|
|
|
|
| |
scanf format
string argument type checking.
llvm-svn: 109428
|
|
|
|
|
|
|
| |
engine of the new translation unit. State marshal is there but no real
work is done. End nodes are passed back.
llvm-svn: 109105
|
|
|
|
| |
llvm-svn: 108907
|
|
|
|
| |
llvm-svn: 108906
|
|
|
|
| |
llvm-svn: 108905
|
|
|
|
|
|
|
| |
derived 'PrintfConversionSpecifier' from this class. We will do the same for
'ScanfConversionSpecifier'.
llvm-svn: 108903
|
|
|
|
| |
llvm-svn: 108901
|
|
|
|
|
|
| |
printf checking).
llvm-svn: 108900
|
|
|
|
| |
llvm-svn: 108899
|
|
|
|
|
|
| |
enum for scanf checking.
llvm-svn: 108898
|
|
|
|
|
|
|
| |
analagous enum in analyze_scanf. This is prep for refactoring the logic for handling
ConversionSpecifiers for both scanf and printf.
llvm-svn: 108897
|
|
|
|
|
|
| |
<rdar://problem/8204052>.
llvm-svn: 108742
|
|
|
|
| |
llvm-svn: 108668
|
|
|
|
| |
llvm-svn: 108633
|
|
|
|
| |
llvm-svn: 108621
|
|
|
|
|
|
|
| |
Let AnalysisContext contain a TranslationUnit.
Let CallEnter refer to an AnalysisContext instead of a FunctionDecl.
llvm-svn: 108617
|
|
|
|
| |
llvm-svn: 108542
|
|
|
|
| |
llvm-svn: 108502
|
|
|
|
| |
llvm-svn: 108501
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
includes
handling the parsing of scanf format strings and hooking the checking into Sema.
Most of this checking logic piggybacks on what was already there for checking printf format
strings, but the checking logic has been refactored to support both.
What is left to be done is to support argument type checking in format strings and of course
fix the usual tail of bugs that will follow.
llvm-svn: 108500
|
|
|
|
|
|
|
|
|
| |
types, updating callers of both isFloatingType() and
isRealFloatingType() accordingly. Caught at least one issue where we
allowed one to declare a vector of vectors (!), along with cleaning up
the standard-conversion logic for C++.
llvm-svn: 106595
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Precision toStrings shouldn't print a dot when they have no value.
- Length of char length modifier is now returned correctly.
- Added several fixit tests.
Note: fixit tests are currently broken due to a bug in HighlightRange. Marking as XFAIL for now.
M test/Sema/format-strings-fixit.c
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
llvm-svn: 106275
|
|
|
|
|
|
|
| |
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
llvm-svn: 106245
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Added warning for undefined behavior when using field specifier
- Added warning for undefined behavior when using length modifier
- Fixed warnings for invalid flags
- Added warning for ignored flags
- Added fixits for the above warnings
- Fixed accuracy of detecting several undefined behavior conditions
- Receive normal warnings in addition to security warnings when using %n
- Fix bug where '+' flag would remain on unsigned conversion suggestions
Summary of changes:
- Added expanded tests
- Added/expanded warnings
- Added position info to OptionalAmounts for fixits
- Extracted optional flags to a wrapper class with position info for fixits
- Added several methods to validate a FormatSpecifier by component, each checking for undefined behavior
- Fixed conversion specifier checking to conform to C99 standard
- Added hooks to detect the invalid states in CheckPrintfHandler::HandleFormatSpecifier
Note: warnings involving the ' ' (space) flag are temporarily disabled until whitespace highlighting no longer triggers assertions. I will make a post about this on cfe-dev shortly.
M test/Sema/format-strings.c
M include/clang/Basic/DiagnosticSemaKinds.td
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
M lib/Sema/SemaChecking.cpp
llvm-svn: 106233
|
|
|
|
| |
llvm-svn: 106188
|
|
|
|
|
|
| |
PR 4468.
llvm-svn: 106151
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Added some handling of flags that become invalid when changing the conversion specifier.
- Changed fixit behavior to remove unnecessary length modifiers.
- Separated some tests out and added some comments.
modified:
lib/Analysis/PrintfFormatString.cpp
test/Sema/format-strings-fixit.c
llvm-svn: 105807
|
|
|
|
|
|
|
| |
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
|