aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker
AgeCommit message (Collapse)Author
2010-04-09Remove copy of 'Optional' in Clang tree, and convert clients to use the one ↵Ted Kremenek
now in the LLVM tree. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100891 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08For 'open' check in UnixAPIChecker, hard code value of 'O_CREAT' on Darwin.Ted Kremenek
This is still not an ideal solution, but should disable the check for other targets where the value of O_CREAT is different. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08Temporarily only enable 'open' check on Mac OS X to unbreak Windows ↵Ted Kremenek
buildbot. I'm looking into an alternate fix right now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100816 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08Add static analyzer check for calls to 'pthread_once()' where the ↵Ted Kremenek
control-flow has automatic storage. This matches the corresponding check for 'dispatch_once()'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07Fix crash in StoreManager::CastRegion() when the base region is a type with ↵Ted Kremenek
0 size. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100594 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06Teach MemRegion::getBaseRegion() about ObjCIvarRegions. We want to treatTed Kremenek
them the same way as fields. This fixes a regression in RegionStore::RemoveDeadbindings() that emerged from going to the cluster-based analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06Fix PR 6725. It looks like the copy constructor gets elided during inlining.Zhongxing Xu
This bug only shows up with GCC 4.4.1 Release-Asserts build. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100516 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05Always assume block-level expressions in the caller are alive when analyzingZhongxing Xu
the callee. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05Since now we process regions in clusters when removing dead bindings, thisZhongxing Xu
code can be removed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100428 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01Use the element type to compute the array size when the base region is a ↵Zhongxing Xu
VarRegion. Patch by Jordy Rose. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100099 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01Initial support for visiting CXXMemberCallExpr.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01Improve C++ constructor handling.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100080 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01Fix a bug (PR 6699) in RegionStore::RemoveDeadBindings() whereTed Kremenek
array values with a non-zero offset would get prematurely pruned from the store. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100067 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor
the C-only "optimization". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100022 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31Revert r100008, which inexplicably breaks the clang-i686-darwin10 builderDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100018 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31Rename CodeModificationHint to FixItHint, since we've been using theDouglas Gregor
term "fix-it" everywhere and even *I* get tired of long names sometimes. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100008 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30Introduce a new kind of derived-to-base cast which bypasses the need forJohn McCall
null checks, and make sure we elide null checks when accessing base class members. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30RegionStore: specially handle loads from integer global variables declared ↵Ted Kremenek
'const'. Fixes a false positive reported in PR 6288. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99922 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30Use 'const Optional<SVal>&' to avoid an extra copy.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99921 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30the big refactoring bits of PR3782.Rafael Espindola
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30Change the analyzer to recognize (but ignore) assignments to isa. Fixes PR ↵Ted Kremenek
6302. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29Be a bit more consistent in using operator->Rafael Espindola
This patch moves some methods from QualType to Type and changes the users to use -> instead of . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27Checker: random include cleanup.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26Fix NoReturnFunctionChecker to properly look at a function's typeTed Kremenek
when determining if it returns. Fixes <rdar://problem/7796563>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99663 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25Add methods to remove a GDM entry.Zhongxing Xu
Instead of setting the ReturnExpr GDM to NULL, remove it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24Use llvm::SmallString instead of std::string.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99442 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24Improve static analyzer diagnostic concerning the use of 'mktemp'Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99441 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23Bind the constructed object value to CXXConstructExpr.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99271 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23update CMakeLists.txtZhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23Clear the return expr GDM after using it.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23Add a AggExprVisitor class. It contains lots of boilerZhongxing Xu
plate code for evaluating expressions of C++ class type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99267 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23merge line.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99259 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23Since we now may have basicblocks with the same block is in different function,Zhongxing Xu
change the block counter map from unsigned -> unsigned to <StackFrameContext*, unsigned> -> unsigned. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99255 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23Tweak null dereference diagnostics to give clearer diagnostics whenTed Kremenek
a null dereference results from a field access. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99236 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22Improve the diagnostics for the UndefinedAssignmentChecker when anTed Kremenek
uninitialized value is used in the LHS of a compound assignment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99221 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22Sort calls to add_clang_library()Kovarththanan Rajaratnam
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-21Delete the new visitor if an old one already exists.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99114 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20Reapply r99024 (but with the memory issue now fixed).Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99064 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20Check if a BugReporterVisitor has already been added to a BugReporterContext.Ted Kremenek
This avoids redundant diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99063 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20Revert r99024, "Augment path diagnostics to include displaying when a messageDaniel Dunbar
expression", statistical evidence indicates it has some kind of memory error. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20Augment path diagnostics to include displaying when a message expressionTed Kremenek
is not evaluated because the receiver is nil. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99024 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18Refactor argument checking in CallAndMessageChecker to be the sameTed Kremenek
for both CallExprs and ObjCMessageExprs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18Detect pass-by-value arguments that are structs that containTed Kremenek
uninitialized data. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98796 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18Tweak dead stores checker to not emit a warning when initializationTed Kremenek
a scalar variable with a scalar parameter. This is a form of defensive programming. If the variable is unused, it will be caused by -Wunused-variable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17Mark CXXThisRegion in the current or parent stack frame context as live so thatZhongxing Xu
their bindings are not removed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16Add VisitCXXContructExpr logic to the analyzer. This still has not fully workedZhongxing Xu
since RemoveDeadBinding mistakenly remove the binding to CXXThisRegion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98629 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12Allow users to set CPPFLAGS and CXXFLAGS on the make command line.Jeffrey Yasskin
Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98399 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10Simplify assertion.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98176 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10Remove '#if 0' code. Lazy compound values have proven their worth.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98175 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10Remove the subregion map cache. It is no longer used.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98161 91177308-0d34-0410-b5e6-96231b3b80d8