summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* unique_ptrify Driver::ToolChainsDavid Blaikie2017-01-131-44/+45
| | | | llvm-svn: 291938
* unique_ptrify createDriverOptTableDavid Blaikie2017-01-135-14/+12
| | | | llvm-svn: 291919
* Use less byval on 32-bit Windows x86 for classes with basesReid Kleckner2017-01-131-22/+38
| | | | | | | | | | | | This comes up in V8, which has a Handle template class that wraps a typed pointer, and is frequently passed by value. The pointer is stored in the base, HandleBase. This change allows us to pass the struct as a pointer instead of using byval. This avoids creating tons of temporary allocas that we copy from during call lowering. Eventually, it would be good to use FCAs here instead. llvm-svn: 291917
* [Sema] Add warning for unused lambda capturesMalcolm Parsons2017-01-133-3/+25
| | | | | | | | | | | | | | | Summary: Warn when a lambda explicitly captures something that is not used in its body. The warning is part of -Wunused and can be enabled with -Wunused-lambda-capture. Reviewers: rsmith, arphaman, jbcoe, aaron.ballman Subscribers: Quuxplusone, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D28467 llvm-svn: 291905
* Implement DR1265 (wg21.link/cwg1265).Richard Smith2017-01-132-66/+90
| | | | | | | | | | | | Diasllow a declaration using the 'auto' type specifier from using two different meanings of it at once, or from declaring multiple functions with deduced return types or introducing multiple trailing return types. The standard does not technically disallow the multiple trailing return types case if all the declarators declare variables (such as function pointers with trailing return types), but we disallow that too, following the clear intent. llvm-svn: 291880
* [Sema] Restrict explicit instantation definition dllexportShoaib Meenai2017-01-131-2/+4
| | | | | | | | | | | | | | | | In the case where the template class itself is already `dllexport`, the implicit instantiation will have already emitted all members. When we check the explicit instantiation definition, the `Specialization` will have inherited the `dllexport` attribute, so we'll attempt to emit all members for a second time, which causes an assertion failure. Restrict the exporting to when the `dllexport` attribute is newly introduced by the explicit instantiation definition. Fixes PR31608. Differential Revision: https://reviews.llvm.org/D28590 llvm-svn: 291877
* [DOXYGEN] Documentation for the newly added x86 intrinsics.Ekaterina Romanova2017-01-135-12/+64
| | | | | | | | | | | | | | Added doxygen comments for the newly added intrinsics in avxintrin.h, namely _mm256_cvtsd_f64, _mm256_cvtsi256_si32 and _mm256_cvtss_f32 Added doxygen comments for the new intrinsics in emmintrin.h, namely _mm_loadu_si64 and _mm_load_sd. Explicit parameter names were added for _mm_clflush and _mm_setcsr The rest of the changes are editorial, removing trailing spaces at the end of the lines. Differential Revision: https://reviews.llvm.org/D28503 llvm-svn: 291876
* Pass -fprofile-sample-use to lto backends.Dehao Chen2017-01-131-2/+5
| | | | | | | | | | | | Summary: LTO backend will not invoke SampleProfileLoader pass even if -fprofile-sample-use is specified. This patch passes the flag down so that pass manager can add the SampleProfileLoader pass correctly. Reviewers: mehdi_amini, tejohnson Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28588 llvm-svn: 291870
* [analyzer] Add LocationContext as a parameter to checkRegionChangesAnna Zaks2017-01-1311-48/+60
| | | | | | | | | | | This patch adds LocationContext to checkRegionChanges and removes wantsRegionChangeUpdate as it was unused. A patch by Krzysztof Wiśniewski! Differential Revision: https://reviews.llvm.org/D27090 llvm-svn: 291869
* [tsan] Do not report errors in __destroy_helper_block_Anna Zaks2017-01-131-3/+11
| | | | | | | | | | There is a synchronization point between the reference count of a block dropping to zero and it's destruction, which TSan does not observe. Do not report errors in the compiler-emitted block destroy method and everything called from it. This is similar to https://reviews.llvm.org/D25857 Differential Revision: https://reviews.llvm.org/D28387 llvm-svn: 291868
* [analyzer] Support inlining of '[self classMethod]' and '[[self class] ↵Anna Zaks2017-01-131-2/+60
| | | | | | | | classMethod]' Differential Revision: https://reviews.llvm.org/D28495 llvm-svn: 291867
* [analyzer] Fix false positives in Keychain API checkerAnna Zaks2017-01-131-83/+89
| | | | | | | | | | | | | | The checker has several false positives that this patch addresses: - Do not check if the return status has been compared to error (or no error) at the time when leaks are reported since the status symbol might no longer be alive. Instead, pattern match on the assume and stop tracking allocated symbols on error paths. - The checker used to report error when an unknown symbol was freed. This could lead to false positives, let's not repot those. This leads to loss of coverage in double frees. - Do not enforce that we should only call free if we are sure that error was not returned and the pointer is not null. That warning is too noisy and we received several false positive reports about it. (I removed: "Only call free if a valid (non-NULL) buffer was returned") - Use !isDead instead of isLive in leak reporting. Otherwise, we report leaks for objects we loose track of. This change triggered change #1. This also adds checker specific dump to the state. Differential Revision: https://reviews.llvm.org/D28330 llvm-svn: 291866
* Improve handling of instantiated thread_local variables in Itanium C++ ABI.Richard Smith2017-01-132-14/+31
| | | | | | | | | | | | | | | | | * Do not initialize these variables when initializing the rest of the thread_locals in the TU; they have unordered initialization so they can be initialized by themselves. This fixes a rejects-valid bug: we would make the per-variable initializer function internal, but put it in a comdat keyed off the variable, resulting in link errors when the comdat is selected from a different TU (as the per TU TLS init function tries to call an init function that does not exist). * On Darwin, when we decide that we're not going to emit a thread wrapper function at all, demote its linkage to External. Fixes a verifier failure on explicit instantiation of a thread_local variable on Darwin. llvm-svn: 291865
* Address review comments on r290392:Chandler Carruth2017-01-121-4/+6
| | | | | | | | | | | | | - Don't break using '-mllvm -disable-llvm-optzns' (yet). - Don't add support for '-mllvm -disable-llvm-passes'. This is important for LLVM 4 as we haven't yet really told folks this is coming. I'll add release notes about this. I've also added some explicit testing of this so its more obvious what is happening here. llvm-svn: 291850
* clang-format: Fix regression introduced by r291801.Daniel Jasper2017-01-121-8/+4
| | | | | | | | | | | | | | Uncovered by polly tests. Before: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaa, {}, aaaaaaaaaaaaaaaaaaaaaaa); After: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaa, {}, aaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 291807
* clang-format: Treat braced lists like other complex parameters.Daniel Jasper2017-01-121-0/+7
| | | | | | | | | | | | | | | | | Specifically, wrap before them if they are multi-line so that we don't create long hanging indents. This prevents having a lot of code indented a lot in some cases. Before: someFunction(Param, {List1, List2, List3}); After: someFunction(Param, {List1, List2, List3}); llvm-svn: 291801
* [Modules] Fix misleading warning about missing textual header in umbrella headerBruno Cardoso Lopes2017-01-121-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | When a textual header is present inside a umbrella dir but not in the header, we get the misleading warning: warning: umbrella header for module 'FooFramework' does not include header 'Baz_Private.h' The module map in question: framework module FooFramework { umbrella header "FooUmbrella.h" export * module * { export * } module Private { textual header "Baz_Private.h" } } Fix this by taking textual headers into account. llvm-svn: 291794
* [analyzer] Don't dereference the array value when binding it to a reference.Artem Dergachev2017-01-122-8/+3
| | | | | | | | | | This replaces the hack in r291754, which was fixing pr31592, which was caused by r291754, with a more appropriate solution. rdar://problem/28832541 Differential revision: https://reviews.llvm.org/D28602 llvm-svn: 291781
* Revert r291774 which caused buildbot failure.Dehao Chen2017-01-121-5/+2
| | | | llvm-svn: 291775
* Pass -fprofile-sample-use to lto backends.Dehao Chen2017-01-121-2/+5
| | | | | | | | | | | | Summary: LTO backend will not invoke SampleProfileLoader pass even if -fprofile-sample-use is specified. This patch passes the flag down so that pass manager can add the SampleProfileLoader pass correctly. Reviewers: mehdi_amini, tejohnson Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28588 llvm-svn: 291774
* Tracking exception specification source locationsMalcolm Parsons2017-01-126-2/+18
| | | | | | | | | | | | | | | | | | | | Summary: We do not currently track the source locations for exception specifications such that their source range can be queried through the AST. This leads to trying to write more complex code to determine the source range for uses like FixItHints (see D18575 for an example). In addition to use within tools like clang-tidy, I think this information may become more important to track as exception specifications become more integrated into the type system. Patch by Don Hinton. Reviewers: rsmith Subscribers: malcolm.parsons, sbarzowski, alexfh, hintonda, cfe-commits Differential Revision: https://reviews.llvm.org/D20428 llvm-svn: 291771
* Avoid multiple -Wunreachable-code diagnostics that are triggered byAlex Lorenz2017-01-122-5/+25
| | | | | | | | | | | the same source range and use the unary operator fixit only when it actually silences the warning. rdar://24570531 Differential Revision: https://reviews.llvm.org/D28231 llvm-svn: 291757
* [analyzer] Avoid a crash in DereferenceChecker on string literal initializers.Artem Dergachev2017-01-121-0/+6
| | | | | | | | | | | | A hotfix for pr31592 that fixes the crash but not the root cause of the problem. We need to update the analyzer engine further to account for AST changes introduced in r289618. At the moment we're erroneously performing a redundant lvalue-to-rvalue cast in this scenario, and squashing the rvalue of the object bound to the reference into the reference itself. rdar://problem/28832541 llvm-svn: 291754
* PR31469: Don't add friend template class decls to redecl chain in dependent ↵Vassil Vassilev2017-01-124-9/+20
| | | | | | | | | | | | | | | | | contexts. Fixes a crash in modules where the template class decl becomes the most recent decl in the redeclaration chain and forcing the template instantiator try to instantiate the friend declaration, rather than the template definition. In practice, A::list<int> produces a TemplateSpecializationType A::__1::list<int, allocator<type-parameter-0-0> >' failing to replace to subsitute the default argument to allocator<int>. Kudos Richard Smith (D28399). llvm-svn: 291753
* Remove redundant passing around of a "ContainsAutoType" flag.Richard Smith2017-01-1211-79/+61
| | | | | | | | | | | | This flag serves no purpose other than to prevent us walking through a type to check whether it contains an 'auto' specifier; this duplication of information is error-prone, does not appear to provide any performance benefit, and will become less practical once we support C++1z deduced class template types and eventually constrained types from the Concepts TS. No functionality change intended. llvm-svn: 291737
* [index] Introduce symbol subkinds to mark an accessor getter or setter.Argyrios Kyrtzidis2017-01-111-2/+12
| | | | llvm-svn: 291707
* [index] Ignore invalid ObjC categories.Argyrios Kyrtzidis2017-01-111-5/+6
| | | | | | We currently are unable to get a USR for those and it doesn't seem useful to try to index them. llvm-svn: 291705
* [index] Add 'IBTypeOf' relation for ObjC methods marked with IBAction and ↵Argyrios Kyrtzidis2017-01-115-15/+40
| | | | | | properties with IBOutletCollection. llvm-svn: 291703
* [PowerPC] Fix the wrong implementation of builtin vec_rlnm.Tony Jiang2017-01-111-2/+4
| | | | llvm-svn: 291702
* [index] Add 'contained-by' relation between references and their lexical ↵Argyrios Kyrtzidis2017-01-112-2/+9
| | | | | | container. llvm-svn: 291700
* Module: Do not add any link flags when an implementation TU of a module importsManman Ren2017-01-111-1/+7
| | | | | | | | | | | a header of that same module. This fixes a regression caused by r280409. rdar://problem/29930553 This is an updated version for r291628 (which was reverted in r291688). llvm-svn: 291689
* This reverts r291628. As suggested by Richard, we can simplyManman Ren2017-01-111-9/+4
| | | | | | | | filter out the implicilty imported modules at CodeGen instead of removing the implicit ImportDecl when an implementation TU of a module imports a header of that same module. llvm-svn: 291688
* Remove repeated word in comment (NFC)Malcolm Parsons2017-01-111-1/+1
| | | | llvm-svn: 291667
* [Modules] Support #import when entering files with modulesBruno Cardoso Lopes2017-01-113-7/+47
| | | | | | | | | | | | Textual headers and builtins that are #import'd from different modules should get re-entered when these modules are independent from each other. Differential Revision: https://reviews.llvm.org/D26267 rdar://problem/25881934 llvm-svn: 291644
* [analyzer] Fix crash in body farm for getter without implicit self.Devin Coughlin2017-01-111-0/+2
| | | | | | | | | | | | | | | | | Fix a crash in body farm when synthesizing a getter for a property synthesized for a property declared in a protocol on a class extension that shadows a declaration of the property in a category. In this case, Sema doesn't fill in the implicit 'self' parameter for the getter in the category, which leads to a crash when trying to synthesize the getter for it. To avoid the crash, skip getter synthesis in body farm if the self parameter is not filled int. rdar://problem/29938138 llvm-svn: 291635
* Module: Do not create Implicit ImportDecl for module X if weManman Ren2017-01-111-4/+9
| | | | | | | | | are building an implemenation of module X. This fixes a regression caused by r280409. rdar://problem/29930553 llvm-svn: 291628
* Remove dead code.Richard Smith2017-01-101-5/+0
| | | | llvm-svn: 291610
* Remove a couple of parameters that are always false.Richard Smith2017-01-101-21/+14
| | | | llvm-svn: 291608
* Serialize the UsesSEH bit on FunctionDeclReid Kleckner2017-01-102-0/+3
| | | | | | Fixes PR31539 llvm-svn: 291600
* [Driver] Add openSuse AArch64 TripleKostya Kortchinsky2017-01-101-1/+1
| | | | | | | | | | | | | | | | Summary: openSuse has AArch64 support, with images running on the Raspberry Pi 3. The libraries and headers live under the aarch64-suse-linux subdirectory, which is currently not in the AArch64 triples list. Address this by adding the corresponding string to AArch64Triples. Reviewers: chandlerc, bruno, bkramer, rengolin Subscribers: aemerson, rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D28238 llvm-svn: 291598
* Don't try to check implicit conversion sequences for an object argument ifRichard Smith2017-01-101-2/+8
| | | | | | | there is no object argument, when early checking of implicit conversion sequences for a function template fails. llvm-svn: 291597
* Fix conversion index / argument index mismatch when diagnosing overload ↵Richard Smith2017-01-101-32/+18
| | | | | | resolution failure. llvm-svn: 291596
* [ARM] Use generic bitreverse intrinsic, rather than ARM specific rbit.Chad Rosier2017-01-101-3/+3
| | | | | | The backend already supports lowering this intrinsic to a rbit instruction. llvm-svn: 291582
* [analyzer] Treat pointers to static member functions as function pointersDevin Coughlin2017-01-101-0/+12
| | | | | | | | | | | | Sema treats pointers to static member functions as having function pointer type, so treat treat them as function pointer values in the analyzer as well. This prevents an assertion failure in SValBuilder::evalBinOp caused by code that expects function pointers to be Locs (in contrast, PointerToMember values are nonlocs). Differential Revision: https://reviews.llvm.org/D28033 llvm-svn: 291581
* [OpenMP] Sema and parsing for 'target teams distribute simd’ pragmaKelvin Li2017-01-1013-12/+189
| | | | | | | | This patch is to implement sema and parsing for 'target teams distribute simd’ pragma. Differential Revision: https://reviews.llvm.org/D28252 llvm-svn: 291579
* CGDecl: Skip static variable initializers in unreachable codeMatthias Braun2017-01-101-2/+2
| | | | | | | | This fixes http://llvm.org/PR31054 Differential Revision: https://reviews.llvm.org/D28505 llvm-svn: 291576
* [AArch64] Use generic bitreverse intrinsic, rather than AArch64 specific.Chad Rosier2017-01-101-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D28400 llvm-svn: 291574
* [OpenMP] Basic support for a parallel directive in a target region on an ↵Arpith Chacko Jacob2017-01-104-27/+294
| | | | | | | | | | | | | | | | | | | | | NVPTX device Summary: This patch introduces support for the execution of parallel constructs in a target region on the NVPTX device. Parallel regions must be in the lexical scope of the target directive. The master thread in the master warp signals parallel work for worker threads in worker warps on encountering a parallel region. Note: The patch does not yet support capture of arguments in a parallel region so the test cases are simple. Reviewers: ABataev Differential Revision: https://reviews.llvm.org/D28145 llvm-svn: 291565
* [Sema] Avoid -Wshadow warning when a "redefinition of " error is presentedAlex Lorenz2017-01-101-22/+35
| | | | | | | | | | | This commit ensures that clang avoids the redundant -Wshadow warning for variables that already get a "redefinition of " error. rdar://29067894 Differential Revision: https://reviews.llvm.org/D28350 llvm-svn: 291564
* Remove fixme, use ASTContext::getCanonicalTemplateSpecializationType.Vassil Vassilev2017-01-101-10/+2
| | | | | | Reviewed by Richard Smith (D28306). llvm-svn: 291552
OpenPOWER on IntegriCloud