summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Fix two false positives in -Wreturn-stack-addressRichard Trieu2016-08-052-1/+76
| | | | | | | | | | | If the return type is a pointer and the function returns the reference to a pointer, don't warn since only the value is returned, not the reference. If a reference function parameter appears in the reference chain, don't warn since binding happens at the caller scope, so addresses returned are not to local stack. This includes default arguments as well. llvm-svn: 277889
* [NFC][ObjC Availability] Refactor DiagnoseAvailabilityOfDeclErik Pilkington2016-08-055-98/+101
| | | | | | Differential revision: https://reviews.llvm.org/D23221 llvm-svn: 277887
* [clang-tblgen] Remove unused #include (NFC)Vedant Kumar2016-08-051-1/+0
| | | | llvm-svn: 277885
* Fix false positive in -Wunsequenced and templates.Richard Trieu2016-08-052-1/+57
| | | | | | | | | | | | | | For builtin logical operators, there is a well-defined ordering of argument evaluation. For overloaded operator of the same type, there is no argument evaluation order, similar to other function calls. When both are present, uninstantiated templates with an operator&& is treated as an unresolved function call. Unresolved function calls are treated as normal function calls, and may result in false positives when the builtin logical operator is used. Have the unsequenced checker ignore dependent expressions to avoid this false positive. The check also happens in template instantiations to catch when the overloaded operator is used. llvm-svn: 277866
* PR26423: Assert on valid use of using declaration of a function with an ↵David Blaikie2016-08-052-4/+32
| | | | | | | | | | | | undeduced auto return type For now just disregard the using declaration in this case. Suboptimal, but wiring up the ability to have declarations of functions that are separate from their definition (we currently only do that for member functions) and have differing return types (we don't have any support for that) is more work than seems reasonable to at least fix this crash. llvm-svn: 277852
* [SemaOpenMP] Some miscellaneous cleanupsDavid Majnemer2016-08-051-142/+139
| | | | | | | | Clean up some typos, follow the coding style a little more rigorously. No functionality change is intended. llvm-svn: 277840
* Revert "[Sema] Add sizeof diagnostics for bzero"Bruno Cardoso Lopes2016-08-053-54/+3
| | | | | | This reverts commit r277787, which caused PR28870. llvm-svn: 277830
* AMDGPU : Add Clang builtin intrinsics for compare with the fullWei Ding2016-08-054-0/+89
| | | | | | | | wavefront result. Differential Revision: http://reviews.llvm.org/D22934 llvm-svn: 277824
* [OpenMP] Sema and parsing for 'teams distribute' pragmaKelvin Li2016-08-0536-13/+3543
| | | | | | | | This patch is to implement sema and parsing for 'teams distribute' pragma. Differential Revision: https://reviews.llvm.org/D23189 llvm-svn: 277818
* Reapply r276973 "Adjust Registry interface to not require plugins to export ↵John Brawn2016-08-057-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a registry" This differs from the previous version by being more careful about template instantiation/specialization in order to prevent errors when building with clang -Werror. Specifically: * begin is not defined in the template and is instead instantiated when Head is. I think the warning when we don't do that is wrong (PR28815) but for now at least do it this way to avoid the warning. * Instead of performing template specializations in LLVM_INSTANTIATE_REGISTRY instead provide a template definition then do explicit instantiation. No compiler I've tried has problems with doing it the other way, but strictly speaking it's not permitted by the C++ standard so better safe than sorry. Original commit message: Currently the Registry class contains the vestiges of a previous attempt to allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a plugin would have its own copy of a registry and export it to be imported by the tool that's loading the plugin. This only works if the plugin is entirely self-contained with the only interface between the plugin and tool being the registry, and in particular this conflicts with how IR pass plugins work. This patch changes things so that instead the add_node function of the registry is exported by the tool and then imported by the plugin, which solves this problem and also means that instead of every plugin having to export every registry they use instead LLVM only has to export the add_node functions. This allows plugins that use a registry to work on Windows if LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used. llvm-svn: 277806
* Fix crash in template type diffing.Richard Trieu2016-08-052-0/+36
| | | | | | | | | When the type being diffed is a type alias, and the orginal type is not a templated type, then there will be no unsugared TemplateSpecializationType. When this happens, exit early from the constructor. Also add assertions to the other iterator accessor to prevent the iterator from being used. llvm-svn: 277797
* Allow -1 to assign max value to unsigned bitfields.Richard Trieu2016-08-053-1/+19
| | | | | | | | Silence the -Wbitfield-constant-conversion warning for when -1 or other negative values are assigned to unsigned bitfields, provided that the bitfield is wider than the minimum number of bits needed to encode the negative value. llvm-svn: 277796
* [Sema] Add sizeof diagnostics for bzeroBruno Cardoso Lopes2016-08-043-3/+54
| | | | | | | | | | | | | | | | | | | | | | | | | For memset (and others) we can get diagnostics like: struct stat { int x; }; void foo(struct stat *stamps) { bzero(stamps, sizeof(stamps)); memset(stamps, 0, sizeof(stamps)); } t.c:7:28: warning: 'memset' call operates on objects of type 'struct stat' while the size is based on a different type 'struct stat *' [-Wsizeof-pointer-memaccess] memset(stamps, 0, sizeof(stamps)); ~~~~~~ ^~~~~~ t.c:7:28: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)? memset(stamps, 0, sizeof(stamps)); ^~~~~~ This patch implements the same class of warnings for bzero. Differential Revision: https://reviews.llvm.org/D22525 rdar://problem/18963514 llvm-svn: 277787
* [ADT] Migrate DepthFirstIterator to use NodeRefTim Shen2016-08-043-0/+5
| | | | | | | | | | | | Summary: The corresponding LLVM change is D23146. Reviewers: dblaikie, chandlerc Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23147 llvm-svn: 277783
* [analyzer] Make CloneDetector recognize different variable patterns.Artem Dergachev2016-08-043-25/+152
| | | | | | | | | | | | | | | | | CloneDetector should be able to detect clones with renamed variables. However, if variables are referenced multiple times around the code sample, the usage patterns need to be recognized. For example, (x < y ? y : x) and (y < x ? y : x) are no longer clones, however (a < b ? b : a) is still a clone of the former. Variable patterns are computed and compared during a separate filtering pass. Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D22982 llvm-svn: 277757
* [OpenCL] Add the lit test for image size which was omitted by r277647.Yaxun Liu2016-08-041-0/+18
| | | | llvm-svn: 277756
* [OpenCL] Remove extra native_ functions from opencl-c.hYaxun Liu2016-08-041-112/+0
| | | | | | | | | | There should be no native_ builtin functions with double type arguments. Patch by Aaron En Ye Shi. Differential Revision : https://reviews.llvm.org/D23071 llvm-svn: 277754
* [OpenCL] Added underscores to the names of 'to_addr' OpenCL built-ins.Alexey Bader2016-08-042-16/+17
| | | | | | | | | | | | | | | Summary: In order to re-define OpenCL built-in functions 'to_{private,local,global}' in OpenCL run-time library LLVM names must be different from the clang built-in function names. Reviewers: yaxunl, Anastasia Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23120 llvm-svn: 277743
* Make isExternC work on VarDecls too.Benjamin Kramer2016-08-043-1/+20
| | | | llvm-svn: 277712
* After PR28761 use -Wall with -Werror in builtins tests to identifyEric Christopher2016-08-0433-61/+61
| | | | | | possible problems in headers. llvm-svn: 277696
* [Concepts] remove default argument for RequiresClause; NFCHubert Tong2016-08-031-2/+1
| | | | llvm-svn: 277658
* [OpenCL] Fix size of image typeYaxun Liu2016-08-036-18/+19
| | | | | | | | | | The size of image type is reported incorrectly as size of a pointer to address space 0, which causes error when casting image type to pointers by __builtin_astype. The fix is to get image address space from TargetInfo then report the size accordingly. Differential Revision: https://reviews.llvm.org/D22927 llvm-svn: 277647
* Fix bug in conflict check for Replacements::add().Manuel Klimek2016-08-032-7/+28
| | | | | | | We would not detect conflicts when inserting insertions at the same offset as previously contained replacements. llvm-svn: 277603
* Fix quadratic runtime when adding items to tooling::Replacements.Manuel Klimek2016-08-032-18/+90
| | | | | | | | | | | Previously, we would search through all replacements when inserting a new one to check for overlaps. Instead, make use of the fact that we already have a set of replacments without overlaps to find the potential overlap with lower_bound. Differential Revision: https://reviews.llvm.org/D23119 llvm-svn: 277597
* [clang/test] Fix a flaky unittest on windowsEtienne Bergeron2016-08-031-4/+10
| | | | | | | | | | | | | | | | | | | | Summary: The append operator on a shell command for quick command-line is causing trouble on windows. [NFC] The easiest way to fix them is to avoid using them. This patch is an attempt to fix this broken build bot: clang-x86-win2008-selfhost http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/9523 Reviewers: rnk Subscribers: cfe-commits, chrisha Differential Revision: https://reviews.llvm.org/D23105 llvm-svn: 277576
* [index] Fix crash with indexing designated init expressions inside templates.Argyrios Kyrtzidis2016-08-032-1/+13
| | | | | | rdar://27452869 llvm-svn: 277570
* [CUDA] Updated CUDA tests that must run w/o CUDA installation.Artem Belevich2016-08-024-11/+11
| | | | | | | Fixes test failures after r277542 on systems that don't have CUDA installed. llvm-svn: 277552
* [analyzer] Update two comments in MPI-Checker. NFC.Devin Coughlin2016-08-022-7/+4
| | | | | | | | | | Correct two comments that do not match the current behavior of the checker. A patch by Alexander Droste! Differential Revision: https://reviews.llvm.org/D22670 llvm-svn: 277547
* [CUDA] Fix libdevice selection.Artem Belevich2016-08-024-26/+74
| | | | | | | | | | | This makes clang's libdevice selection match that of NVCC as described in http://docs.nvidia.com/cuda/libdevice-users-guide/basic-usage.html#version-selection If required libdevice variant is not found, driver now fails with an error. Differential Revision: https://reviews.llvm.org/D23037 llvm-svn: 277542
* [CUDA] Do not allow using NVPTX target for host compilation.Artem Belevich2016-08-025-13/+20
| | | | | | Differential Revision: https://reviews.llvm.org/D23042 llvm-svn: 277537
* [CFG] Fix crash finding destructor of lifetime-extended temporary.Devin Coughlin2016-08-022-1/+26
| | | | | | | | | | | Fix a crash under -Wthread-safety when finding the destructor for a lifetime-extending reference. A patch by Nandor Licker! Differential Revision: https://reviews.llvm.org/D22419 llvm-svn: 277522
* Revert "[Order Files] Remove dtrace predicate"Chris Bieneman2016-08-021-1/+2
| | | | | | | | This reverts commit r277487. Removing the probe predicate was a red herring. It results in more symbols being placed in the final order file, but they are symbols from outside the clang image. llvm-svn: 277492
* Update Clang Parser test error message to match new parser errorsNirav Dave2016-08-021-1/+1
| | | | | | Update clang tests in light of r277489. llvm-svn: 277490
* Updated documentationVitaly Buka2016-08-021-1/+2
| | | | | | | | | | Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D22992 llvm-svn: 277488
* [Order Files] Remove dtrace predicateChris Bieneman2016-08-021-2/+1
| | | | | | Having the dtrace predicate setup to only show probes in clang filters out static initializers executed by dyld, which we do want included in the order files. llvm-svn: 277487
* [analyzer] Hotfix for buildbot failure due to unspecified triple in r277449Artem Dergachev2016-08-021-1/+1
| | | | | | | | | If a target triple is not specified, the default host triple is used, which is not good for compiling inline assembler code. Patch by Raphael Isemann! llvm-svn: 277473
* [clang-cl] Fix PCH tests to use x86_64 as targetDiana Picus2016-08-023-7/+7
| | | | | | | | | | | | These tests require x86-registered-target, but they don't force the target as x86 on the command line, which means they will be run and they might fail when building the x86 backend on another platform (such as AArch64). Fixes https://llvm.org/bugs/show_bug.cgi?id=28797 Differential Revision: https://reviews.llvm.org/D23054 llvm-svn: 277457
* [analyzer] Respect statement-specific data in CloneDetection.Artem Dergachev2016-08-0216-12/+532
| | | | | | | | | | | | | | | | | So far the CloneDetector only respected the kind of each statement when searching for clones. This patch refines the way the CloneDetector collects data from each statement by providing methods for each statement kind, that will read the kind-specific attributes. For example, statements 'a < b' and 'a > b' are no longer considered to be clones, because they are different in operation code, which is an attribute specific to the BinaryOperator statement kind. Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D22514 llvm-svn: 277449
* Revert r276896 "Update Clang Parser test error message to match new parser ↵Hans Wennborg2016-08-011-1/+1
| | | | | | | | errors" This depended on r276895, which was reverted in r277402. llvm-svn: 277405
* [Order Files] Fixing an error in the perf-helper scriptChris Bieneman2016-08-011-1/+1
| | | | | | Dtrace probemod needs to be based on the first argument of the command, not the first argument of the args. This error was introduced a while back when I added support for skipping the driver and invoking cc1 directly. llvm-svn: 277401
* Add FIXMEs for MSVC 2013 hacks in r277211. NFC.Paul Robinson2016-08-011-0/+5
| | | | llvm-svn: 277396
* CodeGen: simplify the CC handling for TLS wrappersSaleem Abdulrasool2016-08-012-2/+12
| | | | | | | | | Use the calling convention of the wrapper directly to set the calling convention to ensure that the calling convention matches. Incorrectly setting the calling convention results in the code path being entirely nullified as InstCombine + SimplifyCFG will prune the mismatched CC calls. llvm-svn: 277390
* [ObjC Availability] Fix partial-availability false positive introduced in ↵Erik Pilkington2016-08-012-1/+6
| | | | | | | | | | r277058 Thanks to Nico Weber for pointing this out! Differential revision: https://reviews.llvm.org/D23024 llvm-svn: 277378
* [codeview] Skip injected class names in nested record emissionReid Kleckner2016-08-012-0/+24
| | | | | | | | We were already trying to do this, but our check wasn't quite right. Fixes PR28790 llvm-svn: 277367
* [AArch64] Add support for Samsung Exynos M2 (NFC).Evandro Menezes2016-08-014-0/+32
| | | | llvm-svn: 277365
* [Parse] Let declarations follow labels in -fms-extensions modeDavid Majnemer2016-08-012-1/+11
| | | | | | | | | MSVC permits declarations in these places as conforming extension (it is a constraint violation otherwise). This fixes PR28782. llvm-svn: 277352
* Make RecursiveASTVisitor visit lambda capture initialization expressionsMartin Bohme2016-08-012-0/+11
| | | | | | | | | | | | | | | | | | | | | Summary: Lambda capture initializations are part of the explicit source code and therefore should be visited by default but, so far, RecursiveASTVisitor does not visit them. This appears to be an oversight. Because the lambda body needs custom handling (calling TraverseLambdaBody()), the DEF_TRAVERSE_STMT for LambdaExpr sets ShouldVisitChildren to false but then neglects to visit the lambda capture initializations. This patch adds code to visit the expressions associated with lambda capture initializations. Reviewers: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22566 llvm-svn: 277342
* [analyzer] Fix execution permissions for the scan-build-py scripts.Artem Dergachev2016-08-017-0/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D22969 llvm-svn: 277338
* Implement tooling::Replacements as a class.Eric Liu2016-08-0115-632/+674
| | | | | | | | | | | | | | | | | | | Summary: - Implement clang::tooling::Replacements as a class to provide interfaces to control how replacements for a single file are combined and provide guarantee on the order of replacements being applied. - tooling::Replacements only contains replacements for the same file now. Use std::map<std::string, tooling::Replacements> to represent multi-file replacements. - Error handling for the interface change will be improved in followup patches. Reviewers: djasper, klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D21748 llvm-svn: 277335
* Allow .exe extension to ld to fix test with mingw.Yaron Keren2016-08-011-1/+1
| | | | llvm-svn: 277334
OpenPOWER on IntegriCloud