Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump LLVM commit hash to dd7a3d4 #728

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 76 additions & 96 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
clang: git build-essential pkg-config python3 curl openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev
msvc: ''
extra-values: |
llvm-hash: e1065370aaacb1b1cb48e77d37d376bf024f4a39
llvm-hash: dd7a3d4d798e30dfe53b5bbbbcd9a23c24ea1af9
llvm-id: {{ substr llvm-hash 0 7 }}
llvm-build-preset-prefix: {{#if optimized-debug}}debwithopt{{else}}{{lowercase build-type}}{{/if}}
llvm-build-preset-suffix: {{#if (ieq os 'windows') }}win{{else}}unix{{/if}}
Expand All @@ -74,10 +74,6 @@ jobs:
llvm-archive-basename: llvm-{{ os }}-{{ llvm-build-preset-prefix }}-{{ llvm-id }}
llvm-archive-extension: {{#if (ieq os 'windows') }}7z{{else}}tar.bz2{{/if}}
llvm-archive-filename: {{ llvm-archive-basename }}.{{ llvm-archive-extension }}
libcxx-runtimes: libcxx;libcxxabi{{#if (ine os 'windows') }};libunwind{{/if}}
libcxx-targets: cxx {{#if (ine os 'windows') }}cxxabi unwind{{/if}} install-cxx {{#if (ine os 'windows') }}install-cxxabi install-unwind{{/if}}
libcxx-cxxflags: {{#if (ieq os 'windows') }}-D__ORDER_LITTLE_ENDIAN__=1234 -D__ORDER_BIG_ENDIAN__=4321 -D__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__{{/if}}
libcxx-cmake-args: -D LLVM_ENABLE_RUNTIMES="{{ libcxx-runtimes }}" {{#if (ieq os 'windows') }}-D LIBCXXABI_USE_LLVM_UNWINDER=OFF -D LIBCXXABI_ENABLE_SHARED=OFF -D LIBCXXABI_ENABLE_STATIC=ON -D LIBCXX_ENABLE_SHARED=OFF -D LIBCXX_NO_VCRUNTIME=ON{{/if}} {{#if (ieq os 'macos') }}-D CMAKE_OSX_ARCHITECTURES=""{{/if}}
mrdocs-ccflags: {{ ccflags }} {{#if (eq compiler 'gcc') }}-static{{/if}} {{#if asan }}-static-libasan{{/if}} {{#if tsan }}-static-libtsan{{/if}}
mrdocs-cxxflags: {{ cxxflags }} {{#if (eq compiler 'gcc') }}-static{{/if}} {{#if asan }}-static-libasan{{/if}} {{#if tsan }}-static-libtsan{{/if}}
mrdocs-package-generators: {{#if (ieq os 'windows') }}7Z ZIP WIX{{else}}TGZ TXZ{{/if}}
Expand Down Expand Up @@ -178,6 +174,81 @@ jobs:
with:
apt-get: ${{ matrix.install }}

- name: Resolve LLVM Root
id: resolve-llvm-root
run: |
set -x
cd ..
llvm_root=$(pwd)/third-party/llvm-project/install
if [[ ${{ runner.os }} == 'Windows' ]]; then
llvm_root=$(echo "$llvm_root" | sed 's/\\/\//g')
llvm_root=$(echo $llvm_root | sed 's|^/d/|D:/|')
echo "$llvm_root"
fi
echo -E "llvm-root=$llvm_root" >> $GITHUB_OUTPUT

- name: Cached LLVM Binaries
id: llvm-cache
uses: actions/cache@v4
with:
path: ${{ steps.resolve-llvm-root.outputs.llvm-root }}
key: ${{ matrix.llvm-cache-key }}

- name: Download LLVM Binaries
id: llvm-download
if: steps.llvm-cache.outputs.cache-hit != 'true'
run: |
set -x
url=https://mrdocs.com/llvm+clang/${{ matrix.llvm-archive-filename }}
http_status=$(curl -s -o /dev/null -w "%{http_code}" -I "$url")
if [ "$http_status" -eq 200 ]; then
found="true"
echo "found=$found" >> $GITHUB_OUTPUT
curl -L -o ${{ matrix.llvm-archive-filename }} "$url"
install_prefix=$(pwd)/../third-party/llvm-project/install
mkdir -p $install_prefix
if [[ ${{ matrix.llvm-archive-extension }} == '7z' ]]; then
7z x ${{ matrix.llvm-archive-filename }} -o$install_prefix
else
tar -xjf ${{ matrix.llvm-archive-filename }} -C $install_prefix
fi
if [[ $(ls -1 $install_prefix | wc -l) -eq 1 ]]; then
single_dir=$(ls -1 $install_prefix)
if [[ -d $install_prefix/$single_dir ]]; then
mv $install_prefix/$single_dir/* $install_prefix/
rmdir $install_prefix/$single_dir
fi
fi
else
found="false"
echo "found=$found" >> $GITHUB_OUTPUT
fi

- name: Install LLVM
uses: alandefreitas/cpp-actions/[email protected]
if: steps.llvm-cache.outputs.cache-hit != 'true' && steps.llvm-download.outputs.found != 'true'
with:
cmake-version: '>=3.26'
source-dir: ../third-party/llvm-project/llvm
git-repository: https://github.com/llvm/llvm-project.git
git-tag: ${{ matrix.llvm-hash }}
download-dir: ../third-party/llvm-project
patches: |
./third-party/llvm/CMakePresets.json
./third-party/llvm/CMakeUserPresets.json
build-dir: ${sourceDir}/llvm/build
preset: ${{ matrix.llvm-build-preset }}
build-type: ${{ matrix.build-type }}
extra-args: |
${{ runner.os == 'Windows' && '-DLLVM_ENABLE_RUNTIMES=libcxx' || '-DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind' }}
cc: ${{ steps.setup-cpp.outputs.cc }}
cxx: ${{ steps.setup-cpp.outputs.cxx }}
generator: Ninja
install: true
install-prefix: ${sourceDir}/../install
run-tests: false
trace-commands: true

- name: Install Duktape
uses: alandefreitas/cpp-actions/[email protected]
with:
Expand Down Expand Up @@ -270,97 +341,6 @@ jobs:
run-tests: false
trace-commands: true

- name: Resolve LLVM Root
id: resolve-llvm-root
run: |
set -x
cd ..
llvm_root=$(pwd)/third-party/llvm-project/install
if [[ ${{ runner.os }} == 'Windows' ]]; then
llvm_root=$(echo "$llvm_root" | sed 's/\\/\//g')
llvm_root=$(echo $llvm_root | sed 's|^/d/|D:/|')
echo "$llvm_root"
fi
echo -E "llvm-root=$llvm_root" >> $GITHUB_OUTPUT

- name: Cached LLVM Binaries
id: llvm-cache
uses: actions/cache@v4
with:
path: ${{ steps.resolve-llvm-root.outputs.llvm-root }}
key: ${{ matrix.llvm-cache-key }}

- name: Download LLVM Binaries
id: llvm-download
if: steps.llvm-cache.outputs.cache-hit != 'true'
run: |
set -x
url=https://mrdocs.com/llvm+clang/${{ matrix.llvm-archive-filename }}
http_status=$(curl -s -o /dev/null -w "%{http_code}" -I "$url")
if [ "$http_status" -eq 200 ]; then
found="true"
echo "found=$found" >> $GITHUB_OUTPUT
curl -L -o ${{ matrix.llvm-archive-filename }} "$url"
install_prefix=$(pwd)/../third-party/llvm-project/install
mkdir -p $install_prefix
if [[ ${{ matrix.llvm-archive-extension }} == '7z' ]]; then
7z x ${{ matrix.llvm-archive-filename }} -o$install_prefix
else
tar -xjf ${{ matrix.llvm-archive-filename }} -C $install_prefix
fi
if [[ $(ls -1 $install_prefix | wc -l) -eq 1 ]]; then
single_dir=$(ls -1 $install_prefix)
if [[ -d $install_prefix/$single_dir ]]; then
mv $install_prefix/$single_dir/* $install_prefix/
rmdir $install_prefix/$single_dir
fi
fi
else
found="false"
echo "found=$found" >> $GITHUB_OUTPUT
fi

- name: Install LLVM
uses: alandefreitas/cpp-actions/[email protected]
if: steps.llvm-cache.outputs.cache-hit != 'true' && steps.llvm-download.outputs.found != 'true'
with:
cmake-version: '>=3.26'
source-dir: ../third-party/llvm-project/llvm
git-repository: https://github.com/llvm/llvm-project.git
git-tag: ${{ matrix.llvm-hash }}
download-dir: ../third-party/llvm-project
patches: |
./third-party/llvm/CMakePresets.json
./third-party/llvm/CMakeUserPresets.json
build-dir: ${sourceDir}/llvm/build
preset: ${{ matrix.llvm-build-preset }}
build-type: ${{ matrix.build-type }}
cc: ${{ steps.setup-cpp.outputs.cc }}
cxx: ${{ steps.setup-cpp.outputs.cxx }}
install: true
install-prefix: ${sourceDir}/../install
run-tests: false
trace-commands: true

- name: Install LibC++
uses: alandefreitas/cpp-actions/[email protected]
if: steps.llvm-cache.outputs.cache-hit != 'true' && steps.llvm-download.outputs.found != 'true'
with:
cmake-version: '>=3.26'
source-dir: ../third-party/llvm-project/runtimes
build-dir: ${sourceDir}/build-libcxx
build-target: ${{ matrix.libcxx-targets }}
# MrDocs will only use the LibC++ headers: any compiler that works in this workflow will do
cc: ${{ runner.os == 'macOS' && steps.setup-cpp.outputs.cc || '../third-party/llvm-project/install/bin/clang' }}
cxx: ${{ runner.os == 'macOS' && steps.setup-cpp.outputs.cxx || '../third-party/llvm-project/install/bin/clang++' }}
cxxflags: ${{ matrix.libcxx-cxxflags }}
generator: Ninja
extra-args: ${{ matrix.libcxx-cmake-args }}
install: true
install-prefix: ${sourceDir}/../install
run-tests: false
trace-commands: true

- name: Install Node.js
uses: actions/setup-node@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/install.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ NOTE: These examples assume VcPkg is already installed in the `third-party/vcpkg
=== LLVM

MrDocs uses LLVM to parse C++ code and extract documentation from it.
It depends on a recent version of LLVM: https://github.com/llvm/llvm-project/tree/e1065370aaacb1b1cb48e77d37d376bf024f4a39[e1065370]
It depends on a recent version of LLVM: https://github.com/llvm/llvm-project/tree/dd7a3d4d798e30dfe53b5bbbbcd9a23c24ea1af9[dd7a3d4]

**Download**:

Expand All @@ -310,7 +310,7 @@ mkdir -p llvm-project <.>
cd llvm-project
git init <.>
git remote add origin https://github.com/llvm/llvm-project.git <.>
git fetch --depth 1 origin e1065370aaacb1b1cb48e77d37d376bf024f4a39 <.>
git fetch --depth 1 origin dd7a3d4d798e30dfe53b5bbbbcd9a23c24ea1af9 <.>
git checkout FETCH_HEAD <.>
----

Expand Down
4 changes: 2 additions & 2 deletions src/lib/AST/ASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1697,15 +1697,15 @@ class ASTVisitor
template_params, sfinae_info->Arguments, param_idx);
if(! param_arg)
return std::nullopt;
unsigned ParamIdx = FindParam(ATD->getInjectedTemplateArgs(), *param_arg);
unsigned ParamIdx = FindParam(ATD->getInjectedTemplateArgs(context_), *param_arg);
return std::make_tuple(ATD->getTemplateParameters(), std::move(controlling_params), ParamIdx);
}

auto* CTD = dyn_cast<ClassTemplateDecl>(TD);
if(! CTD)
return std::nullopt;

auto PrimaryArgs = CTD->getInjectedTemplateArgs();
auto PrimaryArgs = CTD->getInjectedTemplateArgs(context_);
llvm::SmallBitVector ControllingParams(PrimaryArgs.size());

QualType MemberType;
Expand Down
Loading
Loading