aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker
AgeCommit message (Collapse)Author
2010-12-22[analyzer] Refactoring: lib/Checker -> lib/GR and libclangChecker -> ↵Argyrios Kyrtzidis
libclangGRCore git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122421 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22[analyzer] Refactoring: include/clang/Checker -> include/clang/GRArgyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122420 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22If the unary operator is prefix and an lvalue (in C++), bindZhongxing Xu
the location (l-value) to it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22The base type is not always pointer type. We may cast to a base reference.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122393 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22Always blast through no-op casts when getting expr SVals.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22After inlining the CXXConstructExpr, bind the temporary object region to it.Zhongxing Xu
This change is necessary when the variable is a const reference and we need the l-value of the construct expr. After that, when binding the variable, recover the lazy compound value when the variable is not a reference. In Environment, use the value of a no-op cast expression when it has one. Otherwise, blast-through it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122388 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20Rename 'VisitLocation' to 'visitLocation'.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122271 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20Rename 'Generate[Node,Sink]' to 'generate[Node,Sink]'.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19If the initializer is an rvalue and the variable is a const reference,Zhongxing Xu
create a temporary object for it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18The evaluation of dereference and address-of is identical.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122146 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18Replace all uses of PathV1::get{Basename,Dirname,Suffix} with their PathV2 ↵Michael J. Spencer
equivalents. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122140 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18Replace all uses of PathV1::getLast with PathV2::filename.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17Replace all uses of PathV1::isAbsolute with PathV2::is_{absolute,relative}.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122087 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17Remove explicit summaries from retain/releaseTed Kremenek
checker that are automatically handled now by the Cocoa conventions logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17Move CocoaConventions.[h,cpp] from libCheckerTed Kremenek
to libAnalysis. Similar to Format (format string checking), CocoaConventions has the potential to serve clients other than the static analyzer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17Revise Cocoa conventions detection: 'copy' and 'mutableCopy'Ted Kremenek
only indicates the create rule if it starts at the beginning of the method name, not within the method name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17Rename several methods/functions in the analyzerTed Kremenek
to start with lowercase characters. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122035 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16Start migration of static analyzer to using theTed Kremenek
implicit lvalue-to-rvalue casts that John McCall recently introduced. This causes a whole bunch of logic in the analyzer for handling lvalues to vanish. It does, however, raise a few issues in the analyzer w.r.t to modeling various constructs (e.g., field accesses to compound literals). The .c/.m analysis test cases that fail are due to a missing lvalue-to-rvalue cast that will get introduced into the AST. The .cpp failures were more than I could investigate in one go, and the patch was already getting huge. I have XFAILED some of these tests, and they should obviously be further investigated. Some highlights of this patch include: - CFG no longer requires an lvalue bit for CFGElements - StackFrameContext doesn't need an 'asLValue' flag - The "VisitLValue" path from GRExprEngine has been eliminated. Besides the test case failures (XFAILed), there are surely other bugs that are fallout from this change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121960 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-14Added missing IgnoreParens().Abramo Bagnara
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10It's kindof silly that ExtQuals has an ASTContext&, and we can use thatJohn McCall
space better. Remove this reference. To make that work, change some APIs (most importantly, getDesugaredType()) to take an ASTContext& if they need to return a QualType. Simultaneously, diminish the need to return a QualType by introducing some useful APIs on SplitQualType, which is just a std::pair<const Type *, Qualifiers>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08Remove the TypesCompatibleExprClass AST node. Merge its functionality into ↵Francois Pichet
BinaryTypeTraitExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121121 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet
New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall
reason this is limited to C++, and it's certainly not limited to temporaries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05Mark SVal constructors 'explicit'.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120970 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05Rename Environment::LookupExpr() toTed Kremenek
Environment::lookupExpr() and move its implementation out-of-line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120969 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04More anonymous struct/union redesign. This one deals with anonymous field ↵Francois Pichet
used in a constructor initializer list: struct X { X() : au_i1(123) {} union { int au_i1; float au_f1; }; }; clang will now deal with au_i1 explicitly as an IndirectFieldDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall
not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120890 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04Minor refactoring; have BugReport::getRanges return a pair of iterator, no ↵Argyrios Kyrtzidis
functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03Fix an insidious bug in BugReporter whereTed Kremenek
a node in the trimmed graph might not always correctly map back to the original error node. This could cause a crash in some cases when flagging memory leaks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03Also include the pointer address of the ExplodedNodeTed Kremenek
when generating DOT output for an ExplodedGraph. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03Also show notes about the taken path in TextPathDiagnostics.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120783 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03Remove leftover code and use the text path diagnostic client even without a ↵Argyrios Kyrtzidis
specified output file since it just uses diagnostic notes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120773 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03Introduce TextPathDiagnostics, a simple PathDiagnosticClient that outputs as ↵Argyrios Kyrtzidis
diagnostic notes the sequence of events; useful for testing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120770 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03Handle any number of SourceRanges inside BugReporter::FlushReport.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120769 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03Rename Create[*]DiagnosticClient -> create[*]DiagnosticClient.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120768 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02Merge ValueManager into SValBuilder.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120696 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall
ObjCPropertyRefExpr into the latter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01Rename all 'AssumeXXX' methods in libCheckerTed Kremenek
to 'assumeXXX'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01Rename all 'EvalXXX' methods in libChecker toTed Kremenek
'evalXXX'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01Rename 'SValuator' to 'SValBuilder'. The new nameTed Kremenek
reflects what the class actually does. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120605 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01Restore the lvalue-to-rvalue conversion patch with a minimal fix.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120555 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30L-value to r-value conversion is not ready for prime-time.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30Introduce an r-value to l-value cast kind. I'm not promising anythingJohn McCall
about the reliability of this yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29Merge System into Support.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120297 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-26Do not use StripCasts() in this context.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120178 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-26Should not use StripCasts() in this context.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120177 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-26Rename CXXObjectRegion to CXXTempObjectRegion.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120176 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-26Regionstore: support derived-to-base cast by creating a CXXBaseObjectRegion.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120173 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-26Add a fixme.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120172 91177308-0d34-0410-b5e6-96231b3b80d8