summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Restructure ExprEngine::VisitCXXNewExpr to do a bit less work.Jordan Rose2013-03-301-10/+11
| | | | | | No functionality change. llvm-svn: 178402
* [analyzer] Handle caching out while evaluating a C++ new expression.Jordan Rose2013-03-302-3/+12
| | | | | | | | | | | | | Evaluating a C++ new expression now includes generating an intermediate ExplodedNode, and this node could very well represent a previously- reachable state in the ExplodedGraph. If so, we can short-circuit the rest of the evaluation. Caught by the assertion a few lines later. <rdar://problem/13510065> llvm-svn: 178401
* [analyzer] Add debug helper LocationContext::dumpStack().Jordan Rose2013-03-302-0/+28
| | | | | | | | | | | Sample output: #0 void construct(pointer __p, llvm::ImutAVLTree<llvm::ImutContainerInfo<clang::ento::BugType *> > *const &__val) #1 void push_back(const value_type &__x) #2 void destroy() #3 void release() #4 void ~ImmutableSet() llvm-svn: 178400
* [analyzer] Garbage removedAnton Yartsev2013-03-301-2/+0
| | | | llvm-svn: 178398
* [analyzer] Test addedAnton Yartsev2013-03-301-1/+7
| | | | llvm-svn: 178397
* [analyzer] Enabled unix.Malloc checker.Anton Yartsev2013-03-305-64/+68
| | | | | | + Refactoring. llvm-svn: 178388
* [analyzer] Tests for intersections with other checkers from ↵Anton Yartsev2013-03-301-0/+0
| | | | | | MallocChecker.cpp factored out to NewDelete-intersections.mm llvm-svn: 178387
* generalize testcaseAdrian Prantl2013-03-291-1/+1
| | | | llvm-svn: 178383
* [analyzer] Address Jordan’s review of r178309 - do not register an extra ↵Anna Zaks2013-03-293-35/+38
| | | | | | | | | | | | visitor for nil receiver We can check if the receiver is nil in the node that corresponds to the StmtPoint of the message send. At that point, the receiver is guaranteed to be live. We will find at least one unreclaimed node due to my previous commit (look for StmtPoint instead of PostStmt) and the fact that the nil receiver nodes are tagged. + a couple of extra tests. llvm-svn: 178381
* [analyzer] Look for a StmtPoint node instead of PostStmt in ↵Anna Zaks2013-03-291-1/+1
| | | | | | | | | | trackNullOrUndefValue. trackNullOrUndefValue tries to find the first node that matches the statement it is tracking. Since we collect PostStmt nodes (in node reclamation), none of those might be on the current path, so relax the search to look for any StmtPoint. llvm-svn: 178380
* [libclang] Add test case for r178374.Argyrios Kyrtzidis2013-03-291-0/+10
| | | | llvm-svn: 178378
* When looking for overridden ObjC methods, don't ignore 'hidden' ones.Argyrios Kyrtzidis2013-03-293-22/+30
| | | | | | | | | | | | When using modules we should not ignore overridden methods from categories that are hidden because the module is not visible. This will give more consistent results (when imports change) and it's more correct since the methods are indeed overridden even if they are not "visible" for lookup purposes. rdar://13350796 llvm-svn: 178374
* [libclang] If libclang logging is enabled, print all compiler diagnostics to ↵Argyrios Kyrtzidis2013-03-291-3/+7
| | | | | | stderr instead of capturing them. llvm-svn: 178373
* [cmake] Add clang-headers as a dependency of libclang and if we have to copy ↵Argyrios Kyrtzidis2013-03-292-2/+9
| | | | | | | | them for the IDE case, also create a symlink inside the libclang.dylib directory. llvm-svn: 178372
* Sema: Warn on sizeof on binary ops on decayed arrays.Benjamin Kramer2013-03-296-2/+54
| | | | | | | | | | | | | The array will decay into a pointer, creating an unexpected result. sizeof(array + int) is an easy to make typo for sizeof(array) + int. This was motivated by a NetBSD security bug, used sizeof(key - r) instead of sizeof(key) - r, reducing entropy in a random number generator. http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_cprng.c.diff?r1=1.14&r2=1.15&only_with_tag=MAIN&f=h Differential Revision: http://llvm-reviews.chandlerc.com/D571 llvm-svn: 178371
* Bugfix/Followup for r177086.Adrian Prantl2013-03-298-39/+55
| | | | | | | | | * Store the .block_descriptor (instead of self) in the alloca so we can guarantee that all captured variables are available at -O0. * Add the missing OpDeref for the alloca. rdar://problem/12767564 llvm-svn: 178361
* Improvement on r177086.Adrian Prantl2013-03-292-3/+18
| | | | | | | | * Let DIType for block-captured self to point to the completed cached interface type. rdar://problem/12767564 llvm-svn: 178360
* Hexagon: Set Hexagon tool-chain when configured as OSless target.Jyotsna Verma2013-03-291-1/+5
| | | | llvm-svn: 178358
* Remove sign-compare warning on systems that still use 32 bit time_ts.Benjamin Kramer2013-03-291-4/+4
| | | | llvm-svn: 178351
* Fix thinko (and the bots): We still want to warn in C.Rafael Espindola2013-03-291-2/+2
| | | | llvm-svn: 178335
* Don't special case one line extern "C" decls.Rafael Espindola2013-03-292-0/+5
| | | | | | | | | | | | | | We already avoided warning for extern "C" const char *Version_string = "2.9"; now we also don't produce any warnings for extern "C" { extern const char *Version_string2 = "2.9"; } llvm-svn: 178333
* Add RDSEED intrinsic support defined in AVX2 extensionMichael Liao2013-03-298-4/+112
| | | | llvm-svn: 178331
* Add XTEST intrinsic defined in TSX extensionMichael Liao2013-03-293-0/+15
| | | | llvm-svn: 178330
* [cfg] Always guard (when AddStaticInitBranches == true) DeclStmts for static ↵Ted Kremenek2013-03-291-15/+15
| | | | | | variables, not just ones with explicit initializers llvm-svn: 178322
* [analyzer] Add static initializer test case (from <rdar://problem/13227740>).Ted Kremenek2013-03-291-0/+23
| | | | llvm-svn: 178321
* Revert r178273 as it broke the Linux bootstrap due to false positivesTimur Iskhodzhanov2013-03-293-165/+17
| | | | llvm-svn: 178320
* Add static analyzer support for conditionally executing static initializers.Ted Kremenek2013-03-2910-29/+81
| | | | llvm-svn: 178318
* Add configuration plumbing to enable static initializer branching in the CFG ↵Ted Kremenek2013-03-295-3/+16
| | | | | | | | | for the analyzer. This setting still isn't enabled yet in the analyzer. This is just prep work. llvm-svn: 178317
* Objective-C: Produce precise diagnostic whenFariborz Jahanian2013-03-283-20/+43
| | | | | | | | 'isa' ivar is accessed provided it is the first ivar. Fixit hint will follow in another patch. This is continuation of // rdar://13503456 llvm-svn: 178313
* [analyzer] Document existence of ConstPointerEscape.Anna Zaks2013-03-281-0/+12
| | | | llvm-svn: 178311
* [analyzer] Add support for escape of const pointers and use it to allow ↵Anna Zaks2013-03-2811-39/+195
| | | | | | | | | | | | | “newed” pointers to escape Add a new callback that notifies checkers when a const pointer escapes. Currently, this only works for const pointers passed as a top level parameter into a function. We need to differentiate the const pointers escape from regular escape since the content pointed by const pointer will not change; if it’s a file handle, a file cannot be closed; but delete is allowed on const pointers. This should suppress several false positives reported by the NewDelete checker on llvm codebase. llvm-svn: 178310
* [analyzer] Apply the suppression rules to the nil receiver only if the value ↵Anna Zaks2013-03-286-52/+186
| | | | | | | | | | | | | | participates in the computation of the nil we warn about. We should only suppress a bug report if the IDCed or null returned nil value is directly related to the value we are warning about. This was not the case for nil receivers - we would suppress a bug report that had an IDCed nil receiver on the path regardless of how it’s related to the warning. 1) Thread EnableNullFPSuppression parameter through the visitors to differentiate between tracking the value which is directly responsible for the bug and other values that visitors are tracking (ex: general tracking of nil receivers). 2) in trackNullOrUndef specifically address the case when a value of the message send is nil due to the receiver being nil. llvm-svn: 178309
* [ms-cxxabi] Add more tests for r178297Reid Kleckner2013-03-282-2/+35
| | | | | | | This covers a few cases where the class of a member pointer is not a CXXRecordDecl. llvm-svn: 178307
* [sema] Check the result of getAsCXXRecordDecl() to fix the buildReid Kleckner2013-03-281-2/+2
| | | | | | | I'm not 100% sure what should happen here to find the real CXXRecordDecl. llvm-svn: 178297
* Warn about more than the first unused variable when -Werror is set.Matt Beaumont-Gay2013-03-283-2/+12
| | | | | | | To do this, thread DiagnosticErrorTrap's hasUnrecoverableErrorOccurred through to Scope. llvm-svn: 178294
* [sema] Remove unused variable from r178283Reid Kleckner2013-03-281-1/+0
| | | | | | | Wouldn't it be cool if we had a compiler for Windows that could warn about these things? llvm-svn: 178289
* [ms-cxxabi] Correctly compute the size of member pointersReid Kleckner2013-03-286-41/+241
| | | | | | | | | | | | | | | | | Summary: This also relaxes the requirement on Windows that the member pointer class type be a complete type (http://llvm.org/PR12070). We still ask for a complete type to instantiate any templates (MSVC does this), but if that fails we continue as normal, relying on any inheritance attributes on the declaration. Reviewers: rjmccall CC: triton, timurrrr, cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D568 llvm-svn: 178283
* Objective-C: Provide fixit suggestions when class objectFariborz Jahanian2013-03-287-8/+66
| | | | | | | | is accessed via accessing 'isa' ivar to use object_getClass/object_setClass apis. // rdar://13503456 llvm-svn: 178282
* Provide a fixit to static_cast for reinterpret_casts within a class hierarchy.Jordan Rose2013-03-282-6/+49
| | | | | | | | | The suggestion was already in the text of the note; this just adds the actual fixit and the appropriate test cases. Patch by Alexander Zinenko! llvm-svn: 178274
* Implemented a warning when an input several bitwise operations areSam Panzer2013-03-283-17/+165
| | | | | | | | | | | likely be implicitly truncated: * All forms of Bitwise-and, bitwise-or, and integer multiplication. * The assignment form of integer addition, subtraction, and exclusive-or * The RHS of the comma operator * The LHS of left shifts. llvm-svn: 178273
* Rename clang::driver::tools::linuxtools to clang::driver::tools::gnutools.Thomas Schwinge2013-03-283-17/+16
| | | | | | | This is about the GNU Binutils' assembler and linker, so reflect that in the name. llvm-svn: 178272
* Rename LinuxDistro to Distro.Thomas Schwinge2013-03-281-11/+11
| | | | | | | | The concept of such a software distribution is not tied to the Linux kernel; for example Debian GNU/Linux, Debian GNU/Hurd, and Debian GNU/kFreeBSD all share the same source packages and generally the same user-space configuration. llvm-svn: 178270
* Use early return in printing logic. Minor cleanup.Ted Kremenek2013-03-281-2/+4
| | | | llvm-svn: 178264
* Add CFG logic to create a conditional branch for modeling static initializers.Ted Kremenek2013-03-282-2/+34
| | | | | | | | | | | | | | | | This is an optional variant of the CFG. This allows analyses to model whether or not a static initializer has run, e.g.: static Foo x = bar(); For basic dataflow analysis in Sema we will just assume that the initializer always runs. For the static analyzer we can use this branch to accurately track whether or not initializers are on. This patch just adds the (opt-in) functionality to the CFG. The static analyzer still needs to be modified to adopt this feature. llvm-svn: 178263
* Fixed handling of comments before preprocessor directives.Alexander Kornienko2013-03-282-2/+10
| | | | | | | | | Comments before preprocessor directives used to be stored with InPPDirective flag set, which prevented correct comment splitting in this case. Fixed by flushing comments before switching on InPPDirective. Added a new test and fixed one of the existing tests. llvm-svn: 178261
* Fix order of initialization warning.Eric Christopher2013-03-281-1/+1
| | | | llvm-svn: 178255
* [analyzer] These implements unix.MismatchedDeallocatorChecker checker.Anton Yartsev2013-03-286-85/+499
| | | | | | | | + Improved display names for allocators and deallocators The checker checks if a deallocation function matches allocation one. ('free' for 'malloc', 'delete' for 'new' etc.) llvm-svn: 178250
* These are all simple pointer wrappers. Pass them by value.Rafael Espindola2013-03-284-4/+4
| | | | llvm-svn: 178247
* [analyzer] For now assume all standard global 'operator new' functions ↵Anton Yartsev2013-03-285-56/+158
| | | | | | | | allocate memory in heap. + Improved test coverage for cplusplus.NewDelete checker. llvm-svn: 178244
* Add support for gcc-compatible -mpopcntd -mno-popcntd PPC optionsHal Finkel2013-03-284-1/+14
| | | | | | | gcc provides -mpopcntd and -mno-popcntd for controlling the popcntd target feature; support these options as well. llvm-svn: 178235
OpenPOWER on IntegriCloud