summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary calls to c_str.Benjamin Kramer2012-08-241-3/+3
| | | | llvm-svn: 162590
* Fix analyzer tests.Ted Kremenek2012-08-2488-107/+107
| | | | llvm-svn: 162588
* Revert "Go ahead and show experimental checkers in the scan-build "-h" output."Ted Kremenek2012-08-241-0/+9
| | | | llvm-svn: 162587
* Instantiate class template specializations during ADL.John McCall2012-08-244-9/+40
| | | | llvm-svn: 162586
* objective-C: When checking for valid overriden propertyFariborz Jahanian2012-08-242-1/+33
| | | | | | | | in class extension, assume default is rewdwrite and don't issue any diagnostics, privided other ownership models are ok. llvm-svn: 162583
* Rename the "experimental" checker package to "alpha". We will then refineTed Kremenek2012-08-241-18/+18
| | | | | | | this group into "alpha" and "beta" to distinguish between checkers in different levels of premature state. llvm-svn: 162582
* Rework how PathDiagnosticConsumers pass knowledge of what files theyTed Kremenek2012-08-244-14/+76
| | | | | | | | | | | | | generated for a given diagnostic to another. Because PathDiagnostics are specific to a give PathDiagnosticConsumer, store in a FoldingSet a unique hash for a PathDiagnostic (that will be the same for the same bug for different PathDiagnosticConsumers) that stores a list of files generated. This can then be read by the other PathDiagnosticConsumers. This fixes breakage in the PLIST-HTML output. llvm-svn: 162580
* [analyzer] Address Jordan's review comments.Anna Zaks2012-08-241-7/+5
| | | | llvm-svn: 162579
* Fix 80-column violation.Chad Rosier2012-08-241-1/+2
| | | | llvm-svn: 162575
* Comment diagnostics: for unresolved parameters, do not suggest parameter fixitDmitri Gribenko2012-08-244-74/+131
| | | | | | | | with parameter that is documented. Fixes PR13670, <rdar://problem/12155840>. llvm-svn: 162570
* [ms-inline asm] Refactor code. No functional change intended.Chad Rosier2012-08-243-17/+25
| | | | llvm-svn: 162568
* [ms-inline asm] Generate the Input/Output expressions using Chad Rosier2012-08-241-7/+14
| | | | | | Sema::ActOnIdExpression(). llvm-svn: 162564
* [analyzer] If we dereference a NULL that came from a function, show the return.Jordan Rose2012-08-242-0/+868
| | | | | | | | | | | | More generally, any time we try to track where a null value came from, we should show if it came from a function. This usually isn't necessary if the value is symbolic, but if the value is just a constant we previously just ignored its origin entirely. Now, we'll step into the function and recursively add a visitor to the returned expression. <rdar://problem/12114609> llvm-svn: 162563
* Fix 80-column violation.Chad Rosier2012-08-241-1/+2
| | | | llvm-svn: 162560
* Push ArrayRef through the Expr hierarchy.Benjamin Kramer2012-08-2417-281/+236
| | | | | | No functionality change. llvm-svn: 162552
* Fix the definition of JSONAnchorSource. MSVC mangles variable symbols, and ↵NAKAMURA Takumi2012-08-241-1/+1
| | | | | | "volatile" affects. llvm-svn: 162550
* Teach CFG that 'if (x & 0)' and 'if (x * 0)' is an unfeasible branch.Ted Kremenek2012-08-242-0/+33
| | | | | | Fixes <rdar://problem/11005770>. llvm-svn: 162545
* Allow RecursiveASTVisitor to visit CXXCtorInitializer objects for whichJames Dennett2012-08-243-43/+169
| | | | | | | | | | | isWritten() returns false, if shouldVisitImplicitCode() returns true. Previously those CXXCtorInitializers were always skipped. In order to make this change easier to test, this patch also extends the test class template ExpectedLocationVisitor to support arbitrary numbers of expected matches and disallowed matches. llvm-svn: 162544
* Go ahead and show experimental checkers in the scan-build "-h" output.Ted Kremenek2012-08-241-9/+0
| | | | | | | | | They are labeled as not being enabled-by-default, and how else are users going to test them. Fixes <rdar://problem/11654923> llvm-svn: 162543
* Use LLVM's plugin registry to enable registering new compilationDaniel Jasper2012-08-249-373/+474
| | | | | | | databases. Move JSONCompilationDatabase.h to its own files and register it as plugin. llvm-svn: 162541
* Rename the ASTMatchers to better match AST nodes. Now, allDaniel Jasper2012-08-244-661/+646
| | | | | | | | | ASTMatchers have the same name as the corresponding AST nodes but are lower case. The only exceptions are the "CXX" prefixes which are not copied over to the matcher names as the goal is to actually remove these prefixes from the AST node names. llvm-svn: 162536
* On OS X, use xcrun (if present) to find the clang to use for static analysis ifTed Kremenek2012-08-241-6/+20
| | | | | | | | no clang can be found relative to the location of scan-build. Fixes <rdar://problem/11691794> llvm-svn: 162535
* [analyzer] Fix realloc related bug in the malloc checker.Anna Zaks2012-08-242-17/+52
| | | | | | | When reallocation of a non-allocated (not owned) symbol fails do not expect it to be freed. llvm-svn: 162533
* [analyzer] Remove unnecessary code.Anna Zaks2012-08-241-16/+0
| | | | | | | | This code has been added a while ago and removing it does not trigger any test failures. The false positives it was trying to suppress are probably handled by other logic (ex: special handling of delegates). llvm-svn: 162529
* [analyzer] Move DynamicTypeInfo out of the ProgramState.hAnna Zaks2012-08-242-34/+57
| | | | | | | (I am not sure if we should move the setters and getters as well and make them into static methods..) llvm-svn: 162528
* New -fcatch-undefined-behavior features:Richard Smith2012-08-247-32/+178
| | | | | | | | * when checking that a pointer or reference refers to appropriate storage for a type, also check the alignment and perform a null check * check that references are bound to appropriate storage * check that 'this' has appropriate storage in member accesses and member function calls llvm-svn: 162523
* Updated LibTooling.html, minor improvements in CommonOptionsParserAlexander Kornienko2012-08-244-80/+59
| | | | llvm-svn: 162521
* DeclPrinter tests: mark test case we get wrong currently with WRONG.Dmitri Gribenko2012-08-241-1/+1
| | | | llvm-svn: 162512
* DeclPrinter tests: add two more tests.Dmitri Gribenko2012-08-241-0/+23
| | | | llvm-svn: 162511
* [ms-inline asm] Add the basic APIs for Exprs to the MSAsmStmt AST. Next we needChad Rosier2012-08-243-6/+45
| | | | | | generate the Input/Output expressions using Sema::ActOnIdExpression(). llvm-svn: 162509
* [analyzer] Make analyzer less aggressive when dealing with [self init].Anna Zaks2012-08-245-15/+171
| | | | | | | | | | | | | | With inlining, retain count checker starts tracking 'self' through the init methods. The analyser results were too noisy if the developer did not follow 'self = [super init]' pattern (which is common especially in older code bases) - we reported self init anti-pattern AND possible use-after-free. This patch teaches the retain count checker to assume that [super init] does not fail when it's not consumed by another expression. This silences the retain count warning that warns about possibility of use-after-free when init fails, while preserving all the other checking on 'self'. llvm-svn: 162508
* Comment semantic analysis: treat function typedefs as functions so that one canDmitri Gribenko2012-08-244-3/+85
| | | | | | | | use \param and \returns in documentation. Fixes PR13533. llvm-svn: 162507
* Fix a few -Wdocumentation warnings.Dmitri Gribenko2012-08-245-13/+7
| | | | llvm-svn: 162506
* Now that ASTMultiPtr is nothing more than a array reference, make it a ↵Benjamin Kramer2012-08-2322-176/+106
| | | | | | | | MutableArrayRef. This required changing all get() calls to data() and using the simpler constructors. llvm-svn: 162501
* [scan-build] Accept -fno-objc-arc as well as -fobjc-arc.Jordan Rose2012-08-231-0/+1
| | | | | | | | | This is how Xcode lets individual files be marked as non-ARC when the rest of the project is ARC-enabled, so this is necessary for scan-build xcodebuild. Patch by Paul Eipper! llvm-svn: 162497
* [analyzer] For now, treat pointers-to-members as non-null void * symbols.Jordan Rose2012-08-233-3/+60
| | | | | | | | | | | | Until we have full support for pointers-to-members, we can at least approximate some of their use by tracking null and non-null values. We thus treat &A::m_ptr as a non-null void * symbol, and MemberPointer(0) as a pointer-sized null constant. This enables support for what is sometimes called the "safe bool" idiom, demonstrated in the test case. llvm-svn: 162495
* [analyzer] Handle UserDefinedConversion casts in C++.Jordan Rose2012-08-232-11/+24
| | | | | | | | This is trivial; the UserDefinedConversion always wraps a CXXMemberCallExpr for the appropriate conversion function, so it's just a matter of propagating that value to the CastExpr itself. llvm-svn: 162494
* Remove ASTOwningVector, it doesn't own anything and provides no value over ↵Benjamin Kramer2012-08-2316-105/+79
| | | | | | SmallVector. llvm-svn: 162492
* Attaching comments to decls: since it was decided that Decl::isImplicit shouldDmitri Gribenko2012-08-231-2/+0
| | | | | | | | | | | | not be set for implicit instantiations, remove the FIXME. This should be the last bit for PR13634. The actual fix happened in r162238. Motivation: it might be misleading to mark implicit instantiations as Decl::isImplicit = true. Because then, in order to be consistent, we should mark all instantiated members as implicit. But the user did actually type the declaration for the member, but the compiler played with it a little bit. llvm-svn: 162488
* [ms-inline asm] Add a few helper function to the MSAsmStmt class that are neededChad Rosier2012-08-231-0/+38
| | | | | | | | | | by CodeGen. In the long-term, much of the codegen logic will be shared between the GNU-style and MS-style inline assembly, but for now I'm replicating this logic to avoid regressions with the GNU-style. llvm-svn: 162478
* Rip out remnants of move semantic emulation and smart pointers in Sema.Benjamin Kramer2012-08-2328-428/+263
| | | | | | | These were nops for quite a while and only lead to confusion. ASTMultiPtr now behaves like a proper dumb array reference. llvm-svn: 162475
* Added a method to DeclContext that marks theSean Callanan2012-08-231-0/+7
| | | | | | | | | | lookup table as needing to be built. This is required for LLDB, which provides the contents of many DeclContexts through a custom ExternalASTSource. llvm-svn: 162471
* Change a bunch of cases where we do "getAs<...>->doSomething()" toTed Kremenek2012-08-232-16/+19
| | | | | | | | | "castAs<...>->doSomething()". The analyzer was flagging these as potential null dereferences, which is technically true. The invariants appear to be that these casts should never fail, so let's use castAs<> instead and avoid a runtime check. llvm-svn: 162468
* When disambiguating an expression-statement from a declaraton-statement, if theRichard Smith2012-08-235-17/+42
| | | | | | | statement starts with an identifier for which name lookup will fail either way, look at later tokens to disambiguate in order to improve error recovery. llvm-svn: 162464
* [ms-inline asm] Remove an unused argument. This logic can now be reused by theChad Rosier2012-08-232-10/+7
| | | | | | ms-style inline asms. llvm-svn: 162463
* [analyzer] Support C++ default arguments if they are literal values.Jordan Rose2012-08-234-5/+46
| | | | | | | | | | | | | | | | | | A CXXDefaultArgExpr wraps an Expr owned by a ParmVarDecl belonging to the called function. In general, ExprEngine and Environment ought to treat this like a ParenExpr or other transparent wrapper expression, with the inside expression evaluated first. However, if we call the same function twice, we'd produce a CFG that contains the same wrapped expression twice, and we're not set up to handle that. I've added a FIXME to the CFG builder to come back to that, but meanwhile we can at least handle expressions that don't need to be explicitly evaluated: literals. This probably handles many common uses of default parameters: true/false, null, etc. Part of PR13385 / <rdar://problem/12156507> llvm-svn: 162453
* Fix a bunch of -Wdocumentation warnings.Dmitri Gribenko2012-08-2319-40/+31
| | | | llvm-svn: 162452
* [ms-inline asm] Rename a few induction variables to avoid confusion and silenceChad Rosier2012-08-231-7/+7
| | | | | | a gcc warning. llvm-svn: 162444
* Mark these const.Roman Divacky2012-08-232-2/+2
| | | | llvm-svn: 162443
* Fix transposed optional / required in Objective-C metadata (GNUstep runtime)David Chisnall2012-08-231-8/+8
| | | | | | Patch by Niels Grewe! llvm-svn: 162441
OpenPOWER on IntegriCloud