summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Thread-safety analysis: Add support for selectively turning off warningsDeLesley Hutchins2012-09-073-75/+180
| | | | | | within part of a particular method. llvm-svn: 163397
* [analyzer] Explain why we need condition 8.Anna Zaks2012-09-071-1/+4
| | | | llvm-svn: 163394
* Attempt to pacify Windows buildbots.Roman Divacky2012-09-071-1/+1
| | | | llvm-svn: 163389
* Link to crtend.S when PIE in the FreeBSD driver. Patch by Brooks Davis!Roman Divacky2012-09-072-3/+17
| | | | llvm-svn: 163388
* Adds a first iteration of the basic AST matcher documentation landing page.Manuel Klimek2012-09-071-0/+130
| | | | llvm-svn: 163387
* Introduces anchors into LibASTMatchersReference.html.Manuel Klimek2012-09-072-159/+184
| | | | | | | | This allows linking to LibASTMatchersRefernce.html#<matcher><N>Anchor to link to the N'the declaration of a matcher and automatically expand its documentation. llvm-svn: 163386
* Change the behavior of the isDerivedFrom-matcher to not match on theDaniel Jasper2012-09-073-13/+31
| | | | | | | | | | | | class itself. This caused some confusion (intuitively, a class is not derived from itself) and makes it hard to write certain matchers, e.g. "match and bind any pair of base and subclass". The original behavior can be achieved with a new isA-matcher. Similar to all other matchers, this matcher has the same behavior and name as the corresponding AST-entity - in this case the isa<>() function. llvm-svn: 163385
* Implements hasAncestor.Manuel Klimek2012-09-074-15/+245
| | | | | | | | | | | | | | | | | | | | | | Implements the hasAncestor matcher. This builds on the previous patch that introduced DynTypedNode to build up a parent map for an additional degree of freedom in the AST traversal. The map is only built once we hit an hasAncestor matcher, in order to not slow down matching for cases where this is not needed. We could implement some speed-ups for special cases, like building up the parent map as we go and only building up the full map if we break out of the already visited part of the tree, but that is probably not going to be worth it, and would make the code significantly more complex. Major TODOs are: - implement hasParent - implement type traversal - implement memoization in hasAncestor llvm-svn: 163382
* Revert "Rework the retain-release.m test to use FileCheck and the "text" output"Ted Kremenek2012-09-071-1348/+180
| | | | | | Apparently the output of this test is not deterministic. Needs investigation. llvm-svn: 163377
* Fix off-by-one bug in diagnostic prose of ObjCContainersASTChecker.Ted Kremenek2012-09-072-8/+10
| | | | | | | | | While the check itself should count 0-based for the parameter index, the diagnostic should be 1-based (first, second, third, not start at 0). Fixes <rdar://problem/12249569>. llvm-svn: 163375
* ExplodedGraph::shouldCollectNode() should not collect nodes for non-Expr StmtsTed Kremenek2012-09-071-3/+3
| | | | | | | | (as this previously was the case before this was refactored). We also shouldn't need to specially handle BinaryOperators since the eagerly-assume heuristic tags such nodes. llvm-svn: 163374
* Rework the retain-release.m test to use FileCheck and the "text" outputTed Kremenek2012-09-071-180/+1348
| | | | | | | | | | of the analyzer, as the RetainReleaseChecker has many fine-grain path diagnostic events that were not being checked. This uncovered an inconsistency between the path diagnostics between Objective-C and Objective-C++ code in ConditionBRVisitor that was fixed in a recent patch. llvm-svn: 163373
* Fix bug in ConditionBRVisitor where for C++ (and not C) we were not ignoringTed Kremenek2012-09-073-6/+6
| | | | | | | | | | | | | | | | implicit pointer-to-boolean conversions in condition expressions. This would result in inconsistent diagnostic emission between C and C++. A consequence of this is now ConditionBRVisitor and TrackConstraintBRVisitor may emit redundant diagnostics, for example: "Assuming pointer value is null" (TrackConstraintBRVisitor) "Assuming 'p' is null" (ConditionBRVisitor) We need to reconcile the two, and perhaps prefer one over the other in some cases. llvm-svn: 163372
* PR9023: A template template parameter whose template parameter list contains anRichard Smith2012-09-0712-152/+607
| | | | | | | | | | | | | unexpanded parameter pack is a pack expansion. Thus, as with a non-type template parameter which is a pack expansion, it needs to be expanded early into a fixed list of template parameters. Since the expanded list of template parameters is not itself a parameter pack, it is permitted to appear before the end of the template parameter list, so also remove that restriction (for both template template parameter pack expansions and non-type template parameter pack expansions). llvm-svn: 163369
* [analyzer] Fail gracefully when the dynamic type is outside the hierarchy.Jordan Rose2012-09-072-1/+41
| | | | | | | | | | | | | | | | | | | With some particularly evil casts, we can get an object whose dynamic type is not actually a subclass of its static type. In this case, we won't even find the statically-resolved method as a devirtualization candidate. Rather than assert that this situation cannot occur, we now simply check that the dynamic type is not an ancestor or descendent of the static type, and leave it at that. This error actually occurred analyzing LLVM: CallEventManager uses a BumpPtrAllocator to allocate a concrete subclass of CallEvent (FunctionCall), but then casts it to the actual subclass requested (such as ObjCMethodCall) to perform the constructor. Yet another crash in PR13763. llvm-svn: 163367
* Teach RetainCountChecker that CFPlugInInstanceCreate does notTed Kremenek2012-09-062-0/+14
| | | | | | | | return a CF object at all. Fixes <rdar://problem/9566345> llvm-svn: 163362
* [analyzer] Don't crash if we cache out while evaluating an ObjC message.Jordan Rose2012-09-062-2/+65
| | | | | | | | | | | | | | | | A bizarre series of coincidences led us to generate a previously-seen node in the middle of processing an Objective-C message, where we assume the receiver is non-nil. We were assuming that such an assumption would never "cache out" like this, and blithely went on using a null ExplodedNode as the predecessor for the next step in evaluation. Although the test case committed here is complicated, this could in theory happen in other ways as well, so the correct fix is just to test if the non-nil assumption results in an ExplodedNode we've seen before. <rdar://problem/12243648> llvm-svn: 163361
* [analyzer] Assert that StmtPoint should be created with a non-null Stmt.Anna Zaks2012-09-061-1/+3
| | | | llvm-svn: 163358
* [analyzer] testing: add a build mode to allow C++11 testing.Anna Zaks2012-09-062-16/+22
| | | | llvm-svn: 163357
* Refine diagnostics for leaks reported when returning an objectTed Kremenek2012-09-062-14/+31
| | | | | | | | via function/method with [CF,NS]_RETURNS_NOT_RETAINED. Fixes <rdar://problem/11379000>. llvm-svn: 163355
* Tweak DeadStoresChecker to not warn about dead stores to variables thatTed Kremenek2012-09-062-3/+72
| | | | | | | | | are used in EH code. Right now the CFG doesn't support exceptions well, so we need this hack to avoid bogus dead store warnings. Fixes <rdar://problem/12147586> llvm-svn: 163353
* Clarified diagnostics for range-based for loops with invalid rangesSam Panzer2012-09-063-3/+24
| | | | llvm-svn: 163350
* [analyzer] Don't attempt to devirtualize calls to base class destructors.Jordan Rose2012-09-067-17/+73
| | | | | | | | | | | | | | | | | | | CXXDestructorCall now has a flag for when it is a base destructor call. Other kinds of destructor calls (locals, fields, temporaries, and 'delete') all behave as "whole-object" destructors and do not behave differently from one another (specifically, in these cases we /should/ try to devirtualize a call to a virtual destructor). This was causing crashes in both our internal buildbot, the crash still being tracked in PR13765, and some of the crashes being tracked in PR13763, due to a assertion failure. (The behavior under -Asserts happened to be correct anyway.) Adding this knowledge also allows our DynamicTypePropagation checker to do a bit less work; the special rules about virtual method calls during a destructor only require extra handling during base destructors. llvm-svn: 163348
* [ms-inline asm] Output empty asm statements for the directives we don'tChad Rosier2012-09-062-10/+16
| | | | | | | handle. Otherwise, the AsmParser will explode if we try to generate an object files. llvm-svn: 163345
* [ms-inline asm] The IR representation of inline assembly enumerates the inputChad Rosier2012-09-062-1/+26
| | | | | | | and output expressions much like that in GNU-style inline assembly. Output expressions are first. Do this for MS-style inline asms. llvm-svn: 163342
* refactoring + objective-C specific test for my last patch.Fariborz Jahanian2012-09-064-10/+25
| | | | | | // rdar://12233989 llvm-svn: 163338
* Don't try to check override control for invalid member functions. Fixes a ↵Richard Smith2012-09-062-0/+8
| | | | | | crash in a corner case. Patch by Olivier Goffart! llvm-svn: 163337
* Use custom ABIInfo for le32/PNaCl argument codegenDerek Schuff2012-09-063-0/+188
| | | | | | | | | This patch uses a new ABIInfo implementation specific to the le32 target, rather than falling back to DefaultABIInfo. Its behavior is basically the same, but it also allows the regparm argument attribute. It also includes basic tests for argument codegen and attributes. llvm-svn: 163333
* Enabling the UTF conversion routines that were previously conditionally ↵Enrico Granata2012-09-062-4/+0
| | | | | | ifdef'ed out. This change is required to support enhancements in the LLDB data formatters llvm-svn: 163331
* Fixing the return type information for objc_sync_enter and objc_sync_exit. ↵Aaron Ballman2012-09-065-14/+14
| | | | | | Patch thanks to Joe Ranieri! llvm-svn: 163330
* c: make __attribute__((unused)) transitive.Fariborz Jahanian2012-09-062-4/+26
| | | | | | | Don't warn if annotated decl is used inside another unused. // rdar://12233989 llvm-svn: 163329
* Tighten up regexps some more.Jakob Stoklund Olesen2012-09-061-4/+4
| | | | | | | These tests were failing for me because the .* was greedily matching up to the /libexec/ld-elf.so.1" later on the same line. llvm-svn: 163328
* Remove unused typedefs. Found by gcc48.Roman Divacky2012-09-061-12/+0
| | | | llvm-svn: 163327
* Dont cast away const needlessly. Found by gcc48 -Wcast-qual.Roman Divacky2012-09-0621-38/+40
| | | | llvm-svn: 163325
* Update AddressSanitizer docsAlexey Samsonov2012-09-061-5/+3
| | | | llvm-svn: 163303
* Fix a mistake in an HTML example code snippet.Jordan Rose2012-09-061-1/+1
| | | | | | Caught by Kurt Arnlund! llvm-svn: 163286
* PR13775: When checking for a tag type being shadowed by some other declaration,Richard Smith2012-09-062-19/+31
| | | | | | don't trample over the caller's LookupResult in the case where the check fails. llvm-svn: 163281
* [analyzer] Enhance the member expr tracking to account for references.Anna Zaks2012-09-054-2/+27
| | | | | | As per Jordan's suggestion. (Came out of code review for r163261.) llvm-svn: 163269
* Continue including temporary destructors in the CFG used for warnings.Jordan Rose2012-09-051-1/+2
| | | | | | ...and hopefully unbreak buildbots. My apologies! llvm-svn: 163267
* Format strings: suggest casts for NS(U)Integer and [SU]Int32 on Darwin.Jordan Rose2012-09-053-23/+311
| | | | | | | | | | | | | | | These types are defined differently on 32-bit and 64-bit platforms, and trying to offer a fixit for one platform would only mess up the format string for the other. The Apple-recommended solution is to cast to a type that is known to be large enough and always use that to print the value. This should only have an impact on compile time if the format string is incorrect; in cases where the format string matches the definition on the current platform, no warning will be emitted. <rdar://problem/9135072&12164284> llvm-svn: 163266
* Format string checking: change long if-statement to early returns.Jordan Rose2012-09-051-66/+69
| | | | | | No functionality change. llvm-svn: 163265
* [analyzer] Always include destructors in the analysis CFG.Jordan Rose2012-09-0514-19/+60
| | | | | | | | | | | | | | | | | | | | | While destructors will continue to not be inlined (unless the analyzer config option 'c++-inlining' is set to 'destructors'), leaving them out of the CFG is an incomplete model of the behavior of an object, and can cause false positive warnings (like PR13751, now working). Destructors for temporaries are still not on by default, since (a) we haven't actually checked this code to be sure it's fully correct (in particular, we probably need to be very careful with regard to lifetime-extension when a temporary is bound to a reference, C++11 [class.temporary]p5), and (b) ExprEngine doesn't actually do anything when it sees a temporary destructor in the CFG -- not even invalidate the object region. To enable temporary destructors, set the 'cfg-temporary-dtors' analyzer config option to '1'. The old -cfg-add-implicit-dtors cc1 option, which controlled all implicit destructors, has been removed. llvm-svn: 163264
* [analyzer] Fix a crash PR13762.Anna Zaks2012-09-052-1/+8
| | | | llvm-svn: 163262
* [analyzer] NullOrUndef diagnostics: track symbols binded to regions.Anna Zaks2012-09-052-8/+366
| | | | | | | | | If a region is binded to a symbolic value, we should track the symbol. (The code I changed was not previously exercised by the regression tests.) llvm-svn: 163261
* [analyzer] Remove unneeded code.Anna Zaks2012-09-051-18/+8
| | | | | | | This region is set as interesting as part of trackNullOrUndefValue call, no need to mark it as interesting twice. llvm-svn: 163260
* Add test missed in previous commit.Eric Christopher2012-09-051-0/+56
| | | | llvm-svn: 163253
* Try to fix the windows bots.Eric Christopher2012-09-051-4/+4
| | | | llvm-svn: 163252
* Apply some driver improvements for freebsd-*-mips*.Eric Christopher2012-09-052-9/+68
| | | | | | Patch by Brooks Davis. llvm-svn: 163249
* [cindex.py] Make the use of a compatibilty check explicitTobias Grosser2012-09-051-4/+31
| | | | | | | | | | | | | | | | At the moment, we implictly check compatibility between the python bindings and libclang, as the python bindings will fail to load in case a method we use in libclang is not available. This patch makes the use of this compatibility check explicit and introduces a flag to optionally disable the check. This will allow us to further harden the compatibility check, but it also gives the user the possibility to disable the compatibility check to evaluate compatibility with older libclang versions. I added documentation that makes clear the python bindings are only tested with the libclang version they have been shipped with. llvm-svn: 163238
* Thread-safety analysis: bugfix for case where a trylock occurs in anDeLesley Hutchins2012-09-052-0/+30
| | | | | | expression involving temporaries. llvm-svn: 163237
OpenPOWER on IntegriCloud