From 6905e349ed61395794d65567a5c0b42e874e4904 Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Sat, 9 Nov 2024 08:08:12 -0800 Subject: [PATCH] CI: use latest versions of operating systems and actions. No functional change otherwise. One new clang-tidy finding addressed found with a newer version. --- .github/bin/run-clang-format.sh | 4 +- .github/bin/run-clang-tidy-cached.cc | 1 + .github/bin/run-clang-tidy.sh | 14 +-- .github/workflows/logs_on_demand.yml | 34 +++--- .github/workflows/main.yml | 118 +++++++++++---------- .github/workflows/non_vendored.yml | 4 +- .github/workflows/regression_on_demand.yml | 14 +-- .github/workflows/yosys-plugin.yml | 4 +- shell.nix | 9 +- src/Design/Statement.cpp | 1 + 10 files changed, 106 insertions(+), 97 deletions(-) diff --git a/.github/bin/run-clang-format.sh b/.github/bin/run-clang-format.sh index 62e33db6f2..f8aec2218f 100755 --- a/.github/bin/run-clang-format.sh +++ b/.github/bin/run-clang-format.sh @@ -13,10 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +CLANG_FORMAT="${CLANG_FORMAT:-clang-format}" + FORMAT_OUT=${TMPDIR:-/tmp}/clang-format-diff.out # Run on all c++ files. -find include src -name "*.h" -o -name "*.cpp" | xargs clang-format --style=Google -i +find src include -name "*.h" -o -name "*.cpp" | xargs ${CLANG_FORMAT} --style=Google -i # Check if we got any diff, then print it out in in the CI. # TODO: make these suggested diffs in the pull request. diff --git a/.github/bin/run-clang-tidy-cached.cc b/.github/bin/run-clang-tidy-cached.cc index af5af08eca..4150456515 100755 --- a/.github/bin/run-clang-tidy-cached.cc +++ b/.github/bin/run-clang-tidy-cached.cc @@ -117,6 +117,7 @@ struct ConfigValues { static constexpr ConfigValues kConfig = { .start_dir = ".", .file_include_re = "^(src|include)", + .file_exclude_re = "\\.template\\.", // Not clean yet, don't revisit yet. .revisit_brokenfiles_if_build_config_newer = false, }; diff --git a/.github/bin/run-clang-tidy.sh b/.github/bin/run-clang-tidy.sh index cbc17ca5c5..ba529fc40d 100755 --- a/.github/bin/run-clang-tidy.sh +++ b/.github/bin/run-clang-tidy.sh @@ -18,21 +18,13 @@ # It caches the results, so is much faster, but doesn't have the # concept of the 'limited' clang-tidy. +# Exact binary can be set with environment variable if needed. +CLANG_TIDY="${CLANG_TIDY:-clang-tidy}" + LOCAL_TMP=${TMPDIR:-/tmp} TIDY_OUT=${LOCAL_TMP}/clang-tidy-surelog.out -# Default clang-tidy, but if they are only available in versioned form, -# use them. Configuration below is tested with 12, so using that is our -# preferred version. -CLANG_TIDY=clang-tidy -for version in 12 13 14 11 ; do - if command -v clang-tidy-${version}; then - CLANG_TIDY=clang-tidy-${version} - break - fi -done - hash ${CLANG_TIDY} || exit 2 # make sure it is installed. if [ "$1" == "limited" ]; then diff --git a/.github/workflows/logs_on_demand.yml b/.github/workflows/logs_on_demand.yml index fafd9ba646..5516e1e50d 100644 --- a/.github/workflows/logs_on_demand.yml +++ b/.github/workflows/logs_on_demand.yml @@ -12,7 +12,7 @@ jobs: # Linux build, test, and publish linux-install: name: "Linux | Install | ${{ matrix.compiler }} | ${{ matrix.config }} | ${{ matrix.vendored_dependencies }}" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: @@ -27,14 +27,14 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 if: ${{ matrix.vendored_dependencies }} - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 if: ${{ !matrix.vendored_dependencies }} # Fetch tags for CMakeLists version check @@ -108,7 +108,7 @@ jobs: pushd build && ctest --output-on-failure && popd rm -rf build # make sure we only see installation artifacts - + # this shouldnt be necessary, and can't be reproduced outside CI export CMAKE_PREFIX_PATH=$INSTALL_DIR @@ -132,7 +132,7 @@ jobs: if: ${{ matrix.vendored_dependencies }} - name: Upload build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.artifact-name }} path: artifacts/${{ env.artifact-name }}.tar.gz @@ -142,7 +142,7 @@ jobs: # Linux regression linux-regression: name: "Linux | Regression | ${{ matrix.compiler }} | ${{ matrix.config }} [${{ matrix.shard }}]" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: linux-install strategy: fail-fast: false @@ -164,7 +164,7 @@ jobs: sudo apt install -y google-perftools libgoogle-perftools-dev - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 architecture: x64 @@ -175,13 +175,13 @@ jobs: pip3 install psutil - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.build-artifact-name }} @@ -209,7 +209,7 @@ jobs: - name: Upload regression artifacts if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.regression-artifact-name }} path: build/${{ env.regression-artifact-name }}.tar.gz @@ -217,17 +217,17 @@ jobs: # Code formatting CodeFormatting: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Dependencies run: | - sudo apt-get install clang-format + sudo apt-get install clang-format-18 clang-format --version - name: Run formatting style check @@ -236,18 +236,18 @@ jobs: # Code Tideness ClangTidy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Install Dependencies run: | sudo apt-get update -qq - sudo apt -qq -y install clang-tidy-12 \ + sudo apt -qq -y install clang-tidy-18 \ g++-9 default-jre cmake \ uuid-dev build-essential - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 architecture: x64 @@ -258,7 +258,7 @@ jobs: pip3 install psutil - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3c6a52aa2..a84fe35e08 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: # Linux build, test, and publish linux-install: name: "Linux | Install | ${{ matrix.compiler }} | ${{ matrix.config }}" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: @@ -30,7 +30,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -83,7 +83,7 @@ jobs: tar czfp artifacts/${{ env.artifact-name }}.tar.gz ${{ env.artifact-name }} - name: Upload build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.artifact-name }} path: artifacts/${{ env.artifact-name }}.tar.gz @@ -92,7 +92,7 @@ jobs: # Linux regression linux-regression: name: "Linux | Regression | ${{ matrix.compiler }} | ${{ matrix.config }} [${{ matrix.shard }}]" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: linux-install strategy: fail-fast: false @@ -115,7 +115,7 @@ jobs: sudo apt install -y google-perftools libgoogle-perftools-dev - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 architecture: x64 @@ -126,13 +126,13 @@ jobs: pip3 install psutil - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.build-artifact-name }} @@ -160,7 +160,7 @@ jobs: - name: Upload regression artifacts if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.regression-artifact-name }} path: build/${{ env.regression-artifact-name }}.tar.gz @@ -169,7 +169,7 @@ jobs: # Various other builds where just one compiler is sufficient to test with. linux-pythonapi: name: "Linux | Python API | ${{ matrix.compiler }} | ${{ matrix.config }}" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: @@ -180,7 +180,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -207,7 +207,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -231,7 +231,7 @@ jobs: # Valgrind linux-valgrind: name: "Linux | Valgrind | ${{ matrix.project }} | ${{ matrix.compiler }} | ${{ matrix.config }}" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: linux-install strategy: fail-fast: false @@ -256,7 +256,7 @@ jobs: sudo apt install -y google-perftools libgoogle-perftools-dev valgrind - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 architecture: x64 @@ -267,13 +267,13 @@ jobs: pip3 install psutil - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.build-artifact-name }} @@ -298,7 +298,7 @@ jobs: - name: Upload regression artifacts if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.regression-artifact-name }} path: build/${{ env.regression-artifact-name }}.tar.gz @@ -323,7 +323,7 @@ jobs: steps: - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 architecture: x64 @@ -344,7 +344,7 @@ jobs: MSYS2_PATH_TYPE: inherit - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 11 @@ -364,14 +364,14 @@ jobs: mklink /D %GITHUB_WORKSPACE% C:\Surelog - name: Configure Pagefile - uses: al-cheb/configure-pagefile-action@v1.3 + uses: al-cheb/configure-pagefile-action@v1.4 with: minimum-size: 8GB maximum-size: 16GB disk-root: "D:" - name: Git pull - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -430,7 +430,7 @@ jobs: tar czfp artifacts/${{ env.artifact-name }}.tar.gz ${{ env.artifact-name }} - name: Upload build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.artifact-name }} path: artifacts/${{ env.artifact-name }}.tar.gz @@ -459,7 +459,7 @@ jobs: steps: - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 architecture: x64 @@ -492,20 +492,20 @@ jobs: mklink /D %GITHUB_WORKSPACE% C:\Surelog - name: Configure Pagefile - uses: al-cheb/configure-pagefile-action@v1.3 + uses: al-cheb/configure-pagefile-action@v1.4 with: minimum-size: 8GB maximum-size: 16GB disk-root: "D:" - name: Git pull - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.build-artifact-name }} @@ -553,7 +553,7 @@ jobs: - name: Upload regression artifacts if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.regression-artifact-name }} path: build/${{ env.regression-artifact-name }}.tar.gz @@ -585,7 +585,7 @@ jobs: vcpkg install zlib zlib:x64-windows - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 architecture: x64 @@ -596,7 +596,7 @@ jobs: pip3 install psutil - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 11 @@ -623,13 +623,13 @@ jobs: mklink /D %GITHUB_WORKSPACE% C:\Surelog - name: Configure Pagefile - uses: al-cheb/configure-pagefile-action@v1.3 + uses: al-cheb/configure-pagefile-action@v1.4 with: minimum-size: 8GB maximum-size: 16GB disk-root: "D:" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -706,7 +706,7 @@ jobs: tar czfp artifacts/${{ env.artifact-name }}.tar.gz ${{ env.artifact-name }} - name: Upload build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.artifact-name }} path: artifacts/${{ env.artifact-name }}.tar.gz @@ -740,7 +740,7 @@ jobs: choco install -y make - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 architecture: x64 @@ -762,19 +762,19 @@ jobs: mklink /D %GITHUB_WORKSPACE% C:\Surelog - name: Configure Pagefile - uses: al-cheb/configure-pagefile-action@v1.3 + uses: al-cheb/configure-pagefile-action@v1.4 with: minimum-size: 8GB maximum-size: 16GB disk-root: "D:" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.build-artifact-name }} @@ -809,7 +809,7 @@ jobs: - name: Upload regression artifacts if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.regression-artifact-name }} path: build/${{ env.regression-artifact-name }}.tar.gz @@ -832,7 +832,7 @@ jobs: steps: - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 11 @@ -840,7 +840,7 @@ jobs: architecture: x64 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 architecture: x64 @@ -850,7 +850,7 @@ jobs: pip3 install orderedmultidict pip3 install psutil - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -909,7 +909,7 @@ jobs: tar czfp artifacts/${{ env.artifact-name }}.tar.gz ${{ env.artifact-name }} - name: Upload build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.artifact-name }} path: artifacts/${{ env.artifact-name }}.tar.gz @@ -936,7 +936,7 @@ jobs: steps: - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 architecture: x64 @@ -946,7 +946,7 @@ jobs: pip3 install orderedmultidict pip3 install psutil - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -963,7 +963,7 @@ jobs: which python && python --version - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.build-artifact-name }} @@ -991,20 +991,20 @@ jobs: - name: Upload regression artifacts if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.regression-artifact-name }} path: build/${{ env.regression-artifact-name }}.tar.gz release-tagging: name: Version Tagging - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 if: ${{github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')}} permissions: contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -1031,7 +1031,7 @@ jobs: - name: Publish tag if: ${{ env.TAG != '' }} - uses: actions/github-script@v6 + uses: actions/github-script@v7 env: TAG_NAME: ${{env.TAG}} TAG_SHA: ${{env.TAG_SHA}} @@ -1046,37 +1046,41 @@ jobs: # Code formatting CodeFormatting: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Dependencies run: | - sudo apt-get install clang-format - clang-format --version + # clang-format 18 seems to still settle and has different + # outcome with minor versions. So using stable 17 for now. + sudo apt-get install clang-format-17 - name: Run formatting style check - run: ./.github/bin/run-clang-format.sh + run: | + export CLANG_FORMAT=clang-format-17 + "${CLANG_FORMAT}" --version + ./.github/bin/run-clang-format.sh # Code Tideness ClangTidy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Install Dependencies run: | sudo apt-get update -qq - sudo apt -qq -y install clang-tidy-12 \ + sudo apt -qq -y install clang-tidy-18 \ g++-9 default-jre cmake \ uuid-dev build-essential - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 architecture: x64 @@ -1087,7 +1091,7 @@ jobs: pip3 install psutil - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -1111,4 +1115,6 @@ jobs: - name: Run clang tidy run: | + export CLANG_TIDY=clang-tidy-18 + "${CLANG_TIDY}" --version ./.github/bin/run-clang-tidy.sh limited diff --git a/.github/workflows/non_vendored.yml b/.github/workflows/non_vendored.yml index de114fc720..0fbbaba6d7 100644 --- a/.github/workflows/non_vendored.yml +++ b/.github/workflows/non_vendored.yml @@ -15,7 +15,7 @@ jobs: # Linux build and test linux-install: name: "Linux | Install | ${{ matrix.compiler }} | ${{ matrix.config }}" - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Fetch tags for CMakeLists version check # https://github.com/actions/checkout/issues/701 diff --git a/.github/workflows/regression_on_demand.yml b/.github/workflows/regression_on_demand.yml index 6d99a0c5db..5d6cdcdd9c 100644 --- a/.github/workflows/regression_on_demand.yml +++ b/.github/workflows/regression_on_demand.yml @@ -38,7 +38,7 @@ jobs: sudo ln -sf /usr/bin/gcov-9 /usr/bin/gcov - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.8 architecture: x64 @@ -47,7 +47,7 @@ jobs: run: pip3 install psutil - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -84,7 +84,7 @@ jobs: - name: Archive regression artifacts if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: surelog-linux-gcc-regression-${{ matrix.mode }} path: | @@ -113,7 +113,7 @@ jobs: choco install -y swig --side-by-side --version=3.0.12 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.8 architecture: x64 @@ -122,7 +122,7 @@ jobs: run: pip3 install psutil - name: Setup Java - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 1.8 java-package: jre @@ -140,7 +140,7 @@ jobs: rd /S /Q %GITHUB_WORKSPACE% mklink /D %GITHUB_WORKSPACE% C:\Surelog - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -180,7 +180,7 @@ jobs: - name: Archive regression artifacts if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: surelog-windows-msvc-regression-${{ matrix.mode }} path: | diff --git a/.github/workflows/yosys-plugin.yml b/.github/workflows/yosys-plugin.yml index 9c536346fa..1e5851a361 100644 --- a/.github/workflows/yosys-plugin.yml +++ b/.github/workflows/yosys-plugin.yml @@ -51,12 +51,12 @@ jobs: - name: Create Cache Timestamp id: cache_timestamp - uses: nanzm/get-time-action@v1.1 + uses: nanzm/get-time-action@v2.0 with: format: 'YYYY-MM-DD-HH-mm-ss' - name: Setup cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.CCACHE_DIR }} key: cache_${{ steps.cache_timestamp.outputs.time }} diff --git a/shell.nix b/shell.nix index ffa3ea552d..dff7482b11 100644 --- a/shell.nix +++ b/shell.nix @@ -32,7 +32,7 @@ pkgs.mkShell { # Ease development ccache - clang-tools # clang-format, clang-tidy + clang-tools_18 # for clang-tidy git cacert lcov # generate coverage ninja @@ -41,5 +41,12 @@ pkgs.mkShell { shellHook = '' export CMAKE_CXX_COMPILER_LAUNCHER=ccache export ADDITIONAL_CMAKE_OPTIONS="-DSURELOG_USE_HOST_GTEST=On -DSURELOG_USE_HOST_CAPNP=On -DSURELOG_USE_HOST_JSON=On -DSURELOG_USE_HOST_ANTLR=On -DANTLR_JAR_LOCATION=${pkgs.antlr4.jarLocation}" + + # Use latest clang-tidy + export CLANG_TIDY=${pkgs.clang-tools_18}/bin/clang-tidy + + # There is too much volatility between even micro-versions of + # clang-format 18. Let's use 17 for now. + export CLANG_FORMAT=${pkgs.clang-tools_17}/bin/clang-format ''; } diff --git a/src/Design/Statement.cpp b/src/Design/Statement.cpp index ab205d6ca2..8ea5729042 100644 --- a/src/Design/Statement.cpp +++ b/src/Design/Statement.cpp @@ -47,6 +47,7 @@ std::string_view SubRoutineCallStmt::getVarName(NodeId base_name) const { std::vector SubRoutineCallStmt::getVarChainNames() const { std::vector result; + result.reserve(m_var_chain.size()); for (auto node : m_var_chain) { result.emplace_back(getVarName(node)); }