Skip to content

Commit 7e1d7d0

Browse files
committed
Merge remote-tracking branch 'upstream/release/11.x' into ldc-release/11.x
2 parents 7d41290 + 43ff75f commit 7e1d7d0

File tree

193 files changed

+4224
-872
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+4224
-872
lines changed

.github/workflows/clang-tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Clang Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release/**'
7+
paths:
8+
- 'clang/**'
9+
- 'llvm/**'
10+
- '.github/workflows/clang-tests.yml'
11+
pull_request:
12+
paths:
13+
- 'clang/**'
14+
- 'llvm/**'
15+
- '.github/workflows/clang-tests.yml'
16+
17+
jobs:
18+
build_clang:
19+
name: clang check-all
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os:
25+
- ubuntu-latest
26+
- windows-latest
27+
- macOS-latest
28+
steps:
29+
- name: Setup Windows
30+
if: startsWith(matrix.os, 'windows')
31+
uses: llvm/actions/setup-windows@master
32+
with:
33+
arch: amd64
34+
- name: Install Ninja
35+
uses: llvm/actions/install-ninja@master
36+
- uses: actions/checkout@v1
37+
with:
38+
fetch-depth: 1
39+
- name: Test clang
40+
uses: llvm/actions/build-test-llvm-project@master
41+
with:
42+
cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release
43+
build_target: check-clang

.github/workflows/libclc-tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: libclc Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release/**'
7+
paths:
8+
- 'clang/**'
9+
- 'llvm/**'
10+
- 'libclc/**'
11+
- '.github/workflows/libclc-tests.yml'
12+
pull_request:
13+
paths:
14+
- 'clang/**'
15+
- 'llvm/**'
16+
- 'libclc/**'
17+
- '.github/workflows/libclc-tests.yml'
18+
19+
jobs:
20+
build_libclc:
21+
name: libclc test
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os:
27+
- ubuntu-latest
28+
# Disable build on windows, because I can't figure out where llvm-config is.
29+
#- windows-latest
30+
- macOS-latest
31+
steps:
32+
- name: Setup Windows
33+
if: startsWith(matrix.os, 'windows')
34+
uses: llvm/actions/setup-windows@master
35+
with:
36+
arch: amd64
37+
- name: Install Ninja
38+
uses: llvm/actions/install-ninja@master
39+
- uses: actions/checkout@v1
40+
with:
41+
fetch-depth: 1
42+
- name: Build clang
43+
uses: llvm/actions/build-test-llvm-project@master
44+
with:
45+
cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release
46+
build_target: ""
47+
- name: Build and test libclc
48+
run: |
49+
mkdir libclc-build
50+
cd libclc-build
51+
cmake -G Ninja ../libclc -DLLVM_CONFIG=../build/bin/llvm-config
52+
ninja
53+
ninja test

.github/workflows/lld-tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: LLD Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release/**'
7+
paths:
8+
- 'lld/**'
9+
- 'llvm/**'
10+
- '.github/workflows/lld-tests.yml'
11+
pull_request:
12+
paths:
13+
- 'lld/**'
14+
- 'llvm/**'
15+
- '.github/workflows/lld-tests.yml'
16+
17+
jobs:
18+
build_lld:
19+
name: lld check-all
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os:
25+
- ubuntu-latest
26+
- windows-latest
27+
- macOS-latest
28+
steps:
29+
- name: Setup Windows
30+
if: startsWith(matrix.os, 'windows')
31+
uses: llvm/actions/setup-windows@master
32+
with:
33+
arch: amd64
34+
- name: Install Ninja
35+
uses: llvm/actions/install-ninja@master
36+
- uses: actions/checkout@v1
37+
with:
38+
fetch-depth: 1
39+
- name: Test lld
40+
uses: llvm/actions/build-test-llvm-project@master
41+
with:
42+
cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="lld" -DCMAKE_BUILD_TYPE=Release
43+
build_target: check-lld

.github/workflows/lldb-tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: lldb Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release/**'
7+
paths:
8+
- 'clang/**'
9+
- 'llvm/**'
10+
- 'lldb/**'
11+
- '.github/workflows/lldb-tests.yml'
12+
pull_request:
13+
paths:
14+
- 'clang/**'
15+
- 'llvm/**'
16+
- 'lldb/**'
17+
- '.github/workflows/lldb-tests.yml'
18+
19+
jobs:
20+
build_lldb:
21+
name: lldb build
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os:
27+
- ubuntu-latest
28+
- windows-latest
29+
# macOS build disabled due to: llvm.org/PR46190
30+
#- macOS-latest
31+
steps:
32+
- name: Setup Windows
33+
if: startsWith(matrix.os, 'windows')
34+
uses: llvm/actions/setup-windows@master
35+
with:
36+
arch: amd64
37+
- name: Install Ninja
38+
uses: llvm/actions/install-ninja@master
39+
- uses: actions/checkout@v1
40+
with:
41+
fetch-depth: 1
42+
- name: Build lldb
43+
uses: llvm/actions/build-test-llvm-project@master
44+
with:
45+
# Mac OS requries that libcxx is enabled for lldb tests, so we need to disable them.
46+
cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lldb" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF
47+
# check-lldb is not consistent, so we only build lldb.
48+
build_target: ""

.github/workflows/llvm-tests.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: LLVM Tests
2+
3+
env:
4+
release_major: 11
5+
6+
on:
7+
push:
8+
branches:
9+
- 'release/**'
10+
paths:
11+
- 'llvm/**'
12+
- '.github/workflows/llvm-tests.yml'
13+
pull_request:
14+
paths:
15+
- 'llvm/**'
16+
- '.github/workflows/llvm-tests.yml'
17+
18+
jobs:
19+
build_llvm:
20+
name: llvm check-all
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
os:
26+
- ubuntu-latest
27+
- windows-latest
28+
- macOS-latest
29+
steps:
30+
- name: Setup Windows
31+
if: startsWith(matrix.os, 'windows')
32+
uses: llvm/actions/setup-windows@master
33+
with:
34+
arch: amd64
35+
- name: Install Ninja
36+
uses: llvm/actions/install-ninja@master
37+
- uses: actions/checkout@v1
38+
with:
39+
fetch-depth: 1
40+
- name: Test llvm
41+
uses: llvm/actions/build-test-llvm-project@master
42+
with:
43+
cmake_args: -G Ninja -DCMAKE_BUILD_TYPE=Release
44+
45+
abi-dump:
46+
runs-on: ubuntu-latest
47+
strategy:
48+
matrix:
49+
name:
50+
- build-baseline
51+
- build-latest
52+
include:
53+
- name: build-baseline
54+
# FIXME: Referencing the env context does not work here
55+
# ref: llvmorg-${{ env.release_major }}.0.0
56+
ref: llvmorg-11.0.0
57+
repo: llvm/llvm-project
58+
- name: build-latest
59+
ref: ${{ github.sha }}
60+
repo: ${{ github.repository }}
61+
steps:
62+
- name: Install Ninja
63+
uses: llvm/actions/install-ninja@master
64+
- name: Install abi-compliance-checker
65+
run: |
66+
sudo apt-get install abi-dumper autoconf pkg-config
67+
- name: Install universal-ctags
68+
run: |
69+
git clone https://github.com/universal-ctags/ctags.git
70+
cd ctags
71+
./autogen.sh
72+
./configure
73+
sudo make install
74+
- name: Download source code
75+
uses: llvm/actions/get-llvm-project-src@master
76+
with:
77+
ref: ${{ matrix.ref }}
78+
repo: ${{ matrix.repo }}
79+
- name: Configure
80+
run: |
81+
mkdir build
82+
cd build
83+
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="" -DLLVM_BUILD_LLVM_DYLIB=ON -DCMAKE_C_FLAGS_DEBUG="-g -Og" -DCMAKE_CXX_FLAGS_DEBUG="-g -Og" ../llvm
84+
- name: Build
85+
run: ninja -C build libLLVM-${{ env.release_major }}.so
86+
- name: Dump ABI
87+
run: abi-dumper -lver ${{ matrix.ref }} -skip-cxx -public-headers llvm/include -o ${{ matrix.ref }}.abi.tar.gz build/lib/libLLVM-${{ env.release_major }}.so
88+
- name: Upload ABI file
89+
uses: actions/upload-artifact@v1
90+
with:
91+
name: ${{ matrix.name }}
92+
path: ${{ matrix.ref }}.abi.tar.gz
93+
94+
abi-compare:
95+
runs-on: ubuntu-latest
96+
needs:
97+
- abi-dump
98+
steps:
99+
- name: Download baseline
100+
uses: actions/download-artifact@v1
101+
with:
102+
name: build-baseline
103+
- name: Download latest
104+
uses: actions/download-artifact@v1
105+
with:
106+
name: build-latest
107+
- name: Install abi-compliance-checker
108+
run: sudo apt-get install abi-compliance-checker
109+
- name: Compare ABI
110+
run: abi-compliance-checker -l libLLVM-${{ env.release_major}}.so -old build-baseline/*.tar.gz -new build-latest/*.tar.gz
111+
- name: Upload ABI Comparison
112+
if: always()
113+
uses: actions/upload-artifact@v1
114+
with:
115+
name: compat-report-${{ github.sha }}
116+
path: compat_reports/

azure-pipelines.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
variables:
22
# Version of clang host compiler.
3-
CLANG_VERSION: 10.0.1
3+
CLANG_VERSION: 11.0.0
44
LLVM_PROJECTS_TO_ENABLE: compiler-rt;lld;mlir
55
LLVM_TARGETS_TO_BUILD: AArch64;AMDGPU;ARM;Mips;MSP430;NVPTX;PowerPC;RISCV;WebAssembly;X86
66
LLVM_EXPERIMENTAL_TARGETS_TO_BUILD: AVR
@@ -19,7 +19,6 @@ jobs:
1919
pool:
2020
vmImage: 'windows-2019'
2121
variables:
22-
CLANG_VERSION: 10.0.0
2322
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
2423
EXTRA_CMAKE_FLAGS: -DLLVM_USE_CRT_RELEASE=MT
2524
strategy:
@@ -59,6 +58,8 @@ jobs:
5958
ARCH: x86_64
6059
# To improve portability of the generated binaries, link the C++ standard library statically.
6160
EXTRA_CMAKE_FLAGS: -DLLVM_BINUTILS_INCDIR=/usr/include -DLLVM_STATIC_LINK_CXX_STDLIB=ON
61+
# Official clang 11.0.0 was available for Ubuntu 16.04, but isn't anymore...
62+
CLANG_VERSION: 10.0.1
6263
strategy:
6364
matrix:
6465
x64:

clang/examples/Attribute/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
add_llvm_library(Attribute MODULE Attribute.cpp PLUGIN_TOOL clang)
22

33
if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
4-
target_link_libraries(Attribute ${cmake_2_8_12_PRIVATE}
4+
target_link_libraries(Attribute PRIVATE
55
clangAST
66
clangBasic
77
clangFrontend

clang/include/clang/Basic/Attr.td

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2115,7 +2115,7 @@ def InitPriority : InheritableAttr {
21152115
let Spellings = [GCC<"init_priority", /*AllowInC*/0>];
21162116
let Args = [UnsignedArgument<"Priority">];
21172117
let Subjects = SubjectList<[Var], ErrorDiag>;
2118-
let Documentation = [Undocumented];
2118+
let Documentation = [InitPriorityDocs];
21192119
}
21202120

