Summary:
These all had somewhat custom file headers with different text from the
ones I searched for previously, and so I missed them. Thanks to Hal and
Kristina and others who prompted me to fix this, and sorry it took so
long.
Reviewers: hfinkel
Subscribers: mcrosier, javed.absar, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60406
llvm-svn: 357941
Summary:
https://reviews.llvm.org/D51633 added error handling to the ASTNodeImporter::VisitEnumDecl(...) for the conflicting names case. This could lead to erroneous return of an error in that case since we should have been using SearchName. Name may be empty in the case where we find the name via getTypedefNameForAnonDecl(...).
Differential Revision: https://reviews.llvm.org/D59665
llvm-svn: 357940
Summary:
Emit !heapallocsite in the metadata for calls to functions marked with
__declspec(allocator). Eventually this will be emitted as S_HEAPALLOCSITE debug
info in codeview.
Reviewers: rnk
Subscribers: jfb, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60237
llvm-svn: 357928
Added special processing of the memory management directives/clauses for
NVPTX target. For private locals, omp_default_mem_alloc and
omp_thread_mem_alloc result in allocation in local memory.
omp_const_mem_alloc allocates const memory, omp_teams_mem_alloc
allocates shared memory, and omp_cgroup_mem_alloc and
omp_large_cap_mem_alloc allocate global memory.
llvm-svn: 357923
Running `make check-all` fails on Solaris 11/SPARC since the clang python
tests FAIL:
............................
======================================================================
FAIL: test_extent (tests.cindex.test_location.TestLocation)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/cindex/test_location.py", line 87, in test_extent
self.assert_location(one.extent.start,line=1,column=1,offset=0)
File "tests/cindex/test_location.py", line 22, in assert_location
self.assertEqual(loc.column, column)
AssertionError: 5 != 1
======================================================================
FAIL: test_get_children (tests.cindex.test_cursor.TestCursor)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/cindex/test_cursor.py", line 70, in test_get_children
self.assertEqual(tu_nodes[0].is_definition(), True)
AssertionError: False != True
----------------------------------------------------------------------
Ran 126 tests in 2.123s
FAILED (failures=2, skipped=6)
Unfortunately, this aborts the rest of `make check-all`, even with `-k`, so
this patch disables the test as is already done on a couple of other
targets.
This allowed the `sparc-sun-solaris2.11` test to finish.
Differential Revision: https://reviews.llvm.org/D60046
llvm-svn: 357917
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
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
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
[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
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
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
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/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
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
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
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
Adding in androidx as another import group.
Differential Revision: https://reviews.llvm.org/D60203
Patch from Sam Maier <smaier@chromium.org>!
llvm-svn: 357700
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
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
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
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
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
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
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
Create method `optForNone()` testing for the function level equivalent of
`-O0` and refactor appropriately.
Differential revision: https://reviews.llvm.org/D59852
llvm-svn: 357638