summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix unused variable warningSimon Pilgrim2016-06-131-51/+50
| | | | llvm-svn: 272541
* [Clang][X86] Convert non-temporal store builtins to generic ↵Simon Pilgrim2016-06-135-72/+60
| | | | | | | | | | | | | | __builtin_nontemporal_store in headers We can now use __builtin_nontemporal_store instead of target specific builtins for naturally aligned nontemporal stores which avoids the need for handling in CGBuiltin.cpp The scalar integer nontemporal (unaligned) store builtins will have to wait as __builtin_nontemporal_store currently assumes natural alignment and doesn't accept the 'packed struct' trick that we use for normal unaligned load/stores. The nontemporal loads require further backend support before we can safely convert them to __builtin_nontemporal_load Differential Revision: http://reviews.llvm.org/D21272 llvm-svn: 272540
* clang-format: Fix incorrect function type detection.Daniel Jasper2016-06-131-6/+7
| | | | | | | | | | Before: returnsFunction (&param1, &param2)(param); After: returnsFunction(&param1, &param2)(param); llvm-svn: 272538
* clang-format: Don't merge const and &, e.g. in function ref qualifiers.Daniel Jasper2016-06-131-1/+1
| | | | | | | | | | | | | | | | | Before (when aligning & to the right): SomeType MemberFunction(const Deleted &) const&; After: SomeType MemberFunction(const Deleted &) const &; This also applies to variable declarations, e.g.: int const * a; However, this form is very uncommon (most people would write "const int* a" instead) and contracting to "const*" might actually send the wrong signal of what the const binds to. llvm-svn: 272537
* clang-format: Fix incorrect cast detection.Daniel Jasper2016-06-131-2/+2
| | | | | | | | | | Before: auto s = sizeof...(Ts)-1; After: auto s = sizeof...(Ts) - 1; llvm-svn: 272536
* clang-format: Don't indent lambda body relative to its return type.Daniel Jasper2016-06-131-5/+7
| | | | | | | | | | | | | | | | Before: []() // -> int { return 1; // }; After: []() // -> int { return 1; // }; llvm-svn: 272535
* MPIBugReporter.h: Fix a warning. [-Wdocumentation]NAKAMURA Takumi2016-06-131-1/+1
| | | | llvm-svn: 272534
* [AVX512] Masked pcmpeqd, pcmpeqq, pcmpgtd, and pcmpgtq don't require ↵Craig Topper2016-06-131-18/+16
| | | | | | avx512bw, just avx512vl. llvm-svn: 272532
* [analyzer] Remove some list initialization from MPI Checker to make MSVC ↵Devin Coughlin2016-06-132-19/+19
| | | | | | | | | | bots happy. This is a speculative attempt to fix the compiler error: "list initialization inside member initializer list or non-static data member initializer is not implemented" with r272529. llvm-svn: 272530
* [analyzer] Add checker to verify the correct usage of the MPI APIDevin Coughlin2016-06-139-0/+1034
| | | | | | | | | | | | | | | | | | | | | This commit adds a static analysis checker to verify the correct usage of the MPI API in C and C++. This version updates the reverted r271981 to fix a memory corruption found by the ASan bots. Three path-sensitive checks are included: - Double nonblocking: Double request usage by nonblocking calls without intermediate wait - Missing wait: Nonblocking call without matching wait. - Unmatched wait: Waiting for a request that was never used by a nonblocking call Examples of how to use the checker can be found at https://github.com/0ax1/MPI-Checker A patch by Alexander Droste! Reviewers: zaks.anna, dcoughlin Differential Revision: http://reviews.llvm.org/D21081 llvm-svn: 272529
* clang-format: [JS] post-fix non-null assertion operator.Martin Probst2016-06-131-0/+5
| | | | | | | | | | | | | | Summary: Do not insert whitespace preceding the "!" postfix operator. This is an incomplete fix, but should cover common usage. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D21204 llvm-svn: 272524
* Add some std::move where the value is only read otherwise.Benjamin Kramer2016-06-125-23/+28
| | | | | | This mostly affects smart pointers. No functionality change intended. llvm-svn: 272520
* [CodeGen] Update to use an ArrayRef of uint32_t instead of int in calls to ↵Craig Topper2016-06-121-10/+10
| | | | | | CreateShuffleVector to match llvm interface change. llvm-svn: 272492
* Fix cv-qualification of '*this' captures and nasty bug PR27507 Faisal Vali2016-06-112-25/+118
| | | | | | | | | | | | | The bug report by Gonzalo (https://llvm.org/bugs/show_bug.cgi?id=27507 -- which results in clang crashing when generic lambdas that capture 'this' are instantiated in contexts where the Functionscopeinfo stack is not in a reliable state - yet getCurrentThisType expects it to be) - unearthed some additional bugs in regards to maintaining proper cv qualification through 'this' when performing by value captures of '*this'. This patch attempts to correct those bugs and makes the following changes: o) when capturing 'this', we do not need to remember the type of 'this' within the LambdaScopeInfo's Capture - it is never really used for a this capture - so remove it. o) teach getCurrentThisType to walk the stack of lambdas (even in scenarios where we run out of LambdaScopeInfo's such as when instantiating call operators) looking for by copy captures of '*this' and resetting the type of 'this' based on the constness of that capturing lambda's call operator. This patch has been baking in review-hell for > 6 weeks - all the comments so far have been addressed and the bug (that it addresses in passing, and I regret not submitting as a separate patch initially) has been reported twice independently, so is frequent and important for us not to just sit on. I merged the cv qualification-fix and the PR-fix initially in one patch, since they resulted from my initial implementation of star-this and so were related. If someone really feels strongly, I can put in the time to revert this - separate the two out - and recommit. I won't claim it's immunized against all bugs, but I feel confident enough about the fix to land it for now. llvm-svn: 272480
* [AVX512] Implement masked and 512-bit pshufd intrinsics directly with ↵Craig Topper2016-06-113-25/+36
| | | | | | __builtin_shufflevector and __builtin_ia32_select. llvm-svn: 272467
* [X86] Add explicit typecasts to some intrinsics.Craig Topper2016-06-111-4/+6
| | | | llvm-svn: 272466
* [clang-format] pass Style by reference instead of value.Eric Liu2016-06-111-1/+1
| | | | llvm-svn: 272465
* Revert "Strip Android version when looking up toolchain paths."Chandler Carruth2016-06-111-9/+1
| | | | | | | This reverts commit r272413. The tests here have been failing on several different build bots for over 10 hours. llvm-svn: 272454
* Revert "[ASTMatchers] New forEachOverriden matcher."Chandler Carruth2016-06-112-19/+9
| | | | | | | This reverts commit r272386. It doesn't compile with MSVC and those bots have been red the entire day as a consequence. llvm-svn: 272453
* [AVX512] Implement 512-bit and masked shufflelo and shufflehi intrinsics ↵Craig Topper2016-06-114-56/+84
| | | | | | directly with __builtin_shufflevector and __builtin_ia32_select. Also improve the formatting of the AVX2 version. llvm-svn: 272452
* [AVX512] Add _mm512_bsrli_epi128 and _mm512_bslli_epi128 intrinsics.Craig Topper2016-06-111-1/+138
| | | | llvm-svn: 272451
* [Sema] Return an appropriate result from CheckSpecifiedExceptionTypeDavid Majnemer2016-06-111-2/+5
| | | | | | | | We shouldn't return true from CheckSpecifiedExceptionType if the record type is incomplete and -fms-extensions is engaged. Otherwise we will have an incomplete AST. llvm-svn: 272447
* Revise RenderScript attribute declarationPirama Arumuga Nainar2016-06-101-13/+2
| | | | | | | | | | | | | | | | Summary: Address post-patch comments to r272342. - Rename the 'kernel' attribute's name - Idiomatically restrict the attribute to the 'RenderScript' LangOpt. Reviewers: aaron.ballman, rsmith Subscribers: cfe-commits, srhines Differential Revision: http://reviews.llvm.org/D21240 llvm-svn: 272438
* [-fms-extensions] Don't crash on explicit class-scope specializations & ↵David Majnemer2016-06-101-1/+1
| | | | | | | | | | | | | | default arguments The code had a typo it was doing: Param->setUninstantiatedDefaultArg(Param->getUninstantiatedDefaultArg()); This is a no-op but may assert, we wanted to do: Param->setUninstantiatedDefaultArg(OldParam->getUninstantiatedDefaultArg()); This fixes PR28082. llvm-svn: 272425
* Driver: make it easier to select the SjLj EH modelSaleem Abdulrasool2016-06-101-1/+2
| | | | | | | | | | | GCC still permits enabling the SjLj EH model. This is something which can be done on various targets. Hoist the -fsjlj-exceptions option into the driver and pass it through. This allows one to opt into the alternative EH model while retaining the default to be the target's default. Resolves PR27749! llvm-svn: 272424
* Remove a few gendered pronouns.Nico Weber2016-06-105-8/+7
| | | | llvm-svn: 272415
* Strip Android version when looking up toolchain paths.Josh Gao2016-06-101-1/+9
| | | | | | | | | | | | | | | | Summary: Android target triples can include a version number in the abi field (e.g. 'aarch64-linux-android21'), used for checking for availability. However, the driver was searching for toolchain binaries using the passed in triple as a prefix. Reviewers: srhines, danalbert, t.p.northover Subscribers: t.p.northover, aemerson, tberghammer, danalbert, srhines, cfe-commits Differential Revision: http://reviews.llvm.org/D21163 llvm-svn: 272413
* [-fms-extensions] Permit incomplete types in dynamic exception specificationsDavid Majnemer2016-06-101-2/+5
| | | | | | | | | | Microsoft headers, comdef.h and comutil.h, assume that this is an OK thing to do. Downgrade the hard error to a warning if we are in -fms-extensions mode. This fixes PR28080. llvm-svn: 272412
* This patch fixes target linker emulation for ARM 32 big endian.Strahinja Petrovic2016-06-101-1/+1
| | | | llvm-svn: 272402
* Preallocate ExplodedNode hash tableBen Craig2016-06-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | Rehashing the ExplodedNode table is very expensive. The hashing itself is expensive, and the general activity of iterating over the hash table is highly cache unfriendly. Instead, we guess at the eventual size by using the maximum number of steps allowed. This generally avoids a rehash. It is possible that we still need to rehash if the backlog of work that is added to the worklist significantly exceeds the number of work items that we process. Even if we do need to rehash in that scenario, this change is still a win, as we still have fewer rehashes that we would have prior to this change. For small work loads, this will increase the memory used. For large work loads, it will somewhat reduce the memory used. Speed is significantly increased. A large .C file took 3m53.812s to analyze prior to this change. Now it takes 3m38.976s, for a ~6% improvement. http://reviews.llvm.org/D20933 llvm-svn: 272394
* [ASTMatchers] New forEachOverriden matcher.Clement Courbet2016-06-102-9/+19
| | | | | | Matches methods overridden by the given method. llvm-svn: 272386
* Check for null pointers before calling the Stmt ProfilerRichard Trieu2016-06-101-31/+63
| | | | | | | | | Some calls from OMPClauseProfiler were calling the Stmt Profiler with null pointers, but the profiler can only handle non-null pointers. Add an assert to the VisitStmt for valid pointers, and check all calls from OMPClauseProfiler to be non-null pointers. llvm-svn: 272368
* Fix recognition of shadowed template parameterSerge Pavlov2016-06-101-6/+8
| | | | | | | | | | | | | | | | | | | | | | | Crash reported in PR28023 is caused by the fact that non-type template parameters are found by tag name lookup. In the code provided in that PR: template<int V> struct A { struct B { template <int> friend struct V; }; }; the template parameter V is found when lookup for redeclarations of 'struct V' is made. Latter on the error about shadowing of 'V' is emitted but the semantic context of 'struct V' is already determined wrong: 'struct A' instead of translation unit. The fix moves the check for shadowing toward the beginning of the method and thus prevents from wrong context calculations. This change fixes PR28023. llvm-svn: 272366
* Remove CXXConstructExpr::getFoundDecl(); it turned out to not be useful.Richard Smith2016-06-106-32/+26
| | | | llvm-svn: 272357
* Add doxygen comments to mmintrin.h's intrinsics.Ekaterina Romanova2016-06-101-0/+1041
| | | | | | | | | | The doxygen comments are automatically generated based on Sony's intrinsics docu ment. I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. llvm-svn: 272350
* RenderScript support in the FrontendPirama Arumuga Nainar2016-06-093-0/+26
| | | | | | | | | | | | | | | | | | | | | Summary: Create a new Frontend LangOpt to specify the renderscript language. It is enabled by the "-x renderscript" option from the driver. Add a "kernel" function attribute only for RenderScript (an "ignored attribute" warning is generated otherwise). Make the NativeHalfType and NativeHalfArgsAndReturns LangOpts be implied by the RenderScript LangOpt. Reviewers: rsmith Subscribers: cfe-commits, srhines Differential Revision: http://reviews.llvm.org/D21198 llvm-svn: 272342
* clang-format: [JS] recognized named functions in AnnotatingParser.Martin Probst2016-06-091-1/+4
| | | | | | | | | | | | | | | Summary: This also fixes union type formatting in function parameter types. Before: function x(path: number| string) {} After: function x(path: number|string) {} Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D21206 llvm-svn: 272330
* Fix a crash in the AST dumper.Richard Trieu2016-06-091-2/+4
| | | | | | | Boxed expressions in a template context may have a null method decl. If so, don't try to access the selector. llvm-svn: 272318
* Add a RenderScript language typePirama Arumuga Nainar2016-06-091-0/+1
| | | | | | | | | | | | | | | | | Summary: Add RenderScript language type and associate it with ".rs" extensions. Test that the driver passes "-x renderscript" to the frontend for ".rs" files. (Also add '.rs' to the list of suffixes tested by lit). Reviewers: rsmith Subscribers: cfe-commits, srhines Differential Revision: http://reviews.llvm.org/D21199 llvm-svn: 272317
* Revert "[Temporary] Add an ExprWithCleanups for each C++ ↵Tim Shen2016-06-0917-109/+51
| | | | | | | | | MaterializeTemporaryExpr." This reverts r272296, since there are clang-tidy failures that appear to be caused by this change. llvm-svn: 272310
* [CUDA] Implement __shfl* intrinsics in clang headers.Justin Lebar2016-06-092-6/+77
| | | | | | | | | | | | Summary: Clang changes to make use of the LLVM intrinsics added in D21160. Reviewers: tra Subscribers: jholewinski, cfe-commits Differential Revision: http://reviews.llvm.org/D21162 llvm-svn: 272299
* [Temporary] Add an ExprWithCleanups for each C++ MaterializeTemporaryExpr.Tim Shen2016-06-0917-51/+109
| | | | | | | | | | | These ExprWithCleanups are added for holding a RunCleanupsScope not for destructor calls; rather, they are for lifetime marks. This requires ExprWithCleanups to keep a bit to indicate whether it have cleanups with side effects (e.g. dtor calls). Differential Revision: http://reviews.llvm.org/D20498 llvm-svn: 272296
* CIndex: add support for static_assertOlivier Goffart2016-06-091-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D18080 llvm-svn: 272273
* [Sema] Don't crash when a field w/ a mem-initializer clashes with a record nameDavid Majnemer2016-06-091-2/+1
| | | | | | | | | | | It is possible for a field and a class to have the same name. In such cases, performing lookup for the field might return a result set with more than one entry. An overzealous assertion fired, causing us to crash instead of using the non-class lookup result. This fixes PR28060. llvm-svn: 272247
* [X86] Handle AVX2 pslldqi and psrldqi intrinsics shufflevector creation ↵Craig Topper2016-06-093-94/+116
| | | | | | directly in the header file instead of in CGBuiltin.cpp. Simplify the sse2 equivalents as well. llvm-svn: 272246
* [X86] Reuse the EmitX86Select routine to handle the select for masked ↵Craig Topper2016-06-091-16/+7
| | | | | | palignr too. llvm-svn: 272245
* [X86] Add void to the argument list of intrinsics that don't take arguments ↵Craig Topper2016-06-095-11/+11
| | | | | | since empty argument list mean something else in C. llvm-svn: 272244
* [DebugInfo] Add calling conventions to DISubroutineTypeReid Kleckner2016-06-082-15/+57
| | | | | | | | | | | | | | | | | | | | | | | Summary: This should have been a very simple change, but it was greatly complicated by the construction of new Decls during IR generation. In particular, we reconstruct the AST function type in order to get the implicit 'this' parameter into C++ method types. We also have to worry about FunctionDecls whose types are not FunctionTypes because CGBlocks.cpp constructs some dummy FunctionDecls with 'void' type. Depends on D21114 Reviewers: aprantl, dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D21141 llvm-svn: 272198
* [Sema] Don't permit catching variably modified typesDavid Majnemer2016-06-081-0/+5
| | | | | | | | Variably modified types shouldn't be permitted in catch clauses. This fixes PR28047. llvm-svn: 272159
* Prune away some unused using decls. NFC.Benjamin Kramer2016-06-082-2/+0
| | | | | | Found by clang's misc-unused-using-decls. llvm-svn: 272156
OpenPOWER on IntegriCloud