- Jun 22, 2015
-
-
Alexander Kornienko authored
The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240270 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 20, 2015
-
-
Adrian Prantl authored
A PCHContainerOperations abstract interface provides operations for creating and unwrapping containers for serialized ASTs (precompiled headers and clang modules). The default implementation is RawPCHContainerOperations, which uses a flat file for the output. The main application for this interface will be an ObjectFilePCHContainerOperations implementation that uses LLVM to wrap the module in an ELF/Mach-O/COFF container to store debug info alongside the AST. rdar://problem/20091852 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240225 91177308-0d34-0410-b5e6-96231b3b80d8
-
Douglas Gregor authored
Includes a simple static analyzer check and not much else, but we'll also be able to take advantage of this in Swift. This feature can be tested for using __has_feature(cf_returns_on_parameters). This commit also contains two fixes: - Look through non-typedef sugar when deciding whether something is a CF type. - When (cf|ns)_returns(_not)?_retained is applied to invalid properties, refer to "property" instead of "method" in the error message. rdar://problem/18742441 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240185 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 19, 2015
-
-
Eric Christopher authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240110 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 18, 2015
-
-
Alexey Bataev authored
Added parsing, sema analysis and codegen for '#pragma omp taskgroup' directive (OpenMP 4.0). The code for directive is generated the following way: #pragma omp taskgroup <body> void __kmpc_taskgroup(<loc>, thread_id); <body> void __kmpc_end_taskgroup(<loc>, thread_id); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240011 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 15, 2015
-
-
Devin Coughlin authored
Update ObjCContainersChecker to be notified when pointers escape so it can remove size information for escaping CFMutableArrayRefs. When such pointers escape, un-analyzed code could mutate the array and cause the size information to be incorrect. rdar://problem/19406485 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239709 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 13, 2015
-
-
Rafael Espindola authored
As noted on Errc.h: // * std::errc is just marked with is_error_condition_enum. This means that // common patters like AnErrorCode == errc::no_such_file_or_directory take // 4 virtual calls instead of two comparisons. And on some libstdc++ those virtual functions conclude that ------------------------ int main() { std::error_code foo = std::make_error_code(std::errc::no_such_file_or_directory); return foo == std::errc::no_such_file_or_directory; } ------------------------- should exit with 0. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239684 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 10, 2015
-
-
Yunzhong Gao authored
Based on previous discussion on the mailing list, clang currently lacks support for C99 partial re-initialization behavior: Reference: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-April/029188.html Reference: http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_253.htm This patch attempts to fix this problem. Given the following code snippet, struct P1 { char x[6]; }; struct LP1 { struct P1 p1; }; struct LP1 l = { .p1 = { "foo" }, .p1.x[2] = 'x' }; // this example is adapted from the example for "struct fred x[]" in DR-253; // currently clang produces in l: { "\0\0x" }, // whereas gcc 4.8 produces { "fox" }; // with this fix, clang will also produce: { "fox" }; Differential Review: http://reviews.llvm.org/D5789 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239446 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 04, 2015
-
-
Devin Coughlin authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238993 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 03, 2015
-
-
Enrico Pertoso authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238910 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 29, 2015
-
-
Benjamin Kramer authored
If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238601 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 17, 2015
-
-
Pete Cooper authored
This file doesn't include CheckerManager or forward declare it, so is sensitive to include order. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235209 91177308-0d34-0410-b5e6-96231b3b80d8
-
Sylvestre Ledru authored
Enforcing the assert caused the following tests to fail: Clang :: Analysis__bstring.c Clang :: Analysis__comparison-implicit-casts.cpp Clang :: Analysis__malloc-interprocedural.c Clang :: Analysis__malloc.c Clang :: Analysis__redefined_system.c Clang :: Analysis__string.c Clang :: Analysis__weak-functions.c git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235190 91177308-0d34-0410-b5e6-96231b3b80d8
-
Sylvestre Ledru authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235188 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 14, 2015
-
-
Anton Yartsev authored
TODO: support realloc(). Currently it is not possible due to the present realloc() handling. Currently RegionState is not being attached to realloc() in case of a zero Size argument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234889 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 11, 2015
-
-
Alexander Kornienko authored
Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234678 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 10, 2015
-
-
Benjamin Kramer authored
No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234587 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 30, 2015
-
-
Jordan Rose authored
This is imitating a pre-r228174 state where ivars are not considered tracked by default, but with the addition that even ivars /with/ retain count information (e.g. "[_ivar retain]; [ivar _release];") are not being tracked as well. This is to ensure that we don't regress on values accessed through both properties and ivars, which is what r228174 was trying to fix. The issue occurs in code like this: [_contentView retain]; [_contentView removeFromSuperview]; [self addSubview:_contentView]; // invalidates 'self' [_contentView release]; In this case, the call to -addSubview: may change the value of self->_contentView, and so the analyzer can't be sure that we didn't leak the original _contentView. This is a correct conservative view of the world, but not a useful one. Until we have a heuristic that allows us to not consider this a leak, not emitting a diagnostic is our best bet. This commit disables all of the ivar-related retain count tests, but does not remove them to ensure that we don't crash trying to evaluate either valid or erroneous code. The next commit will add a new test for the example above so that this commit (and the previous one) can be reverted wholesale when a better solution is implemented. Rest of rdar://problem/20335433 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233592 91177308-0d34-0410-b5e6-96231b3b80d8
-
Jordan Rose authored
Give up this checking in order to continue tracking that these values came from direct ivar access, which will be important in the next commit. Part of rdar://problem/20335433 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233591 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 24, 2015
-
-
Benjamin Kramer authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233060 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 22, 2015
-
-
Benjamin Kramer authored
That's not really necessary here. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232921 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 20, 2015
-
-
Jordan Rose authored
Similarly, don't assume +0 if the property's setter is manually implemented. In both cases, if the property's ownership is explicitly written, then we /do/ assume the ivar has the same ownership. rdar://problem/20218183 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232849 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 18, 2015
-
-
Yaron Keren authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232624 91177308-0d34-0410-b5e6-96231b3b80d8
-
Yaron Keren authored
Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232622 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 14, 2015
-
-
Benjamin Kramer authored
They're expensive to compare and we won't sort many of them so std::sort doesn't give any benefits and causes code bloat. Func fact: clang -O3 didn't even bother to inline libc++'s std::sort here. While there validate the predicate a bit harder, the sort is unstable and we don't want to introduce any non-determinism. I had to spell out the function pointer type because GCC 4.7 still fails to convert the lambda to a function pointer :( No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232263 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 11, 2015
-
-
Ed Schouten authored
CloudABI also supports the arc4random() function. We can enable compiler warnings for rand(), random() and *rand48() on this system as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231914 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 10, 2015
-
-
Anton Yartsev authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231863 91177308-0d34-0410-b5e6-96231b3b80d8
-
Yaron Keren authored
Saves adding .str() call to any raw_ostream << SmallString usage and a small step towards making .str() consistent in the ADTs by removing one of the SmallString::str() use cases, discussion at http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141013/240026.html I'll update the Phabricator patch http://reviews.llvm.org/D6372 for review of the Twine SmallString support, it's more complex than this one. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231763 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 09, 2015
-
-
Benjamin Kramer authored
Found by -Wmissing-prototypes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231668 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 07, 2015
-
-
Jordan Rose authored
In theory we could assume a CF property is stored at +0 if there's not a custom setter, but that's not really worth the complexity. What we do know is that a CF property can't have ownership attributes, and so we shouldn't assume anything about the ownership of the ivar. rdar://problem/20076963 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231553 91177308-0d34-0410-b5e6-96231b3b80d8
-
Anton Yartsev authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231548 91177308-0d34-0410-b5e6-96231b3b80d8
-
Anton Yartsev authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231540 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 05, 2015
-
-
Anton Yartsev authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231314 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 04, 2015
-
-
Gabor Horvath authored
Reviewed by: Anna Zaks Original patch by: Aleksei Sidorin Differential Revision: http://reviews.llvm.org/D7905 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231266 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 03, 2015
-
-
Anton Yartsev authored
Binding __builtin_alloca() return value to the symbolic value kills previous binding to a AllocaRegion established by the core.BuiltinFunctions checker. Other checkers may rely upon this information. Rollback handling of __builtin_alloca() to the way prior to r229850. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231160 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 25, 2015
-
-
David Majnemer authored
We would wrongfully reject (a.~A)() in both the destructor and pseudo-destructor cases. This fixes PR22668. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230512 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 20, 2015
-
-
Jordan Rose authored
We expect in general that any nil value has no retain count information associated with it; violating this results in unexpected state unification /later/ when we decide to throw the information away. Unexpectedly caching out can lead to an assertion failure or crash. rdar://problem/19862648 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229934 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 19, 2015
-
-
Anton Yartsev authored
+ separate bug report for "Free alloca()" error to be able to customize checkers responsible for this error. + Muted "Free alloca()" error for NewDelete checker that is not responsible for c-allocated memory, turned on for unix.MismatchedDeallocator checker. + RefState for alloca() - to be able to detect usage of zero-allocated memory by upcoming ZeroAllocDereference checker. + AF_Alloca family to handle alloca() consistently - keep proper family in RefState, handle 'alloca' by getCheckIfTracked() facility, etc. + extra tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229850 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 18, 2015
-
-
Anton Yartsev authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229593 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 17, 2015
-
-
Benjamin Kramer authored
Same functionality, but hoists the vector growth out of the loop. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229508 91177308-0d34-0410-b5e6-96231b3b80d8
-