summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* For printf format string checking, move the tracking of the data argument ↵Ted Kremenek2010-02-261-13/+21
| | | | | | | | | 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
* Always add CallExpr as block-level expression. Inline-based interproceduralZhongxing Xu2010-02-241-1/+1
| | | | | | analysis needs this. llvm-svn: 97014
* Add support for '%C' and '%S' printf conversion specifiers.Ted Kremenek2010-02-241-22/+35
| | | | llvm-svn: 97005
* Move the rest of the unreachable code analysis from libSemaTed Kremenek2010-02-231-9/+235
| | | | | | to libAnalysis (with only the error reporting in libSema). llvm-svn: 96893
* Start moving some of the logic for the unreachable code analysis out of libSemaTed Kremenek2010-02-232-0/+53
| | | | | | and into libAnalysis. llvm-svn: 96872
* Revert "Simplify code: Succ is guaranteed to be not NULL.", which turns out toDaniel Dunbar2010-02-221-28/+28
| | | | | | not be guaranteed. llvm-svn: 96782
* Simplify code: Succ is guaranteed to be not NULL.Zhongxing Xu2010-02-221-28/+28
| | | | llvm-svn: 96772
* Add a utility method.Zhongxing Xu2010-02-171-0/+12
| | | | llvm-svn: 96471
* Refactor the logic for printf argument type-checking into ↵Ted Kremenek2010-02-161-32/+143
| | | | | | | | | | analyze_printf::ArgTypeResult. Implement printf argument type checking for '%s'. Fixes <rdar://problem/3065808>. llvm-svn: 96310
* Convert tabs to spaces.Ted Kremenek2010-02-091-5/+5
| | | | llvm-svn: 95621
* Teach RegionStore::InvalidateRegions() to also invalidate static variables ↵Ted Kremenek2010-02-061-2/+20
| | | | | | referenced by blocks. llvm-svn: 95459
* Move ParseFormatString() and FormatStringHandler back into the ↵Ted Kremenek2010-02-041-2/+4
| | | | | | analyze_printf namespace. llvm-svn: 95324
* Add format string type checking support for 'long double'.Ted Kremenek2010-02-011-1/+4
| | | | llvm-svn: 95026
* Recognize 'q' as a format length modifier (from BSD).Daniel Dunbar2010-01-301-0/+1
| | | | llvm-svn: 94894
* Add format string checking of 'double' arguments. Fixes ↵Ted Kremenek2010-01-301-0/+3
| | | | | | <rdar://problem/6931734>. llvm-svn: 94867
* Fix spacing.Ted Kremenek2010-01-291-1/+1
| | | | llvm-svn: 94852
* Per a suggestion from Cristian Draghici, add a method to FormatSpecifier ↵Ted Kremenek2010-01-291-0/+53
| | | | | | 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
* Enhancements to the alternate (WIP) format string checking:Ted Kremenek2010-01-291-2/+10
| | | | | | | | | | - 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
* Alternate format string checking: issue warnings for incomplete format ↵Ted Kremenek2010-01-291-13/+11
| | | | | | | | | | 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
* Alternate format string checking: issue a warning for invalid conversion ↵Ted Kremenek2010-01-291-13/+18
| | | | | | specifiers. llvm-svn: 94792
* Yet another attempt to make the Linux buildbots happy. Apparently there are ↵Ted Kremenek2010-01-291-4/+7
| | | | | | differences on how nested namespaces are handled... llvm-svn: 94790
* Move definition of FormatStringHandler::~FormatStringHandler() within ↵Ted Kremenek2010-01-291-1/+1
| | | | | | namespace directives. Hopefully this will make the Linux buildbots happy. llvm-svn: 94784
* Add precision/field width checking to AlternateCheckPrintfString().Ted Kremenek2010-01-291-4/+6
| | | | llvm-svn: 94774
* Fix off-by-one error in ParseFormatSpecifier() when reporting the location ↵Ted Kremenek2010-01-281-3/+2
| | | | | | of a null character. llvm-svn: 94762
* Add position of conversion specifier character to 'ConversionSpecifier'.Ted Kremenek2010-01-281-26/+31
| | | | llvm-svn: 94739
* Rename namespace clang::printf to clang::analyze_printf to avoid problems ↵Ted Kremenek2010-01-281-4/+4
| | | | | | where the reference to 'printf' is ambiguous. llvm-svn: 94733
* Allow HandleFormatSpecifier() to indicate that no more processing of the ↵Ted Kremenek2010-01-281-1/+2
| | | | | | format string is desired. llvm-svn: 94715
* Add '@' conversion specifier.Ted Kremenek2010-01-281-4/+5
| | | | llvm-svn: 94713
* Remove invalid conversion specifiers from format string checking.Ted Kremenek2010-01-281-5/+0
| | | | llvm-svn: 94707
* Add a few more conversion specifiers to ParseFormatSpecifier (these appear ↵Ted Kremenek2010-01-281-20/+27
| | | | | | in SemaChecking). llvm-svn: 94704
* Add skeleton for a more structured way to analyzing pring formatTed Kremenek2010-01-272-0/+240
| | | | | | | | | | | | | | | | | | | | | | strings than what we currently have in Sema. This is both an experiment and a WIP. The idea is simple: parse the format string incrementally, constructing a well-structure representation of each format specifier. Each format specifier is then handed back one-by-one to a client via a callback. Malformed format strings are also handled with callbacks. The idea is to separate the parsing of the format string from the emission of diagnostics. Currently what we have in Sema for handling format strings is a mongrel of both that is hard to follow and difficult to modify (I can apply this label since I'm the original author of that code). This is in libAnalysis as it is reasonable generic and can potentially be used both by libSema and libChecker. Comments welcome. llvm-svn: 94702
* Split libAnalysis into two libraries: libAnalysis and libChecker.Ted Kremenek2010-01-2566-22594/+4
| | | | | | | | | | | | | | | | | | | | | | | | | (1) libAnalysis is a generic analysis library that can be used by Sema. It defines the CFG, basic dataflow analysis primitives, and inexpensive flow-sensitive analyses (e.g. LiveVariables). (2) libChecker contains the guts of the static analyzer, incuding the path-sensitive analysis engine and domain-specific checks. Now any clients that want to use the frontend to build their own tools don't need to link in the entire static analyzer. This change exposes various obvious cleanups that can be made to the layout of files and headers in libChecker. More changes pending. :) This change also exposed a layering violation between AnalysisContext and MemRegion. BlockInvocationContext shouldn't explicitly know about BlockDataRegions. For now I've removed the BlockDataRegion* from BlockInvocationContext (removing context-sensitivity; although this wasn't used yet). We need to have a better way to extend BlockInvocationContext (and any LocationContext) to add context-sensitivty. llvm-svn: 94406
* -fno-rtti is now the default.Chris Lattner2010-01-241-1/+0
| | | | llvm-svn: 94379
* Process cast according to the cast kind. Prepare for more specific cast Zhongxing Xu2010-01-221-17/+47
| | | | | | handling (for C++). No functionality change for now. llvm-svn: 94153
* Improve unreachable code warnings with respect to dead binary andMike Stump2010-01-211-1/+2
| | | | | | unary operators. llvm-svn: 94084
* Speed up compilation by avoiding generating exceptional edges fromMike Stump2010-01-212-10/+36
| | | | | | | | | | | | | CallExprs as those edges help cause a n^2 explosion in the number of destructor calls. Other consumers, such as static analysis, that would like to have more a more complete CFG can select the inclusion of those edges as CFG build time. This also fixes up the two compilation users of CFGs to be tolerant of having or not having those edges. All catch code is assumed be to live if we didn't generate the exceptional edges for CallExprs. llvm-svn: 94074
* Add infrastructure to add base initializers and member initializers toMike Stump2010-01-212-5/+13
| | | | | | the CFG. WIP. llvm-svn: 94062
* Correct comments.Zhongxing Xu2010-01-201-1/+1
| | | | llvm-svn: 93999
* Wire up the EH context for the catch clauses to the outer EH context. WIP.Mike Stump2010-01-201-9/+9
| | | | llvm-svn: 93963
* Add an exceptional edge from the try terminated block to the outer EHMike Stump2010-01-201-2/+16
| | | | | | | | context (try or the Exit block) when there isn't a catch (...). Improve CFG printing for catch (...). llvm-svn: 93962
* Add CFG support for the start and end of scopes and infrastructure forMike Stump2010-01-191-18/+76
| | | | | | implicit destructor calls. WIP. llvm-svn: 93922
* Tighten code and rework indentation of some if() branches (for readability). ↵Ted Kremenek2010-01-191-16/+15
| | | | | | No functionality change. llvm-svn: 93904
* Remove extra space in uses of 'assert()'.Ted Kremenek2010-01-191-7/+7
| | | | llvm-svn: 93903
* Re-alphabetize cases in switch statement.Ted Kremenek2010-01-191-9/+9
| | | | llvm-svn: 93902
* Fix a serious bug: Tmp3 is the wrong destination set. We should create a newZhongxing Xu2010-01-191-6/+6
| | | | | | intermediate destination set Tmp4. llvm-svn: 93873
* Add try/catch CFG support. Also improve throw CFG support. WIP.Mike Stump2010-01-191-10/+100
| | | | llvm-svn: 93840
* Add support for computing size in elements for symbolic regions obtained fromZhongxing Xu2010-01-184-10/+36
| | | | | | malloc(). llvm-svn: 93722
* If the symbol has not been tracked, do not free it. This is possible when freeZhongxing Xu2010-01-181-1/+6
| | | | | | is called on a pointer that does not get its value directly from malloc. llvm-svn: 93706
* Don't suggest the developer use 'arc4random' instead of 'rand' when that ↵Ted Kremenek2010-01-151-3/+15
| | | | | | function is not available. Fixes PR 6012. llvm-svn: 93508
* Teach BugReporter to "escape" the occurance of '%' characters in diagnostic ↵Ted Kremenek2010-01-151-2/+17
| | | | | | messages when emitted results to the standard Diagnostics output. Fixes PR 6033. llvm-svn: 93507
OpenPOWER on IntegriCloud