21212121
def Section : InheritableAttr {
@@ -3444,3 +3444,11 @@ def ReleaseHandle : InheritableParamAttr {
34443444
let Subjects = SubjectList<[ParmVar]>;
34453445
let Documentation = [ReleaseHandleDocs];
34463446
}
3447+
3448+
def Builtin : InheritableAttr {
3449+
let Spellings = [];
3450+
let Args = [UnsignedArgument<"ID">];
3451+
let Subjects = SubjectList<[Function]>;
3452+
let SemaHandler = 0;
3453+
let Documentation = [Undocumented];
3454+
}

clang/include/clang/Basic/AttrDocs.td

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,32 @@ global variable or function should be in after translation.
5757
let Heading = "section, __declspec(allocate)";
5858
}
5959

60+
def InitPriorityDocs : Documentation {
61+
let Category = DocCatVariable;
62+
let Content = [{
63+
In C++, the order in which global variables are initialized across translation
64+
units is unspecified, unlike the ordering within a single translation unit. The
65+
``init_priority`` attribute allows you to specify a relative ordering for the
66+
initialization of objects declared at namespace scope in C++. The priority is
67+
given as an integer constant expression between 101 and 65535 (inclusive).
68+
Priorities outside of that range are reserved for use by the implementation. A
69+
lower value indicates a higher priority of initialization. Note that only the
70+
relative ordering of values is important. For example:
71+
72+
.. code-block:: c++
73+
74+
struct SomeType { SomeType(); };
75+
__attribute__((init_priority(200))) SomeType Obj1;
76+
__attribute__((init_priority(101))) SomeType Obj2;
77+
78+
``Obj1`` will be initialized *before* ``Obj2`` despite the usual order of
79+
initialization being the opposite.
80+
81+
This attribute is only supported for C++ and Objective-C++ and is ignored in
82+
other language modes.
83+
}];
84+
}
85+
6086
def InitSegDocs : Documentation {
6187
let Category = DocCatVariable;
6288
let Content = [{

0 commit comments

Comments
 (0)