aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
AgeCommit message (Collapse)Author
2010-02-09Convert tabs to spaces.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-06Teach RegionStore::InvalidateRegions() to also invalidate static variables ↵Ted Kremenek
referenced by blocks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95459 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04Move ParseFormatString() and FormatStringHandler back into the ↵Ted Kremenek
analyze_printf namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95324 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01Add format string type checking support for 'long double'.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95026 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30Recognize 'q' as a format length modifier (from BSD).Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94894 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30Add format string checking of 'double' arguments. Fixes ↵Ted Kremenek
<rdar://problem/6931734>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29Fix spacing.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29Per a suggestion from Cristian Draghici, add a method to FormatSpecifier ↵Ted Kremenek
that returns the expected type of the matching data argument. It isn't complete, but should handle several of the important cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29Enhancements to the alternate (WIP) format string checking:Ted Kremenek
- 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94834 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29Alternate format string checking: issue warnings for incomplete format ↵Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29Alternate format string checking: issue a warning for invalid conversion ↵Ted Kremenek
specifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94792 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29Yet another attempt to make the Linux buildbots happy. Apparently there are ↵Ted Kremenek
differences on how nested namespaces are handled... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29Move definition of FormatStringHandler::~FormatStringHandler() within ↵Ted Kremenek
namespace directives. Hopefully this will make the Linux buildbots happy. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94784 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29Add precision/field width checking to AlternateCheckPrintfString().Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94774 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28Fix off-by-one error in ParseFormatSpecifier() when reporting the location ↵Ted Kremenek
of a null character. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28Add position of conversion specifier character to 'ConversionSpecifier'.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94739 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28Rename namespace clang::printf to clang::analyze_printf to avoid problems ↵Ted Kremenek
where the reference to 'printf' is ambiguous. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94733 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28Allow HandleFormatSpecifier() to indicate that no more processing of the ↵Ted Kremenek
format string is desired. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94715 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28Add '@' conversion specifier.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94713 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28Remove invalid conversion specifiers from format string checking.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94707 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28Add a few more conversion specifiers to ParseFormatSpecifier (these appear ↵Ted Kremenek
in SemaChecking). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94704 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27Add skeleton for a more structured way to analyzing pring formatTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94702 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25Split libAnalysis into two libraries: libAnalysis and libChecker.Ted Kremenek
(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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94406 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24-fno-rtti is now the default.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22Process cast according to the cast kind. Prepare for more specific cast Zhongxing Xu
handling (for C++). No functionality change for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94153 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21Improve unreachable code warnings with respect to dead binary andMike Stump
unary operators. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21Speed up compilation by avoiding generating exceptional edges fromMike Stump
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21Add infrastructure to add base initializers and member initializers toMike Stump
the CFG. WIP. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20Correct comments.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20Wire up the EH context for the catch clauses to the outer EH context. WIP.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20Add an exceptional edge from the try terminated block to the outer EHMike Stump
context (try or the Exit block) when there isn't a catch (...). Improve CFG printing for catch (...). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19Add CFG support for the start and end of scopes and infrastructure forMike Stump
implicit destructor calls. WIP. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93922 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19Tighten code and rework indentation of some if() branches (for readability). ↵Ted Kremenek
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19Remove extra space in uses of 'assert()'.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93903 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19Re-alphabetize cases in switch statement.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93902 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19Fix a serious bug: Tmp3 is the wrong destination set. We should create a newZhongxing Xu
intermediate destination set Tmp4. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19Add try/catch CFG support. Also improve throw CFG support. WIP.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18Add support for computing size in elements for symbolic regions obtained fromZhongxing Xu
malloc(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93722 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18If the symbol has not been tracked, do not free it. This is possible when freeZhongxing Xu
is called on a pointer that does not get its value directly from malloc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93706 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15Don't suggest the developer use 'arc4random' instead of 'rand' when that ↵Ted Kremenek
function is not available. Fixes PR 6012. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15Teach BugReporter to "escape" the occurance of '%' characters in diagnostic ↵Ted Kremenek
messages when emitted results to the standard Diagnostics output. Fixes PR 6033. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15Convert a few more uses of std::string& to llvm::StringRef.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93506 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14Fix pr6035.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13Add an unreachable code checker.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11Fix pasto.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93181 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11Avoid use of deprecated functions (CStrInCStrNoCase and StringsEqualNoCase).Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93175 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11Roll out ASTContext::getTypeSizeInChars(), replacing instances ofKen Dyck
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits ones as appropriate. Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType, fromQuantity(), and getQuantity() for clarity. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93153 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11Enhance ScanReachableSymbols::scan(). Now another OSAtomic test case passes.Zhongxing Xu
The old test case has a little mistake. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11Enhance SVals::getAsRegion: get the region that is converted to an integer.Zhongxing Xu
This with previous patch fixes a OSAtomic test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93146 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11Switch RegionStore over to using <BaseRegion+raw offset> to storeTed Kremenek
value bindings. Along with a small change to OSAtomicChecker, this resolves <rdar://problem/7527292> and resolves some long-standing issues with how values can be bound to the same physical address by not have the same "key". This change is only a beginning; logically RegionStore needs to better handle loads from addresses where the stored value is larger/smaller/different type than the loaded value. We handle these cases in an approximate fashion now (via CastRetrievedVal and help in SimpleSValuator), but it could be made much smarter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93137 91177308-0d34-0410-b5e6-96231b3b80d8