summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* IAS is now enabled for all OS on MIPS64Brad Smith2019-04-082-10/+2
| | | | llvm-svn: 357879
* Enable IAS for FreeBSD SPARC64.Brad Smith2019-04-072-5/+8
| | | | llvm-svn: 357878
* [clang-format] Fix bug https://bugs.llvm.org/show_bug.cgi?id=41413Owen Pan2019-04-072-3/+27
| | | | | | Differential Revision: https://reviews.llvm.org/D60374 llvm-svn: 357877
* [clang-format] Fix Bug 41407Owen Pan2019-04-062-1/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D60359 llvm-svn: 357851
* [clang-format] BreakAfterReturnType ignored on functions with numeric ↵Paul Hoad2019-04-062-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | template parameters Summary: Addresses PR40696 - https://bugs.llvm.org/show_bug.cgi?id=40696 The BreakAfterReturnType didn't work if it had a single arguments which was a template with an integer template parameter ``` int foo(A<8> a) { return a; } ``` When run with the Mozilla style. would not break after the `int` ``` int TestFn(A<8> a) { return a; } ``` This revision resolves this issue by allowing numeric constants to be considered function parameters if if seen inside `<>` Reviewers: djasper, klimek, JonasToth, krasimir, reuk, alexfh Reviewed By: klimek Subscribers: cfe-commits, llvm-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D59309 llvm-svn: 357837
* Revert "[Lexer] NFC: Fix an off-by-one bug in getAsCharRange()."Artem Dergachev2019-04-053-25/+2
| | | | | | | | | | This reverts commit r357823. Was breaking clang-tidy! Differential Revision: https://reviews.llvm.org/D59977 llvm-svn: 357827
* [Lexer] NFC: Fix an off-by-one bug in getAsCharRange().Artem Dergachev2019-04-053-2/+25
| | | | | | | | | | | | | | As the unit test demonstrates, subtracting 1 from the offset was unnecessary. The only user of this function was the plist file emitter (in Static Analyzer and ARCMigrator). It means that a lot of Static Analyzer's plist arrows are in fact off by one character. The patch carefully preserves this completely incorrect behavior and causes no functional change, i.e. no plist format breakage. Differential Revision: https://reviews.llvm.org/D59977 llvm-svn: 357823
* [analyzer] NoStoreFuncVisitor: Suppress reports with no-store in system headers.Artem Dergachev2019-04-053-22/+88
| | | | | | | | | | | | | | | | | The idea behind this heuristic is that normally the visitor is there to inform the user that a certain function may fail to initialize a certain out-parameter. For system header functions this is usually dictated by the contract, and it's unlikely that the header function has accidentally forgot to put the value into the out-parameter; it's more likely that the user has intentionally skipped the error check. Warnings on skipped error checks are more like security warnings; they aren't necessarily useful for all users, and they should instead be introduced on a per-API basis. Differential Revision: https://reviews.llvm.org/D60107 llvm-svn: 357810
* [clang-fuzzer] Include ExternalProject before using it.Matt Morehouse2019-04-051-0/+1
| | | | | | | Some versions of CMake require ExternalProject to be included before we can use ExternalProject_Add. llvm-svn: 357803
* Fix error in NamedDeclPrinterTestDavid Goldman2019-04-051-16/+20
| | | | | | | | Caused by D56924, shouldn't use raw string literals in macros. Differential Revision: https://reviews.llvm.org/D60326 llvm-svn: 357799
* [docs] Fix rst title in clang langext docs. NFCI Kristina Brooks2019-04-051-1/+1
| | | | | | | | Fix an odd line in LanguageExtensions.rst which rendered incorrectly due to an underscore being mixed in with dashes. llvm-svn: 357793
* [AMDGPU] rename vi-insts into gfx8-instsStanislav Mekhanoshin2019-04-054-6/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D60293 llvm-svn: 357792
* [CUDA][Windows] Last fix for the clang Bug 38811 "Clang fails to compile ↵Evgeny Mankov2019-04-053-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with CUDA-9.x on Windows" (https://bugs.llvm.org/show_bug.cgi?id=38811). [IMPORTANT] With that last fix, CUDA has just started being compiling by clang on Windows after nearly a year and two clang’s major releases (7 and 8). As long as the last LLVM release, in which clang was compiling CUDA on Windows successfully, was 6.0.1, this fix and two previous have to be included into upcoming 7.1.0 and 8.0.1 releases. [How to repro] clang++.exe -x cuda "c:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0\0_Simple\simplePrintf\simplePrintf.cu" -I"c:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0\common\inc" --cuda-gpu-arch=sm_50 --cuda-path="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0" -L"c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64" -lcudart.lib -v [Output] In file included from C:\GIT\LLVM\trunk-for-submits\llvm-64-release-vs2017-15.9.9\dist\lib\clang\9.0.0\include\__clang_cuda_runtime_wrapper.h:327: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:390:11: error: no matching function for call to '__isinfl' return (__isinfl(a) != 0); ^~~~~~~~ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:2662:14: note: candidate function not viable: call to __host__ function from __device__ function __func__(int __isinfl(long double a)) ^ In file included from <built-in>:1: In file included from C:\GIT\LLVM\trunk-for-submits\llvm-64-release-vs2017-15.9.9\dist\lib\clang\9.0.0\include\__clang_cuda_runtime_wrapper.h:327: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:438:11: error: no matching function for call to '__isnanl' return (__isnanl(a) != 0); ^~~~~~~~ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:2672:14: note: candidate function not viable: call to __host__ function from __device__ function __func__(int __isnanl(long double a)) ^ In file included from <built-in>:1: In file included from C:\GIT\LLVM\trunk-for-submits\llvm-64-release-vs2017-15.9.9\dist\lib\clang\9.0.0\include\__clang_cuda_runtime_wrapper.h:327: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:486:11: error: no matching function for call to '__finitel' return (__finitel(a) != 0); ^~~~~~~~~ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:2652:14: note: candidate function not viable: call to __host__ function from __device__ function __func__(int __finitel(long double a)) ^ 3 errors generated when compiling for sm_50. [Solution] Add missing long double device functions' declarations. Provide only declarations to prevent any use of long double on the device side, because CUDA does not support long double on the device side. [Testing] {Windows 10, Ubuntu 16.04.5}/{Visual C++ 2017 15.9.9, gcc+ 5.4.0}/CUDA {8.0, 9.0, 9.1, 9.2, 10.0, 10.1} Reviewed by: Artem Belevich Differential Revision: http://reviews.llvm.org/D60220 llvm-svn: 357779
* [Tooling] add a Heuristic field indicating that a CompileCommand was guessed.Sam McCall2019-04-053-10/+36
| | | | | | | | | | | | | | | | | | | | Summary: Use cases: - a tool that dumps the heuristic used for each header in a project can be used to evaluate changes to the heuristic - we want to expose this information to users in clangd as it affects accuracy/reliability of editor features - express interpolation tests more directly Reviewers: ilya-biryukov, klimek Subscribers: ioeric, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60194 llvm-svn: 357770
* [LibTooling] Add Transformer, a library for source-to-source transformations.Yitzhak Mandelbaum2019-04-055-0/+804
| | | | | | | | | | | | | | | | Summary: Adds a basic version of Transformer, a library supporting the concise specification of clang-based source-to-source transformations. A full discussion of the end goal can be found on the cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling". Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, ABataev, mgorny, jfb, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59376 llvm-svn: 357768
* [LibTooling] Add "SourceCode" library for functions relating to source-code ↵Yitzhak Mandelbaum2019-04-058-82/+207
| | | | | | | | | | | | | | | | | | | | | | | | | manipulation. Summary: Introduces a utility library in Refactoring/ to collect routines related to source-code manipulation. In this change, we move "extended-range" functions from the FixIt library (in clangTooling) to this new library. We need to use this functionality in Refactoring/ and cannot access it if it resides in Tooling/, because that would cause clangToolingRefactor to depend on clangTooling, which would be a circular dependency. Reviewers: ilya-biryukov, ioeric Reviewed By: ilya-biryukov Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60269 llvm-svn: 357764
* [test] Specify an explicit darwin version in a triple inAlex Lorenz2019-04-051-1/+1
| | | | | | | | | | `test/Driver/debug-options.c` to ensure that the driver selects the DWARF 2 version as intended by the test. Fixes the `test/Driver/debug-options.c` test regression on GreenDragon on macOS that started failing after r357713. llvm-svn: 357740
* [IR] Refactor attribute methods in Function class (NFC)Evandro Menezes2019-04-041-1/+1
| | | | | | | | Rename the functions that query the optimization kind attributes. Differential revision: https://reviews.llvm.org/D60287 llvm-svn: 357731
* Make SourceManager::createFileID(UnownedTag, ...) take a const ↵Nico Weber2019-04-0410-41/+48
| | | | | | | | | | | | | | | | | | | | | llvm::MemoryBuffer* Requires making the llvm::MemoryBuffer* stored by SourceManager const, which in turn requires making the accessors for that return const llvm::MemoryBuffer*s and updating all call sites. The original motivation for this was to use it and fix the TODO in CodeGenAction.cpp's ConvertBackendLocation() by using the UnownedTag version of createFileID, and since llvm::SourceMgr* hands out a const llvm::MemoryBuffer* this is required. I'm not sure if fixing the TODO this way actually works, but this seems like a good change on its own anyways. No intended behavior change. Differential Revision: https://reviews.llvm.org/D60247 llvm-svn: 357724
* Special case ObjCPropertyDecl for printingDavid Goldman2019-04-042-1/+47
| | | | | | | | ObjCPropertyDecl should use the category interface as a context similar to what is done for methods. Previously category methods would be printed as `::property`; now they are printed as `Class::property`. llvm-svn: 357720
* [OPENMP]Add codegen for task reduction vars with allocate clause, NFC.Alexey Bataev2019-04-042-2/+22
| | | | | | Added test for the task reduction variables with the allocate clause. llvm-svn: 357717
* Verify that Android targets generate DWARF 4 by default.Stephen Hines2019-04-041-1/+7
| | | | | | | | | | | | | | | | | | | | | Summary: In the future, Android releases will support DWARF 5, but we need to ensure that older targets only have DWARF 4 generated for them. This patch inserts that verification for all Android releases now. The patch also fixes 2 minor mistakes (a mistakenly moved RUN line, and the missing G_DWARF2 check label). Reviewers: aprantl Reviewed By: aprantl Subscribers: chh, pirama, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60238 llvm-svn: 357713
* [OPENMP]Add codegen for linear vars with allocate clause, NFC.Alexey Bataev2019-04-041-3/+16
| | | | | | Added test for the linear variables with the allocate clause. llvm-svn: 357712
* [OPENMP]Fix lookup of the user-defined reductions in C.Alexey Bataev2019-04-042-11/+26
| | | | | | Fixed the regression of the lookup of user-defined reductions for C. llvm-svn: 357708
* [RISCV] Fix rL357699 by adding missing zero-length filesAlex Bradbury2019-04-043-0/+0
| | | | | | svn add doesn't play very nicely here... llvm-svn: 357702
* Updating Chromium's Java import orderNico Weber2019-04-041-3/+10
| | | | | | | | | | Adding in androidx as another import group. Differential Revision: https://reviews.llvm.org/D60203 Patch from Sam Maier <smaier@chromium.org>! llvm-svn: 357700
* [RISCV] Collect library directories and triples for riscv64 triple tooAlex Bradbury2019-04-044-6/+113
| | | | | | | | | | | | When setting up library and tools paths when detecting an accompanying GCC installation only riscv32 was handled. As a consequence when targetting riscv64 neither the linker nor libraries would be found. This adds handling and tests for riscv64. Differential Revision: https://reviews.llvm.org/D53392 Patch by Edward Jones. llvm-svn: 357699
* [clang-format] Preserve include blocks in ObjC Google styleKrasimir Georgiev2019-04-042-0/+17
| | | | | | | | | | | | | | | | | | Summary: r357567 started to regroup include block for Google style; it was meant to apply only for C++. This patch reverts this for ObjC. Reviewers: ioeric Reviewed By: ioeric Subscribers: thakis, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60263 llvm-svn: 357695
* [RISCV][NFC] s/riscv32-linux-unknown-elf/riscv32-unknown-linux-gnu in ↵Alex Bradbury2019-04-041-2/+2
| | | | | | | | | | test/Driver/riscv32-toolchain.c riscv32-linux-unknown-elf was a weird thing to test for as it doesn't match the triple used in any common RISC-V toolchain distributions (e.g. riscv-gnu-toolchain scripts produce riscv{32,64}-unknown-linux-gnu). llvm-svn: 357693
* [CodeComplete] Fix crash when completing ObjC block parameter with a broken typeSam McCall2019-04-042-0/+17
| | | | | | | | | | | | | | | | | | | Summary: The fix isn't great, but it's hard to fix properly because the completion code sensibly uses ParmVarDecl to represent parameters, but the AST-building code sensibly doesn't synthesize them if the type is broken. Also this case is apparently really rare, so it's probably not worth bending over backwards for. Reviewers: ilya-biryukov Subscribers: javed.absar, kristof.beyls, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60258 llvm-svn: 357686
* [PR41157][OpenCL] Prevent implicit init of local addr space var in C++ mode.Anastasia Stulova2019-04-043-5/+27
| | | | | | | | | | | Prevent adding initializers implicitly to variables declared in local address space. This happens when they get converted into global variables and therefore theoretically have to be default initialized in C++. Differential Revision: https://reviews.llvm.org/D59646 llvm-svn: 357684
* [PR41276] Fixed incorrect generation of addr space cast for 'this' in C++.Anastasia Stulova2019-04-047-26/+49
| | | | | | | | | | | | | | | Improved classification of address space cast when qualification conversion is performed - prevent adding addr space cast for non-pointer and non-reference types. Take address space correctly from the pointee. Also pass correct address space from 'this' object using AggValueSlot when generating addrspacecast in the constructor call. Differential Revision: https://reviews.llvm.org/D59988 llvm-svn: 357682
* Revert r357452 - 'SimplifyCFG SinkCommonCodeFromPredecessors: Also sink ↵David L. Jones2019-04-043-2/+3
| | | | | | | | | | function calls without used results (PR41259)' This revision causes tests to fail under ASAN. Since the cause of the failures is not clear (could be ASAN, could be a Clang bug, could be a bug in this revision), the safest course of action seems to be to revert while investigating. llvm-svn: 357667
* add periodsAmy Huang2019-04-031-6/+6
| | | | llvm-svn: 357643
* [IR] Create new method in `Function` class (NFC)Evandro Menezes2019-04-031-2/+1
| | | | | | | | | Create method `optForNone()` testing for the function level equivalent of `-O0` and refactor appropriately. Differential revision: https://reviews.llvm.org/D59852 llvm-svn: 357638
* [OPENMP]Add codegen for reduction vars with allocate clause, NFC.Alexey Bataev2019-04-031-3/+15
| | | | | | Added test for the reduction variables with the allocate clause. llvm-svn: 357629
* [OPENMP]Add codegen for lastprivate vars with allocate clause, NFC.Alexey Bataev2019-04-031-11/+25
| | | | | | Added test for the lastprivatized variables with the allocate clause. llvm-svn: 357625
* Revert "[analyzer] Toning down invalidation a bit".Artem Dergachev2019-04-036-27/+28
| | | | | | | | | | | | | | | This reverts commit r352473. The overall idea is great, but it seems to cause unintented consequences when not only Region Store invalidation but also pointer escape mechanism was accidentally affected. Based on discussions in https://reviews.llvm.org/D58121#1452483 and https://reviews.llvm.org/D57230#1434161 Differential Revision: https://reviews.llvm.org/D57230 llvm-svn: 357620
* [OPENMP]Add codegen for firstprivate vars with allocate clause.Alexey Bataev2019-04-034-18/+76
| | | | | | | Added codegen/test for the firstprivatized variables with the allocate clause. llvm-svn: 357617
* Revert "[LibTooling] Add Transformer, a library for source-to-source ↵Alexey Bataev2019-04-035-805/+0
| | | | | | | | | transformations." This reverts commit r357576 to fix the problem with the cyclic dependencies between libTooling and libToolingRefactor. llvm-svn: 357612
* Bug-40323: MS ABI adding template static member in the linker directive ↵Jennifer Yu2019-04-032-0/+63
| | | | | | section to make sure init function can be called before main. llvm-svn: 357610
* [clang-format] Do not emit replacements while regrouping if Cpp includes are OKKrasimir Georgiev2019-04-032-13/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently clang-format would always emit a replacement for multi-block #include sections if `IBS_Regroup`, even if the sections are correct: ``` % cat ~/test.h #include <a.h> #include "b.h" % bin/clang-format --output-replacements-xml -style=google ~/test.h <?xml version='1.0'?> <replacements xml:space='preserve' incomplete_format='false'> <replacement offset='0' length='30'>#include &lt;a.h>&#10;&#10;#include "b.h"</replacement> </replacements> % ``` This change makes clang-format not emit replacements in this case. The logic is similar to the one implemented for Java in r354452. Reviewers: ioeric Reviewed By: ioeric Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60199 llvm-svn: 357599
* Whitespace and formatting changes; NFC.Aaron Ballman2019-04-031-6/+5
| | | | llvm-svn: 357589
* Add a new attribute documentation category for declarations.Aaron Ballman2019-04-032-20/+22
| | | | | | This moves documentation for some attributes into new categories that are hopefully a bit more clear. In general, "Type" documentation should be for attributes that appertain to types while "Declaration" documentation should be for attributes that appertain to declarations other than functions or variables. llvm-svn: 357585
* Fixing a typo; NFC.Aaron Ballman2019-04-032-2/+2
| | | | llvm-svn: 357579
* Fix typos in tests. NFC.Xing GUO2019-04-031-1/+1
| | | | | | | | | | | | | | Reviewers: Higuoxing Reviewed By: Higuoxing Subscribers: kubamracek, cfe-commits, #sanitizers, llvm-commits Tags: #clang, #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60183 llvm-svn: 357577
* [LibTooling] Add Transformer, a library for source-to-source transformations.Yitzhak Mandelbaum2019-04-035-0/+805
| | | | | | | | | | | | | | | | Summary: Adds a basic version of Transformer, a library supporting the concise specification of clang-based source-to-source transformations. A full discussion of the end goal can be found on the cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling". Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: mgorny, jfb, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59376 llvm-svn: 357576
* [clang-format] Regroup #includes into blocks for Google styleEric Liu2019-04-033-3/+16
| | | | | | | | | | | | | | | | | Summary: Regrouping #includes in blocks separated by blank lines when sorting C++ #include headers was implemented recently, and it has been preferred in Google's C++ style guide: https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes Reviewers: sammccall, klimek Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60116 llvm-svn: 357567
* Adding 'CLion integration' to clang-format docSylvestre Ledru2019-04-031-0/+13
| | | | | | | | | | | | | | | | | | | | Summary: This commit adds a chapter 'CLion integration' to ClangFormat.rst. The official announcement of clang-format support in CLion 2019.1: https://blog.jetbrains.com/clion/2019/03/clion-2019-1-embedded-dev-clangformat-memory-view/ Patch by Marina Kalashina Reviewers: djasper, sylvestre.ledru, krasimir Reviewed By: sylvestre.ledru Subscribers: jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60115 llvm-svn: 357566
* [libclang][test] Suppress annoying 'LIBCLANG TOOLING ERROR' outputFangrui Song2019-04-031-0/+9
| | | | | | | | | | | check-all invokes check-clang-python which prints the annoying message: LIBCLANG TOOLING ERROR: fixed-compilation-database: Error while opening fixed database: No such file or directory json-compilation-database: Error while opening JSON database: No such file or directory Let's fix it now with os.dup os.dup2 trick. llvm-svn: 357562
OpenPOWER on IntegriCloud