Skip to content

Commit 27c6880

Browse files
authored
Switch to Github Actions on master (#321)
* Fix build errors and remove clang patch on master branch. For in-tree build, opencl-clang depends on llvm-project which is frequently updated everyday, so it is not necessary to have patch mechanism for clang which will result in many errors when apply patches. Signed-off-by: haonanya <[email protected]> * Switch to Github Actions on master Signed-off-by: haonanya <[email protected]> * Removed -dwarf-column-info flag and apply suggestions Signed-off-by: haonanya <[email protected]>
1 parent e0d718e commit 27c6880

File tree

4 files changed

+71
-52
lines changed

4 files changed

+71
-52
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: In-tree build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore: # no need to check build for:
8+
- 'docs/**' # documentation
9+
- '**.md' # README
10+
pull_request:
11+
branches:
12+
- master
13+
paths-ignore: # no need to check build for:
14+
- 'docs/**' # documentation
15+
- '**.md' # README
16+
schedule:
17+
# Weekly build on Mondays
18+
# Ideally, we might want to simplify our regular nightly build as we
19+
# probably don't need every configuration to be built every day: most of
20+
# them are only necessary in pre-commits to avoid breakages
21+
- cron: 0 0 * * 0
22+
23+
env:
24+
LLVM_VERSION: 15
25+
26+
jobs:
27+
build_and_test_linux:
28+
name: Linux
29+
strategy:
30+
matrix:
31+
build_type: [Release]
32+
include:
33+
- build_type: Release
34+
fail-fast: false
35+
runs-on: ubuntu-18.04
36+
steps:
37+
- name: Checkout LLVM sources
38+
uses: actions/checkout@v2
39+
with:
40+
repository: llvm/llvm-project
41+
ref: main
42+
path: llvm-project
43+
- name: Checkout the translator sources
44+
uses: actions/checkout@v2
45+
with:
46+
repository: KhronosGroup/SPIRV-LLVM-Translator
47+
ref: master
48+
path: llvm-project/SPIRV-LLVM-Translator
49+
- name: Checkout opencl-clang sources
50+
uses: actions/checkout@v2
51+
with:
52+
path: llvm-project/opencl-clang
53+
- name: Configure
54+
run: |
55+
mkdir build && cd build
56+
cmake ${{ github.workspace }}/llvm-project/llvm \
57+
-DLLVM_ENABLE_PROJECTS="clang" \
58+
-DLLVM_EXTERNAL_PROJECTS="llvm-spirv;opencl-clang" \
59+
-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=${{ github.workspace }}/llvm-project/SPIRV-LLVM-Translator \
60+
-DLLVM_EXTERNAL_OPENCL_CLANG_SOURCE_DIR=${{ github.workspace }}/llvm-project/opencl-clang \
61+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
62+
-DLLVM_TARGETS_TO_BUILD="X86" \
63+
-G "Unix Makefiles"
64+
- name: Build
65+
run: |
66+
cd build
67+
68+
make opencl-clang -j2

options.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ OpenCLArgList *OpenCLOptTable::ParseArgs(const char *szOptions,
8989
}
9090

9191
unsigned prev = index;
92-
Arg *pArg = ParseOneArg(*pArgs, index);
92+
std::unique_ptr<Arg> pArg = ParseOneArg(*pArgs, index);
9393
assert(index > prev && "Parser failed to consume argument.");
9494

9595
// Check for missing argument error.
@@ -101,8 +101,8 @@ OpenCLArgList *OpenCLOptTable::ParseArgs(const char *szOptions,
101101
break;
102102
}
103103

104-
m_synthesizedArgs.emplace_back(std::unique_ptr<llvm::opt::Arg>(pArg));
105-
pArgs->append(pArg);
104+
pArgs->append(pArg.get());
105+
m_synthesizedArgs.emplace_back(std::move(pArg));
106106
}
107107
return pArgs.release();
108108
}

options_compile.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ std::string EffectiveOptionsFilter::processOptions(const OpenCLArgList &args,
178178
effectiveArgs.push_back("-cl-kernel-arg-info");
179179
effectiveArgs.push_back("-fno-validate-pch");
180180
effectiveArgs.push_back("-fno-caret-diagnostics");
181-
effectiveArgs.push_back("-dwarf-column-info");
182181

183182
if (std::find_if(effectiveArgs.begin(), effectiveArgs.end(),
184183
[](const ArgsVector::value_type& a) {

patches/clang/0001-Remove-__IMAGE_SUPPORT__-macro-for-SPIR.patch

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)