mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
Compare commits
50 Commits
v2025.1.1-
...
v2025.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17a03514ba | ||
|
|
9ebc4b32ae | ||
|
|
ce60bd5035 | ||
|
|
468a3c6d95 | ||
|
|
4350ea769c | ||
|
|
83397392f4 | ||
|
|
786d22049b | ||
|
|
86137c49f5 | ||
|
|
4edf52d3b6 | ||
|
|
a41fb460a9 | ||
|
|
d4985b8ba0 | ||
|
|
1538370034 | ||
|
|
eef1bf33de | ||
|
|
78b6d61e88 | ||
|
|
e7dd5dca82 | ||
|
|
a27df8ec24 | ||
|
|
85507a6c65 | ||
|
|
b74f84f876 | ||
|
|
54e9c76e03 | ||
|
|
203487a6aa | ||
|
|
57344ef3b2 | ||
|
|
46d401553e | ||
|
|
9e63dcfb16 | ||
|
|
934bf7bf05 | ||
|
|
fe49cbe429 | ||
|
|
0470e51569 | ||
|
|
72fdca3507 | ||
|
|
dee50bf500 | ||
|
|
939a9ceee1 | ||
|
|
b670a59b5b | ||
|
|
9b12ddb595 | ||
|
|
76625fa0f9 | ||
|
|
bb130b67b8 | ||
|
|
469bb3290d | ||
|
|
02a0adc653 | ||
|
|
0c99073b94 | ||
|
|
d631fa8e4b | ||
|
|
19d385d149 | ||
|
|
d0cc7e4eca | ||
|
|
807dffed35 | ||
|
|
f46c81cfe3 | ||
|
|
9ccd73108b | ||
|
|
38d8929f48 | ||
|
|
cc73236a06 | ||
|
|
f8720a628c | ||
|
|
156bd71fef | ||
|
|
6e44187ff6 | ||
|
|
e2cbdf9718 | ||
|
|
66cce1835c | ||
|
|
6fe5da7289 |
65
.github/actions/pregen/action.yml
vendored
Normal file
65
.github/actions/pregen/action.yml
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
name: 'Setup and run pregeneration'
|
||||
description: 'Sets up the dependencies needed to generate generated files and runs all generation scripts'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set up Python 3.12
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Install jinja and protobuf
|
||||
run: python -m pip install jinja2 protobuf grpcio-tools
|
||||
shell: bash
|
||||
- name: Install protobuf and perl dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y protobuf-compiler liblist-moreutils-perl
|
||||
wget https://github.com/HebiRobotics/QuickBuffers/releases/download/1.3.3/protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
|
||||
chmod +x protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
|
||||
shell: bash
|
||||
- name: Regenerate hal
|
||||
run: ./hal/generate_usage_reporting.py
|
||||
shell: bash
|
||||
|
||||
- name: Regenerate ntcore
|
||||
run: ./ntcore/generate_topics.py
|
||||
shell: bash
|
||||
|
||||
- name: Regenerate imgui
|
||||
run: |
|
||||
./thirdparty/imgui_suite/generate_fonts.sh
|
||||
./thirdparty/imgui_suite/generate_gl3w.py
|
||||
shell: bash
|
||||
|
||||
- name: Regenerate HIDs
|
||||
run: |
|
||||
./wpilibc/generate_hids.py
|
||||
./wpilibj/generate_hids.py
|
||||
./wpilibNewCommands/generate_hids.py
|
||||
shell: bash
|
||||
|
||||
- name: Regenerate PWM motor controllers
|
||||
run: |
|
||||
./wpilibc/generate_pwm_motor_controllers.py
|
||||
./wpilibj/generate_pwm_motor_controllers.py
|
||||
shell: bash
|
||||
|
||||
- name: Regenerate mrcal minimath
|
||||
run: ./wpical/generate_mrcal.py
|
||||
shell: bash
|
||||
|
||||
- name: Regenerate wpimath
|
||||
run: |
|
||||
./wpimath/generate_nanopb.py
|
||||
./wpimath/generate_numbers.py
|
||||
./wpimath/generate_quickbuf.py --quickbuf_plugin protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
|
||||
shell: bash
|
||||
|
||||
- name: Regenerate wpiunits
|
||||
run: ./wpiunits/generate_units.py
|
||||
shell: bash
|
||||
|
||||
- name: Regenerate wpiutil nanopb
|
||||
run: ./wpiutil/generate_nanopb.py
|
||||
shell: bash
|
||||
@@ -2,8 +2,6 @@ name: Artifactory Nightly Cleanup
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '15 2 * * *'
|
||||
|
||||
jobs:
|
||||
wpilib-mvn-development_unused_cleanup:
|
||||
|
||||
101
.github/workflows/comment-command.yml
vendored
101
.github/workflows/comment-command.yml
vendored
@@ -1,101 +0,0 @@
|
||||
name: Comment Commands
|
||||
on:
|
||||
issue_comment:
|
||||
types: [ created ]
|
||||
|
||||
jobs:
|
||||
format:
|
||||
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/format')
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: React Rocket
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const {owner, repo} = context.issue
|
||||
github.rest.reactions.createForIssueComment({
|
||||
owner,
|
||||
repo,
|
||||
comment_id: context.payload.comment.id,
|
||||
content: "rocket",
|
||||
});
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.COMMENT_COMMAND_PAT_TOKEN }}
|
||||
- name: Fetch all history and metadata
|
||||
run: |
|
||||
git checkout -b pr
|
||||
git branch -f main origin/main
|
||||
- name: Checkout PR
|
||||
run: |
|
||||
gh pr checkout $NUMBER
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.COMMENT_COMMAND_PAT_TOKEN }}"
|
||||
NUMBER: ${{ github.event.issue.number }}
|
||||
- name: Set up Python 3.12
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Install wpiformat
|
||||
run: pip3 install wpiformat==2024.50
|
||||
- name: Run wpiformat
|
||||
run: wpiformat
|
||||
- name: Run spotlessApply
|
||||
run: ./gradlew spotlessApply
|
||||
- name: Commit
|
||||
run: |
|
||||
# Set credentials
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
# Commit
|
||||
git commit -am "Formatting fixes"
|
||||
git push
|
||||
|
||||
pregen:
|
||||
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/pregen')
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: React Rocket
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const {owner, repo} = context.issue
|
||||
github.rest.reactions.createForIssueComment({
|
||||
owner,
|
||||
repo,
|
||||
comment_id: context.payload.comment.id,
|
||||
content: "rocket",
|
||||
});
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.COMMENT_COMMAND_PAT_TOKEN }}
|
||||
- name: Checkout PR
|
||||
run: |
|
||||
gh pr checkout $NUMBER
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.COMMENT_COMMAND_PAT_TOKEN }}"
|
||||
NUMBER: ${{ github.event.issue.number }}
|
||||
- name: Set up Python 3.12
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Install jinja
|
||||
run: python -m pip install jinja2
|
||||
- name: Install protobuf dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler && wget https://github.com/HebiRobotics/QuickBuffers/releases/download/1.3.3/protoc-gen-quickbuf-1.3.3-linux-x86_64.exe && chmod +x protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
|
||||
- name: Regenerate all
|
||||
run: ./.github/workflows/pregen_all.py --quickbuf_plugin=protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
|
||||
- name: Commit
|
||||
run: |
|
||||
# Set credentials
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
# Commit
|
||||
git commit -am "Regenerate pregenerated files"
|
||||
git push
|
||||
1
.github/workflows/documentation.yml
vendored
1
.github/workflows/documentation.yml
vendored
@@ -20,6 +20,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- uses: gradle/actions/wrapper-validation@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
|
||||
5
.github/workflows/fix_compile_commands.py
vendored
5
.github/workflows/fix_compile_commands.py
vendored
@@ -18,9 +18,9 @@ def main():
|
||||
for obj in data:
|
||||
out_args = []
|
||||
|
||||
# Filter out -isystem flags that cause false positives
|
||||
iter_args = iter(obj["arguments"])
|
||||
for arg in iter_args:
|
||||
# Filter out -isystem flags that cause false positives
|
||||
if arg == "-isystem":
|
||||
next_arg = next(iter_args)
|
||||
|
||||
@@ -28,6 +28,9 @@ def main():
|
||||
# error: conflicting types for '_mm_prefetch' [clang-diagnostic-error]
|
||||
if not next_arg.startswith("/usr/lib/gcc/"):
|
||||
out_args += ["-isystem", next_arg]
|
||||
# Replace GCC warning argument with one Clang recognizes
|
||||
elif arg == "-Wno-maybe-uninitialized":
|
||||
out_args.append("-Wno-uninitialized")
|
||||
else:
|
||||
out_args.append(arg)
|
||||
|
||||
|
||||
14
.github/workflows/gradle-wrapper-validation.yml
vendored
14
.github/workflows/gradle-wrapper-validation.yml
vendored
@@ -1,14 +0,0 @@
|
||||
name: "Validate Gradle Wrapper"
|
||||
on: [pull_request, push]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
name: "Validation"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: gradle/actions/wrapper-validation@v3
|
||||
10
.github/workflows/gradle.yml
vendored
10
.github/workflows/gradle.yml
vendored
@@ -7,6 +7,13 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
name: "Validation"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: gradle/actions/wrapper-validation@v4
|
||||
|
||||
build-docker:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -26,6 +33,7 @@ jobs:
|
||||
build-options: "-Ponlylinuxx86-64"
|
||||
name: "Build - ${{ matrix.artifact-name }}"
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [validation]
|
||||
steps:
|
||||
- name: Free Disk Space
|
||||
uses: jlumbroso/free-disk-space@main
|
||||
@@ -109,6 +117,7 @@ jobs:
|
||||
outputs: "ntcoreffi/build/outputs"
|
||||
name: "Build - ${{ matrix.artifact-name }}"
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: [validation]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -181,6 +190,7 @@ jobs:
|
||||
build-documentation:
|
||||
name: "Build - Documentation"
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [validation]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
||||
26
.github/workflows/lint-format.yml
vendored
26
.github/workflows/lint-format.yml
vendored
@@ -11,6 +11,13 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
name: "Validation"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: gradle/actions/wrapper-validation@v4
|
||||
|
||||
wpiformat:
|
||||
name: "wpiformat"
|
||||
runs-on: ubuntu-22.04
|
||||
@@ -27,9 +34,11 @@ jobs:
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Install wpiformat
|
||||
run: pip3 install wpiformat==2024.50
|
||||
run: |
|
||||
python -m venv ${{ runner.temp }}/wpiformat
|
||||
${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2024.51
|
||||
- name: Run
|
||||
run: wpiformat
|
||||
run: ${{ runner.temp }}/wpiformat/bin/wpiformat
|
||||
- name: Check output
|
||||
run: git --no-pager diff --exit-code HEAD
|
||||
- name: Generate diff
|
||||
@@ -51,6 +60,7 @@ jobs:
|
||||
tidy:
|
||||
name: "clang-tidy"
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [validation]
|
||||
container: wpilib/ubuntu-base:22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -66,21 +76,24 @@ jobs:
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Install wpiformat
|
||||
run: pip3 install wpiformat==2024.50
|
||||
run: |
|
||||
python -m venv ${{ runner.temp }}/wpiformat
|
||||
${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2024.51
|
||||
- name: Create compile_commands.json
|
||||
run: |
|
||||
./gradlew generateCompileCommands -Ptoolchain-optional-roboRio
|
||||
./.github/workflows/fix_compile_commands.py build/TargetedCompileCommands/linuxx86-64release/compile_commands.json
|
||||
./.github/workflows/fix_compile_commands.py build/TargetedCompileCommands/linuxx86-64debug/compile_commands.json
|
||||
- name: List changed files
|
||||
run: wpiformat -list-changed-files
|
||||
run: ${{ runner.temp }}/wpiformat/bin/wpiformat -list-changed-files
|
||||
- name: Run clang-tidy release
|
||||
run: wpiformat -no-format -tidy-changed -compile-commands=build/TargetedCompileCommands/linuxx86-64release -vv
|
||||
run: ${{ runner.temp }}/wpiformat/bin/wpiformat -no-format -tidy-changed -compile-commands=build/TargetedCompileCommands/linuxx86-64release -vv
|
||||
- name: Run clang-tidy debug
|
||||
run: wpiformat -no-format -tidy-changed -compile-commands=build/TargetedCompileCommands/linuxx86-64debug -vv
|
||||
run: ${{ runner.temp }}/wpiformat/bin/wpiformat -no-format -tidy-changed -compile-commands=build/TargetedCompileCommands/linuxx86-64debug -vv
|
||||
javaformat:
|
||||
name: "Java format"
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [validation]
|
||||
container: wpilib/ubuntu-base:22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -114,6 +127,7 @@ jobs:
|
||||
documentation:
|
||||
name: "Documentation"
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [validation]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
||||
78
.github/workflows/pregen_all.py
vendored
78
.github/workflows/pregen_all.py
vendored
@@ -1,78 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def main():
|
||||
script_path = Path(__file__).resolve()
|
||||
REPO_ROOT = script_path.parent.parent.parent
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"--quickbuf_plugin",
|
||||
help="Path to the quickbuf protoc plugin",
|
||||
required=True,
|
||||
)
|
||||
args = parser.parse_args()
|
||||
subprocess.run(
|
||||
[sys.executable, f"{REPO_ROOT}/hal/generate_usage_reporting.py"], check=True
|
||||
)
|
||||
subprocess.run(
|
||||
[sys.executable, f"{REPO_ROOT}/ntcore/generate_topics.py"], check=True
|
||||
)
|
||||
subprocess.run(
|
||||
[sys.executable, f"{REPO_ROOT}/wpimath/generate_numbers.py"], check=True
|
||||
)
|
||||
subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
f"{REPO_ROOT}/wpimath/generate_quickbuf.py",
|
||||
f"--quickbuf_plugin={args.quickbuf_plugin}",
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
f"{REPO_ROOT}/wpimath/generate_nanopb.py",
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
subprocess.run(
|
||||
[sys.executable, f"{REPO_ROOT}/wpiunits/generate_units.py"], check=True
|
||||
)
|
||||
subprocess.run(
|
||||
[sys.executable, f"{REPO_ROOT}/wpilibc/generate_hids.py"], check=True
|
||||
)
|
||||
subprocess.run(
|
||||
[sys.executable, f"{REPO_ROOT}/wpilibj/generate_hids.py"], check=True
|
||||
)
|
||||
subprocess.run(
|
||||
[sys.executable, f"{REPO_ROOT}/wpilibNewCommands/generate_hids.py"], check=True
|
||||
)
|
||||
subprocess.run(
|
||||
[sys.executable, f"{REPO_ROOT}/wpilibc/generate_pwm_motor_controllers.py"],
|
||||
check=True,
|
||||
)
|
||||
subprocess.run(
|
||||
[sys.executable, f"{REPO_ROOT}/wpilibj/generate_pwm_motor_controllers.py"],
|
||||
check=True,
|
||||
)
|
||||
subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
f"{REPO_ROOT}/wpiutil/generate_nanopb.py",
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
subprocess.run(
|
||||
[sys.executable, f"{REPO_ROOT}/thirdparty/imgui_suite/generate_gl3w.py"],
|
||||
check=True,
|
||||
)
|
||||
subprocess.run(f"{REPO_ROOT}/thirdparty/imgui_suite/generate_fonts.sh", check=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
12
.github/workflows/pregenerate.yml
vendored
12
.github/workflows/pregenerate.yml
vendored
@@ -18,16 +18,8 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python 3.12
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Install jinja and protobuf
|
||||
run: python -m pip install jinja2 protobuf grpcio-tools
|
||||
- name: Install protobuf dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler && wget https://github.com/HebiRobotics/QuickBuffers/releases/download/1.3.3/protoc-gen-quickbuf-1.3.3-linux-x86_64.exe && chmod +x protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
|
||||
- name: Regenerate all
|
||||
run: python ./.github/workflows/pregen_all.py --quickbuf_plugin protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
|
||||
- name: Run pregen
|
||||
uses: ./.github/actions/pregen
|
||||
- name: Add untracked files to index so they count as changes
|
||||
run: git add -A
|
||||
- name: Check output
|
||||
|
||||
9
.github/workflows/sentinel-build.yml
vendored
9
.github/workflows/sentinel-build.yml
vendored
@@ -10,6 +10,13 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
name: "Validation"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: gradle/actions/wrapper-validation@v4
|
||||
|
||||
build-docker:
|
||||
if: (github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main') || github.event_name != 'schedule'
|
||||
strategy:
|
||||
@@ -30,6 +37,7 @@ jobs:
|
||||
build-options: "-Ponlylinuxx86-64"
|
||||
name: "Build - ${{ matrix.artifact-name }}"
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [validation]
|
||||
steps:
|
||||
- name: Free Disk Space
|
||||
uses: jlumbroso/free-disk-space@main
|
||||
@@ -101,6 +109,7 @@ jobs:
|
||||
outputs: "ntcoreffi/build/outputs"
|
||||
name: "Build - ${{ matrix.artifact-name }}"
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: [validation]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
||||
58
.github/workflows/tools.yml
vendored
58
.github/workflows/tools.yml
vendored
@@ -29,12 +29,13 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: gradle/actions/wrapper-validation@v4
|
||||
- name: Build WPILib with Gradle
|
||||
uses: addnab/docker-run-action@v3
|
||||
with:
|
||||
image: wpilib/roborio-cross-ubuntu:2025-22.04
|
||||
options: -v ${{ github.workspace }}:/work -w /work -e GITHUB_REF -e CI -e DISPLAY
|
||||
run: df . && rm -f semicolon_delimited_script && ./gradlew :wpilibc:publish :wpilibj:publish :wpilibNewCommands:publish :hal:publish :cameraserver:publish :ntcore:publish :cscore:publish :wpimath:publish :wpinet:publish :wpiutil:publish :apriltag:publish :wpiunits:publish :simulation:halsim_gui:publish :simulation:halsim_ds_socket:publish :fieldImages:publish :epilogue-processor:publish :epilogue-runtime:publish :thirdparty:googletest:publish -x test -x Javadoc -x doxygen --build-cache && cp -r /root/releases/maven/development /work
|
||||
run: df . && rm -f semicolon_delimited_script && ./gradlew :wpilibc:publish :wpilibj:publish :wpilibNewCommands:publish :hal:publish :cameraserver:publish :ntcore:publish :cscore:publish :wpimath:publish :wpinet:publish :wpiutil:publish :apriltag:publish :wpiunits:publish :simulation:halsim_gui:publish :simulation:halsim_ds_socket:publish :simulation:halsim_ws_server:publish :simulation:halsim_ws_client:publish :simulation:halsim_xrp:publish :fieldImages:publish :romiVendordep:publish :xrpVendordep:publish :epilogue-processor:publish :epilogue-runtime:publish :thirdparty:googletest:publish -x test -x Javadoc -x doxygen --build-cache && cp -r /root/releases/maven/development /work
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MavenArtifacts
|
||||
@@ -148,3 +149,58 @@ jobs:
|
||||
path: |
|
||||
build/allOutputs/
|
||||
retention-days: 7
|
||||
|
||||
Robotpy:
|
||||
name: "Build - Robotpy"
|
||||
needs: [build-artifacts]
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: robotpy/mostrobotpy
|
||||
fetch-depth: 0
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: MavenArtifacts
|
||||
- name: Move artifacts
|
||||
run: mkdir -p ~/releases/maven/development && cp -r edu ~/releases/maven/development
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.13
|
||||
|
||||
#
|
||||
# Setup build caching
|
||||
#
|
||||
|
||||
- name: Set ccache size
|
||||
shell: bash
|
||||
id: ccache
|
||||
run: echo "MAX_SIZE=500M" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Setup ccache
|
||||
# uses: hendrikmuhs/ccache-action@v1.2.10
|
||||
uses: robotpy/ccache-action@fork
|
||||
with:
|
||||
key: ubuntu-22.04-3.13
|
||||
variant: ccache
|
||||
max-size: ${{ steps.ccache.outputs.max_size }}
|
||||
|
||||
- name: Install deps
|
||||
shell: bash
|
||||
run: |
|
||||
python -m pip --disable-pip-version-check install -r rdev_requirements.txt
|
||||
|
||||
- name: Install numpy (needed for stubgen but broken in raspbian CI)
|
||||
shell: bash
|
||||
run: |
|
||||
python -m pip --disable-pip-version-check install numpy
|
||||
- name: Patch RobotPy rdev to use local development
|
||||
run: git config user.name github-actions && git config user.email github-actions@github.com && set -- ~/releases/maven/development/edu/wpi/first/wpiutil/wpiutil-cpp/*/ ; wpilibversion=$(basename $1) && echo $wpilibversion && sed --regexp-extended -i 's@(wpilib_bin_url =).*@\1 \"file:\/\/'"$HOME"'\/releases\/maven\/development"@' rdev.toml && sed --regexp-extended -i 's/(wpilib_bin_version =).*/\1 \"'"$wpilibversion"'\"/' rdev.toml && ./rdev.sh update-pyproject --commit
|
||||
- name: Build + test wheels
|
||||
shell: bash
|
||||
run: |
|
||||
./rdev.sh ci run
|
||||
env:
|
||||
RPYBUILD_STRIP_LIBPYTHON: "1"
|
||||
RPYBUILD_CC_LAUNCHER: ccache
|
||||
|
||||
@@ -76,6 +76,7 @@ cmake_dependent_option(
|
||||
)
|
||||
option(WITH_CSCORE "Build cscore (needs OpenCV)" ON)
|
||||
option(WITH_NTCORE "Build ntcore" ON)
|
||||
option(WITH_WPICAL "Build wpical" OFF)
|
||||
option(WITH_WPIMATH "Build wpimath" ON)
|
||||
cmake_dependent_option(
|
||||
WITH_WPIUNITS
|
||||
@@ -142,6 +143,11 @@ if(WITH_DOCS)
|
||||
include(AddDoxygenDocs)
|
||||
add_doxygen_docs()
|
||||
endif()
|
||||
|
||||
if(WITH_WPICAL)
|
||||
find_package(Ceres CONFIG REQUIRED)
|
||||
endif()
|
||||
|
||||
find_package(LIBSSH CONFIG 0.7.1)
|
||||
|
||||
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
|
||||
@@ -314,6 +320,9 @@ if(WITH_GUI)
|
||||
add_subdirectory(glass)
|
||||
add_subdirectory(outlineviewer)
|
||||
add_subdirectory(sysid)
|
||||
if(WITH_WPICAL)
|
||||
add_subdirectory(wpical)
|
||||
endif()
|
||||
if(LIBSSH_FOUND)
|
||||
add_subdirectory(roborioteamnumbersetter)
|
||||
add_subdirectory(datalogtool)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2009-2024 FIRST and other WPILib contributors
|
||||
Copyright (c) 2009-2025 FIRST and other WPILib contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -59,6 +59,8 @@ Using Gradle makes building WPILib very straightforward. It only has a few depen
|
||||
|
||||
On macOS ARM, run `softwareupdate --install-rosetta`. This is necessary to be able to use the macOS x86 roboRIO toolchain on ARM.
|
||||
|
||||
On linux, run `sudo apt install gfortran`. This is necessary to be able to build WPIcal on linux platforms.
|
||||
|
||||
## Setup
|
||||
|
||||
Clone the WPILib repository and follow the instructions above for installing any required tooling. The build process uses versioning information from git. Downloading the source is not sufficient to run the build.
|
||||
|
||||
@@ -15,7 +15,8 @@ licenses, and/or restrictions:
|
||||
|
||||
Program Locations
|
||||
------- ---------
|
||||
Google Test gtest
|
||||
Google Test thirdparty/googletest/include
|
||||
thirdparty/googletest/src
|
||||
LLVM wpiutil/src/main/native/thirdparty/llvm
|
||||
wpiutil/src/test/native/cpp/llvm/
|
||||
JSON for Modern C++ wpiutil/src/main/native/thirdparty/json
|
||||
@@ -33,17 +34,28 @@ popper.js wpinet/src/main/native/resources/popper-*
|
||||
units wpimath/src/main/native/include/units/
|
||||
Eigen wpimath/src/main/native/thirdparty/eigen/include/
|
||||
StackWalker wpiutil/src/main/native/windows/StackWalker.*
|
||||
GHC filesystem wpiutil/src/main/native/thirdparty/include/wpi/ghc/
|
||||
Team 254 Library wpilibj/src/main/java/edu/wpi/first/wpilibj/spline/SplineParameterizer.java
|
||||
wpilibj/src/main/java/edu/wpi/first/wpilibj/trajectory/TrajectoryParameterizer.java
|
||||
wpilibc/src/main/native/include/spline/SplineParameterizer.h
|
||||
wpilibc/src/main/native/include/trajectory/TrajectoryParameterizer.h
|
||||
wpilibc/src/main/native/cpp/trajectory/TrajectoryParameterizer.cpp
|
||||
Team 254 Library wpimath/src/main/java/edu/wpi/first/math/spline/SplineParameterizer.java
|
||||
wpimath/src/main/java/edu/wpi/first/math/trajectory/TrajectoryParameterizer.java
|
||||
wpimath/src/main/native/include/frc/spline/SplineParameterizer.h
|
||||
wpimath/src/main/native/include/frc/trajectory/TrajectoryParameterizer.h
|
||||
wpimath/src/main/native/cpp/trajectory/TrajectoryParameterizer.cpp
|
||||
Portable File Dialogs wpigui/src/main/native/include/portable-file-dialogs.h
|
||||
V8 export-template wpiutil/src/main/native/include/wpi/SymbolExports.h
|
||||
GCEM wpimath/src/main/native/thirdparty/gcem/include/
|
||||
Sleipnir wpimath/src/main/native/thirdparty/sleipnir
|
||||
Debugging wpiutil/src/main/native/thirdparty/debugging
|
||||
argparse wpiutil/src/main/native/thirdparty/argparse/include/wpi/argparse.h
|
||||
apriltag apriltag/src/main/native/thirdparty/apriltag
|
||||
glfw thirdparty/imgui_suite/glfw
|
||||
Dear ImGui thirdparty/imgui_suite/imgui
|
||||
implot thirdparty/imgui_suite/implot
|
||||
memory wpiutil/src/main/native/thirdparty/memory
|
||||
nanopb wpiutil/src/main/native/thirdparty/nanopb
|
||||
protobuf wpiutil/src/main/native/thirdparty/protobuf
|
||||
mrcal wpical/src/main/native/thirdparty/mrcal
|
||||
libdogleg wpical/src/main/native/thirdparty/libdogleg
|
||||
|
||||
Additionally, glfw, memory, and nanopb were all modified for use in WPILib.
|
||||
|
||||
==============================================================================
|
||||
Google Test License
|
||||
@@ -462,7 +474,7 @@ limitations under the License.
|
||||
|
||||
|
||||
==============================================================================
|
||||
MPacks License
|
||||
MPack License
|
||||
==============================================================================
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -1078,33 +1090,6 @@ and/or modify it under the terms of the Do What the **** You Want
|
||||
to Public License, Version 2, as published by the WTFPL Task Force.
|
||||
See http://www.wtfpl.net/ for more details.
|
||||
|
||||
======================
|
||||
Boost Software License
|
||||
======================
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
======
|
||||
fmtlib
|
||||
======
|
||||
@@ -1136,29 +1121,6 @@ of this Software are embedded into a machine-executable object form of such
|
||||
source code, you may redistribute such embedded portions in such object form
|
||||
without including the above copyright and permission notices.
|
||||
|
||||
==============
|
||||
GHC filesystem
|
||||
==============
|
||||
Copyright (c) 2018, Steffen Schümann <s.schuemann@pobox.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
==================
|
||||
V8 export-template
|
||||
==================
|
||||
@@ -1251,3 +1213,492 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
================
|
||||
argparse License
|
||||
================
|
||||
Copyright (c) 2018 Pranav Srinivas Kumar <pranav.srinivas.kumar@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
================
|
||||
apriltag License
|
||||
================
|
||||
BSD 2-Clause License
|
||||
|
||||
Copyright (C) 2013-2016, The Regents of The University of Michigan.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the Regents of The University of Michigan.
|
||||
|
||||
============
|
||||
gl3w License
|
||||
============
|
||||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
============
|
||||
glfw License
|
||||
============
|
||||
Copyright (c) 2002-2006 Marcus Geelnard
|
||||
|
||||
Copyright (c) 2006-2019 Camilla Löwy
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would
|
||||
be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not
|
||||
be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
==================
|
||||
Dear ImGui License
|
||||
==================
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2024 Omar Cornut
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
==============
|
||||
implot License
|
||||
==============
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Evan Pezent
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
==============
|
||||
memory License
|
||||
==============
|
||||
Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors
|
||||
|
||||
This software is provided 'as-is', without any express or
|
||||
implied warranty. In no event will the authors be held
|
||||
liable for any damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute
|
||||
it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented;
|
||||
you must not claim that you wrote the original software.
|
||||
If you use this software in a product, an acknowledgment
|
||||
in the product documentation would be appreciated but
|
||||
is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such,
|
||||
and must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any
|
||||
source distribution.
|
||||
|
||||
==============
|
||||
nanopb License
|
||||
==============
|
||||
Copyright (c) 2011 Petteri Aimonen <jpa at nanopb.mail.kapsi.fi>
|
||||
|
||||
This software is provided 'as-is', without any express or
|
||||
implied warranty. In no event will the authors be held liable
|
||||
for any damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
================
|
||||
protobuf License
|
||||
================
|
||||
Copyright 2008 Google Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Code generated by the Protocol Buffer compiler is owned by the owner
|
||||
of the input file used when generating it. This code is not
|
||||
standalone and requires a support library to be linked with it. This
|
||||
support library is itself covered by the above license.
|
||||
|
||||
===========
|
||||
stb License
|
||||
===========
|
||||
This software is available under 2 licenses -- choose whichever you prefer.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE A - MIT License
|
||||
Copyright (c) 2017 Sean Barrett
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE B - Public Domain (www.unlicense.org)
|
||||
This is free and unencumbered software released into the public domain.
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
commercial or non-commercial, and by any means.
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
this software under copyright law.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
=============
|
||||
mrcal License
|
||||
=============
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright (c) 2017-2023 California Institute of Technology ("Caltech"). U.S.
|
||||
Government sponsorship acknowledged. All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
=================
|
||||
libdogleg License
|
||||
=================
|
||||
Copyright 2011 Oblong Industries 2017 Dima Kogan <dima@secretsauce.net>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
|
||||
The full text of the license is available at http://www.gnu.org/licenses
|
||||
|
||||
27
WORKSPACE
27
WORKSPACE
@@ -35,8 +35,8 @@ maven_install(
|
||||
# Download toolchains
|
||||
http_archive(
|
||||
name = "rules_bzlmodrio_toolchains",
|
||||
sha256 = "2ef1cafce7f4fd4e909bb5de8b0dc771a934646afd55d5f100ff31f6b500df98",
|
||||
url = "https://github.com/wpilibsuite/rules_bzlmodRio_toolchains/releases/download/2024-1.bcr1/rules_bzlmodRio_toolchains-2024-1.bcr1.tar.gz",
|
||||
sha256 = "fe267e2af53c1def1e962700a9aeda9e8fdfa9fb46b72167c615ec0e25447dd6",
|
||||
url = "https://github.com/wpilibsuite/rules_bzlmodRio_toolchains/releases/download/2025-1/rules_bzlmodRio_toolchains-2025-1.tar.gz",
|
||||
)
|
||||
|
||||
load("@rules_bzlmodrio_toolchains//:maven_deps.bzl", "setup_legacy_setup_toolchains_dependencies")
|
||||
@@ -71,6 +71,12 @@ register_toolchains(
|
||||
"@local_bullseye_64//:macos",
|
||||
"@local_bullseye_64//:linux",
|
||||
"@local_bullseye_64//:windows",
|
||||
"@local_bookworm_32//:macos",
|
||||
"@local_bookworm_32//:linux",
|
||||
"@local_bookworm_32//:windows",
|
||||
"@local_bookworm_64//:macos",
|
||||
"@local_bookworm_64//:linux",
|
||||
"@local_bookworm_64//:windows",
|
||||
)
|
||||
|
||||
setup_legacy_setup_jdk_dependencies()
|
||||
@@ -87,8 +93,8 @@ setup_legacy_bzlmodrio_ni_cpp_dependencies()
|
||||
|
||||
http_archive(
|
||||
name = "bzlmodrio-opencv",
|
||||
sha256 = "5314cce05b49451a46bf3e3140fc401342e53d5f3357612ed4473e59bb616cba",
|
||||
url = "https://github.com/wpilibsuite/bzlmodRio-opencv/releases/download/2024.4.8.0-4.bcr1/bzlmodRio-opencv-2024.4.8.0-4.bcr1.tar.gz",
|
||||
sha256 = "4f4a607956ca8555618736c3058dd96e09d02df19e95088c1e352d2319fd70c7",
|
||||
url = "https://github.com/wpilibsuite/bzlmodRio-opencv/releases/download/2025.4.10.0-2/bzlmodRio-opencv-2025.4.10.0-2.tar.gz",
|
||||
)
|
||||
|
||||
load("@bzlmodrio-opencv//:maven_cpp_deps.bzl", "setup_legacy_bzlmodrio_opencv_cpp_dependencies")
|
||||
@@ -98,3 +104,16 @@ setup_legacy_bzlmodrio_opencv_cpp_dependencies()
|
||||
load("@bzlmodrio-opencv//:maven_java_deps.bzl", "setup_legacy_bzlmodrio_opencv_java_dependencies")
|
||||
|
||||
setup_legacy_bzlmodrio_opencv_java_dependencies()
|
||||
|
||||
http_archive(
|
||||
name = "build_bazel_apple_support",
|
||||
sha256 = "c4bb2b7367c484382300aee75be598b92f847896fb31bbd22f3a2346adf66a80",
|
||||
url = "https://github.com/bazelbuild/apple_support/releases/download/1.15.1/apple_support.1.15.1.tar.gz",
|
||||
)
|
||||
|
||||
load(
|
||||
"@build_bazel_apple_support//lib:repositories.bzl",
|
||||
"apple_support_dependencies",
|
||||
)
|
||||
|
||||
apple_support_dependencies()
|
||||
|
||||
112
apriltag/BUILD.bazel
Normal file
112
apriltag/BUILD.bazel
Normal file
@@ -0,0 +1,112 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
||||
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
|
||||
load("@rules_python//python:defs.bzl", "py_binary")
|
||||
load("//shared/bazel/rules/gen:gen-resources.bzl", "generate_resources")
|
||||
|
||||
cc_library(
|
||||
name = "thirdparty-apriltag",
|
||||
srcs = glob(["src/main/native/thirdparty/apriltag/src/**"]),
|
||||
hdrs = glob(["src/main/native/thirdparty/apriltag/include/**"]),
|
||||
copts = select({
|
||||
"@bazel_tools//src/conditions:darwin": [
|
||||
"-Wno-format-nonliteral",
|
||||
"-Wno-gnu-zero-variadic-macro-arguments",
|
||||
"-Wno-uninitialized",
|
||||
"-Wno-sign-compare",
|
||||
"-Wno-type-limits",
|
||||
],
|
||||
"@bazel_tools//src/conditions:windows": [
|
||||
"/wd4005",
|
||||
"/wd4018",
|
||||
"/wd4244",
|
||||
"/wd4267",
|
||||
"/wd4996",
|
||||
],
|
||||
"@rules_bzlmodrio_toolchains//constraints/combined:is_linux": [
|
||||
"-Wno-format-nonliteral",
|
||||
"-Wno-maybe-uninitialized",
|
||||
"-Wno-sign-compare",
|
||||
"-Wno-type-limits",
|
||||
],
|
||||
}),
|
||||
includes = ["src/main/native/thirdparty/apriltag/include/common"],
|
||||
strip_include_prefix = "src/main/native/thirdparty/apriltag/include",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
generate_resources(
|
||||
name = "generate-resources",
|
||||
namespace = "frc",
|
||||
prefix = "APRILTAG",
|
||||
resource_files = glob(["src/main/native/resources/**"]),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "apriltag.static",
|
||||
srcs = [":generate-resources"] + glob(
|
||||
["src/main/native/cpp/**"],
|
||||
exclude = ["src/main/native/cpp/jni/**"],
|
||||
),
|
||||
hdrs = glob(["src/main/native/include/**/*"]),
|
||||
defines = ["WPILIB_EXPORTS"],
|
||||
strip_include_prefix = "src/main/native/include",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":thirdparty-apriltag",
|
||||
"//wpimath:wpimath.static",
|
||||
"//wpiutil:wpiutil.static",
|
||||
],
|
||||
)
|
||||
|
||||
java_library(
|
||||
name = "apriltag-java",
|
||||
srcs = glob(["src/main/java/**/*.java"]),
|
||||
resource_strip_prefix = "apriltag/src/main/native/resources",
|
||||
resources = glob(["src/main/native/resources/**"]),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//wpimath:wpimath-java",
|
||||
"//wpiutil:wpiutil-java",
|
||||
"@bzlmodrio-opencv//libraries/java/opencv",
|
||||
"@maven//:com_fasterxml_jackson_core_jackson_annotations",
|
||||
"@maven//:com_fasterxml_jackson_core_jackson_core",
|
||||
"@maven//:com_fasterxml_jackson_core_jackson_databind",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "apriltag-cpp-test",
|
||||
size = "small",
|
||||
srcs = glob(["src/test/native/cpp/**"]),
|
||||
tags = [
|
||||
"no-asan",
|
||||
],
|
||||
deps = [
|
||||
":apriltag.static",
|
||||
"//thirdparty/googletest:googletest.static",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "DevMain-Cpp",
|
||||
srcs = ["src/dev/native/cpp/main.cpp"],
|
||||
deps = [
|
||||
":apriltag.static",
|
||||
],
|
||||
)
|
||||
|
||||
java_binary(
|
||||
name = "DevMain-Java",
|
||||
srcs = ["src/dev/java/edu/wpi/first/apriltag/DevMain.java"],
|
||||
main_class = "edu.wpi.first.apriltag.DevMain",
|
||||
deps = [
|
||||
":apriltag-java",
|
||||
],
|
||||
)
|
||||
|
||||
py_binary(
|
||||
name = "convert_apriltag_layouts",
|
||||
srcs = ["convert_apriltag_layouts.py"],
|
||||
tags = ["manual"],
|
||||
)
|
||||
@@ -20,6 +20,8 @@ enum class AprilTagField {
|
||||
k2023ChargedUp,
|
||||
/// 2024 Crescendo.
|
||||
k2024Crescendo,
|
||||
/// Alias to the current game.
|
||||
kDefaultField = k2024Crescendo,
|
||||
|
||||
// This is a placeholder for denoting the last supported field. This should
|
||||
// always be the last entry in the enum and should not be used by users
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary")
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
||||
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
|
||||
|
||||
cc_library(
|
||||
name = "cameraserver.static",
|
||||
srcs = glob(["src/main/native/cpp/**"]),
|
||||
hdrs = glob(["src/main/native/include/**/*"]),
|
||||
includes = [
|
||||
"cpp",
|
||||
"src/main/native/include",
|
||||
],
|
||||
strip_include_prefix = "src/main/native/include",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//cscore:cscore.static",
|
||||
"//ntcore:ntcore.static",
|
||||
],
|
||||
)
|
||||
|
||||
java_library(
|
||||
name = "cameraserver-java",
|
||||
srcs = glob(["src/main/java/**/*.java"]),
|
||||
@@ -16,10 +32,21 @@ java_library(
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "cameraserver-cpp-test",
|
||||
size = "small",
|
||||
srcs = glob(["src/test/native/**"]),
|
||||
deps = [
|
||||
":cameraserver.static",
|
||||
"//thirdparty/googletest:googletest.static",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "DevMain-Cpp",
|
||||
srcs = ["src/dev/native/cpp/main.cpp"],
|
||||
deps = [
|
||||
":cameraserver.static",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -14,18 +14,20 @@ macro(wpilib_target_warnings target)
|
||||
|
||||
target_compile_options(${target} PRIVATE ${WARNING_FLAGS})
|
||||
else()
|
||||
target_compile_options(
|
||||
${target}
|
||||
PRIVATE
|
||||
/wd4146
|
||||
/wd4244
|
||||
/wd4251
|
||||
/wd4267
|
||||
/wd4324
|
||||
/WX
|
||||
/D_CRT_SECURE_NO_WARNINGS
|
||||
${WPILIB_TARGET_WARNINGS}
|
||||
set(WARNING_FLAGS
|
||||
/wd4146
|
||||
/wd4244
|
||||
/wd4251
|
||||
/wd4267
|
||||
/wd4324
|
||||
/D_CRT_SECURE_NO_WARNINGS
|
||||
${WPILIB_TARGET_WARNINGS}
|
||||
)
|
||||
if(NOT NO_WERROR)
|
||||
set(WARNING_FLAGS ${WARNING_FLAGS} /WX)
|
||||
endif()
|
||||
|
||||
target_compile_options(${target} PRIVATE ${WARNING_FLAGS})
|
||||
endif()
|
||||
|
||||
# Suppress C++-specific OpenCV warning; C compiler rejects it with an error
|
||||
|
||||
@@ -1,5 +1,76 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library")
|
||||
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
|
||||
|
||||
WIN_SRCS = glob([
|
||||
"src/main/native/windows/**/*.cpp",
|
||||
"src/main/native/windows/**/*.h",
|
||||
])
|
||||
|
||||
LINUX_SRCS = glob([
|
||||
"src/main/native/linux/**/*.cpp",
|
||||
"src/main/native/linux/**/*.h",
|
||||
])
|
||||
|
||||
MAC_SRCS = glob(["src/main/native/osx/**/*.cpp"])
|
||||
|
||||
filegroup(
|
||||
name = "native-srcs",
|
||||
srcs = select({
|
||||
"@bazel_tools//src/conditions:darwin": MAC_SRCS,
|
||||
"@bazel_tools//src/conditions:windows": WIN_SRCS,
|
||||
"@rules_bzlmodrio_toolchains//constraints/combined:is_linux": LINUX_SRCS,
|
||||
}),
|
||||
)
|
||||
|
||||
objc_library(
|
||||
name = "cscore-mac",
|
||||
srcs = glob([
|
||||
"src/main/native/objcpp/**/*.mm",
|
||||
"src/main/native/cpp/*.h",
|
||||
]),
|
||||
hdrs = glob([
|
||||
"src/main/native/include/**/*",
|
||||
"src/main/native/objcpp/**/*.h",
|
||||
]),
|
||||
copts = [
|
||||
"-std=c++20",
|
||||
],
|
||||
includes = [
|
||||
"src/main/native/cpp",
|
||||
"src/main/native/include",
|
||||
"src/main/native/objcpp",
|
||||
],
|
||||
tags = ["manual"],
|
||||
deps = [
|
||||
"//wpinet:wpinet.static",
|
||||
"//wpiutil:wpiutil.static",
|
||||
"@bzlmodrio-opencv//libraries/cpp/opencv",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "cscore.static",
|
||||
srcs = [":native-srcs"] + glob(
|
||||
["src/main/native/cpp/**"],
|
||||
exclude = ["src/main/native/cpp/jni/**"],
|
||||
),
|
||||
hdrs = glob(["src/main/native/include/**/*"]),
|
||||
includes = [
|
||||
"src/main/native/cpp",
|
||||
"src/main/native/include",
|
||||
],
|
||||
strip_include_prefix = "src/main/native/include",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//wpinet:wpinet.static",
|
||||
"//wpiutil:wpiutil.static",
|
||||
"@bzlmodrio-opencv//libraries/cpp/opencv",
|
||||
] + select({
|
||||
"@bazel_tools//src/conditions:darwin": [":cscore-mac"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
|
||||
java_library(
|
||||
name = "cscore-java",
|
||||
srcs = glob(["src/main/java/**/*.java"]),
|
||||
@@ -10,6 +81,24 @@ java_library(
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "cscore-cpp-test",
|
||||
size = "small",
|
||||
srcs = glob(["src/test/native/**"]),
|
||||
deps = [
|
||||
":cscore.static",
|
||||
"//thirdparty/googletest:googletest.static",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "DevMain-Cpp",
|
||||
srcs = ["src/dev/native/cpp/main.cpp"],
|
||||
deps = [
|
||||
":cscore.static",
|
||||
],
|
||||
)
|
||||
|
||||
java_binary(
|
||||
name = "DevMain-Java",
|
||||
srcs = ["src/dev/java/edu/wpi/first/cscore/DevMain.java"],
|
||||
|
||||
@@ -185,7 +185,7 @@ model {
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
lib library: 'cscore', linkage: 'shared'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imguiSuite', linkage: 'static'
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
it.buildable = false
|
||||
return
|
||||
|
||||
@@ -44,7 +44,7 @@ public class CvSink extends ImageSink {
|
||||
* Create a sink for accepting OpenCV images. grabFrame() must be called on the created sink to
|
||||
* get each new image.
|
||||
*
|
||||
* @param name Source name (arbitrary unique identifier)
|
||||
* @param name Sink name (arbitrary unique identifier)
|
||||
* @param pixelFormat Source pixel format
|
||||
*/
|
||||
public CvSink(String name, PixelFormat pixelFormat) {
|
||||
|
||||
@@ -50,7 +50,7 @@ inline void NamedLog(wpi::Logger& logger, unsigned int level, const char* file,
|
||||
|
||||
#define SLOG(level, format, ...) \
|
||||
NamedLog(m_logger, level, __FILE__, __LINE__, GetName(), \
|
||||
FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__)
|
||||
format __VA_OPT__(, ) __VA_ARGS__)
|
||||
|
||||
#define SERROR(format, ...) \
|
||||
SLOG(::wpi::WPI_LOG_ERROR, format __VA_OPT__(, ) __VA_ARGS__)
|
||||
|
||||
@@ -63,6 +63,11 @@ uint64_t RawSinkImpl::GrabFrame(WPI_RawFrame& image) {
|
||||
}
|
||||
|
||||
uint64_t RawSinkImpl::GrabFrame(WPI_RawFrame& image, double timeout) {
|
||||
return GrabFrame(image, timeout, 0);
|
||||
}
|
||||
|
||||
uint64_t RawSinkImpl::GrabFrame(WPI_RawFrame& image, double timeout,
|
||||
uint64_t lastFrameTime) {
|
||||
SetEnabled(true);
|
||||
|
||||
auto source = GetSource();
|
||||
@@ -72,7 +77,7 @@ uint64_t RawSinkImpl::GrabFrame(WPI_RawFrame& image, double timeout) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto frame = source->GetNextFrame(timeout); // blocks
|
||||
auto frame = source->GetNextFrame(timeout, lastFrameTime); // blocks
|
||||
if (!frame) {
|
||||
// Bad frame; sleep for 20 ms so we don't consume all processor time.
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(20));
|
||||
@@ -183,6 +188,18 @@ uint64_t GrabSinkFrameTimeout(CS_Sink sink, WPI_RawFrame& image, double timeout,
|
||||
return static_cast<RawSinkImpl&>(*data->sink).GrabFrame(image, timeout);
|
||||
}
|
||||
|
||||
uint64_t GrabSinkFrameTimeoutLastTime(CS_Sink sink, WPI_RawFrame& image,
|
||||
double timeout, uint64_t lastFrameTime,
|
||||
CS_Status* status) {
|
||||
auto data = Instance::GetInstance().GetSink(sink);
|
||||
if (!data || (data->kind & SinkMask) == 0) {
|
||||
*status = CS_INVALID_HANDLE;
|
||||
return 0;
|
||||
}
|
||||
return static_cast<RawSinkImpl&>(*data->sink)
|
||||
.GrabFrame(image, timeout, lastFrameTime);
|
||||
}
|
||||
|
||||
} // namespace cs
|
||||
|
||||
extern "C" {
|
||||
@@ -209,4 +226,13 @@ uint64_t CS_GrabRawSinkFrameTimeout(CS_Sink sink, struct WPI_RawFrame* image,
|
||||
return cs::GrabSinkFrameTimeout(sink, *image, timeout, status);
|
||||
}
|
||||
|
||||
uint64_t CS_GrabRawSinkFrameTimeoutWithFrameTime(CS_Sink sink,
|
||||
struct WPI_RawFrame* image,
|
||||
double timeout,
|
||||
uint64_t lastFrameTime,
|
||||
CS_Status* status) {
|
||||
return cs::GrabSinkFrameTimeoutLastTime(sink, *image, timeout, lastFrameTime,
|
||||
status);
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
@@ -34,10 +34,15 @@ class RawSinkImpl : public SinkImpl {
|
||||
|
||||
uint64_t GrabFrame(WPI_RawFrame& frame);
|
||||
uint64_t GrabFrame(WPI_RawFrame& frame, double timeout);
|
||||
// Wait for a frame with a time other than lastFrameTime
|
||||
uint64_t GrabFrame(WPI_RawFrame& frame, double timeout,
|
||||
uint64_t lastFrameTime);
|
||||
|
||||
private:
|
||||
void ThreadMain();
|
||||
|
||||
// Copies the image from incomingFrame into rawFrame, converting where
|
||||
// necessary to the resolution of rawFrame
|
||||
uint64_t GrabFrameImpl(WPI_RawFrame& rawFrame, Frame& incomingFrame);
|
||||
|
||||
std::atomic_bool m_active; // set to false to terminate threads
|
||||
|
||||
@@ -84,12 +84,17 @@ Frame SourceImpl::GetNextFrame() {
|
||||
return m_frame;
|
||||
}
|
||||
|
||||
Frame SourceImpl::GetNextFrame(double timeout) {
|
||||
Frame SourceImpl::GetNextFrame(double timeout, Frame::Time lastFrameTime) {
|
||||
std::unique_lock lock{m_frameMutex};
|
||||
auto oldTime = m_frame.GetTime();
|
||||
|
||||
if (lastFrameTime == 0) {
|
||||
lastFrameTime = m_frame.GetTime();
|
||||
}
|
||||
|
||||
// Wait unitl m_frame has a timestamp other than lastFrameTime
|
||||
if (!m_frameCv.wait_for(
|
||||
lock, std::chrono::milliseconds(static_cast<int>(timeout * 1000)),
|
||||
[=, this] { return m_frame.GetTime() != oldTime; })) {
|
||||
[=, this] { return m_frame.GetTime() != lastFrameTime; })) {
|
||||
m_frame = Frame{*this, "timed out getting frame", wpi::Now()};
|
||||
}
|
||||
return m_frame;
|
||||
|
||||
@@ -98,7 +98,8 @@ class SourceImpl : public PropertyContainer {
|
||||
|
||||
// Blocking function that waits for the next frame and returns it (with
|
||||
// timeout in seconds). If timeout expires, returns empty frame.
|
||||
Frame GetNextFrame(double timeout);
|
||||
// If lastFrameTime==0, uses m_frame.GetTime() for lastFrameTime
|
||||
Frame GetNextFrame(double timeout, Frame::Time lastFrameTime = 0);
|
||||
|
||||
// Force a wakeup of all GetNextFrame() callers by sending an empty frame.
|
||||
void Wakeup();
|
||||
|
||||
@@ -151,6 +151,27 @@ class CvSink : public ImageSink {
|
||||
[[nodiscard]]
|
||||
uint64_t GrabFrameNoTimeoutDirect(cv::Mat& image);
|
||||
|
||||
/**
|
||||
* Wait for the next frame and get the image.
|
||||
* Times out (returning 0) after timeout seconds.
|
||||
* The provided image will have the pixelFormat this class was constructed
|
||||
* with. The data is backed by data in the CvSink. It will be invalidated by
|
||||
* any grabFrame*() call on the sink.
|
||||
*
|
||||
* <p>If lastFrameTime is provided and non-zero, the sink will fill image with
|
||||
* the first frame from the source that is not equal to lastFrameTime. If
|
||||
* lastFrameTime is zero, the time of the current frame owned by the CvSource
|
||||
* is used, and this function will block until the connected CvSource provides
|
||||
* a new frame.
|
||||
*
|
||||
* @return Frame time, or 0 on error (call GetError() to obtain the error
|
||||
* message); the frame time is in the same time base as wpi::Now(),
|
||||
* and is in 1 us increments.
|
||||
*/
|
||||
[[nodiscard]]
|
||||
uint64_t GrabFrameDirectLastTime(cv::Mat& image, uint64_t lastFrameTime,
|
||||
double timeout = 0.225);
|
||||
|
||||
private:
|
||||
constexpr int GetCvFormat(WPI_PixelFormat pixelFormat);
|
||||
|
||||
@@ -365,6 +386,25 @@ inline uint64_t CvSink::GrabFrameNoTimeoutDirect(cv::Mat& image) {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
inline uint64_t CvSink::GrabFrameDirectLastTime(cv::Mat& image,
|
||||
uint64_t lastFrameTime,
|
||||
double timeout) {
|
||||
rawFrame.height = 0;
|
||||
rawFrame.width = 0;
|
||||
rawFrame.stride = 0;
|
||||
rawFrame.pixelFormat = pixelFormat;
|
||||
auto timestamp = GrabSinkFrameTimeoutLastTime(m_handle, rawFrame, timeout,
|
||||
lastFrameTime, &m_status);
|
||||
if (m_status != CS_OK) {
|
||||
return 0;
|
||||
}
|
||||
image =
|
||||
cv::Mat{rawFrame.height, rawFrame.width,
|
||||
GetCvFormat(static_cast<WPI_PixelFormat>(rawFrame.pixelFormat)),
|
||||
rawFrame.data, static_cast<size_t>(rawFrame.stride)};
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
} // namespace cs
|
||||
|
||||
#endif // CSCORE_CSCORE_CV_H_
|
||||
|
||||
@@ -27,6 +27,11 @@ uint64_t CS_GrabRawSinkFrame(CS_Sink sink, struct WPI_RawFrame* rawImage,
|
||||
CS_Status* status);
|
||||
uint64_t CS_GrabRawSinkFrameTimeout(CS_Sink sink, struct WPI_RawFrame* rawImage,
|
||||
double timeout, CS_Status* status);
|
||||
uint64_t CS_GrabRawSinkFrameTimeoutWithFrameTime(CS_Sink sink,
|
||||
struct WPI_RawFrame* rawImage,
|
||||
double timeout,
|
||||
uint64_t lastFrameTime,
|
||||
CS_Status* status);
|
||||
|
||||
CS_Sink CS_CreateRawSink(const struct WPI_String* name, CS_Bool isCv,
|
||||
CS_Status* status);
|
||||
@@ -67,6 +72,9 @@ void PutSourceFrame(CS_Source source, const WPI_RawFrame& image,
|
||||
uint64_t GrabSinkFrame(CS_Sink sink, WPI_RawFrame& image, CS_Status* status);
|
||||
uint64_t GrabSinkFrameTimeout(CS_Sink sink, WPI_RawFrame& image, double timeout,
|
||||
CS_Status* status);
|
||||
uint64_t GrabSinkFrameTimeoutLastTime(CS_Sink sink, WPI_RawFrame& image,
|
||||
double timeout, uint64_t lastFrameTime,
|
||||
CS_Status* status);
|
||||
|
||||
/**
|
||||
* A source for user code to provide video frames as raw bytes.
|
||||
@@ -163,6 +171,24 @@ class RawSink : public ImageSink {
|
||||
*/
|
||||
[[nodiscard]]
|
||||
uint64_t GrabFrameNoTimeout(wpi::RawFrame& image) const;
|
||||
|
||||
/**
|
||||
* Wait for the next frame and get the image. May block forever.
|
||||
* The provided image will have three 8-bit channels stored in BGR order.
|
||||
*
|
||||
* <p>If lastFrameTime is provided and non-zero, the sink will fill image with
|
||||
* the first frame from the source that is not equal to lastFrameTime. If
|
||||
* lastFrameTime is zero, the time of the current frame owned by the CvSource
|
||||
* is used, and this function will block until the connected CvSource provides
|
||||
* a new frame.
|
||||
*
|
||||
* @return Frame time, or 0 on error (call GetError() to obtain the error
|
||||
* message); the frame time is in the same time base as wpi::Now(),
|
||||
* and is in 1 us increments.
|
||||
*/
|
||||
[[nodiscard]]
|
||||
uint64_t GrabFrameLastTime(wpi::RawFrame& image, uint64_t lastFrameTime,
|
||||
double timeout = 0.225) const;
|
||||
};
|
||||
|
||||
inline RawSource::RawSource(std::string_view name, const VideoMode& mode) {
|
||||
@@ -199,6 +225,14 @@ inline uint64_t RawSink::GrabFrameNoTimeout(wpi::RawFrame& image) const {
|
||||
m_status = 0;
|
||||
return GrabSinkFrame(m_handle, image, &m_status);
|
||||
}
|
||||
|
||||
inline uint64_t RawSink::GrabFrameLastTime(wpi::RawFrame& image,
|
||||
uint64_t lastFrameTime,
|
||||
double timeout) const {
|
||||
m_status = 0;
|
||||
return GrabSinkFrameTimeoutLastTime(m_handle, image, timeout, lastFrameTime,
|
||||
&m_status);
|
||||
}
|
||||
/** @} */
|
||||
|
||||
} // namespace cs
|
||||
|
||||
@@ -29,7 +29,7 @@ inline void NamedLog(UsbCameraImplObjc* objc, unsigned int level,
|
||||
|
||||
#define OBJCLOG(level, format, ...) \
|
||||
NamedLog(self, level, __FILE__, __LINE__, \
|
||||
FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__)
|
||||
format __VA_OPT__(, ) __VA_ARGS__)
|
||||
|
||||
#define OBJCERROR(format, ...) \
|
||||
OBJCLOG(::wpi::WPI_LOG_ERROR, format __VA_OPT__(, ) __VA_ARGS__)
|
||||
|
||||
@@ -101,7 +101,7 @@ model {
|
||||
lib project: ':glass', library: 'glass', linkage: 'static'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imguiSuite', linkage: 'static'
|
||||
nativeUtils.useRequiredLibrary(it, 'libssh')
|
||||
if (it.targetPlatform.operatingSystem.isWindows()) {
|
||||
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
|
||||
|
||||
@@ -5,4 +5,4 @@ include(CompileWarnings)
|
||||
file(GLOB developerRobotCpp_src src/main/native/cpp/*.cpp)
|
||||
|
||||
add_executable(developerRobotCpp ${developerRobotCpp_src})
|
||||
target_link_libraries(developerRobotCpp wpilibc)
|
||||
target_link_libraries(developerRobotCpp wpilibc wpilibNewCommands apriltag)
|
||||
|
||||
@@ -142,6 +142,19 @@ deploy {
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent the eclipse compiler (used by the VS Code extension for intellisense and debugging)
|
||||
// from generating bad class files from annotation processors like Epilogue
|
||||
eclipse {
|
||||
classpath {
|
||||
containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
|
||||
file.whenMerged { cp ->
|
||||
def entries = cp.entries;
|
||||
def src = new org.gradle.plugins.ide.eclipse.model.SourceFolder('build/generated/sources/annotationProcessor/java/main/', null)
|
||||
entries.add(src)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('deployJava') {
|
||||
try {
|
||||
dependsOn tasks.named('deployjreroborio')
|
||||
|
||||
22
epilogue-processor/BUILD.bazel
Normal file
22
epilogue-processor/BUILD.bazel
Normal file
@@ -0,0 +1,22 @@
|
||||
load("@rules_java//java:defs.bzl", "java_library", "java_plugin")
|
||||
|
||||
java_library(
|
||||
name = "processor",
|
||||
srcs = glob(["src/main/java/**/*.java"]),
|
||||
visibility = ["//visibility:public"],
|
||||
runtime_deps = [
|
||||
"//wpilibNewCommands:wpilibNewCommands-java",
|
||||
],
|
||||
deps = [
|
||||
"//epilogue-runtime:epilogue",
|
||||
],
|
||||
)
|
||||
|
||||
java_plugin(
|
||||
name = "plugin",
|
||||
processor_class = "edu.wpi.first.epilogue.processor.AnnotationProcessor",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":processor",
|
||||
],
|
||||
)
|
||||
@@ -43,6 +43,8 @@ public class LoggerGenerator {
|
||||
LoggerGenerator::isBuiltInJavaMethod;
|
||||
private final ProcessingEnvironment m_processingEnv;
|
||||
private final List<ElementHandler> m_handlers;
|
||||
|
||||
@SuppressWarnings("BadAnnotationImplementation")
|
||||
private final Logged m_defaultConfig =
|
||||
new Logged() {
|
||||
@Override
|
||||
|
||||
12
epilogue-runtime/BUILD.bazel
Normal file
12
epilogue-runtime/BUILD.bazel
Normal file
@@ -0,0 +1,12 @@
|
||||
load("@rules_java//java:defs.bzl", "java_library")
|
||||
|
||||
java_library(
|
||||
name = "epilogue",
|
||||
srcs = glob(["src/main/java/**/*.java"]),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//ntcore:networktables-java",
|
||||
"//wpiunits",
|
||||
"//wpiutil:wpiutil-java",
|
||||
],
|
||||
)
|
||||
@@ -198,9 +198,10 @@ public interface EpilogueBackend {
|
||||
*
|
||||
* @param identifier the identifier of the data field
|
||||
* @param value the new value of the data field
|
||||
* @param <U> the dimension of the unit
|
||||
*/
|
||||
default void log(String identifier, Measure<?> value) {
|
||||
log(identifier, value.baseUnitMagnitude());
|
||||
default <U extends Unit> void log(String identifier, Measure<U> value) {
|
||||
log(identifier, value, value.baseUnit());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,7 +213,7 @@ public interface EpilogueBackend {
|
||||
* @param <U> the dimension of the unit
|
||||
*/
|
||||
default <U extends Unit> void log(String identifier, Measure<U> value, U unit) {
|
||||
log(identifier, value.in(unit));
|
||||
log(identifier + " (" + unit.symbol() + ")", value.in(unit));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
31
fieldImages/BUILD.bazel
Normal file
31
fieldImages/BUILD.bazel
Normal file
@@ -0,0 +1,31 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||
load("@rules_java//java:defs.bzl", "java_library")
|
||||
load("//shared/bazel/rules/gen:gen-resources.bzl", "generate_resources")
|
||||
|
||||
generate_resources(
|
||||
name = "generate-resources",
|
||||
namespace = "fields",
|
||||
prefix = "FIELDS",
|
||||
resource_files = glob(["src/main/native/resources/**"]),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "fieldImages",
|
||||
srcs = [":generate-resources"] + glob(["src/main/native/cpp/**"]),
|
||||
hdrs = glob(["src/main/native/include/**/*"]),
|
||||
strip_include_prefix = "src/main/native/include",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
java_library(
|
||||
name = "fieldImages-java",
|
||||
srcs = glob(["src/main/java/**/*.java"]),
|
||||
resource_strip_prefix = "fieldImages/src/main/native/resources",
|
||||
resources = glob(["src/main/native/resources/**"]),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"@maven//:com_fasterxml_jackson_core_jackson_annotations",
|
||||
"@maven//:com_fasterxml_jackson_core_jackson_databind",
|
||||
],
|
||||
)
|
||||
@@ -97,7 +97,7 @@ model {
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
lib project: ':fieldImages', library: 'fieldImages', linkage: 'shared'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imguiSuite', linkage: 'static'
|
||||
}
|
||||
appendDebugPathToBinaries(binaries)
|
||||
}
|
||||
@@ -127,7 +127,7 @@ model {
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
lib project: ':fieldImages', library: 'fieldImages', linkage: 'shared'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imguiSuite', linkage: 'static'
|
||||
}
|
||||
appendDebugPathToBinaries(binaries)
|
||||
}
|
||||
@@ -167,7 +167,7 @@ model {
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
lib project: ':fieldImages', library: 'fieldImages', linkage: 'static'
|
||||
nativeUtils.useRequiredLibrary(it, 'opencv_static')
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imguiSuite', linkage: 'static'
|
||||
if (it.targetPlatform.operatingSystem.isWindows()) {
|
||||
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
|
||||
it.linker.args << '/DELAYLOAD:MF.dll' << '/DELAYLOAD:MFReadWrite.dll' << '/DELAYLOAD:MFPlat.dll' << '/delay:nobind'
|
||||
|
||||
@@ -57,12 +57,22 @@ void Window::Display() {
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, m_padding);
|
||||
}
|
||||
|
||||
std::string label;
|
||||
std::string* name = &m_name;
|
||||
if (m_name.empty()) {
|
||||
label = fmt::format("{}###{}", m_defaultName, m_id);
|
||||
} else {
|
||||
label = fmt::format("{}###{}", m_name, m_id);
|
||||
name = &m_defaultName;
|
||||
}
|
||||
std::string label = fmt::format("{}###{}", *name, m_id);
|
||||
|
||||
// Accounts for size of title, collapse button, and close button
|
||||
float minWidth =
|
||||
ImGui::CalcTextSize(name->c_str()).x + ImGui::GetFontSize() * 2 +
|
||||
ImGui::GetStyle().ItemInnerSpacing.x * 3 +
|
||||
ImGui::GetStyle().FramePadding.x * 2 + ImGui::GetStyle().WindowBorderSize;
|
||||
// Accounts for size of hamburger button
|
||||
if (m_renamePopupEnabled || m_view->HasSettings()) {
|
||||
minWidth += ImGui::GetFontSize() + ImGui::GetStyle().FramePadding.x;
|
||||
}
|
||||
ImGui::SetNextWindowSizeConstraints({minWidth, 0}, ImVec2{FLT_MAX, FLT_MAX});
|
||||
|
||||
if (Begin(label.c_str(), &m_visible, m_flags)) {
|
||||
if (m_renamePopupEnabled || m_view->HasSettings()) {
|
||||
|
||||
@@ -33,7 +33,7 @@ void glass::DisplayLEDDisplay(LEDDisplayModel* model, int index) {
|
||||
int& order = storage.GetInt("order", LEDConfig::RowMajor);
|
||||
int& start = storage.GetInt("start", LEDConfig::UpperLeft);
|
||||
|
||||
ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
|
||||
ImGui::PushItemWidth(ImGui::GetFontSize() * 7);
|
||||
ImGui::LabelText("Length", "%d", length);
|
||||
ImGui::LabelText("Running", "%s", running ? "Yes" : "No");
|
||||
ImGui::InputInt("Columns", &numColumns);
|
||||
|
||||
@@ -122,5 +122,6 @@ kResourceType_ChoreoTrigger = 120
|
||||
kResourceType_PathWeaverTrajectory = 121
|
||||
kResourceType_Koors40 = 122
|
||||
kResourceType_ThriftyNova = 123
|
||||
kResourceType_PWFSEN36005 = 124
|
||||
kResourceType_LaserShark = 125
|
||||
kResourceType_RevServoHub = 124
|
||||
kResourceType_PWFSEN36005 = 125
|
||||
kResourceType_LaserShark = 126
|
||||
|
||||
@@ -267,10 +267,12 @@ public final class FRCNetComm {
|
||||
public static final int kResourceType_Koors40 = 122;
|
||||
/** kResourceType_ThriftyNova = 123. */
|
||||
public static final int kResourceType_ThriftyNova = 123;
|
||||
/** kResourceType_PWFSEN36005 = 124. */
|
||||
public static final int kResourceType_PWFSEN36005 = 124;
|
||||
/** kResourceType_LaserShark = 125. */
|
||||
public static final int kResourceType_LaserShark = 125;
|
||||
/** kResourceType_RevServoHub = 124. */
|
||||
public static final int kResourceType_RevServoHub = 124;
|
||||
/** kResourceType_PWFSEN36005 = 125. */
|
||||
public static final int kResourceType_PWFSEN36005 = 125;
|
||||
/** kResourceType_LaserShark = 126. */
|
||||
public static final int kResourceType_LaserShark = 126;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -175,8 +175,9 @@ namespace HALUsageReporting {
|
||||
kResourceType_PathWeaverTrajectory = 121,
|
||||
kResourceType_Koors40 = 122,
|
||||
kResourceType_ThriftyNova = 123,
|
||||
kResourceType_PWFSEN36005 = 124,
|
||||
kResourceType_LaserShark = 125,
|
||||
kResourceType_RevServoHub = 124,
|
||||
kResourceType_PWFSEN36005 = 125,
|
||||
kResourceType_LaserShark = 126,
|
||||
};
|
||||
enum tInstances : int32_t {
|
||||
kLanguage_LabVIEW = 1,
|
||||
|
||||
@@ -144,8 +144,9 @@ typedef enum
|
||||
kResourceType_PathWeaverTrajectory = 121,
|
||||
kResourceType_Koors40 = 122,
|
||||
kResourceType_ThriftyNova = 123,
|
||||
kResourceType_PWFSEN36005 = 124,
|
||||
kResourceType_LaserShark = 125,
|
||||
kResourceType_RevServoHub = 124,
|
||||
kResourceType_PWFSEN36005 = 125,
|
||||
kResourceType_LaserShark = 126,
|
||||
|
||||
// kResourceType_MaximumID = 255,
|
||||
} tResourceType;
|
||||
|
||||
@@ -47,6 +47,8 @@ public final class CANAPITypes {
|
||||
kMiscellaneous(10),
|
||||
/** IO breakout. */
|
||||
kIOBreakout(11),
|
||||
/** Servo Controller. */
|
||||
kServoController(12),
|
||||
/** Firmware update. */
|
||||
kFirmwareUpdate(31);
|
||||
|
||||
|
||||
@@ -44,6 +44,8 @@ HAL_ENUM(HAL_CANDeviceType) {
|
||||
HAL_CAN_Dev_kMiscellaneous = 10,
|
||||
/// IO breakout.
|
||||
HAL_CAN_Dev_kIOBreakout = 11,
|
||||
// Servo controller.
|
||||
HAL_CAN_Dev_kServoController = 12,
|
||||
/// Firmware update.
|
||||
HAL_CAN_Dev_kFirmwareUpdate = 31
|
||||
};
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
#include "WireDecoder3.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <bit>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/MathExtras.h>
|
||||
#include <wpi/SpanExtras.h>
|
||||
|
||||
#include "Message3.h"
|
||||
@@ -74,7 +74,7 @@ std::optional<uint64_t> WireDecoder3::SimpleValueReader::Read64(
|
||||
std::optional<double> WireDecoder3::SimpleValueReader::ReadDouble(
|
||||
std::span<const uint8_t>* in) {
|
||||
if (auto val = Read64(in)) {
|
||||
return wpi::bit_cast<double>(val.value());
|
||||
return std::bit_cast<double>(val.value());
|
||||
} else {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
#include "WireEncoder3.h"
|
||||
|
||||
#include <bit>
|
||||
|
||||
#include <wpi/Endian.h>
|
||||
#include <wpi/MathExtras.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/leb128.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
@@ -33,7 +34,7 @@ static void Write32(wpi::raw_ostream& os, uint32_t val) {
|
||||
|
||||
static void WriteDouble(wpi::raw_ostream& os, double val) {
|
||||
uint8_t buf[8];
|
||||
wpi::support::endian::write64be(buf, wpi::bit_cast<uint64_t>(val));
|
||||
wpi::support::endian::write64be(buf, std::bit_cast<uint64_t>(val));
|
||||
os << buf;
|
||||
}
|
||||
|
||||
|
||||
@@ -387,7 +387,7 @@ class GenericPublisher : public Publisher {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultBoolean(bool defaultValue) {
|
||||
return nt::SetDefaultBoolean(m_pubHandle, defaultValue);
|
||||
@@ -397,7 +397,7 @@ class GenericPublisher : public Publisher {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultInteger(int64_t defaultValue) {
|
||||
return nt::SetDefaultInteger(m_pubHandle, defaultValue);
|
||||
@@ -407,7 +407,7 @@ class GenericPublisher : public Publisher {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultFloat(float defaultValue) {
|
||||
return nt::SetDefaultFloat(m_pubHandle, defaultValue);
|
||||
@@ -417,7 +417,7 @@ class GenericPublisher : public Publisher {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultDouble(double defaultValue) {
|
||||
return nt::SetDefaultDouble(m_pubHandle, defaultValue);
|
||||
@@ -427,7 +427,7 @@ class GenericPublisher : public Publisher {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultString(std::string_view defaultValue) {
|
||||
return nt::SetDefaultString(m_pubHandle, defaultValue);
|
||||
@@ -437,7 +437,7 @@ class GenericPublisher : public Publisher {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultRaw(std::span<const uint8_t> defaultValue) {
|
||||
return nt::SetDefaultRaw(m_pubHandle, defaultValue);
|
||||
@@ -447,7 +447,7 @@ class GenericPublisher : public Publisher {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultBooleanArray(std::span<const int> defaultValue) {
|
||||
return nt::SetDefaultBooleanArray(m_pubHandle, defaultValue);
|
||||
@@ -457,7 +457,7 @@ class GenericPublisher : public Publisher {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultIntegerArray(std::span<const int64_t> defaultValue) {
|
||||
return nt::SetDefaultIntegerArray(m_pubHandle, defaultValue);
|
||||
@@ -467,7 +467,7 @@ class GenericPublisher : public Publisher {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultFloatArray(std::span<const float> defaultValue) {
|
||||
return nt::SetDefaultFloatArray(m_pubHandle, defaultValue);
|
||||
@@ -477,7 +477,7 @@ class GenericPublisher : public Publisher {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultDoubleArray(std::span<const double> defaultValue) {
|
||||
return nt::SetDefaultDoubleArray(m_pubHandle, defaultValue);
|
||||
@@ -487,7 +487,7 @@ class GenericPublisher : public Publisher {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultStringArray(std::span<const std::string> defaultValue) {
|
||||
return nt::SetDefaultStringArray(m_pubHandle, defaultValue);
|
||||
|
||||
@@ -361,11 +361,11 @@ class NetworkTable final {
|
||||
bool PutNumber(std::string_view key, double value);
|
||||
|
||||
/**
|
||||
* Gets the current value in the table, setting it if it does not exist.
|
||||
* Set Default Entry Value
|
||||
*
|
||||
* @param key the key
|
||||
* @param defaultValue the default value to set if key doesn't exist.
|
||||
* @returns False if the table key exists with a different type
|
||||
* @returns True if the table key did not already exist, otherwise False
|
||||
*/
|
||||
bool SetDefaultNumber(std::string_view key, double defaultValue);
|
||||
|
||||
@@ -389,11 +389,11 @@ class NetworkTable final {
|
||||
bool PutString(std::string_view key, std::string_view value);
|
||||
|
||||
/**
|
||||
* Gets the current value in the table, setting it if it does not exist.
|
||||
* Set Default Entry Value
|
||||
*
|
||||
* @param key the key
|
||||
* @param defaultValue the default value to set if key doesn't exist.
|
||||
* @returns False if the table key exists with a different type
|
||||
* @returns True if the table key did not already exist, otherwise False
|
||||
*/
|
||||
bool SetDefaultString(std::string_view key, std::string_view defaultValue);
|
||||
|
||||
@@ -419,11 +419,11 @@ class NetworkTable final {
|
||||
bool PutBoolean(std::string_view key, bool value);
|
||||
|
||||
/**
|
||||
* Gets the current value in the table, setting it if it does not exist.
|
||||
* Set Default Entry Value
|
||||
*
|
||||
* @param key the key
|
||||
* @param defaultValue the default value to set if key doesn't exist.
|
||||
* @returns False if the table key exists with a different type
|
||||
* @returns True if the table key did not already exist, otherwise False
|
||||
*/
|
||||
bool SetDefaultBoolean(std::string_view key, bool defaultValue);
|
||||
|
||||
@@ -452,11 +452,11 @@ class NetworkTable final {
|
||||
bool PutBooleanArray(std::string_view key, std::span<const int> value);
|
||||
|
||||
/**
|
||||
* Gets the current value in the table, setting it if it does not exist.
|
||||
* Set Default Entry Value
|
||||
*
|
||||
* @param key the key
|
||||
* @param defaultValue the default value to set if key doesn't exist.
|
||||
* @return False if the table key exists with a different type
|
||||
* @return True if the table key did not already exist, otherwise False
|
||||
*/
|
||||
bool SetDefaultBooleanArray(std::string_view key,
|
||||
std::span<const int> defaultValue);
|
||||
@@ -490,11 +490,11 @@ class NetworkTable final {
|
||||
bool PutNumberArray(std::string_view key, std::span<const double> value);
|
||||
|
||||
/**
|
||||
* Gets the current value in the table, setting it if it does not exist.
|
||||
* Set Default Entry Value
|
||||
*
|
||||
* @param key the key
|
||||
* @param defaultValue the default value to set if key doesn't exist.
|
||||
* @returns False if the table key exists with a different type
|
||||
* @returns True if the table key did not already exist, otherwise False
|
||||
*/
|
||||
bool SetDefaultNumberArray(std::string_view key,
|
||||
std::span<const double> defaultValue);
|
||||
@@ -524,11 +524,11 @@ class NetworkTable final {
|
||||
bool PutStringArray(std::string_view key, std::span<const std::string> value);
|
||||
|
||||
/**
|
||||
* Gets the current value in the table, setting it if it does not exist.
|
||||
* Set Default Entry Value
|
||||
*
|
||||
* @param key the key
|
||||
* @param defaultValue the default value to set if key doesn't exist.
|
||||
* @returns False if the table key exists with a different type
|
||||
* @returns True if the table key did not already exist, otherwise False
|
||||
*/
|
||||
bool SetDefaultStringArray(std::string_view key,
|
||||
std::span<const std::string> defaultValue);
|
||||
@@ -558,11 +558,11 @@ class NetworkTable final {
|
||||
bool PutRaw(std::string_view key, std::span<const uint8_t> value);
|
||||
|
||||
/**
|
||||
* Gets the current value in the table, setting it if it does not exist.
|
||||
* Set Default Entry Value
|
||||
*
|
||||
* @param key the key
|
||||
* @param defaultValue the default value to set if key doesn't exist.
|
||||
* @return False if the table key exists with a different type
|
||||
* @return True if the table key did not already exist, otherwise False
|
||||
*/
|
||||
bool SetDefaultRaw(std::string_view key,
|
||||
std::span<const uint8_t> defaultValue);
|
||||
@@ -592,11 +592,11 @@ class NetworkTable final {
|
||||
bool PutValue(std::string_view key, const Value& value);
|
||||
|
||||
/**
|
||||
* Gets the current value in the table, setting it if it does not exist.
|
||||
* Set Default Entry Value.
|
||||
*
|
||||
* @param key the key
|
||||
* @param defaultValue the default value to set if key doesn't exist.
|
||||
* @return False if the table key exists with a different type
|
||||
* @return True if the table key did not already exist, otherwise False
|
||||
*/
|
||||
bool SetDefaultValue(std::string_view key, const Value& defaultValue);
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ class NetworkTableEntry final {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultValue(const Value& defaultValue) {
|
||||
return SetDefaultEntryValue(m_handle, defaultValue);
|
||||
@@ -270,7 +270,7 @@ class NetworkTableEntry final {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultBoolean(bool defaultValue) {
|
||||
return nt::SetDefaultBoolean(m_handle, defaultValue);
|
||||
@@ -280,7 +280,7 @@ class NetworkTableEntry final {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultInteger(int64_t defaultValue) {
|
||||
return nt::SetDefaultInteger(m_handle, defaultValue);
|
||||
@@ -290,7 +290,7 @@ class NetworkTableEntry final {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultFloat(float defaultValue) {
|
||||
return nt::SetDefaultFloat(m_handle, defaultValue);
|
||||
@@ -300,7 +300,7 @@ class NetworkTableEntry final {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultDouble(double defaultValue) {
|
||||
return nt::SetDefaultDouble(m_handle, defaultValue);
|
||||
@@ -310,7 +310,7 @@ class NetworkTableEntry final {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultString(std::string_view defaultValue) {
|
||||
return nt::SetDefaultString(m_handle, defaultValue);
|
||||
@@ -320,7 +320,7 @@ class NetworkTableEntry final {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultRaw(std::span<const uint8_t> defaultValue) {
|
||||
return nt::SetDefaultRaw(m_handle, defaultValue);
|
||||
@@ -330,7 +330,7 @@ class NetworkTableEntry final {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultBooleanArray(std::span<const int> defaultValue) {
|
||||
return nt::SetDefaultBooleanArray(m_handle, defaultValue);
|
||||
@@ -340,7 +340,7 @@ class NetworkTableEntry final {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultIntegerArray(std::span<const int64_t> defaultValue) {
|
||||
return nt::SetDefaultIntegerArray(m_handle, defaultValue);
|
||||
@@ -350,7 +350,7 @@ class NetworkTableEntry final {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultFloatArray(std::span<const float> defaultValue) {
|
||||
return nt::SetDefaultFloatArray(m_handle, defaultValue);
|
||||
@@ -360,7 +360,7 @@ class NetworkTableEntry final {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultDoubleArray(std::span<const double> defaultValue) {
|
||||
return nt::SetDefaultDoubleArray(m_handle, defaultValue);
|
||||
@@ -370,7 +370,7 @@ class NetworkTableEntry final {
|
||||
* Sets the entry's value if it does not exist.
|
||||
*
|
||||
* @param defaultValue the default value to set
|
||||
* @return False if the entry exists with a different type
|
||||
* @return True if the entry did not already have a value, otherwise False
|
||||
*/
|
||||
bool SetDefaultStringArray(std::span<const std::string> defaultValue) {
|
||||
return nt::SetDefaultStringArray(m_handle, defaultValue);
|
||||
|
||||
@@ -476,8 +476,8 @@ void NT_GetEntryValueType(NT_Entry entry, unsigned int types,
|
||||
/**
|
||||
* Set Default Entry Value.
|
||||
*
|
||||
* Returns copy of current entry value if it exists.
|
||||
* Otherwise, sets passed in value, and returns set value.
|
||||
* Returns 0 if name exists.
|
||||
* Otherwise, sets passed in value, and returns 1.
|
||||
* Note that one of the type options is "unassigned".
|
||||
*
|
||||
* @param entry entry handle
|
||||
|
||||
@@ -488,8 +488,8 @@ Value GetEntryValue(NT_Handle subentry);
|
||||
/**
|
||||
* Set Default Entry Value
|
||||
*
|
||||
* Returns copy of current entry value if it exists.
|
||||
* Otherwise, sets passed in value, and returns set value.
|
||||
* Returns False if name exists.
|
||||
* Otherwise, sets passed in value, and returns True.
|
||||
* Note that one of the type options is "unassigned".
|
||||
*
|
||||
* @param entry entry handle
|
||||
|
||||
@@ -60,12 +60,12 @@ inline void ReportError(int32_t status, const char* fileName, int lineNumber,
|
||||
}
|
||||
} // namespace frc
|
||||
|
||||
#define FRC_ReportError(status, format, ...) \
|
||||
do { \
|
||||
if ((status) != 0) { \
|
||||
::frc::ReportError(status, __FILE__, __LINE__, __FUNCTION__, \
|
||||
FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__); \
|
||||
} \
|
||||
#define FRC_ReportError(status, format, ...) \
|
||||
do { \
|
||||
if ((status) != 0) { \
|
||||
::frc::ReportError(status, __FILE__, __LINE__, __FUNCTION__, \
|
||||
format __VA_OPT__(, ) __VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
namespace RobotController {
|
||||
|
||||
@@ -102,7 +102,7 @@ model {
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
lib project: ':fieldImages', library: 'fieldImages', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imguiSuite', linkage: 'static'
|
||||
if (it.targetPlatform.operatingSystem.isWindows()) {
|
||||
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
|
||||
} else if (it.targetPlatform.operatingSystem.isMacOsX()) {
|
||||
|
||||
@@ -103,7 +103,7 @@ model {
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
nativeUtils.useRequiredLibrary(it, 'libssh')
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imguiSuite', linkage: 'static'
|
||||
if (it.targetPlatform.operatingSystem.isWindows()) {
|
||||
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
|
||||
it.linker.args << 'ws2_32.lib' << 'advapi32.lib' << 'crypt32.lib' << 'user32.lib'
|
||||
|
||||
53
romiVendordep/BUILD.bazel
Normal file
53
romiVendordep/BUILD.bazel
Normal file
@@ -0,0 +1,53 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
||||
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
|
||||
|
||||
cc_library(
|
||||
name = "romi-cpp.static",
|
||||
srcs = glob([
|
||||
"src/main/native/cpp/**",
|
||||
]),
|
||||
hdrs = glob(["src/main/native/include/**"]),
|
||||
strip_include_prefix = "src/main/native/include",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//wpilibc:wpilibc.static",
|
||||
],
|
||||
)
|
||||
|
||||
java_library(
|
||||
name = "romi-java",
|
||||
srcs = glob(["src/main/java/**/*.java"]),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//hal:hal-java",
|
||||
"//wpilibj",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "romi-test",
|
||||
size = "small",
|
||||
srcs = glob(["src/test/native/cpp/**"]),
|
||||
deps = [
|
||||
"//thirdparty/googletest:googletest.static",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "DevMain-Cpp",
|
||||
srcs = ["src/dev/native/cpp/main.cpp"],
|
||||
deps = [
|
||||
":romi-cpp.static",
|
||||
],
|
||||
)
|
||||
|
||||
java_binary(
|
||||
name = "DevMain-Java",
|
||||
srcs = ["src/dev/java/edu/wpi/first/wpilibj/romi/DevMain.java"],
|
||||
main_class = "edu.wpi.first.wpilibj.romi.DevMain",
|
||||
deps = [
|
||||
"//hal:hal-java",
|
||||
"//ntcore:networktables-java",
|
||||
"//wpiutil:wpiutil-java",
|
||||
],
|
||||
)
|
||||
@@ -62,6 +62,7 @@ include 'epilogue-processor'
|
||||
include 'epilogue-runtime'
|
||||
include 'thirdparty:googletest'
|
||||
include 'thirdparty:imgui_suite'
|
||||
include 'wpical'
|
||||
|
||||
buildCache {
|
||||
def cred = {
|
||||
|
||||
@@ -42,3 +42,6 @@ build:macos --linkopt=-Wl,-rpath,'@loader_path'"
|
||||
|
||||
# Things not in nativetools
|
||||
build:macos --copt=-Wno-shorten-64-to-32
|
||||
|
||||
build:macos --host_per_file_copt=external/zlib/.*\.c@-Wno-deprecated-non-prototype
|
||||
build:macos --host_per_file_copt=external/com_google_protobuf/.*\.cc@-Wno-unused-function
|
||||
|
||||
@@ -14,3 +14,5 @@ build:roborio --cxxopt=-Wno-error=deprecated-declarations
|
||||
|
||||
# Extra 11
|
||||
build:roborio --cxxopt=-Wno-error=deprecated-enum-enum-conversion
|
||||
|
||||
build:roborio --host_per_file_copt=external/zlib/.*\.c@-Wno-deprecated-non-prototype
|
||||
|
||||
13
shared/ceres.gradle
Normal file
13
shared/ceres.gradle
Normal file
@@ -0,0 +1,13 @@
|
||||
nativeUtils {
|
||||
nativeDependencyContainer {
|
||||
ceres(getNativeDependencyTypeClass('WPIStaticMavenDependency')) {
|
||||
groupId = "edu.wpi.first.thirdparty.frc2024.ceres"
|
||||
artifactId = "ceres-cpp"
|
||||
headerClassifier = "headers"
|
||||
sourceClassifier = "sources"
|
||||
ext = "zip"
|
||||
version = '2.2-3'
|
||||
targetPlatforms.addAll(nativeUtils.wpi.platforms.desktopPlatforms)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ nativeUtils {
|
||||
wpi {
|
||||
configureDependencies {
|
||||
opencvYear = "frc2025"
|
||||
niLibVersion = "2025.0.0"
|
||||
niLibVersion = "2025.2.0"
|
||||
opencvVersion = "4.10.0-3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,9 +67,9 @@ def tagList = [
|
||||
"SmartDashboard", "Shuffleboard", "Sendable", "DataLog",
|
||||
|
||||
/* --- Controls --- */
|
||||
"Exponential Profile", "PID", "State-Space", "Ramsete", "Path Following", "Trajectory",
|
||||
"SysId", "Simulation", "Trapezoid Profile", "Profiled PID", "Odometry", "LQR",
|
||||
"Pose Estimator",
|
||||
"Exponential Profile", "PID", "State-Space", "LTVUnicycleController", "Path Following",
|
||||
"Trajectory", "SysId", "Simulation", "Trapezoid Profile", "Profiled PID", "Odometry",
|
||||
"LQR", "Pose Estimator",
|
||||
|
||||
/* --- Hardware --- */
|
||||
"Analog", "Ultrasonic", "Gyro", "Pneumatics", "I2C", "Duty Cycle", "PDP", "DMA", "Relay",
|
||||
|
||||
@@ -31,7 +31,7 @@ model {
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':fieldImages', library: 'fieldImages', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imguiSuite', linkage: 'static'
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
it.buildable = false
|
||||
return
|
||||
|
||||
@@ -1104,7 +1104,15 @@ static void DriverStationExecute() {
|
||||
}
|
||||
|
||||
ImGui::SetNextWindowPos(ImVec2{5, 20}, ImGuiCond_FirstUseEver);
|
||||
ImGui::Begin("Robot State", nullptr, ImGuiWindowFlags_AlwaysAutoResize);
|
||||
const char* title = "Robot State";
|
||||
// Accounts for size of title and collapse button
|
||||
float minWidth = ImGui::CalcTextSize(title).x + ImGui::GetFontSize() +
|
||||
ImGui::GetStyle().ItemInnerSpacing.x * 2 +
|
||||
ImGui::GetStyle().FramePadding.x * 2 +
|
||||
ImGui::GetStyle().WindowBorderSize;
|
||||
ImGui::SetNextWindowSizeConstraints(ImVec2{minWidth, 0},
|
||||
ImVec2{FLT_MAX, FLT_MAX});
|
||||
ImGui::Begin(title, nullptr, ImGuiWindowFlags_AlwaysAutoResize);
|
||||
if (ImGui::Selectable("Disconnected", !isAttached)) {
|
||||
HALSIM_SetDriverStationEnabled(false);
|
||||
HALSIM_SetDriverStationDsAttached(false);
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
#include "XRP.h"
|
||||
|
||||
#include <bit>
|
||||
#include <string>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/Endian.h>
|
||||
#include <wpi/MathExtras.h>
|
||||
#include <wpi/json.h>
|
||||
|
||||
using namespace wpilibxrp;
|
||||
@@ -245,7 +245,7 @@ void XRP::SetupMotorTag(wpi::raw_uv_ostream& buf) {
|
||||
|
||||
// Convert the value
|
||||
wpi::support::endian::write32be(value,
|
||||
wpi::bit_cast<uint32_t>(motor.second));
|
||||
std::bit_cast<uint32_t>(motor.second));
|
||||
buf << value[0] << value[1] << value[2] << value[3];
|
||||
}
|
||||
}
|
||||
@@ -261,7 +261,7 @@ void XRP::SetupServoTag(wpi::raw_uv_ostream& buf) {
|
||||
|
||||
// Convert the value
|
||||
wpi::support::endian::write32be(value,
|
||||
wpi::bit_cast<uint32_t>(servo.second));
|
||||
std::bit_cast<uint32_t>(servo.second));
|
||||
buf << value[0] << value[1] << value[2] << value[3];
|
||||
}
|
||||
}
|
||||
@@ -283,17 +283,17 @@ void XRP::ReadGyroTag(std::span<const uint8_t> packet) {
|
||||
|
||||
packet = packet.subspan(2); // Skip past the size and tag
|
||||
float rate_x =
|
||||
wpi::bit_cast<float>(wpi::support::endian::read32be(&packet[0]));
|
||||
std::bit_cast<float>(wpi::support::endian::read32be(&packet[0]));
|
||||
float rate_y =
|
||||
wpi::bit_cast<float>(wpi::support::endian::read32be(&packet[4]));
|
||||
std::bit_cast<float>(wpi::support::endian::read32be(&packet[4]));
|
||||
float rate_z =
|
||||
wpi::bit_cast<float>(wpi::support::endian::read32be(&packet[8]));
|
||||
std::bit_cast<float>(wpi::support::endian::read32be(&packet[8]));
|
||||
float angle_x =
|
||||
wpi::bit_cast<float>(wpi::support::endian::read32be(&packet[12]));
|
||||
std::bit_cast<float>(wpi::support::endian::read32be(&packet[12]));
|
||||
float angle_y =
|
||||
wpi::bit_cast<float>(wpi::support::endian::read32be(&packet[16]));
|
||||
std::bit_cast<float>(wpi::support::endian::read32be(&packet[16]));
|
||||
float angle_z =
|
||||
wpi::bit_cast<float>(wpi::support::endian::read32be(&packet[20]));
|
||||
std::bit_cast<float>(wpi::support::endian::read32be(&packet[20]));
|
||||
|
||||
// Make the json object
|
||||
wpi::json gyroJson;
|
||||
@@ -314,11 +314,11 @@ void XRP::ReadAccelTag(std::span<const uint8_t> packet) {
|
||||
|
||||
packet = packet.subspan(2); // Skip past the size and tag
|
||||
float accel_x =
|
||||
wpi::bit_cast<float>(wpi::support::endian::read32be(&packet[0]));
|
||||
std::bit_cast<float>(wpi::support::endian::read32be(&packet[0]));
|
||||
float accel_y =
|
||||
wpi::bit_cast<float>(wpi::support::endian::read32be(&packet[4]));
|
||||
std::bit_cast<float>(wpi::support::endian::read32be(&packet[4]));
|
||||
float accel_z =
|
||||
wpi::bit_cast<float>(wpi::support::endian::read32be(&packet[8]));
|
||||
std::bit_cast<float>(wpi::support::endian::read32be(&packet[8]));
|
||||
|
||||
wpi::json accelJson;
|
||||
accelJson["type"] = "Accel";
|
||||
@@ -409,7 +409,7 @@ void XRP::ReadAnalogTag(std::span<const uint8_t> packet) {
|
||||
|
||||
packet = packet.subspan(3);
|
||||
float voltage =
|
||||
wpi::bit_cast<float>(wpi::support::endian::read32be(&packet[0]));
|
||||
std::bit_cast<float>(wpi::support::endian::read32be(&packet[0]));
|
||||
|
||||
wpi::json analogJson;
|
||||
analogJson["type"] = "AI";
|
||||
|
||||
@@ -100,7 +100,7 @@ model {
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'static'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imguiSuite', linkage: 'static'
|
||||
if (it.targetPlatform.operatingSystem.isWindows()) {
|
||||
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
|
||||
it.linker.args << '/DELAYLOAD:MF.dll' << '/DELAYLOAD:MFReadWrite.dll' << '/DELAYLOAD:MFPlat.dll' << '/delay:nobind'
|
||||
@@ -139,7 +139,7 @@ model {
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'static'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imgui', linkage: 'static'
|
||||
lib project: ':thirdparty:imgui_suite', library: 'imguiSuite', linkage: 'static'
|
||||
if (it.targetPlatform.operatingSystem.isWindows()) {
|
||||
it.linker.args << 'Gdi32.lib' << 'Shell32.lib' << 'd3d11.lib' << 'd3dcompiler.lib'
|
||||
it.linker.args << '/DELAYLOAD:MF.dll' << '/DELAYLOAD:MFReadWrite.dll' << '/DELAYLOAD:MFPlat.dll' << '/delay:nobind'
|
||||
|
||||
2
thirdparty/imgui_suite/build.gradle
vendored
2
thirdparty/imgui_suite/build.gradle
vendored
@@ -25,7 +25,7 @@ nativeUtils.platformConfigs.named('osxuniversal') {
|
||||
|
||||
model {
|
||||
components {
|
||||
imgui(NativeLibrarySpec) {
|
||||
imguiSuite(NativeLibrarySpec) {
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
|
||||
8570
thirdparty/imgui_suite/imgui/cpp/imgui_demo.cpp
vendored
Normal file
8570
thirdparty/imgui_suite/imgui/cpp/imgui_demo.cpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -34,7 +34,7 @@ def copy_upstream_src(wpilib_root):
|
||||
def main():
|
||||
name = "fmt"
|
||||
url = "https://github.com/fmtlib/fmt"
|
||||
tag = "11.0.2"
|
||||
tag = "11.1.0"
|
||||
|
||||
fmt = Lib(name, url, tag, copy_upstream_src)
|
||||
fmt.main()
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Tyler Veness <calcmogul@gmail.com>
|
||||
Date: Tue, 16 May 2023 13:49:18 -0700
|
||||
Subject: [PATCH] Suppress warnings we can't fix
|
||||
|
||||
---
|
||||
include/fmt/format.h | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/include/fmt/format.h b/include/fmt/format.h
|
||||
index 67f0ab739b0de55d03ab3e71424f1eb9e9c9bdfc..cf5ad9820683130ce9895f5d216d9b9efd0185ac 100644
|
||||
--- a/include/fmt/format.h
|
||||
+++ b/include/fmt/format.h
|
||||
@@ -1276,7 +1276,14 @@ inline auto equal2(const char* lhs, const char* rhs) -> bool {
|
||||
template <typename Char>
|
||||
FMT_CONSTEXPR20 FMT_INLINE void copy2(Char* dst, const char* src) {
|
||||
if (!is_constant_evaluated() && sizeof(Char) == sizeof(char)) {
|
||||
+#if FMT_GCC_VERSION && FMT_GCC_VERSION >= 1000
|
||||
+# pragma GCC diagnostic push
|
||||
+# pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
+#endif
|
||||
memcpy(dst, src, 2);
|
||||
+#if FMT_GCC_VERSION && FMT_GCC_VERSION >= 1000
|
||||
+# pragma GCC diagnostic pop
|
||||
+#endif
|
||||
return;
|
||||
}
|
||||
*dst++ = static_cast<Char>(*src++);
|
||||
@@ -48,6 +48,7 @@ def copy_upstream_src(wpilib_root):
|
||||
"./backends/imgui_impl_opengl2.cpp",
|
||||
"./backends/imgui_impl_opengl3.cpp",
|
||||
"./imgui.cpp",
|
||||
"./imgui_demo.cpp",
|
||||
"./imgui_draw.cpp",
|
||||
"./imgui_tables.cpp",
|
||||
"./imgui_widgets.cpp",
|
||||
|
||||
58
upstream_utils/libdogleg.py
Executable file
58
upstream_utils/libdogleg.py
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from upstream_utils import Lib, walk_cwd_and_copy_if
|
||||
|
||||
|
||||
def copy_upstream_src(wpilib_root):
|
||||
wpical = os.path.join(wpilib_root, "wpical")
|
||||
|
||||
# Delete old install
|
||||
for d in [
|
||||
"src/main/native/thirdparty/libdogleg/src",
|
||||
"src/main/native/thirdparty/libdogleg/include",
|
||||
]:
|
||||
shutil.rmtree(os.path.join(wpical, d), ignore_errors=True)
|
||||
|
||||
files = walk_cwd_and_copy_if(
|
||||
lambda dp, f: f.endswith("dogleg.h"),
|
||||
os.path.join(wpical, "src/main/native/thirdparty/libdogleg/include"),
|
||||
)
|
||||
for f in files:
|
||||
with open(f) as file:
|
||||
content = file.read()
|
||||
content = content.replace(
|
||||
"#include <cholmod.h>", "#include <suitesparse/cholmod.h>"
|
||||
)
|
||||
with open(f, "w") as file:
|
||||
file.write(content)
|
||||
|
||||
files = walk_cwd_and_copy_if(
|
||||
lambda dp, f: f.endswith("dogleg.cpp"),
|
||||
os.path.join(wpical, "src/main/native/thirdparty/libdogleg/src"),
|
||||
)
|
||||
for f in files:
|
||||
with open(f) as file:
|
||||
content = file.read()
|
||||
content = content.replace("#warning", "// #warning")
|
||||
content = content.replace("__attribute__((unused))", "")
|
||||
content = content.replace(
|
||||
"#include <cholmod_function.h>", "#include <suitesparse/cholmod_function.h>"
|
||||
)
|
||||
with open(f, "w") as file:
|
||||
file.write(content)
|
||||
|
||||
|
||||
def main():
|
||||
name = "libdogleg"
|
||||
url = "https://github.com/dkogan/libdogleg"
|
||||
tag = "c971ea43088d286a3683c1039b9a85f761f7df15"
|
||||
|
||||
libdogleg = Lib(name, url, tag, copy_upstream_src)
|
||||
libdogleg.main()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
38
upstream_utils/libdogleg_patches/0001-Convert-to-C.patch
Normal file
38
upstream_utils/libdogleg_patches/0001-Convert-to-C.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Gold856 <117957790+Gold856@users.noreply.github.com>
|
||||
Date: Fri, 29 Nov 2024 19:52:22 -0500
|
||||
Subject: [PATCH 1/3] Convert to C++
|
||||
|
||||
---
|
||||
dogleg.c => dogleg.cpp | 0
|
||||
dogleg.h | 8 +++++++-
|
||||
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||
rename dogleg.c => dogleg.cpp (100%)
|
||||
|
||||
diff --git a/dogleg.c b/dogleg.cpp
|
||||
similarity index 100%
|
||||
rename from dogleg.c
|
||||
rename to dogleg.cpp
|
||||
diff --git a/dogleg.h b/dogleg.h
|
||||
index 74337263a89d3448f55e125db6702ebfa7588b97..4a23b669a30642d290549bb94a1c787f079d0647 100644
|
||||
--- a/dogleg.h
|
||||
+++ b/dogleg.h
|
||||
@@ -126,7 +126,9 @@ typedef struct
|
||||
|
||||
} dogleg_solverContext_t;
|
||||
|
||||
-
|
||||
+#ifdef __cplusplus
|
||||
+extern "C" {
|
||||
+#endif
|
||||
// Fills in the given structure with the default parameter set
|
||||
void dogleg_getDefaultParameters(dogleg_parameters2_t* parameters);
|
||||
|
||||
@@ -293,3 +295,7 @@ double dogleg_getOutliernessTrace_newFeature_sparse(const double* Jqu
|
||||
int NoutlierFeatures,
|
||||
dogleg_operatingPoint_t* point,
|
||||
dogleg_solverContext_t* ctx);
|
||||
+
|
||||
+#ifdef __cplusplus
|
||||
+} // extern "C"
|
||||
+#endif
|
||||
@@ -0,0 +1,79 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Gold856 <117957790+Gold856@users.noreply.github.com>
|
||||
Date: Fri, 29 Nov 2024 19:54:54 -0500
|
||||
Subject: [PATCH 2/3] Replace VLAs with vectors
|
||||
|
||||
---
|
||||
dogleg.cpp | 17 +++++++++--------
|
||||
1 file changed, 9 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dogleg.cpp b/dogleg.cpp
|
||||
index 7e4259c303e21a9f4c63ba16f1bf5df131935057..9ed95f64b232f41a51fe23d72885ecadd86dc065 100644
|
||||
--- a/dogleg.cpp
|
||||
+++ b/dogleg.cpp
|
||||
@@ -6,6 +6,7 @@
|
||||
// Apparently I need this in MSVC to get constants
|
||||
#define _USE_MATH_DEFINES
|
||||
|
||||
+#include <vector>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <math.h>
|
||||
@@ -1907,7 +1908,7 @@ static bool getOutliernessFactors_dense( // output
|
||||
// where A = Jo inv(JtJ) Jot
|
||||
//
|
||||
// A is symmetric. I store the upper triangle
|
||||
- double A[featureSize*(featureSize+1)/2];
|
||||
+ std::vector<double> A(featureSize*(featureSize+1)/2);
|
||||
int iA=0;
|
||||
for(int i=0; i<featureSize; i++)
|
||||
for(int j=i; j<featureSize; j++, iA++)
|
||||
@@ -1921,7 +1922,7 @@ static bool getOutliernessFactors_dense( // output
|
||||
}
|
||||
accum_outlierness_factor(&factors[i_feature],
|
||||
&point->x[i_measurement],
|
||||
- A, featureSize, *scale);
|
||||
+ A.data(), featureSize, *scale);
|
||||
}
|
||||
|
||||
result = true;
|
||||
@@ -2008,7 +2009,7 @@ static bool getOutliernessFactors_sparse( // output
|
||||
// where A = Jo inv(JtJ) Jot
|
||||
//
|
||||
// A is symmetric. I store the upper triangle
|
||||
- double A[featureSize*(featureSize+1)/2];
|
||||
+ std::vector<double> A(featureSize*(featureSize+1)/2);
|
||||
int iA=0;
|
||||
for(int i=0; i<featureSize; i++)
|
||||
for(int j=i; j<featureSize; j++, iA++)
|
||||
@@ -2027,7 +2028,7 @@ static bool getOutliernessFactors_sparse( // output
|
||||
}
|
||||
accum_outlierness_factor(&factors[i_feature],
|
||||
&point->x[i_measurement],
|
||||
- A, featureSize, *scale);
|
||||
+ A.data(), featureSize, *scale);
|
||||
}
|
||||
|
||||
result = true;
|
||||
@@ -2212,8 +2213,8 @@ double dogleg_getOutliernessTrace_newFeature_sparse(const double* Jqu
|
||||
|
||||
// This is Jt because cholmod thinks in terms of col-first instead of
|
||||
// row-first
|
||||
- int Jt_p[featureSize+1];
|
||||
- int Jt_i[NstateActive*featureSize];
|
||||
+ std::vector<int> Jt_p(featureSize+1);
|
||||
+ std::vector<int> Jt_i(NstateActive*featureSize);
|
||||
for(int i=0; i<=featureSize; i++)
|
||||
{
|
||||
Jt_p[i] = i*NstateActive;
|
||||
@@ -2224,8 +2225,8 @@ double dogleg_getOutliernessTrace_newFeature_sparse(const double* Jqu
|
||||
cholmod_sparse Jt_query_sparse = {.nrow = ctx->Nstate,
|
||||
.ncol = featureSize,
|
||||
.nzmax = NstateActive*featureSize,
|
||||
- .p = (void*)Jt_p,
|
||||
- .i = (void*)Jt_i,
|
||||
+ .p = (void*)Jt_p.data(),
|
||||
+ .i = (void*)Jt_i.data(),
|
||||
.x = (double*)JqueryFeature,
|
||||
.sorted = 1,
|
||||
.packed = 1,
|
||||
324
upstream_utils/libdogleg_patches/0003-Fix-C-build-errors.patch
Normal file
324
upstream_utils/libdogleg_patches/0003-Fix-C-build-errors.patch
Normal file
@@ -0,0 +1,324 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Gold856 <117957790+Gold856@users.noreply.github.com>
|
||||
Date: Sun, 1 Dec 2024 00:28:14 -0500
|
||||
Subject: [PATCH 3/3] Fix C++ build errors
|
||||
|
||||
---
|
||||
dogleg.cpp | 110 +++++++++++++++++++++++++++++++----------------------
|
||||
1 file changed, 65 insertions(+), 45 deletions(-)
|
||||
|
||||
diff --git a/dogleg.cpp b/dogleg.cpp
|
||||
index 9ed95f64b232f41a51fe23d72885ecadd86dc065..c93f696a9427f0644b047308d2d99302cd246462 100644
|
||||
--- a/dogleg.cpp
|
||||
+++ b/dogleg.cpp
|
||||
@@ -327,9 +327,9 @@ void _dogleg_testGradient(unsigned int var, const double* p0,
|
||||
{
|
||||
int is_sparse = NJnnz > 0;
|
||||
|
||||
- double* x0 = malloc(Nmeas * sizeof(double));
|
||||
- double* x = malloc(Nmeas * sizeof(double));
|
||||
- double* p = malloc(Nstate * sizeof(double));
|
||||
+ double* x0 = static_cast<double*>(malloc(Nmeas * sizeof(double)));
|
||||
+ double* x = static_cast<double*>(malloc(Nmeas * sizeof(double)));
|
||||
+ double* p = static_cast<double*>(malloc(Nstate * sizeof(double)));
|
||||
ASSERT(x0);
|
||||
ASSERT(x);
|
||||
ASSERT(p);
|
||||
@@ -376,8 +376,8 @@ void _dogleg_testGradient(unsigned int var, const double* p0,
|
||||
}
|
||||
else
|
||||
{
|
||||
- J_dense = malloc( Nmeas * Nstate * sizeof(J_dense[0]) );
|
||||
- J_dense0 = malloc( Nmeas * Nstate * sizeof(J_dense[0]) );
|
||||
+ J_dense = static_cast<double*>(malloc( Nmeas * Nstate * sizeof(J_dense[0]) ));
|
||||
+ J_dense0 = static_cast<double*>(malloc( Nmeas * Nstate * sizeof(J_dense[0]) ));
|
||||
|
||||
dogleg_callback_dense_t* f_dense = (dogleg_callback_dense_t*)f;
|
||||
p[var] -= GRADTEST_DELTA/2.0;
|
||||
@@ -487,11 +487,13 @@ static void computeCauchyUpdate(dogleg_operatingPoint_t* point,
|
||||
|
||||
// LAPACK prototypes for a packed cholesky factorization and a linear solve
|
||||
// using that factorization, respectively
|
||||
+extern "C" {
|
||||
int dpptrf_(char* uplo, int* n, double* ap,
|
||||
int* info, int uplo_len);
|
||||
int dpptrs_(char* uplo, int* n, int* nrhs,
|
||||
double* ap, double* b, int* ldb, int* info,
|
||||
int uplo_len);
|
||||
+}
|
||||
|
||||
|
||||
void dogleg_computeJtJfactorization(dogleg_operatingPoint_t* point, dogleg_solverContext_t* ctx)
|
||||
@@ -538,8 +540,8 @@ void dogleg_computeJtJfactorization(dogleg_operatingPoint_t* point, dogleg_solve
|
||||
if(ctx->factorization_dense == NULL)
|
||||
{
|
||||
// Need to store symmetric JtJ, so I only need one triangle of it
|
||||
- ctx->factorization_dense = malloc( ctx->Nstate * (ctx->Nstate+1) / 2 *
|
||||
- sizeof( ctx->factorization_dense[0]));
|
||||
+ ctx->factorization_dense = static_cast<double*>(malloc( ctx->Nstate * (ctx->Nstate+1) / 2 *
|
||||
+ sizeof( ctx->factorization_dense[0])));
|
||||
ASSERT(ctx->factorization_dense);
|
||||
}
|
||||
|
||||
@@ -582,7 +584,9 @@ void dogleg_computeJtJfactorization(dogleg_operatingPoint_t* point, dogleg_solve
|
||||
|
||||
|
||||
int info;
|
||||
- dpptrf_(&(char){'L'}, &(int){ctx->Nstate}, ctx->factorization_dense,
|
||||
+ char uplo = 'L';
|
||||
+ int Nstate_copy = ctx->Nstate;
|
||||
+ dpptrf_(&uplo, &Nstate_copy, ctx->factorization_dense,
|
||||
&info, 1);
|
||||
ASSERT(info >= 0); // we MUST either succeed or see complain of singular
|
||||
// JtJ
|
||||
@@ -611,10 +615,10 @@ static void computeGaussNewtonUpdate(dogleg_operatingPoint_t* point, dogleg_solv
|
||||
if( ctx->is_sparse )
|
||||
{
|
||||
// solve JtJ*updateGN = Jt*x. Gauss-Newton step is then -updateGN
|
||||
- cholmod_dense Jt_x_dense = {.nrow = ctx->Nstate,
|
||||
+ cholmod_dense Jt_x_dense = {.nrow = static_cast<size_t>(ctx->Nstate),
|
||||
.ncol = 1,
|
||||
- .nzmax = ctx->Nstate,
|
||||
- .d = ctx->Nstate,
|
||||
+ .nzmax = static_cast<size_t>(ctx->Nstate),
|
||||
+ .d = static_cast<size_t>(ctx->Nstate),
|
||||
.x = point->Jt_x,
|
||||
.xtype = CHOLMOD_REAL,
|
||||
.dtype = CHOLMOD_DOUBLE};
|
||||
@@ -626,18 +630,22 @@ static void computeGaussNewtonUpdate(dogleg_operatingPoint_t* point, dogleg_solv
|
||||
ctx->factorization,
|
||||
&Jt_x_dense,
|
||||
&ctx->common);
|
||||
- vec_negate(point->updateGN_cholmoddense->x,
|
||||
+ vec_negate(static_cast<double*>(point->updateGN_cholmoddense->x),
|
||||
ctx->Nstate); // should be more efficient than this later
|
||||
|
||||
- point->updateGN_lensq = norm2(point->updateGN_cholmoddense->x, ctx->Nstate);
|
||||
+ point->updateGN_lensq = norm2(static_cast<double*>(point->updateGN_cholmoddense->x), ctx->Nstate);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy( point->updateGN_dense, point->Jt_x, ctx->Nstate * sizeof(point->updateGN_dense[0]));
|
||||
int info;
|
||||
- dpptrs_(&(char){'L'}, &(int){ctx->Nstate}, &(int){1},
|
||||
+ char uplo = 'L';
|
||||
+ int nhrs = 1;
|
||||
+ int Nstate_copy = ctx->Nstate;
|
||||
+ int Nstate_copy2 = ctx->Nstate;
|
||||
+ dpptrs_(&uplo, &Nstate_copy, &nhrs,
|
||||
ctx->factorization_dense,
|
||||
- point->updateGN_dense, &(int){ctx->Nstate}, &info, 1);
|
||||
+ point->updateGN_dense, &Nstate_copy2, &info, 1);
|
||||
vec_negate(point->updateGN_dense,
|
||||
ctx->Nstate); // should be more efficient than this later
|
||||
|
||||
@@ -677,7 +685,7 @@ static void computeInterpolatedUpdate(double* update_dogleg,
|
||||
double dsq = trustregion*trustregion;
|
||||
double norm2a = point->updateCauchy_lensq;
|
||||
const double* a = point->updateCauchy;
|
||||
- const double* b = ctx->is_sparse ? point->updateGN_cholmoddense->x : point->updateGN_dense;
|
||||
+ const double* b = ctx->is_sparse ? static_cast<double*>(point->updateGN_cholmoddense->x) : point->updateGN_dense;
|
||||
|
||||
double l2 = 0.0;
|
||||
double neg_c = 0.0;
|
||||
@@ -1029,7 +1037,7 @@ dogleg_operatingPoint_t* allocOperatingPoint(int Nstate, int numMeasurements,
|
||||
{
|
||||
int is_sparse = NJnnz > 0;
|
||||
|
||||
- dogleg_operatingPoint_t* point = malloc(sizeof(dogleg_operatingPoint_t));
|
||||
+ dogleg_operatingPoint_t* point = static_cast<dogleg_operatingPoint_t*>(malloc(sizeof(dogleg_operatingPoint_t)));
|
||||
ASSERT(point != NULL);
|
||||
|
||||
|
||||
@@ -1042,7 +1050,7 @@ dogleg_operatingPoint_t* allocOperatingPoint(int Nstate, int numMeasurements,
|
||||
if(!is_sparse)
|
||||
Npool += numMeasurements*Nstate + Nstate;
|
||||
|
||||
- double* pool = malloc( Npool * sizeof(double) );
|
||||
+ double* pool = static_cast<double*>(malloc( Npool * sizeof(double) ));
|
||||
ASSERT( pool != NULL );
|
||||
|
||||
point->p = &pool[0];
|
||||
@@ -1170,7 +1178,7 @@ static double _dogleg_optimize(double* p, unsigned int Nstate,
|
||||
int is_sparse = NJnnz > 0;
|
||||
|
||||
|
||||
- dogleg_solverContext_t* ctx = malloc(sizeof(dogleg_solverContext_t));
|
||||
+ dogleg_solverContext_t* ctx = static_cast<dogleg_solverContext_t*>(malloc(sizeof(dogleg_solverContext_t)));
|
||||
ctx->f = f;
|
||||
ctx->cookie = cookie;
|
||||
ctx->factorization = NULL;
|
||||
@@ -1294,10 +1302,13 @@ static bool pseudoinverse_J_dense(// output
|
||||
memcpy(out,
|
||||
&point->J_dense[i_meas0*ctx->Nstate],
|
||||
NmeasInChunk*ctx->Nstate*sizeof(double));
|
||||
- dpptrs_(&(char){'L'}, &(int){ctx->Nstate}, &NmeasInChunk,
|
||||
+ char uplo = 'L';
|
||||
+ int Nstate_copy = ctx->Nstate;
|
||||
+ int Nstate_copy2 = ctx->Nstate;
|
||||
+ dpptrs_(&uplo, &Nstate_copy, &NmeasInChunk,
|
||||
ctx->factorization_dense,
|
||||
out,
|
||||
- &(int){ctx->Nstate}, &info, 1);
|
||||
+ &Nstate_copy2, &info, 1);
|
||||
return info==0;
|
||||
}
|
||||
|
||||
@@ -1873,11 +1884,12 @@ static bool getOutliernessFactors_dense( // output
|
||||
int Nmeasurements = ctx->Nmeasurements;
|
||||
bool result = false;
|
||||
|
||||
- double* invJtJ_Jt = malloc(Nstate*chunk_size*sizeof(double));
|
||||
+ double* invJtJ_Jt = static_cast<double*>(malloc(Nstate*chunk_size*sizeof(double)));
|
||||
if(invJtJ_Jt == NULL)
|
||||
{
|
||||
SAY("Couldn't allocate invJtJ_Jt!");
|
||||
- goto done;
|
||||
+ free(invJtJ_Jt);
|
||||
+ return result;
|
||||
}
|
||||
|
||||
getOutliernessScale(scale,
|
||||
@@ -1895,7 +1907,8 @@ static bool getOutliernessFactors_dense( // output
|
||||
if(!pinvresult)
|
||||
{
|
||||
SAY("Couldn't compute pinv!");
|
||||
- goto done;
|
||||
+ free(invJtJ_Jt);
|
||||
+ return result;
|
||||
}
|
||||
i_measurement_valid_chunk_start = i_measurement;
|
||||
i_measurement_valid_chunk_last = i_measurement+chunk_size-1;
|
||||
@@ -1926,7 +1939,6 @@ static bool getOutliernessFactors_dense( // output
|
||||
}
|
||||
|
||||
result = true;
|
||||
- done:
|
||||
free(invJtJ_Jt);
|
||||
return result;
|
||||
}
|
||||
@@ -1975,7 +1987,9 @@ static bool getOutliernessFactors_sparse( // output
|
||||
if(!Jt_chunk)
|
||||
{
|
||||
SAY("Couldn't allocate Jt_chunk!");
|
||||
- goto done;
|
||||
+ if(Jt_chunk) cholmod_free_dense(&Jt_chunk, &ctx->common);
|
||||
+ if(invJtJ_Jt) cholmod_free_dense(&invJtJ_Jt, &ctx->common);
|
||||
+ return result;
|
||||
}
|
||||
|
||||
getOutliernessScale(scale,
|
||||
@@ -1995,7 +2009,9 @@ static bool getOutliernessFactors_sparse( // output
|
||||
if(invJtJ_Jt == NULL)
|
||||
{
|
||||
SAY("Couldn't compute pinv!");
|
||||
- goto done;
|
||||
+ if(Jt_chunk) cholmod_free_dense(&Jt_chunk, &ctx->common);
|
||||
+ if(invJtJ_Jt) cholmod_free_dense(&invJtJ_Jt, &ctx->common);
|
||||
+ return result;
|
||||
}
|
||||
|
||||
i_measurement_valid_chunk_start = i_measurement;
|
||||
@@ -2032,7 +2048,6 @@ static bool getOutliernessFactors_sparse( // output
|
||||
}
|
||||
|
||||
result = true;
|
||||
- done:
|
||||
if(Jt_chunk) cholmod_free_dense(&Jt_chunk, &ctx->common);
|
||||
if(invJtJ_Jt) cholmod_free_dense(&invJtJ_Jt, &ctx->common);
|
||||
return result;
|
||||
@@ -2222,18 +2237,18 @@ double dogleg_getOutliernessTrace_newFeature_sparse(const double* Jqu
|
||||
for(int j=0; j<NstateActive; j++)
|
||||
Jt_i[j + i*NstateActive] = istateActive + j;
|
||||
}
|
||||
- cholmod_sparse Jt_query_sparse = {.nrow = ctx->Nstate,
|
||||
- .ncol = featureSize,
|
||||
- .nzmax = NstateActive*featureSize,
|
||||
- .p = (void*)Jt_p.data(),
|
||||
- .i = (void*)Jt_i.data(),
|
||||
- .x = (double*)JqueryFeature,
|
||||
- .sorted = 1,
|
||||
- .packed = 1,
|
||||
+ cholmod_sparse Jt_query_sparse = {.nrow = static_cast<size_t>(ctx->Nstate),
|
||||
+ .ncol = static_cast<size_t>(featureSize),
|
||||
+ .nzmax = static_cast<size_t>(NstateActive*featureSize),
|
||||
+ .p = Jt_p.data(),
|
||||
+ .i = Jt_i.data(),
|
||||
+ .x = const_cast<double*>(JqueryFeature),
|
||||
.stype = 0, // NOT symmetric
|
||||
.itype = CHOLMOD_INT,
|
||||
.xtype = CHOLMOD_REAL,
|
||||
- .dtype = CHOLMOD_DOUBLE};
|
||||
+ .dtype = CHOLMOD_DOUBLE,
|
||||
+ .sorted = 1,
|
||||
+ .packed = 1};
|
||||
|
||||
// Really shouldn't need to do this every time. In fact I probably don't need
|
||||
// to do it at all, since this will have been done by the solver during the
|
||||
@@ -2408,18 +2423,22 @@ bool dogleg_markOutliers(// output, input
|
||||
|
||||
bool markedAny = false;
|
||||
|
||||
- double* factors = malloc(Nfeatures * sizeof(double));
|
||||
+ double* factors = static_cast<double*>(malloc(Nfeatures * sizeof(double)));
|
||||
if(factors == NULL)
|
||||
{
|
||||
SAY("Error allocating factors");
|
||||
- goto done;
|
||||
+ free(factors);
|
||||
+ return markedAny;
|
||||
}
|
||||
|
||||
if(!dogleg_getOutliernessFactors(factors, scale,
|
||||
featureSize, Nfeatures,
|
||||
*Noutliers,
|
||||
point, ctx))
|
||||
- goto done;
|
||||
+ {
|
||||
+ free(factors);
|
||||
+ return markedAny;
|
||||
+ }
|
||||
|
||||
// I have my list of POTENTIAL outliers (any that have factor > 1.0). I
|
||||
// check to see how much confidence I would lose if I were to throw out any
|
||||
@@ -2427,7 +2446,10 @@ bool dogleg_markOutliers(// output, input
|
||||
// is acceptable
|
||||
double confidence0 = getConfidence(-1);
|
||||
if( confidence0 < 0.0 )
|
||||
- goto done;
|
||||
+ {
|
||||
+ free(factors);
|
||||
+ return markedAny;
|
||||
+ }
|
||||
|
||||
SAY_IF_VERBOSE("Initial confidence: %g", confidence0);
|
||||
|
||||
@@ -2466,7 +2488,6 @@ bool dogleg_markOutliers(// output, input
|
||||
}
|
||||
}
|
||||
|
||||
- done:
|
||||
free(factors);
|
||||
return markedAny;
|
||||
}
|
||||
@@ -2490,11 +2511,11 @@ void dogleg_reportOutliers( double (getConfidence)(int i_feature_exclude),
|
||||
if(featureSize <= 1)
|
||||
featureSize = 1;
|
||||
|
||||
- double* factors = malloc(Nfeatures * sizeof(double));
|
||||
+ double* factors = static_cast<double*>(malloc(Nfeatures * sizeof(double)));
|
||||
if(factors == NULL)
|
||||
{
|
||||
SAY("Error allocating factors");
|
||||
- goto done;
|
||||
+ free(factors);
|
||||
}
|
||||
|
||||
dogleg_getOutliernessFactors(factors, scale,
|
||||
@@ -2516,6 +2537,5 @@ void dogleg_reportOutliers( double (getConfidence)(int i_feature_exclude),
|
||||
rot_confidence_drop_relative);
|
||||
}
|
||||
|
||||
- done:
|
||||
free(factors);
|
||||
}
|
||||
@@ -13,7 +13,7 @@ def run_global_replacements(wpiutil_llvm_files):
|
||||
|
||||
# Rename namespace from llvm to wpi
|
||||
content = content.replace("namespace llvm", "namespace wpi")
|
||||
content = content.replace("llvm::", "wpi::")
|
||||
content = content.replace("llvm:", "wpi:")
|
||||
|
||||
# Fix #includes
|
||||
content = content.replace('include "llvm/ADT', 'include "wpi')
|
||||
@@ -175,7 +175,7 @@ def copy_upstream_src(wpilib_root):
|
||||
def main():
|
||||
name = "llvm"
|
||||
url = "https://github.com/llvm/llvm-project"
|
||||
tag = "llvmorg-18.1.8"
|
||||
tag = "llvmorg-19.1.6"
|
||||
|
||||
patch_options = {
|
||||
"use_threeway": True,
|
||||
|
||||
@@ -1,36 +1,35 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 22:09:18 -0400
|
||||
Subject: [PATCH 01/36] Remove StringRef, ArrayRef, and Optional
|
||||
Subject: [PATCH 01/37] Remove StringRef, ArrayRef, and Optional
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/PointerUnion.h | 1 -
|
||||
llvm/include/llvm/ADT/SmallSet.h | 2 +-
|
||||
llvm/include/llvm/ADT/SmallString.h | 103 ++++++++++--------
|
||||
llvm/include/llvm/ADT/SmallString.h | 101 ++++++++++--------
|
||||
llvm/include/llvm/ADT/SmallVector.h | 7 +-
|
||||
llvm/include/llvm/Support/Chrono.h | 10 +-
|
||||
llvm/include/llvm/Support/Compiler.h | 2 +-
|
||||
llvm/include/llvm/Support/ConvertUTF.h | 31 +++---
|
||||
llvm/include/llvm/Support/ErrorHandling.h | 9 +-
|
||||
.../llvm/Support/SmallVectorMemoryBuffer.h | 6 +-
|
||||
llvm/include/llvm/Support/VersionTuple.h | 6 -
|
||||
llvm/include/llvm/Support/VersionTuple.h | 6 --
|
||||
.../llvm/Support/Windows/WindowsSupport.h | 4 +-
|
||||
llvm/include/llvm/Support/raw_ostream.h | 46 +++++---
|
||||
llvm/include/llvm/Support/xxhash.h | 16 +--
|
||||
llvm/include/llvm/Support/raw_ostream.h | 46 ++++----
|
||||
llvm/include/llvm/Support/xxhash.h | 18 ++--
|
||||
llvm/lib/Support/ConvertUTFWrapper.cpp | 38 +++----
|
||||
llvm/lib/Support/ErrorHandling.cpp | 13 +--
|
||||
llvm/lib/Support/ErrorHandling.cpp | 13 ++-
|
||||
llvm/lib/Support/SmallVector.cpp | 5 +-
|
||||
llvm/lib/Support/raw_ostream.cpp | 25 ++---
|
||||
llvm/lib/Support/xxhash.cpp | 10 +-
|
||||
llvm/lib/Support/raw_ostream.cpp | 25 +++--
|
||||
llvm/lib/Support/xxhash.cpp | 12 +--
|
||||
llvm/unittests/ADT/DenseMapTest.cpp | 29 +----
|
||||
llvm/unittests/ADT/FunctionExtrasTest.cpp | 12 +-
|
||||
llvm/unittests/ADT/HashingTest.cpp | 2 +-
|
||||
llvm/unittests/ADT/FunctionExtrasTest.cpp | 12 +--
|
||||
llvm/unittests/ADT/SmallPtrSetTest.cpp | 1 -
|
||||
llvm/unittests/ADT/SmallStringTest.cpp | 50 ++++-----
|
||||
llvm/unittests/ADT/SmallVectorTest.cpp | 30 +----
|
||||
llvm/unittests/ADT/SmallVectorTest.cpp | 30 ++----
|
||||
llvm/unittests/Support/ConvertUTFTest.cpp | 41 ++++---
|
||||
llvm/unittests/Support/xxhashTest.cpp | 4 +-
|
||||
26 files changed, 232 insertions(+), 271 deletions(-)
|
||||
llvm/unittests/Support/xxhashTest.cpp | 6 +-
|
||||
25 files changed, 232 insertions(+), 273 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/PointerUnion.h b/llvm/include/llvm/ADT/PointerUnion.h
|
||||
index 7d4ed02b622626bb8043acb57b8ce7ed97a5f949..8ac68dbc0a791b8ac0e0ca865e69024cb642aa70 100644
|
||||
@@ -63,7 +62,7 @@ index a16e8ac6f07552d98250e808190b00ee270f12b3..aeee5f97799aea7e7588d7afba1e47b4
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
diff --git a/llvm/include/llvm/ADT/SmallString.h b/llvm/include/llvm/ADT/SmallString.h
|
||||
index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413b0e36e0f 100644
|
||||
index be3193c6ef9beba622f39e3e76cd0f0c6dd422b0..9fab1a7726bc6745296f5ebb24aee4055408e5f5 100644
|
||||
--- a/llvm/include/llvm/ADT/SmallString.h
|
||||
+++ b/llvm/include/llvm/ADT/SmallString.h
|
||||
@@ -15,8 +15,9 @@
|
||||
@@ -137,14 +136,12 @@ index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413
|
||||
std::copy(Ref.begin(), Ref.end(), this->begin() + CurrentSize);
|
||||
CurrentSize += Ref.size();
|
||||
}
|
||||
@@ -89,26 +90,30 @@ public:
|
||||
@@ -89,26 +90,28 @@ public:
|
||||
|
||||
/// Check for string equality. This is more efficient than compare() when
|
||||
/// the relative ordering of inequal strings isn't needed.
|
||||
- [[nodiscard]] bool equals(StringRef RHS) const { return str().equals(RHS); }
|
||||
+ [[nodiscard]] bool equals(std::string_view RHS) const {
|
||||
+ return str().equals(RHS);
|
||||
+ }
|
||||
- [[nodiscard]] bool equals(StringRef RHS) const { return str() == RHS; }
|
||||
+ [[nodiscard]] bool equals(std::string_view RHS) const { return str() == RHS; }
|
||||
|
||||
/// Check for string equality, ignoring case.
|
||||
- [[nodiscard]] bool equals_insensitive(StringRef RHS) const {
|
||||
@@ -173,7 +170,7 @@ index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413
|
||||
return str().compare_numeric(RHS);
|
||||
}
|
||||
|
||||
@@ -116,14 +121,14 @@ public:
|
||||
@@ -116,14 +119,14 @@ public:
|
||||
/// @name String Predicates
|
||||
/// @{
|
||||
|
||||
@@ -194,7 +191,7 @@ index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413
|
||||
}
|
||||
|
||||
/// @}
|
||||
@@ -142,7 +147,7 @@ public:
|
||||
@@ -142,7 +145,7 @@ public:
|
||||
///
|
||||
/// \returns The index of the first occurrence of \p Str, or npos if not
|
||||
/// found.
|
||||
@@ -203,7 +200,7 @@ index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413
|
||||
return str().find(Str, From);
|
||||
}
|
||||
|
||||
@@ -150,7 +155,8 @@ public:
|
||||
@@ -150,7 +153,8 @@ public:
|
||||
///
|
||||
/// \returns The index of the last occurrence of \p C, or npos if not
|
||||
/// found.
|
||||
@@ -213,7 +210,7 @@ index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413
|
||||
return str().rfind(C, From);
|
||||
}
|
||||
|
||||
@@ -158,7 +164,9 @@ public:
|
||||
@@ -158,7 +162,9 @@ public:
|
||||
///
|
||||
/// \returns The index of the last occurrence of \p Str, or npos if not
|
||||
/// found.
|
||||
@@ -224,7 +221,7 @@ index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413
|
||||
|
||||
/// Find the first character in the string that is \p C, or npos if not
|
||||
/// found. Same as find.
|
||||
@@ -170,7 +178,8 @@ public:
|
||||
@@ -170,7 +176,8 @@ public:
|
||||
/// not found.
|
||||
///
|
||||
/// Complexity: O(size() + Chars.size())
|
||||
@@ -234,7 +231,7 @@ index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413
|
||||
return str().find_first_of(Chars, From);
|
||||
}
|
||||
|
||||
@@ -184,15 +193,15 @@ public:
|
||||
@@ -184,15 +191,15 @@ public:
|
||||
/// \p Chars, or npos if not found.
|
||||
///
|
||||
/// Complexity: O(size() + Chars.size())
|
||||
@@ -253,7 +250,7 @@ index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413
|
||||
return str().find_last_of(C, From);
|
||||
}
|
||||
|
||||
@@ -200,8 +209,8 @@ public:
|
||||
@@ -200,8 +207,8 @@ public:
|
||||
/// found.
|
||||
///
|
||||
/// Complexity: O(size() + Chars.size())
|
||||
@@ -264,7 +261,7 @@ index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413
|
||||
return str().find_last_of(Chars, From);
|
||||
}
|
||||
|
||||
@@ -214,7 +223,9 @@ public:
|
||||
@@ -214,7 +221,9 @@ public:
|
||||
|
||||
/// Return the number of non-overlapped occurrences of \p Str in the
|
||||
/// string.
|
||||
@@ -275,7 +272,7 @@ index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413
|
||||
|
||||
/// @}
|
||||
/// @name Substring Operations
|
||||
@@ -229,8 +240,8 @@ public:
|
||||
@@ -229,8 +238,8 @@ public:
|
||||
/// \param N The number of characters to included in the substring. If \p N
|
||||
/// exceeds the number of characters remaining in the string, the string
|
||||
/// suffix (starting with \p Start) will be returned.
|
||||
@@ -286,7 +283,7 @@ index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413
|
||||
return str().substr(Start, N);
|
||||
}
|
||||
|
||||
@@ -244,15 +255,15 @@ public:
|
||||
@@ -244,15 +253,15 @@ public:
|
||||
/// substring. If this is npos, or less than \p Start, or exceeds the
|
||||
/// number of characters remaining in the string, the string suffix
|
||||
/// (starting with \p Start) will be returned.
|
||||
@@ -306,7 +303,7 @@ index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413
|
||||
}
|
||||
|
||||
// TODO: Make this const, if it's safe...
|
||||
@@ -262,20 +273,20 @@ public:
|
||||
@@ -262,20 +271,20 @@ public:
|
||||
return this->data();
|
||||
}
|
||||
|
||||
@@ -332,10 +329,10 @@ index a5b9eec50c8257348743f1e32ebd9a9dabd53b25..45fbf13a43a081731186b0f41c553413
|
||||
return *this;
|
||||
}
|
||||
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
|
||||
index 09676d792dfebd88e5c8eace666b3ab0044a962e..c96fd0e4956ee6d586f85dc79623de137e781ce0 100644
|
||||
index 17444147b102a9636fe4f0f48cfb647aaaf3ed6b..94d8da059f4f8bad50039b0d0b7993396707829c 100644
|
||||
--- a/llvm/include/llvm/ADT/SmallVector.h
|
||||
+++ b/llvm/include/llvm/ADT/SmallVector.h
|
||||
@@ -27,13 +27,12 @@
|
||||
@@ -28,13 +28,12 @@
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <new>
|
||||
@@ -350,7 +347,7 @@ index 09676d792dfebd88e5c8eace666b3ab0044a962e..c96fd0e4956ee6d586f85dc79623de13
|
||||
template <typename IteratorT> class iterator_range;
|
||||
|
||||
template <class Iterator>
|
||||
@@ -127,7 +126,7 @@ template <class T, typename = void> struct SmallVectorAlignmentAndSize {
|
||||
@@ -128,7 +127,7 @@ template <class T, typename = void> struct SmallVectorAlignmentAndSize {
|
||||
};
|
||||
|
||||
/// This is the part of SmallVectorTemplateBase which does not depend on whether
|
||||
@@ -359,7 +356,7 @@ index 09676d792dfebd88e5c8eace666b3ab0044a962e..c96fd0e4956ee6d586f85dc79623de13
|
||||
/// to avoid unnecessarily requiring T to be complete.
|
||||
template <typename T, typename = void>
|
||||
class SmallVectorTemplateCommon
|
||||
@@ -1242,7 +1241,7 @@ public:
|
||||
@@ -1243,7 +1242,7 @@ public:
|
||||
|
||||
template <typename U,
|
||||
typename = std::enable_if_t<std::is_convertible<U, T>::value>>
|
||||
@@ -412,10 +409,10 @@ index 71859af7c7e4a595140475daf356744f52d14d24..9c9ba7002310eba5113c14957f769702
|
||||
bool show_unit = consumeShowUnit(Style);
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
|
||||
index 8c315d255bb772d9e3c100adbd2c07b61283219b..6789f0413d8dc94cb465b6e66506b036449ee186 100644
|
||||
index d8e3794babc7449b436fa1d0bd858dab5198664b..7710bd9a08148289b5ba3b1f2dae5cccc4f26d4d 100644
|
||||
--- a/llvm/include/llvm/Support/Compiler.h
|
||||
+++ b/llvm/include/llvm/Support/Compiler.h
|
||||
@@ -319,7 +319,7 @@
|
||||
@@ -327,7 +327,7 @@
|
||||
#endif
|
||||
|
||||
/// LLVM_GSL_POINTER - Apply this to non-owning classes like
|
||||
@@ -639,7 +636,7 @@ index d3aacd14b2097b1e7e13c1003987c1fd52e0cf76..aabdb2f14668a990329b57f5454a0d7d
|
||||
|
||||
template <typename HandleTraits>
|
||||
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
|
||||
index 42663a9adf2e51ae36209faf7d465094adbf0943..9345348d9ba555022b31f94299684316ffa15939 100644
|
||||
index df9ee2e5a78586d2a2e0eb6e0698953169f7bc58..18bdf4b7d3b96d42d93ca1e4800233b34be42a78 100644
|
||||
--- a/llvm/include/llvm/Support/raw_ostream.h
|
||||
+++ b/llvm/include/llvm/Support/raw_ostream.h
|
||||
@@ -14,13 +14,12 @@
|
||||
@@ -657,7 +654,7 @@ index 42663a9adf2e51ae36209faf7d465094adbf0943..9345348d9ba555022b31f94299684316
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <system_error>
|
||||
@@ -208,7 +207,22 @@ public:
|
||||
@@ -221,7 +220,22 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -681,7 +678,7 @@ index 42663a9adf2e51ae36209faf7d465094adbf0943..9345348d9ba555022b31f94299684316
|
||||
// Inline fast path, particularly for strings with a known length.
|
||||
size_t Size = Str.size();
|
||||
|
||||
@@ -241,7 +255,7 @@ public:
|
||||
@@ -254,7 +268,7 @@ public:
|
||||
// Inline fast path, particularly for constant strings where a sufficiently
|
||||
// smart compiler will simplify strlen.
|
||||
|
||||
@@ -690,7 +687,7 @@ index 42663a9adf2e51ae36209faf7d465094adbf0943..9345348d9ba555022b31f94299684316
|
||||
}
|
||||
|
||||
raw_ostream &operator<<(const std::string &Str) {
|
||||
@@ -249,10 +263,6 @@ public:
|
||||
@@ -262,10 +276,6 @@ public:
|
||||
return write(Str.data(), Str.length());
|
||||
}
|
||||
|
||||
@@ -701,7 +698,7 @@ index 42663a9adf2e51ae36209faf7d465094adbf0943..9345348d9ba555022b31f94299684316
|
||||
raw_ostream &operator<<(const SmallVectorImpl<char> &Str) {
|
||||
return write(Str.data(), Str.size());
|
||||
}
|
||||
@@ -285,7 +295,7 @@ public:
|
||||
@@ -298,7 +308,7 @@ public:
|
||||
|
||||
/// Output \p Str, turning '\\', '\t', '\n', '"', and anything that doesn't
|
||||
/// satisfy llvm::isPrint into an escape sequence.
|
||||
@@ -710,7 +707,7 @@ index 42663a9adf2e51ae36209faf7d465094adbf0943..9345348d9ba555022b31f94299684316
|
||||
|
||||
raw_ostream &write(unsigned char C);
|
||||
raw_ostream &write(const char *Ptr, size_t Size);
|
||||
@@ -501,14 +511,14 @@ public:
|
||||
@@ -511,14 +521,14 @@ public:
|
||||
/// As a special case, if Filename is "-", then the stream will use
|
||||
/// STDOUT_FILENO instead of opening a file. This will not close the stdout
|
||||
/// descriptor.
|
||||
@@ -730,7 +727,7 @@ index 42663a9adf2e51ae36209faf7d465094adbf0943..9345348d9ba555022b31f94299684316
|
||||
sys::fs::CreationDisposition Disp, sys::fs::FileAccess Access,
|
||||
sys::fs::OpenFlags Flags);
|
||||
|
||||
@@ -613,7 +623,7 @@ public:
|
||||
@@ -630,7 +640,7 @@ public:
|
||||
/// Open the specified file for reading/writing/seeking. If an error occurs,
|
||||
/// information about the error is put into EC, and the stream should be
|
||||
/// immediately destroyed.
|
||||
@@ -739,7 +736,7 @@ index 42663a9adf2e51ae36209faf7d465094adbf0943..9345348d9ba555022b31f94299684316
|
||||
|
||||
raw_fd_stream(int fd, bool shouldClose);
|
||||
|
||||
@@ -695,8 +705,8 @@ public:
|
||||
@@ -716,8 +726,8 @@ public:
|
||||
|
||||
void flush() = delete;
|
||||
|
||||
@@ -747,10 +744,10 @@ index 42663a9adf2e51ae36209faf7d465094adbf0943..9345348d9ba555022b31f94299684316
|
||||
- StringRef str() const { return StringRef(OS.data(), OS.size()); }
|
||||
+ /// Return a std::string_view for the vector contents.
|
||||
+ std::string_view str() const { return std::string_view(OS.data(), OS.size()); }
|
||||
SmallVectorImpl<char> &buffer() { return OS; }
|
||||
|
||||
void reserveExtraSpace(uint64_t ExtraSize) override {
|
||||
OS.reserve(tell() + ExtraSize);
|
||||
@@ -753,7 +763,7 @@ class Error;
|
||||
@@ -777,7 +787,7 @@ class Error;
|
||||
/// for other names. For raw_fd_ostream instances, the stream writes to
|
||||
/// a temporary file. The final output file is atomically replaced with the
|
||||
/// temporary file after the \p Write function is finished.
|
||||
@@ -760,10 +757,10 @@ index 42663a9adf2e51ae36209faf7d465094adbf0943..9345348d9ba555022b31f94299684316
|
||||
|
||||
raw_ostream &operator<<(raw_ostream &OS, std::nullopt_t);
|
||||
diff --git a/llvm/include/llvm/Support/xxhash.h b/llvm/include/llvm/Support/xxhash.h
|
||||
index 0cef3a54e50d70177a7401324f7a4daca83c6599..3e19ebabb7ad0ff437220d9fdfe59a313386762a 100644
|
||||
index 5f8a7ab360abe24e86286b2bd6b83df7ca5fa7d3..5267e22a45f6c0c6e3bc9ca1966ed9842772918e 100644
|
||||
--- a/llvm/include/llvm/Support/xxhash.h
|
||||
+++ b/llvm/include/llvm/Support/xxhash.h
|
||||
@@ -38,16 +38,18 @@
|
||||
@@ -38,17 +38,19 @@
|
||||
#ifndef LLVM_SUPPORT_XXHASH_H
|
||||
#define LLVM_SUPPORT_XXHASH_H
|
||||
|
||||
@@ -775,6 +772,7 @@ index 0cef3a54e50d70177a7401324f7a4daca83c6599..3e19ebabb7ad0ff437220d9fdfe59a31
|
||||
+#include <string_view>
|
||||
|
||||
namespace llvm {
|
||||
|
||||
-uint64_t xxHash64(llvm::StringRef Data);
|
||||
-uint64_t xxHash64(llvm::ArrayRef<uint8_t> Data);
|
||||
+uint64_t xxHash64(std::string_view Data);
|
||||
@@ -787,7 +785,16 @@ index 0cef3a54e50d70177a7401324f7a4daca83c6599..3e19ebabb7ad0ff437220d9fdfe59a31
|
||||
+inline uint64_t xxh3_64bits(std::string_view data) {
|
||||
+ return xxh3_64bits(span(reinterpret_cast<const uint8_t*>(data.data()), data.size()));
|
||||
}
|
||||
}
|
||||
|
||||
/*-**********************************************************************
|
||||
@@ -72,7 +74,7 @@ struct XXH128_hash_t {
|
||||
};
|
||||
|
||||
/// XXH3's 128-bit variant.
|
||||
-XXH128_hash_t xxh3_128bits(ArrayRef<uint8_t> data);
|
||||
+XXH128_hash_t xxh3_128bits(span<const uint8_t> data);
|
||||
|
||||
} // namespace llvm
|
||||
|
||||
diff --git a/llvm/lib/Support/ConvertUTFWrapper.cpp b/llvm/lib/Support/ConvertUTFWrapper.cpp
|
||||
index 3fa7365e72d34a5db941d1cbe2b1beebad5c10e6..d53462e742e61d3476915d5b2c5aa63772e78a8a 100644
|
||||
@@ -922,7 +929,7 @@ index 3fa7365e72d34a5db941d1cbe2b1beebad5c10e6..d53462e742e61d3476915d5b2c5aa637
|
||||
Result);
|
||||
} else if (sizeof(wchar_t) == 4) {
|
||||
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
|
||||
index b8b3b7424ac6b1de782e739782f9671194ce77a1..0aa13a0f78eb370b2a673ca4a773f26820575052 100644
|
||||
index cb42e28c04a86dd60deae6fdb0b87850c1bf3727..561509e0efdf15f6e534f0621a5964d92511114c 100644
|
||||
--- a/llvm/lib/Support/ErrorHandling.cpp
|
||||
+++ b/llvm/lib/Support/ErrorHandling.cpp
|
||||
@@ -14,7 +14,6 @@
|
||||
@@ -1001,7 +1008,7 @@ index b6ce37842040b36fc79770ca0296255f2bb42a1a..4f6fee18b659adcbfd79822832f91417
|
||||
}
|
||||
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index 3d3a564af51d120786b358b96a3c90e2b7fbf9f3..220d850b9bc69f8fc2fba7cd23629eca487cde23 100644
|
||||
index 2ce54faa9857e68d9c7de4ad28f6cfa5bae86908..2dbb0674406e1860fdd0c266df64003e45b12fa3 100644
|
||||
--- a/llvm/lib/Support/raw_ostream.cpp
|
||||
+++ b/llvm/lib/Support/raw_ostream.cpp
|
||||
@@ -167,7 +167,7 @@ raw_ostream &raw_ostream::write_uuid(const uuid_t UUID) {
|
||||
@@ -1013,7 +1020,7 @@ index 3d3a564af51d120786b358b96a3c90e2b7fbf9f3..220d850b9bc69f8fc2fba7cd23629eca
|
||||
bool UseHexEscapes) {
|
||||
for (unsigned char c : Str) {
|
||||
switch (c) {
|
||||
@@ -570,7 +570,7 @@ void format_object_base::home() {
|
||||
@@ -564,7 +564,7 @@ void format_object_base::home() {
|
||||
// raw_fd_ostream
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -1022,7 +1029,7 @@ index 3d3a564af51d120786b358b96a3c90e2b7fbf9f3..220d850b9bc69f8fc2fba7cd23629eca
|
||||
sys::fs::CreationDisposition Disp, sys::fs::FileAccess Access,
|
||||
sys::fs::OpenFlags Flags) {
|
||||
assert((Access & sys::fs::FA_Write) &&
|
||||
@@ -596,25 +596,25 @@ static int getFD(StringRef Filename, std::error_code &EC,
|
||||
@@ -590,25 +590,25 @@ static int getFD(StringRef Filename, std::error_code &EC,
|
||||
return FD;
|
||||
}
|
||||
|
||||
@@ -1053,7 +1060,7 @@ index 3d3a564af51d120786b358b96a3c90e2b7fbf9f3..220d850b9bc69f8fc2fba7cd23629eca
|
||||
sys::fs::CreationDisposition Disp,
|
||||
sys::fs::FileAccess Access,
|
||||
sys::fs::OpenFlags Flags)
|
||||
@@ -686,8 +686,7 @@ raw_fd_ostream::~raw_fd_ostream() {
|
||||
@@ -680,8 +680,7 @@ raw_fd_ostream::~raw_fd_ostream() {
|
||||
// has_error() and clear the error flag with clear_error() before
|
||||
// destructing raw_ostream objects which may have errors.
|
||||
if (has_error())
|
||||
@@ -1063,7 +1070,7 @@ index 3d3a564af51d120786b358b96a3c90e2b7fbf9f3..220d850b9bc69f8fc2fba7cd23629eca
|
||||
/*gen_crash_diag=*/false);
|
||||
}
|
||||
|
||||
@@ -706,7 +705,7 @@ raw_fd_ostream::~raw_fd_ostream() {
|
||||
@@ -700,7 +699,7 @@ raw_fd_ostream::~raw_fd_ostream() {
|
||||
// the input is UTF-8 or transcode from the local codepage to UTF-8 before
|
||||
// quoting it. If they don't, this may mess up the encoding, but this is still
|
||||
// probably the best compromise we can make.
|
||||
@@ -1072,7 +1079,7 @@ index 3d3a564af51d120786b358b96a3c90e2b7fbf9f3..220d850b9bc69f8fc2fba7cd23629eca
|
||||
SmallVector<wchar_t, 256> WideText;
|
||||
|
||||
// Fall back to ::write if it wasn't valid UTF-8.
|
||||
@@ -749,7 +748,7 @@ void raw_fd_ostream::write_impl(const char *Ptr, size_t Size) {
|
||||
@@ -746,7 +745,7 @@ void raw_fd_ostream::write_impl(const char *Ptr, size_t Size) {
|
||||
// If this is a Windows console device, try re-encoding from UTF-8 to UTF-16
|
||||
// and using WriteConsoleW. If that fails, fall back to plain write().
|
||||
if (IsWindowsConsole)
|
||||
@@ -1081,7 +1088,7 @@ index 3d3a564af51d120786b358b96a3c90e2b7fbf9f3..220d850b9bc69f8fc2fba7cd23629eca
|
||||
return;
|
||||
#endif
|
||||
|
||||
@@ -925,7 +924,7 @@ raw_ostream &llvm::nulls() {
|
||||
@@ -922,7 +921,7 @@ raw_ostream &llvm::nulls() {
|
||||
// File Streams
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -1090,7 +1097,7 @@ index 3d3a564af51d120786b358b96a3c90e2b7fbf9f3..220d850b9bc69f8fc2fba7cd23629eca
|
||||
: raw_fd_ostream(getFD(Filename, EC, sys::fs::CD_CreateAlways,
|
||||
sys::fs::FA_Write | sys::fs::FA_Read,
|
||||
sys::fs::OF_None),
|
||||
@@ -998,7 +997,7 @@ void buffer_ostream::anchor() {}
|
||||
@@ -1007,7 +1006,7 @@ void buffer_ostream::anchor() {}
|
||||
|
||||
void buffer_unique_ostream::anchor() {}
|
||||
|
||||
@@ -1100,10 +1107,10 @@ index 3d3a564af51d120786b358b96a3c90e2b7fbf9f3..220d850b9bc69f8fc2fba7cd23629eca
|
||||
if (OutputFileName == "-")
|
||||
return Write(outs());
|
||||
diff --git a/llvm/lib/Support/xxhash.cpp b/llvm/lib/Support/xxhash.cpp
|
||||
index 577f14189caff7d74377f7b28d8332deef4c62c4..b9c15e885a1751eaca43317323bd7a85fa201073 100644
|
||||
index cdb76d57e2c1df67e07c39f5e59284ab0ce07984..2496050eef7349ad82b54ffa6fb6bff8278c8364 100644
|
||||
--- a/llvm/lib/Support/xxhash.cpp
|
||||
+++ b/llvm/lib/Support/xxhash.cpp
|
||||
@@ -84,11 +84,11 @@ static uint64_t XXH64_avalanche(uint64_t hash) {
|
||||
@@ -100,11 +100,11 @@ static uint64_t XXH64_avalanche(uint64_t hash) {
|
||||
return hash;
|
||||
}
|
||||
|
||||
@@ -1118,7 +1125,7 @@ index 577f14189caff7d74377f7b28d8332deef4c62c4..b9c15e885a1751eaca43317323bd7a85
|
||||
uint64_t H64;
|
||||
|
||||
if (Len >= 32) {
|
||||
@@ -144,7 +144,7 @@ uint64_t llvm::xxHash64(StringRef Data) {
|
||||
@@ -160,7 +160,7 @@ uint64_t llvm::xxHash64(StringRef Data) {
|
||||
return XXH64_avalanche(H64);
|
||||
}
|
||||
|
||||
@@ -1127,7 +1134,7 @@ index 577f14189caff7d74377f7b28d8332deef4c62c4..b9c15e885a1751eaca43317323bd7a85
|
||||
return xxHash64({(const char *)Data.data(), Data.size()});
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ static uint64_t XXH3_hashLong_64b(const uint8_t *input, size_t len,
|
||||
@@ -550,7 +550,7 @@ static uint64_t XXH3_hashLong_64b(const uint8_t *input, size_t len,
|
||||
(uint64_t)len * PRIME64_1);
|
||||
}
|
||||
|
||||
@@ -1136,12 +1143,21 @@ index 577f14189caff7d74377f7b28d8332deef4c62c4..b9c15e885a1751eaca43317323bd7a85
|
||||
auto *in = data.data();
|
||||
size_t len = data.size();
|
||||
if (len <= 16)
|
||||
@@ -1020,7 +1020,7 @@ XXH3_hashLong_128b(const uint8_t *input, size_t len, const uint8_t *secret,
|
||||
return h128;
|
||||
}
|
||||
|
||||
-llvm::XXH128_hash_t llvm::xxh3_128bits(ArrayRef<uint8_t> data) {
|
||||
+llvm::XXH128_hash_t llvm::xxh3_128bits(span<const uint8_t> data) {
|
||||
size_t len = data.size();
|
||||
const uint8_t *input = data.data();
|
||||
|
||||
diff --git a/llvm/unittests/ADT/DenseMapTest.cpp b/llvm/unittests/ADT/DenseMapTest.cpp
|
||||
index cc3244528f27e2bd7eaa385d8b7f49b2fbb7a3e6..b710ac07461ba58faa99cedeae7f209dc0f5902b 100644
|
||||
index d1bbdde8dfc267770b9d98808de54381571f2785..e93e18423507655ce8275a0718d8e5d01915985f 100644
|
||||
--- a/llvm/unittests/ADT/DenseMapTest.cpp
|
||||
+++ b/llvm/unittests/ADT/DenseMapTest.cpp
|
||||
@@ -9,11 +9,11 @@
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
@@ -10,11 +10,11 @@
|
||||
#include "CountCopyAndMove.h"
|
||||
#include "llvm/ADT/DenseMapInfo.h"
|
||||
#include "llvm/ADT/DenseMapInfoVariant.h"
|
||||
-#include "llvm/ADT/StringRef.h"
|
||||
@@ -1153,8 +1169,8 @@ index cc3244528f27e2bd7eaa385d8b7f49b2fbb7a3e6..b710ac07461ba58faa99cedeae7f209d
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
|
||||
@@ -499,31 +499,6 @@ TEST(DenseMapCustomTest, ReserveTest) {
|
||||
}
|
||||
@@ -523,31 +523,6 @@ TEST(DenseMapCustomTest, InsertOrAssignTest) {
|
||||
EXPECT_EQ(1, CountCopyAndMove::MoveAssignments);
|
||||
}
|
||||
|
||||
-// Make sure DenseMap works with StringRef keys.
|
||||
@@ -1185,7 +1201,7 @@ index cc3244528f27e2bd7eaa385d8b7f49b2fbb7a3e6..b710ac07461ba58faa99cedeae7f209d
|
||||
// Key traits that allows lookup with either an unsigned or char* key;
|
||||
// In the latter case, "a" == 0, "b" == 1 and so on.
|
||||
struct TestDenseMapInfo {
|
||||
@@ -761,7 +736,7 @@ TEST(DenseMapCustomTest, VariantSupport) {
|
||||
@@ -785,7 +760,7 @@ TEST(DenseMapCustomTest, VariantSupport) {
|
||||
// Test that gTest prints map entries as pairs instead of opaque objects.
|
||||
// See third-party/unittest/googletest/internal/custom/gtest-printers.h
|
||||
TEST(DenseMapCustomTest, PairPrinting) {
|
||||
@@ -1228,21 +1244,8 @@ index fc856a976946bf6decda9b6724cac66afc7bdcd6..aff9d61c7f0d48834123b04b74a2e4f7
|
||||
|
||||
TEST(UniqueFunctionTest, SFINAE) {
|
||||
EXPECT_EQ("not a function", returns("boo!"));
|
||||
diff --git a/llvm/unittests/ADT/HashingTest.cpp b/llvm/unittests/ADT/HashingTest.cpp
|
||||
index ab13ee833ce556945fb9526fd13d8bd5f3e5c95a..3e80467ebd0efddcf2cbbe003bb91f1475ca9cb3 100644
|
||||
--- a/llvm/unittests/ADT/HashingTest.cpp
|
||||
+++ b/llvm/unittests/ADT/HashingTest.cpp
|
||||
@@ -295,7 +295,7 @@ TEST(HashingTest, HashCombineRangeGoldenTest) {
|
||||
#endif
|
||||
};
|
||||
for (unsigned i = 0; i < sizeof(golden_data)/sizeof(*golden_data); ++i) {
|
||||
- StringRef str = golden_data[i].s;
|
||||
+ std::string_view str = golden_data[i].s;
|
||||
hash_code hash = hash_combine_range(str.begin(), str.end());
|
||||
#if 0 // Enable this to generate paste-able text for the above structure.
|
||||
std::string member_str = "\"" + str.str() + "\",";
|
||||
diff --git a/llvm/unittests/ADT/SmallPtrSetTest.cpp b/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
index a97f2617cbf70783f3569709f7ee1bff03baebd2..7ed8670fd31ea2a14e6ba7f59a8ac8e35046890c 100644
|
||||
index b45318d076a3d846b7810ce8cdaed7d2d97eca87..a39b11b9f82156a78b9ad7ce7b8c28855829e611 100644
|
||||
--- a/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
+++ b/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
@@ -12,7 +12,6 @@
|
||||
@@ -1621,11 +1624,11 @@ index 6e75fbae0969ba1bf0a76c4d79a123e405a8dae7..3b07d344f15a555f11ad5f8177a0a65b
|
||||
// Overlong sequences of the above.
|
||||
EXPECT_TRUE(CheckConvertUTF8ToUnicodeScalars(
|
||||
diff --git a/llvm/unittests/Support/xxhashTest.cpp b/llvm/unittests/Support/xxhashTest.cpp
|
||||
index 7d78de6772b5159459572fe11633c76d04b86907..d61a5acd21f4d685ca631d3adb20c2649e050bc3 100644
|
||||
index 84308ce130e72818b553ea4185e8542d13182b3c..ef9a43690974ba586acc681e9f8ac49d4661031e 100644
|
||||
--- a/llvm/unittests/Support/xxhashTest.cpp
|
||||
+++ b/llvm/unittests/Support/xxhashTest.cpp
|
||||
@@ -12,7 +12,7 @@
|
||||
using namespace llvm;
|
||||
@@ -32,7 +32,7 @@ static void fillTestBuffer(uint8_t *buffer, size_t len) {
|
||||
}
|
||||
|
||||
TEST(xxhashTest, Basic) {
|
||||
- EXPECT_EQ(0xef46db3751d8e999U, xxHash64(StringRef()));
|
||||
@@ -1633,7 +1636,7 @@ index 7d78de6772b5159459572fe11633c76d04b86907..d61a5acd21f4d685ca631d3adb20c264
|
||||
EXPECT_EQ(0x33bf00a859c4ba3fU, xxHash64("foo"));
|
||||
EXPECT_EQ(0x48a37c90ad27a659U, xxHash64("bar"));
|
||||
EXPECT_EQ(0x69196c1b3af0bff9U,
|
||||
@@ -31,7 +31,7 @@ TEST(xxhashTest, xxh3) {
|
||||
@@ -51,7 +51,7 @@ TEST(xxhashTest, xxh3) {
|
||||
}
|
||||
|
||||
#define F(len, expected) \
|
||||
@@ -1642,3 +1645,12 @@ index 7d78de6772b5159459572fe11633c76d04b86907..d61a5acd21f4d685ca631d3adb20c264
|
||||
F(0, 0x2d06800538d394c2);
|
||||
F(1, 0xd0d496e05c553485);
|
||||
F(2, 0x84d625edb7055eac);
|
||||
@@ -90,7 +90,7 @@ TEST(xxhashTest, xxh3_128bits) {
|
||||
|
||||
#define F(len, expected) \
|
||||
EXPECT_EQ(XXH128_hash_t(expected), \
|
||||
- xxh3_128bits(ArrayRef(sanityBuffer, size_t(len))))
|
||||
+ xxh3_128bits(span(sanityBuffer, size_t(len))))
|
||||
|
||||
F(0, (XXH128_hash_t{0x6001C324468D497FULL,
|
||||
0x99AA06D3014798D8ULL})); /* empty string */
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 22:12:41 -0400
|
||||
Subject: [PATCH 02/36] Wrap std::min/max calls in parens, for Windows warnings
|
||||
Subject: [PATCH 02/37] Wrap std::min/max calls in parens, for Windows warnings
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/DenseMap.h | 4 ++--
|
||||
llvm/include/llvm/ADT/SmallVector.h | 6 +++---
|
||||
llvm/include/llvm/Support/ConvertUTF.h | 2 +-
|
||||
llvm/include/llvm/Support/MathExtras.h | 18 +++++++++---------
|
||||
4 files changed, 15 insertions(+), 15 deletions(-)
|
||||
llvm/include/llvm/Support/MathExtras.h | 20 ++++++++++----------
|
||||
4 files changed, 16 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
|
||||
index 3ef6a7cd1b4b587e61fcb9475d9f3516018bf2ee..108193f04486425f3b7f039cd9d2004be6facafb 100644
|
||||
index 7ccc9445c0a7b882b424b2431858ea596d0eb58f..c4764fffa845a7f9eb69f262aa0ee728d08b1655 100644
|
||||
--- a/llvm/include/llvm/ADT/DenseMap.h
|
||||
+++ b/llvm/include/llvm/ADT/DenseMap.h
|
||||
@@ -416,7 +416,7 @@ protected:
|
||||
@@ -432,7 +432,7 @@ protected:
|
||||
return 0;
|
||||
// +1 is required because of the strict equality.
|
||||
// For example if NumEntries is 48, we need to return 401.
|
||||
@@ -23,7 +23,7 @@ index 3ef6a7cd1b4b587e61fcb9475d9f3516018bf2ee..108193f04486425f3b7f039cd9d2004b
|
||||
}
|
||||
|
||||
void moveFromOldBuckets(BucketT *OldBucketsBegin, BucketT *OldBucketsEnd) {
|
||||
@@ -852,7 +852,7 @@ public:
|
||||
@@ -868,7 +868,7 @@ public:
|
||||
// Reduce the number of buckets.
|
||||
unsigned NewNumBuckets = 0;
|
||||
if (OldNumEntries)
|
||||
@@ -33,10 +33,10 @@ index 3ef6a7cd1b4b587e61fcb9475d9f3516018bf2ee..108193f04486425f3b7f039cd9d2004b
|
||||
this->BaseT::initEmpty();
|
||||
return;
|
||||
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
|
||||
index c96fd0e4956ee6d586f85dc79623de137e781ce0..d7600fe209a58deb07c63e2553f9dad62e06e973 100644
|
||||
index 94d8da059f4f8bad50039b0d0b7993396707829c..85bf5172e419b1b58f53d3cf00d4aabb58877c33 100644
|
||||
--- a/llvm/include/llvm/ADT/SmallVector.h
|
||||
+++ b/llvm/include/llvm/ADT/SmallVector.h
|
||||
@@ -55,7 +55,7 @@ protected:
|
||||
@@ -56,7 +56,7 @@ protected:
|
||||
|
||||
/// The maximum value of the Size_T used.
|
||||
static constexpr size_t SizeTypeMax() {
|
||||
@@ -45,7 +45,7 @@ index c96fd0e4956ee6d586f85dc79623de137e781ce0..d7600fe209a58deb07c63e2553f9dad6
|
||||
}
|
||||
|
||||
SmallVectorBase() = delete;
|
||||
@@ -289,7 +289,7 @@ public:
|
||||
@@ -290,7 +290,7 @@ public:
|
||||
|
||||
size_type size_in_bytes() const { return size() * sizeof(T); }
|
||||
size_type max_size() const {
|
||||
@@ -54,7 +54,7 @@ index c96fd0e4956ee6d586f85dc79623de137e781ce0..d7600fe209a58deb07c63e2553f9dad6
|
||||
}
|
||||
|
||||
size_t capacity_in_bytes() const { return capacity() * sizeof(T); }
|
||||
@@ -721,7 +721,7 @@ public:
|
||||
@@ -722,7 +722,7 @@ public:
|
||||
}
|
||||
|
||||
// Assign over existing elements.
|
||||
@@ -77,10 +77,10 @@ index 5c0e3009c25446a34882fb98329b1d955231bb39..72321022beb373945f7935ed72944fd6
|
||||
/* Some fundamental constants */
|
||||
#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
|
||||
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
|
||||
index aa4f4d2ed42e262f27e3f7f5ce275baf7e556c2d..5cabfdd6493fee33fbc74b831dc1fa3c91ba725d 100644
|
||||
index e568e42afcf4d20dba137346953ff4be9d27ffc7..d9de2e92d5b07bce1d02ffcfda614b9079d2df91 100644
|
||||
--- a/llvm/include/llvm/Support/MathExtras.h
|
||||
+++ b/llvm/include/llvm/Support/MathExtras.h
|
||||
@@ -311,26 +311,26 @@ template <> constexpr inline size_t CTLog2<1>() { return 0; }
|
||||
@@ -338,26 +338,26 @@ template <> constexpr size_t CTLog2<1>() { return 0; }
|
||||
/// (32 bit edition.)
|
||||
/// Ex. Log2_32(32) == 5, Log2_32(1) == 0, Log2_32(0) == -1, Log2_32(6) == 2
|
||||
inline unsigned Log2_32(uint32_t Value) {
|
||||
@@ -111,7 +111,16 @@ index aa4f4d2ed42e262f27e3f7f5ce275baf7e556c2d..5cabfdd6493fee33fbc74b831dc1fa3c
|
||||
}
|
||||
|
||||
/// A and B are either alignments or offsets. Return the minimum alignment that
|
||||
@@ -482,7 +482,7 @@ SaturatingAdd(T X, T Y, bool *ResultOverflowed = nullptr) {
|
||||
@@ -417,7 +417,7 @@ constexpr uint64_t divideCeil(uint64_t Numerator, uint64_t Denominator) {
|
||||
// happens only when Numerator = INT_MIN and Denominator = -1.
|
||||
template <typename U, typename V>
|
||||
constexpr bool divideSignedWouldOverflow(U Numerator, V Denominator) {
|
||||
- return Numerator == std::numeric_limits<U>::min() && Denominator == -1;
|
||||
+ return Numerator == (std::numeric_limits<U>::min)() && Denominator == -1;
|
||||
}
|
||||
|
||||
/// Returns the integer ceil(Numerator / Denominator). Signed version.
|
||||
@@ -605,7 +605,7 @@ SaturatingAdd(T X, T Y, bool *ResultOverflowed = nullptr) {
|
||||
T Z = X + Y;
|
||||
Overflowed = (Z < X || Z < Y);
|
||||
if (Overflowed)
|
||||
@@ -120,7 +129,7 @@ index aa4f4d2ed42e262f27e3f7f5ce275baf7e556c2d..5cabfdd6493fee33fbc74b831dc1fa3c
|
||||
else
|
||||
return Z;
|
||||
}
|
||||
@@ -495,7 +495,7 @@ std::enable_if_t<std::is_unsigned_v<T>, T> SaturatingAdd(T X, T Y, T Z,
|
||||
@@ -618,7 +618,7 @@ std::enable_if_t<std::is_unsigned_v<T>, T> SaturatingAdd(T X, T Y, T Z,
|
||||
bool Overflowed = false;
|
||||
T XY = SaturatingAdd(X, Y, &Overflowed);
|
||||
if (Overflowed)
|
||||
@@ -129,7 +138,7 @@ index aa4f4d2ed42e262f27e3f7f5ce275baf7e556c2d..5cabfdd6493fee33fbc74b831dc1fa3c
|
||||
return SaturatingAdd(XY, Z, Args...);
|
||||
}
|
||||
|
||||
@@ -519,7 +519,7 @@ SaturatingMultiply(T X, T Y, bool *ResultOverflowed = nullptr) {
|
||||
@@ -642,7 +642,7 @@ SaturatingMultiply(T X, T Y, bool *ResultOverflowed = nullptr) {
|
||||
// Special case: if X or Y is 0, Log2_64 gives -1, and Log2Z
|
||||
// will necessarily be less than Log2Max as desired.
|
||||
int Log2Z = Log2_64(X) + Log2_64(Y);
|
||||
@@ -138,7 +147,7 @@ index aa4f4d2ed42e262f27e3f7f5ce275baf7e556c2d..5cabfdd6493fee33fbc74b831dc1fa3c
|
||||
int Log2Max = Log2_64(Max);
|
||||
if (Log2Z < Log2Max) {
|
||||
return X * Y;
|
||||
@@ -639,9 +639,9 @@ std::enable_if_t<std::is_signed_v<T>, T> MulOverflow(T X, T Y, T &Result) {
|
||||
@@ -764,9 +764,9 @@ std::enable_if_t<std::is_signed_v<T>, T> MulOverflow(T X, T Y, T &Result) {
|
||||
// Check how the max allowed absolute value (2^n for negative, 2^(n-1) for
|
||||
// positive) divided by an argument compares to the other.
|
||||
if (IsNegative)
|
||||
@@ -147,6 +156,6 @@ index aa4f4d2ed42e262f27e3f7f5ce275baf7e556c2d..5cabfdd6493fee33fbc74b831dc1fa3c
|
||||
else
|
||||
- return UX > (static_cast<U>(std::numeric_limits<T>::max())) / UY;
|
||||
+ return UX > (static_cast<U>((std::numeric_limits<T>::max)())) / UY;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 22:13:55 -0400
|
||||
Subject: [PATCH 03/36] Change unique_function storage size
|
||||
Subject: [PATCH 03/37] Change unique_function storage size
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/FunctionExtras.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/FunctionExtras.h b/llvm/include/llvm/ADT/FunctionExtras.h
|
||||
index c0bc30c7450fe4b2bc6b9b448824eedc8b132e52..5641a913d0a35ee2911cf872ad90c3dc864f20f5 100644
|
||||
index 49e0e8ab0db400d0a362746342099578257b2eea..3ce85530b718666afa1dafbf60699c1add423ea6 100644
|
||||
--- a/llvm/include/llvm/ADT/FunctionExtras.h
|
||||
+++ b/llvm/include/llvm/ADT/FunctionExtras.h
|
||||
@@ -79,7 +79,7 @@ using EnableIfCallable = std::enable_if_t<std::disjunction<
|
||||
@@ -28,4 +28,4 @@ index c0bc30c7450fe4b2bc6b9b448824eedc8b132e52..5641a913d0a35ee2911cf872ad90c3dc
|
||||
+ // provide four pointers worth of storage here.
|
||||
// This is mutable as an inlined `const unique_function<void() const>` may
|
||||
// still modify its own mutable members.
|
||||
mutable std::aligned_storage_t<InlineStorageSize, alignof(void *)>
|
||||
alignas(void *) mutable std::byte InlineStorage[InlineStorageSize];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 22:17:19 -0400
|
||||
Subject: [PATCH 04/36] Threading updates
|
||||
Subject: [PATCH 04/37] Threading updates
|
||||
|
||||
- Remove guards for threads and exception
|
||||
- Prefer scope gaurd over lock gaurd
|
||||
@@ -12,10 +12,10 @@ Subject: [PATCH 04/36] Threading updates
|
||||
3 files changed, 11 insertions(+), 43 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
|
||||
index 6789f0413d8dc94cb465b6e66506b036449ee186..e608f8ea3a837a04d9c29c8bb7a1fab527d512bb 100644
|
||||
index 7710bd9a08148289b5ba3b1f2dae5cccc4f26d4d..2a6accec1e74c9869d724c7733cc75ab6af9dc8d 100644
|
||||
--- a/llvm/include/llvm/Support/Compiler.h
|
||||
+++ b/llvm/include/llvm/Support/Compiler.h
|
||||
@@ -555,7 +555,6 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
@@ -563,7 +563,6 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
/// initialize to some constant value. In almost all circumstances this is most
|
||||
/// appropriate for use with a pointer, integer, or small aggregation of
|
||||
/// pointers and integers.
|
||||
@@ -23,7 +23,7 @@ index 6789f0413d8dc94cb465b6e66506b036449ee186..e608f8ea3a837a04d9c29c8bb7a1fab5
|
||||
#if __has_feature(cxx_thread_local) || defined(_MSC_VER)
|
||||
#define LLVM_THREAD_LOCAL thread_local
|
||||
#else
|
||||
@@ -563,11 +562,6 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
@@ -571,11 +570,6 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
// we only need the restricted functionality that provides.
|
||||
#define LLVM_THREAD_LOCAL __thread
|
||||
#endif
|
||||
@@ -36,7 +36,7 @@ index 6789f0413d8dc94cb465b6e66506b036449ee186..e608f8ea3a837a04d9c29c8bb7a1fab5
|
||||
/// \macro LLVM_ENABLE_EXCEPTIONS
|
||||
/// Whether LLVM is built with exception support.
|
||||
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
|
||||
index 0aa13a0f78eb370b2a673ca4a773f26820575052..637b669a7d0dae69ef4b34955f21a9fb8ba1276e 100644
|
||||
index 561509e0efdf15f6e534f0621a5964d92511114c..89829dc4faff0b2667ded462444e0eaeec53fd01 100644
|
||||
--- a/llvm/lib/Support/ErrorHandling.cpp
|
||||
+++ b/llvm/lib/Support/ErrorHandling.cpp
|
||||
@@ -44,7 +44,6 @@ static void *ErrorHandlerUserData = nullptr;
|
||||
@@ -83,7 +83,7 @@ index 0aa13a0f78eb370b2a673ca4a773f26820575052..637b669a7d0dae69ef4b34955f21a9fb
|
||||
handler = ErrorHandler;
|
||||
handlerData = ErrorHandlerUserData;
|
||||
}
|
||||
@@ -126,18 +118,14 @@ void llvm::report_fatal_error(std::string_view Reason, bool GenCrashDiag) {
|
||||
@@ -126,9 +118,7 @@ void llvm::report_fatal_error(std::string_view Reason, bool GenCrashDiag) {
|
||||
|
||||
void llvm::install_bad_alloc_error_handler(fatal_error_handler_t handler,
|
||||
void *user_data) {
|
||||
@@ -91,9 +91,10 @@ index 0aa13a0f78eb370b2a673ca4a773f26820575052..637b669a7d0dae69ef4b34955f21a9fb
|
||||
- std::lock_guard<std::mutex> Lock(BadAllocErrorHandlerMutex);
|
||||
-#endif
|
||||
+ std::scoped_lock Lock(BadAllocErrorHandlerMutex);
|
||||
assert(!ErrorHandler && "Bad alloc error handler already registered!\n");
|
||||
assert(!BadAllocErrorHandler &&
|
||||
"Bad alloc error handler already registered!\n");
|
||||
BadAllocErrorHandler = handler;
|
||||
BadAllocErrorHandlerUserData = user_data;
|
||||
@@ -136,9 +126,7 @@ void llvm::install_bad_alloc_error_handler(fatal_error_handler_t handler,
|
||||
}
|
||||
|
||||
void llvm::remove_bad_alloc_error_handler() {
|
||||
@@ -104,7 +105,7 @@ index 0aa13a0f78eb370b2a673ca4a773f26820575052..637b669a7d0dae69ef4b34955f21a9fb
|
||||
BadAllocErrorHandler = nullptr;
|
||||
BadAllocErrorHandlerUserData = nullptr;
|
||||
}
|
||||
@@ -148,9 +136,7 @@ void llvm::report_bad_alloc_error(const char *Reason, bool GenCrashDiag) {
|
||||
@@ -149,9 +137,7 @@ void llvm::report_bad_alloc_error(const char *Reason, bool GenCrashDiag) {
|
||||
{
|
||||
// Only acquire the mutex while reading the handler, so as not to invoke a
|
||||
// user-supplied callback under a lock.
|
||||
@@ -115,7 +116,7 @@ index 0aa13a0f78eb370b2a673ca4a773f26820575052..637b669a7d0dae69ef4b34955f21a9fb
|
||||
Handler = BadAllocErrorHandler;
|
||||
HandlerData = BadAllocErrorHandlerUserData;
|
||||
}
|
||||
@@ -160,10 +146,6 @@ void llvm::report_bad_alloc_error(const char *Reason, bool GenCrashDiag) {
|
||||
@@ -161,10 +147,6 @@ void llvm::report_bad_alloc_error(const char *Reason, bool GenCrashDiag) {
|
||||
llvm_unreachable("bad alloc handler should not return");
|
||||
}
|
||||
|
||||
@@ -126,7 +127,7 @@ index 0aa13a0f78eb370b2a673ca4a773f26820575052..637b669a7d0dae69ef4b34955f21a9fb
|
||||
// Don't call the normal error handler. It may allocate memory. Directly write
|
||||
// an OOM to stderr and abort.
|
||||
const char *OOMMessage = "LLVM ERROR: out of memory\n";
|
||||
@@ -172,15 +154,8 @@ void llvm::report_bad_alloc_error(const char *Reason, bool GenCrashDiag) {
|
||||
@@ -173,15 +155,8 @@ void llvm::report_bad_alloc_error(const char *Reason, bool GenCrashDiag) {
|
||||
(void)!::write(2, Reason, strlen(Reason));
|
||||
(void)!::write(2, Newline, strlen(Newline));
|
||||
abort();
|
||||
@@ -142,7 +143,7 @@ index 0aa13a0f78eb370b2a673ca4a773f26820575052..637b669a7d0dae69ef4b34955f21a9fb
|
||||
// Causes crash on allocation failure. It is called prior to the handler set by
|
||||
// 'install_bad_alloc_error_handler'.
|
||||
static void out_of_memory_new_handler() {
|
||||
@@ -195,7 +170,6 @@ void llvm::install_out_of_memory_new_handler() {
|
||||
@@ -196,7 +171,6 @@ void llvm::install_out_of_memory_new_handler() {
|
||||
assert((old == nullptr || old == out_of_memory_new_handler) &&
|
||||
"new-handler already installed");
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 22:28:13 -0400
|
||||
Subject: [PATCH 05/36] \#ifdef guard safety
|
||||
Subject: [PATCH 05/37] \#ifdef guard safety
|
||||
|
||||
Prevents redefinition if someone is pulling in real LLVM, since the macros are in global namespace
|
||||
---
|
||||
@@ -9,7 +9,7 @@ Prevents redefinition if someone is pulling in real LLVM, since the macros are i
|
||||
1 file changed, 42 insertions(+)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
|
||||
index e608f8ea3a837a04d9c29c8bb7a1fab527d512bb..8f68d79898fe0247f9e17709bf1c1ec2a451c037 100644
|
||||
index 2a6accec1e74c9869d724c7733cc75ab6af9dc8d..cb99bf5efe87d98fd73108c189182a28998bcbe9 100644
|
||||
--- a/llvm/include/llvm/Support/Compiler.h
|
||||
+++ b/llvm/include/llvm/Support/Compiler.h
|
||||
@@ -90,6 +90,7 @@
|
||||
@@ -137,19 +137,23 @@ index e608f8ea3a837a04d9c29c8bb7a1fab527d512bb..8f68d79898fe0247f9e17709bf1c1ec2
|
||||
#if __has_attribute(returns_nonnull)
|
||||
#define LLVM_ATTRIBUTE_RETURNS_NONNULL __attribute__((returns_nonnull))
|
||||
#elif defined(_MSC_VER)
|
||||
@@ -277,9 +296,11 @@
|
||||
@@ -277,6 +296,7 @@
|
||||
#else
|
||||
#define LLVM_ATTRIBUTE_RETURNS_NONNULL
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
/// LLVM_ATTRIBUTE_RESTRICT - Annotates a pointer to tell the compiler that
|
||||
/// it is not aliased in the current scope.
|
||||
@@ -288,6 +308,7 @@
|
||||
|
||||
/// \macro LLVM_ATTRIBUTE_RETURNS_NOALIAS Used to mark a function as returning a
|
||||
/// pointer that does not alias any other valid pointer.
|
||||
+#ifndef LLVM_ATTRIBUTE_RETURNS_NOALIAS
|
||||
#ifdef __GNUC__
|
||||
#define LLVM_ATTRIBUTE_RETURNS_NOALIAS __attribute__((__malloc__))
|
||||
#elif defined(_MSC_VER)
|
||||
@@ -287,8 +308,10 @@
|
||||
@@ -295,8 +316,10 @@
|
||||
#else
|
||||
#define LLVM_ATTRIBUTE_RETURNS_NOALIAS
|
||||
#endif
|
||||
@@ -160,7 +164,7 @@ index e608f8ea3a837a04d9c29c8bb7a1fab527d512bb..8f68d79898fe0247f9e17709bf1c1ec2
|
||||
#if defined(__cplusplus) && __cplusplus > 201402L && LLVM_HAS_CPP_ATTRIBUTE(fallthrough)
|
||||
#define LLVM_FALLTHROUGH [[fallthrough]]
|
||||
#elif LLVM_HAS_CPP_ATTRIBUTE(gnu::fallthrough)
|
||||
@@ -300,6 +323,7 @@
|
||||
@@ -308,6 +331,7 @@
|
||||
#else
|
||||
#define LLVM_FALLTHROUGH
|
||||
#endif
|
||||
@@ -168,7 +172,7 @@ index e608f8ea3a837a04d9c29c8bb7a1fab527d512bb..8f68d79898fe0247f9e17709bf1c1ec2
|
||||
|
||||
/// LLVM_REQUIRE_CONSTANT_INITIALIZATION - Apply this to globals to ensure that
|
||||
/// they are constant initialized.
|
||||
@@ -334,11 +358,13 @@
|
||||
@@ -342,11 +366,13 @@
|
||||
|
||||
/// LLVM_EXTENSION - Support compilers where we have a keyword to suppress
|
||||
/// pedantic diagnostics.
|
||||
@@ -182,7 +186,7 @@ index e608f8ea3a837a04d9c29c8bb7a1fab527d512bb..8f68d79898fe0247f9e17709bf1c1ec2
|
||||
|
||||
/// LLVM_BUILTIN_UNREACHABLE - On compilers which support it, expands
|
||||
/// to an expression which states that it is undefined behavior for the
|
||||
@@ -347,14 +373,17 @@
|
||||
@@ -355,14 +381,17 @@
|
||||
/// '#else' is intentionally left out so that other macro logic (e.g.,
|
||||
/// LLVM_ASSUME_ALIGNED and llvm_unreachable()) can detect whether
|
||||
/// LLVM_BUILTIN_UNREACHABLE has a definition.
|
||||
@@ -200,7 +204,7 @@ index e608f8ea3a837a04d9c29c8bb7a1fab527d512bb..8f68d79898fe0247f9e17709bf1c1ec2
|
||||
#if __has_builtin(__builtin_trap) || defined(__GNUC__)
|
||||
# define LLVM_BUILTIN_TRAP __builtin_trap()
|
||||
#elif defined(_MSC_VER)
|
||||
@@ -366,10 +395,12 @@
|
||||
@@ -374,10 +403,12 @@
|
||||
#else
|
||||
# define LLVM_BUILTIN_TRAP *(volatile int*)0x11 = 0
|
||||
#endif
|
||||
@@ -213,7 +217,7 @@ index e608f8ea3a837a04d9c29c8bb7a1fab527d512bb..8f68d79898fe0247f9e17709bf1c1ec2
|
||||
#if __has_builtin(__builtin_debugtrap)
|
||||
# define LLVM_BUILTIN_DEBUGTRAP __builtin_debugtrap()
|
||||
#elif defined(_MSC_VER)
|
||||
@@ -383,9 +414,11 @@
|
||||
@@ -391,9 +422,11 @@
|
||||
// program to abort if encountered.
|
||||
# define LLVM_BUILTIN_DEBUGTRAP
|
||||
#endif
|
||||
@@ -225,7 +229,7 @@ index e608f8ea3a837a04d9c29c8bb7a1fab527d512bb..8f68d79898fe0247f9e17709bf1c1ec2
|
||||
#if __has_builtin(__builtin_assume_aligned) || defined(__GNUC__)
|
||||
# define LLVM_ASSUME_ALIGNED(p, a) __builtin_assume_aligned(p, a)
|
||||
#elif defined(LLVM_BUILTIN_UNREACHABLE)
|
||||
@@ -394,6 +427,7 @@
|
||||
@@ -402,6 +435,7 @@
|
||||
#else
|
||||
# define LLVM_ASSUME_ALIGNED(p, a) (p)
|
||||
#endif
|
||||
@@ -233,7 +237,7 @@ index e608f8ea3a837a04d9c29c8bb7a1fab527d512bb..8f68d79898fe0247f9e17709bf1c1ec2
|
||||
|
||||
/// \macro LLVM_PACKED
|
||||
/// Used to specify a packed structure.
|
||||
@@ -413,6 +447,7 @@
|
||||
@@ -421,6 +455,7 @@
|
||||
/// long long l;
|
||||
/// };
|
||||
/// LLVM_PACKED_END
|
||||
@@ -241,7 +245,7 @@ index e608f8ea3a837a04d9c29c8bb7a1fab527d512bb..8f68d79898fe0247f9e17709bf1c1ec2
|
||||
#ifdef _MSC_VER
|
||||
# define LLVM_PACKED(d) __pragma(pack(push, 1)) d __pragma(pack(pop))
|
||||
# define LLVM_PACKED_START __pragma(pack(push, 1))
|
||||
@@ -422,6 +457,7 @@
|
||||
@@ -430,6 +465,7 @@
|
||||
# define LLVM_PACKED_START _Pragma("pack(push, 1)")
|
||||
# define LLVM_PACKED_END _Pragma("pack(pop)")
|
||||
#endif
|
||||
@@ -249,7 +253,7 @@ index e608f8ea3a837a04d9c29c8bb7a1fab527d512bb..8f68d79898fe0247f9e17709bf1c1ec2
|
||||
|
||||
/// \macro LLVM_MEMORY_SANITIZER_BUILD
|
||||
/// Whether LLVM itself is built with MemorySanitizer instrumentation.
|
||||
@@ -513,11 +549,13 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
@@ -521,11 +557,13 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
|
||||
/// \macro LLVM_NO_SANITIZE
|
||||
/// Disable a particular sanitizer for a function.
|
||||
@@ -263,7 +267,7 @@ index e608f8ea3a837a04d9c29c8bb7a1fab527d512bb..8f68d79898fe0247f9e17709bf1c1ec2
|
||||
|
||||
/// Mark debug helper function definitions like dump() that should not be
|
||||
/// stripped from debug builds.
|
||||
@@ -525,17 +563,20 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
@@ -533,17 +571,20 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
/// `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` so they do always
|
||||
/// get stripped in release builds.
|
||||
// FIXME: Move this to a private config.h as it's not usable in public headers.
|
||||
@@ -284,7 +288,7 @@ index e608f8ea3a837a04d9c29c8bb7a1fab527d512bb..8f68d79898fe0247f9e17709bf1c1ec2
|
||||
#if defined(_MSC_VER)
|
||||
#define LLVM_PRETTY_FUNCTION __FUNCSIG__
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
@@ -543,6 +584,7 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
@@ -551,6 +592,7 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
|
||||
#else
|
||||
#define LLVM_PRETTY_FUNCTION __func__
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 22:37:34 -0400
|
||||
Subject: [PATCH 06/36] Explicitly use std::
|
||||
Subject: [PATCH 06/37] Explicitly use std::
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/SmallSet.h | 2 +-
|
||||
@@ -24,10 +24,10 @@ index aeee5f97799aea7e7588d7afba1e47b4fa3d8c7b..4969dfb0d61c2fad805c9cb7bc0184ea
|
||||
|
||||
/// Inequality comparison for SmallSet.
|
||||
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
|
||||
index 637b669a7d0dae69ef4b34955f21a9fb8ba1276e..0b87b375de67dc18647e3ebe646bf323dd05e8c5 100644
|
||||
index 89829dc4faff0b2667ded462444e0eaeec53fd01..ea8d60426ead7163550b73e0fdc32cb11bb089cb 100644
|
||||
--- a/llvm/lib/Support/ErrorHandling.cpp
|
||||
+++ b/llvm/lib/Support/ErrorHandling.cpp
|
||||
@@ -213,7 +213,7 @@ void LLVMResetFatalErrorHandler() {
|
||||
@@ -249,7 +249,7 @@ std::error_code llvm::mapLastWindowsError() {
|
||||
// I'd rather not double the line count of the following.
|
||||
#define MAP_ERR_TO_COND(x, y) \
|
||||
case x: \
|
||||
@@ -37,10 +37,10 @@ index 637b669a7d0dae69ef4b34955f21a9fb8ba1276e..0b87b375de67dc18647e3ebe646bf323
|
||||
std::error_code llvm::mapWindowsError(unsigned EV) {
|
||||
switch (EV) {
|
||||
diff --git a/llvm/unittests/ADT/SmallPtrSetTest.cpp b/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
index 7ed8670fd31ea2a14e6ba7f59a8ac8e35046890c..531f81ab5b3fc1dcff731230f3cb7649cb90aedf 100644
|
||||
index a39b11b9f82156a78b9ad7ce7b8c28855829e611..a6c2b329f072639706aa221feb8c08e33533f813 100644
|
||||
--- a/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
+++ b/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
@@ -298,7 +298,7 @@ TEST(SmallPtrSetTest, dereferenceAndIterate) {
|
||||
@@ -259,7 +259,7 @@ TEST(SmallPtrSetTest, dereferenceAndIterate) {
|
||||
|
||||
// Sort. We should hit the first element just once and the final element N
|
||||
// times.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sat, 7 May 2022 22:53:50 -0400
|
||||
Subject: [PATCH 07/36] Remove format_provider
|
||||
Subject: [PATCH 07/37] Remove format_provider
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/Chrono.h | 114 ------------------------
|
||||
@@ -142,7 +142,7 @@ index 9c9ba7002310eba5113c14957f769702c61f4326..b269ff8bb5db7bb3c62c3a87daf255b1
|
||||
|
||||
#endif // LLVM_SUPPORT_CHRONO_H
|
||||
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
|
||||
index 9345348d9ba555022b31f94299684316ffa15939..862a1db876e9b8467a8839dae8f6632f18d5e7a0 100644
|
||||
index 18bdf4b7d3b96d42d93ca1e4800233b34be42a78..6c2eedf99d003a29243fbb2a9a280fe12dd49d8a 100644
|
||||
--- a/llvm/include/llvm/Support/raw_ostream.h
|
||||
+++ b/llvm/include/llvm/Support/raw_ostream.h
|
||||
@@ -27,12 +27,6 @@
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 13:34:07 -0400
|
||||
Subject: [PATCH 08/36] Add compiler warning pragmas
|
||||
Subject: [PATCH 08/37] Add compiler warning pragmas
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/FunctionExtras.h | 11 +++++++++++
|
||||
@@ -17,7 +17,7 @@ Subject: [PATCH 08/36] Add compiler warning pragmas
|
||||
10 files changed, 72 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/FunctionExtras.h b/llvm/include/llvm/ADT/FunctionExtras.h
|
||||
index 5641a913d0a35ee2911cf872ad90c3dc864f20f5..043d8d90fff03d571a923c264b49be37a5dffa09 100644
|
||||
index 3ce85530b718666afa1dafbf60699c1add423ea6..da61b606eb44bdbdeb4674c9c7eab9f691124f9c 100644
|
||||
--- a/llvm/include/llvm/ADT/FunctionExtras.h
|
||||
+++ b/llvm/include/llvm/ADT/FunctionExtras.h
|
||||
@@ -56,6 +56,13 @@ namespace llvm {
|
||||
@@ -34,7 +34,7 @@ index 5641a913d0a35ee2911cf872ad90c3dc864f20f5..043d8d90fff03d571a923c264b49be37
|
||||
namespace detail {
|
||||
|
||||
template <typename T>
|
||||
@@ -412,6 +419,10 @@ public:
|
||||
@@ -411,6 +418,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
@@ -46,10 +46,10 @@ index 5641a913d0a35ee2911cf872ad90c3dc864f20f5..043d8d90fff03d571a923c264b49be37
|
||||
|
||||
#endif // LLVM_ADT_FUNCTIONEXTRAS_H
|
||||
diff --git a/llvm/include/llvm/ADT/Hashing.h b/llvm/include/llvm/ADT/Hashing.h
|
||||
index a5477362a50793985e1e9df9dc77c8a1d5b5846b..08d6edb14eb3cd51405329aae61b9782266a2590 100644
|
||||
index 109966257b51c015754f6410aec5fa9b8de435ae..a33c6eec308c8722f88b09f73f954d39558c3d62 100644
|
||||
--- a/llvm/include/llvm/ADT/Hashing.h
|
||||
+++ b/llvm/include/llvm/ADT/Hashing.h
|
||||
@@ -56,6 +56,11 @@
|
||||
@@ -57,6 +57,11 @@
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
@@ -61,7 +61,7 @@ index a5477362a50793985e1e9df9dc77c8a1d5b5846b..08d6edb14eb3cd51405329aae61b9782
|
||||
namespace llvm {
|
||||
template <typename T, typename Enable> struct DenseMapInfo;
|
||||
|
||||
@@ -697,4 +702,8 @@ struct hash<llvm::hash_code> {
|
||||
@@ -677,4 +682,8 @@ struct hash<llvm::hash_code> {
|
||||
|
||||
} // namespace std;
|
||||
|
||||
@@ -71,7 +71,7 @@ index a5477362a50793985e1e9df9dc77c8a1d5b5846b..08d6edb14eb3cd51405329aae61b9782
|
||||
+
|
||||
#endif
|
||||
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
|
||||
index d7600fe209a58deb07c63e2553f9dad62e06e973..d7788e94b5379f5eba6fbddee50e4b4359da9d80 100644
|
||||
index 85bf5172e419b1b58f53d3cf00d4aabb58877c33..ec340afd4519f4070389434006bf7f2afdbf2993 100644
|
||||
--- a/llvm/include/llvm/ADT/SmallVector.h
|
||||
+++ b/llvm/include/llvm/ADT/SmallVector.h
|
||||
@@ -14,6 +14,14 @@
|
||||
@@ -90,10 +90,10 @@ index d7600fe209a58deb07c63e2553f9dad62e06e973..d7788e94b5379f5eba6fbddee50e4b43
|
||||
#include "llvm/Support/type_traits.h"
|
||||
#include <algorithm>
|
||||
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
|
||||
index 5cabfdd6493fee33fbc74b831dc1fa3c91ba725d..7541447fa2db5e1634d952b1f39957eb725611f4 100644
|
||||
index d9de2e92d5b07bce1d02ffcfda614b9079d2df91..6028ba8ead7627b4821aa8642f5069b305605c5e 100644
|
||||
--- a/llvm/include/llvm/Support/MathExtras.h
|
||||
+++ b/llvm/include/llvm/Support/MathExtras.h
|
||||
@@ -208,6 +208,11 @@ inline uint64_t maxUIntN(uint64_t N) {
|
||||
@@ -231,6 +231,11 @@ inline uint64_t maxUIntN(uint64_t N) {
|
||||
return UINT64_MAX >> (64 - N);
|
||||
}
|
||||
|
||||
@@ -104,8 +104,8 @@ index 5cabfdd6493fee33fbc74b831dc1fa3c91ba725d..7541447fa2db5e1634d952b1f39957eb
|
||||
+
|
||||
/// Gets the minimum value for a N-bit signed integer.
|
||||
inline int64_t minIntN(int64_t N) {
|
||||
assert(N > 0 && N <= 64 && "integer width out of range");
|
||||
@@ -215,6 +220,10 @@ inline int64_t minIntN(int64_t N) {
|
||||
assert(N <= 64 && "integer width out of range");
|
||||
@@ -240,6 +245,10 @@ inline int64_t minIntN(int64_t N) {
|
||||
return UINT64_C(1) + ~(UINT64_C(1) << (N - 1));
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ index 5cabfdd6493fee33fbc74b831dc1fa3c91ba725d..7541447fa2db5e1634d952b1f39957eb
|
||||
+
|
||||
/// Gets the maximum value for a N-bit signed integer.
|
||||
inline int64_t maxIntN(int64_t N) {
|
||||
assert(N > 0 && N <= 64 && "integer width out of range");
|
||||
assert(N <= 64 && "integer width out of range");
|
||||
diff --git a/llvm/include/llvm/Support/MemAlloc.h b/llvm/include/llvm/Support/MemAlloc.h
|
||||
index f3f378b7697a18f57b189c5322b080fe23d45bec..0028e871f6a05baf6172c60c602b8b26e5f116c6 100644
|
||||
--- a/llvm/include/llvm/Support/MemAlloc.h
|
||||
@@ -146,7 +146,7 @@ index f3f378b7697a18f57b189c5322b080fe23d45bec..0028e871f6a05baf6172c60c602b8b26
|
||||
+
|
||||
#endif
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index 220d850b9bc69f8fc2fba7cd23629eca487cde23..65810ca93fdc1290e3188b5f4fb292a1e1e79b60 100644
|
||||
index 2dbb0674406e1860fdd0c266df64003e45b12fa3..e248eb67df9144bb4cf14e3d3acab161a95d1ce3 100644
|
||||
--- a/llvm/lib/Support/raw_ostream.cpp
|
||||
+++ b/llvm/lib/Support/raw_ostream.cpp
|
||||
@@ -10,6 +10,10 @@
|
||||
@@ -161,7 +161,7 @@ index 220d850b9bc69f8fc2fba7cd23629eca487cde23..65810ca93fdc1290e3188b5f4fb292a1
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/Config/config.h"
|
||||
diff --git a/llvm/unittests/ADT/DenseMapTest.cpp b/llvm/unittests/ADT/DenseMapTest.cpp
|
||||
index b710ac07461ba58faa99cedeae7f209dc0f5902b..1f232d3046292c0da940ba4bef7d50604556e4c2 100644
|
||||
index e93e18423507655ce8275a0718d8e5d01915985f..b930a21f8b43b64835436fcd27f4802a7987827f 100644
|
||||
--- a/llvm/unittests/ADT/DenseMapTest.cpp
|
||||
+++ b/llvm/unittests/ADT/DenseMapTest.cpp
|
||||
@@ -6,6 +6,10 @@
|
||||
@@ -173,8 +173,8 @@ index b710ac07461ba58faa99cedeae7f209dc0f5902b..1f232d3046292c0da940ba4bef7d5060
|
||||
+#endif
|
||||
+
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "CountCopyAndMove.h"
|
||||
#include "llvm/ADT/DenseMapInfo.h"
|
||||
#include "llvm/ADT/DenseMapInfoVariant.h"
|
||||
diff --git a/llvm/unittests/ADT/MapVectorTest.cpp b/llvm/unittests/ADT/MapVectorTest.cpp
|
||||
index e0f11b60a0223da7c00a47c20b61136bd608bae6..9c802ab30721c9ce58ed65052a6ab467039226ff 100644
|
||||
--- a/llvm/unittests/ADT/MapVectorTest.cpp
|
||||
|
||||
@@ -1,29 +1,27 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 13:43:50 -0400
|
||||
Subject: [PATCH 09/36] Remove unused functions
|
||||
Subject: [PATCH 09/37] Remove unused functions
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/SmallString.h | 79 ------
|
||||
llvm/include/llvm/ADT/SmallString.h | 77 ------
|
||||
llvm/include/llvm/Support/Errno.h | 9 -
|
||||
llvm/include/llvm/Support/VersionTuple.h | 39 ---
|
||||
llvm/include/llvm/Support/raw_ostream.h | 129 +--------
|
||||
llvm/lib/Support/raw_ostream.cpp | 332 -----------------------
|
||||
5 files changed, 8 insertions(+), 580 deletions(-)
|
||||
5 files changed, 8 insertions(+), 578 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/SmallString.h b/llvm/include/llvm/ADT/SmallString.h
|
||||
index 45fbf13a43a081731186b0f41c553413b0e36e0f..cb6136d8fd1886e8dc444cb807b33a5f1e18aa44 100644
|
||||
index 9fab1a7726bc6745296f5ebb24aee4055408e5f5..cb6136d8fd1886e8dc444cb807b33a5f1e18aa44 100644
|
||||
--- a/llvm/include/llvm/ADT/SmallString.h
|
||||
+++ b/llvm/include/llvm/ADT/SmallString.h
|
||||
@@ -88,17 +88,6 @@ public:
|
||||
@@ -88,15 +88,6 @@ public:
|
||||
/// @name String Comparison
|
||||
/// @{
|
||||
|
||||
- /// Check for string equality. This is more efficient than compare() when
|
||||
- /// the relative ordering of inequal strings isn't needed.
|
||||
- [[nodiscard]] bool equals(std::string_view RHS) const {
|
||||
- return str().equals(RHS);
|
||||
- }
|
||||
- [[nodiscard]] bool equals(std::string_view RHS) const { return str() == RHS; }
|
||||
-
|
||||
- /// Check for string equality, ignoring case.
|
||||
- [[nodiscard]] bool equals_insensitive(std::string_view RHS) const {
|
||||
@@ -33,7 +31,7 @@ index 45fbf13a43a081731186b0f41c553413b0e36e0f..cb6136d8fd1886e8dc444cb807b33a5f
|
||||
/// compare - Compare two strings; the result is negative, zero, or positive
|
||||
/// if this string is lexicographically less than, equal to, or greater than
|
||||
/// the \p RHS.
|
||||
@@ -106,31 +95,6 @@ public:
|
||||
@@ -104,31 +95,6 @@ public:
|
||||
return str().compare(RHS);
|
||||
}
|
||||
|
||||
@@ -65,7 +63,7 @@ index 45fbf13a43a081731186b0f41c553413b0e36e0f..cb6136d8fd1886e8dc444cb807b33a5f
|
||||
/// @}
|
||||
/// @name String Searching
|
||||
/// @{
|
||||
@@ -215,49 +179,6 @@ public:
|
||||
@@ -213,49 +179,6 @@ public:
|
||||
}
|
||||
|
||||
/// @}
|
||||
@@ -186,10 +184,10 @@ index e1cdce77ce8659305c99a21e01f9b3cc3481a5fd..9102ff063afedc03bd524b2805cba98e
|
||||
|
||||
} // end namespace llvm
|
||||
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
|
||||
index 862a1db876e9b8467a8839dae8f6632f18d5e7a0..95019180a9deb406ed4f2991c664a4cc4e956dac 100644
|
||||
index 6c2eedf99d003a29243fbb2a9a280fe12dd49d8a..cbeb712e2a69426d83457cb1065fff4ca80a669d 100644
|
||||
--- a/llvm/include/llvm/Support/raw_ostream.h
|
||||
+++ b/llvm/include/llvm/Support/raw_ostream.h
|
||||
@@ -261,32 +261,6 @@ public:
|
||||
@@ -274,32 +274,6 @@ public:
|
||||
return write(Str.data(), Str.size());
|
||||
}
|
||||
|
||||
@@ -222,7 +220,7 @@ index 862a1db876e9b8467a8839dae8f6632f18d5e7a0..95019180a9deb406ed4f2991c664a4cc
|
||||
/// Output \p Str, turning '\\', '\t', '\n', '"', and anything that doesn't
|
||||
/// satisfy llvm::isPrint into an escape sequence.
|
||||
raw_ostream &write_escaped(std::string_view Str, bool UseHexEscapes = false);
|
||||
@@ -294,21 +268,6 @@ public:
|
||||
@@ -307,21 +281,6 @@ public:
|
||||
raw_ostream &write(unsigned char C);
|
||||
raw_ostream &write(const char *Ptr, size_t Size);
|
||||
|
||||
@@ -244,7 +242,7 @@ index 862a1db876e9b8467a8839dae8f6632f18d5e7a0..95019180a9deb406ed4f2991c664a4cc
|
||||
/// indent - Insert 'NumSpaces' spaces.
|
||||
raw_ostream &indent(unsigned NumSpaces);
|
||||
|
||||
@@ -323,14 +282,19 @@ public:
|
||||
@@ -336,14 +295,19 @@ public:
|
||||
/// @param BG if true change the background, default: change foreground
|
||||
/// @returns itself so it can be used within << invocations
|
||||
virtual raw_ostream &changeColor(enum Colors Color, bool Bold = false,
|
||||
@@ -267,7 +265,7 @@ index 862a1db876e9b8467a8839dae8f6632f18d5e7a0..95019180a9deb406ed4f2991c664a4cc
|
||||
|
||||
/// This function determines if this stream is connected to a "tty" or
|
||||
/// "console" window. That is, the output would be displayed to the user
|
||||
@@ -405,10 +369,6 @@ private:
|
||||
@@ -414,10 +378,6 @@ private:
|
||||
/// unused bytes in the buffer.
|
||||
void copy_to_buffer(const char *Ptr, size_t Size);
|
||||
|
||||
@@ -275,18 +273,18 @@ index 862a1db876e9b8467a8839dae8f6632f18d5e7a0..95019180a9deb406ed4f2991c664a4cc
|
||||
- /// flushing. The result is affected by calls to enable_color().
|
||||
- bool prepare_colors();
|
||||
-
|
||||
/// Flush the tied-to stream (if present) and then write the required data.
|
||||
void flush_tied_then_write(const char *Ptr, size_t Size);
|
||||
virtual void anchor();
|
||||
};
|
||||
|
||||
@@ -460,7 +420,6 @@ class raw_fd_ostream : public raw_pwrite_stream {
|
||||
@@ -466,7 +426,6 @@ class raw_fd_ostream : public raw_pwrite_stream {
|
||||
bool ShouldClose;
|
||||
bool SupportsSeeking = false;
|
||||
bool IsRegularFile = false;
|
||||
- mutable std::optional<bool> HasColors;
|
||||
|
||||
#ifdef _WIN32
|
||||
/// True if this fd refers to a Windows console device. Mintty and other
|
||||
@@ -536,10 +495,6 @@ public:
|
||||
/// Optional stream this stream is tied to. If this stream is written to, the
|
||||
/// tied-to stream will be flushed first.
|
||||
@@ -546,10 +505,6 @@ public:
|
||||
/// to the offset specified from the beginning of the file.
|
||||
uint64_t seek(uint64_t off);
|
||||
|
||||
@@ -294,10 +292,10 @@ index 862a1db876e9b8467a8839dae8f6632f18d5e7a0..95019180a9deb406ed4f2991c664a4cc
|
||||
-
|
||||
- bool has_colors() const override;
|
||||
-
|
||||
std::error_code error() const { return EC; }
|
||||
|
||||
/// Return the value of the flag in this raw_fd_ostream indicating whether an
|
||||
@@ -558,38 +513,6 @@ public:
|
||||
/// Tie this stream to the specified stream. Replaces any existing tied-to
|
||||
/// stream. Specifying a nullptr unties the stream. This is intended for to
|
||||
/// tie errs() to outs(), so that outs() is flushed whenever something is
|
||||
@@ -575,38 +530,6 @@ public:
|
||||
/// - from The Zen of Python, by Tim Peters
|
||||
///
|
||||
void clear_error() { EC = std::error_code(); }
|
||||
@@ -336,7 +334,7 @@ index 862a1db876e9b8467a8839dae8f6632f18d5e7a0..95019180a9deb406ed4f2991c664a4cc
|
||||
};
|
||||
|
||||
/// This returns a reference to a raw_fd_ostream for standard output. Use it
|
||||
@@ -619,19 +542,6 @@ public:
|
||||
@@ -636,19 +559,6 @@ public:
|
||||
/// immediately destroyed.
|
||||
raw_fd_stream(std::string_view Filename, std::error_code &EC);
|
||||
|
||||
@@ -356,7 +354,7 @@ index 862a1db876e9b8467a8839dae8f6632f18d5e7a0..95019180a9deb406ed4f2991c664a4cc
|
||||
/// Check if \p OS is a pointer of type raw_fd_stream*.
|
||||
static bool classof(const raw_ostream *OS);
|
||||
};
|
||||
@@ -749,29 +659,6 @@ public:
|
||||
@@ -773,29 +683,6 @@ public:
|
||||
~buffer_unique_ostream() override { *OS << str(); }
|
||||
};
|
||||
|
||||
@@ -387,7 +385,7 @@ index 862a1db876e9b8467a8839dae8f6632f18d5e7a0..95019180a9deb406ed4f2991c664a4cc
|
||||
|
||||
#endif // LLVM_SUPPORT_RAW_OSTREAM_H
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index 65810ca93fdc1290e3188b5f4fb292a1e1e79b60..c65fb70a4d22db51f4140b910c308333289b6248 100644
|
||||
index e248eb67df9144bb4cf14e3d3acab161a95d1ce3..ee9d2b0cda0a4f338e4b089304203f220a5ed1c4 100644
|
||||
--- a/llvm/lib/Support/raw_ostream.cpp
|
||||
+++ b/llvm/lib/Support/raw_ostream.cpp
|
||||
@@ -19,7 +19,6 @@
|
||||
@@ -448,8 +446,8 @@ index 65810ca93fdc1290e3188b5f4fb292a1e1e79b60..c65fb70a4d22db51f4140b910c308333
|
||||
raw_ostream &raw_ostream::write_escaped(std::string_view Str,
|
||||
bool UseHexEscapes) {
|
||||
for (unsigned char c : Str) {
|
||||
@@ -316,173 +272,6 @@ void raw_ostream::flush_tied_then_write(const char *Ptr, size_t Size) {
|
||||
write_impl(Ptr, Size);
|
||||
@@ -310,173 +266,6 @@ void raw_ostream::copy_to_buffer(const char *Ptr, size_t Size) {
|
||||
OutBufCur += Size;
|
||||
}
|
||||
|
||||
-// Formatted output.
|
||||
@@ -622,7 +620,7 @@ index 65810ca93fdc1290e3188b5f4fb292a1e1e79b60..c65fb70a4d22db51f4140b910c308333
|
||||
template <char C>
|
||||
static raw_ostream &write_padding(raw_ostream &OS, unsigned NumChars) {
|
||||
static const char Chars[] = {C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C,
|
||||
@@ -513,63 +302,8 @@ raw_ostream &raw_ostream::write_zeros(unsigned NumZeros) {
|
||||
@@ -507,63 +296,8 @@ raw_ostream &raw_ostream::write_zeros(unsigned NumZeros) {
|
||||
return write_padding<'\0'>(*this, NumZeros);
|
||||
}
|
||||
|
||||
@@ -686,7 +684,7 @@ index 65810ca93fdc1290e3188b5f4fb292a1e1e79b60..c65fb70a4d22db51f4140b910c308333
|
||||
//===----------------------------------------------------------------------===//
|
||||
// raw_fd_ostream
|
||||
//===----------------------------------------------------------------------===//
|
||||
@@ -865,31 +599,6 @@ size_t raw_fd_ostream::preferred_buffer_size() const {
|
||||
@@ -862,31 +596,6 @@ size_t raw_fd_ostream::preferred_buffer_size() const {
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -718,7 +716,7 @@ index 65810ca93fdc1290e3188b5f4fb292a1e1e79b60..c65fb70a4d22db51f4140b910c308333
|
||||
void raw_fd_ostream::anchor() {}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
@@ -940,19 +649,6 @@ raw_fd_stream::raw_fd_stream(std::string_view Filename, std::error_code &EC)
|
||||
@@ -937,19 +646,6 @@ raw_fd_stream::raw_fd_stream(std::string_view Filename, std::error_code &EC)
|
||||
EC = std::make_error_code(std::errc::invalid_argument);
|
||||
}
|
||||
|
||||
@@ -731,14 +729,14 @@ index 65810ca93fdc1290e3188b5f4fb292a1e1e79b60..c65fb70a4d22db51f4140b910c308333
|
||||
- if (Ret >= 0)
|
||||
- inc_pos(Ret);
|
||||
- else
|
||||
- error_detected(std::error_code(errno, std::generic_category()));
|
||||
- error_detected(errnoAsErrorCode());
|
||||
- return Ret;
|
||||
-}
|
||||
-
|
||||
bool raw_fd_stream::classof(const raw_ostream *OS) {
|
||||
return OS->get_kind() == OStreamKind::OK_FDStream;
|
||||
}
|
||||
@@ -1000,31 +696,3 @@ void raw_pwrite_stream::anchor() {}
|
||||
@@ -1009,31 +705,3 @@ void raw_pwrite_stream::anchor() {}
|
||||
void buffer_ostream::anchor() {}
|
||||
|
||||
void buffer_unique_ostream::anchor() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Thu, 5 May 2022 23:18:34 -0400
|
||||
Subject: [PATCH 10/36] Detemplatize SmallVectorBase
|
||||
Subject: [PATCH 10/37] Detemplatize SmallVectorBase
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/SmallVector.h | 35 ++++++++++-----------------
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH 10/36] Detemplatize SmallVectorBase
|
||||
2 files changed, 18 insertions(+), 54 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
|
||||
index d7788e94b5379f5eba6fbddee50e4b4359da9d80..b953ae45a34772eb7fd04c3af0275a7d093e1242 100644
|
||||
index ec340afd4519f4070389434006bf7f2afdbf2993..6b12ea17aaa894dc9a719ade4c41a3f7df4304e9 100644
|
||||
--- a/llvm/include/llvm/ADT/SmallVector.h
|
||||
+++ b/llvm/include/llvm/ADT/SmallVector.h
|
||||
@@ -56,19 +56,19 @@ using EnableIfConvertibleToInputIterator = std::enable_if_t<std::is_convertible<
|
||||
@@ -57,19 +57,19 @@ using EnableIfConvertibleToInputIterator = std::enable_if_t<std::is_convertible<
|
||||
/// Using 64 bit size is desirable for cases like SmallVector<char>, where a
|
||||
/// 32 bit size would limit the vector to ~4GB. SmallVectors are used for
|
||||
/// buffering bitcode output - which can exceed 4GB.
|
||||
@@ -37,7 +37,7 @@ index d7788e94b5379f5eba6fbddee50e4b4359da9d80..b953ae45a34772eb7fd04c3af0275a7d
|
||||
|
||||
/// This is a helper for \a grow() that's out of line to reduce code
|
||||
/// duplication. This function will report a fatal error if it can't grow at
|
||||
@@ -107,7 +107,7 @@ protected:
|
||||
@@ -108,7 +108,7 @@ protected:
|
||||
/// This does not construct or destroy any elements in the vector.
|
||||
void set_size(size_t N) {
|
||||
assert(N <= capacity()); // implies no overflow in assignment
|
||||
@@ -46,7 +46,7 @@ index d7788e94b5379f5eba6fbddee50e4b4359da9d80..b953ae45a34772eb7fd04c3af0275a7d
|
||||
}
|
||||
|
||||
/// Set the array data pointer to \p Begin and capacity to \p N.
|
||||
@@ -117,19 +117,14 @@ protected:
|
||||
@@ -118,19 +118,14 @@ protected:
|
||||
void set_allocation_range(void *Begin, size_t N) {
|
||||
assert(N <= SizeTypeMax());
|
||||
BeginX = Begin;
|
||||
@@ -69,7 +69,7 @@ index d7788e94b5379f5eba6fbddee50e4b4359da9d80..b953ae45a34772eb7fd04c3af0275a7d
|
||||
alignas(T) char FirstEl[sizeof(T)];
|
||||
};
|
||||
|
||||
@@ -138,8 +133,8 @@ template <class T, typename = void> struct SmallVectorAlignmentAndSize {
|
||||
@@ -139,8 +134,8 @@ template <class T, typename = void> struct SmallVectorAlignmentAndSize {
|
||||
/// to avoid unnecessarily requiring T to be complete.
|
||||
template <typename T, typename = void>
|
||||
class SmallVectorTemplateCommon
|
||||
@@ -80,7 +80,7 @@ index d7788e94b5379f5eba6fbddee50e4b4359da9d80..b953ae45a34772eb7fd04c3af0275a7d
|
||||
|
||||
protected:
|
||||
/// Find the address of the first element. For this pointer math to be valid
|
||||
@@ -461,7 +456,7 @@ template <typename T, bool TriviallyCopyable>
|
||||
@@ -462,7 +457,7 @@ template <typename T, bool TriviallyCopyable>
|
||||
T *SmallVectorTemplateBase<T, TriviallyCopyable>::mallocForGrow(
|
||||
size_t MinSize, size_t &NewCapacity) {
|
||||
return static_cast<T *>(
|
||||
@@ -89,7 +89,7 @@ index d7788e94b5379f5eba6fbddee50e4b4359da9d80..b953ae45a34772eb7fd04c3af0275a7d
|
||||
this->getFirstEl(), MinSize, sizeof(T), NewCapacity));
|
||||
}
|
||||
|
||||
@@ -1333,12 +1328,6 @@ template <typename Out, typename R> SmallVector<Out> to_vector_of(R &&Range) {
|
||||
@@ -1334,12 +1329,6 @@ template <typename Out, typename R> SmallVector<Out> to_vector_of(R &&Range) {
|
||||
return {std::begin(Range), std::end(Range)};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 13:48:59 -0400
|
||||
Subject: [PATCH 11/36] Add vectors to raw_ostream
|
||||
Subject: [PATCH 11/37] Add vectors to raw_ostream
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/raw_ostream.h | 115 ++++++++++++++++++++++++
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH 11/36] Add vectors to raw_ostream
|
||||
2 files changed, 162 insertions(+)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
|
||||
index 95019180a9deb406ed4f2991c664a4cc4e956dac..e7526e016a858ad728feb7cf1c5014b9691759d4 100644
|
||||
index cbeb712e2a69426d83457cb1065fff4ca80a669d..a6799603a0106262520ba1c9fda14a7967b12a63 100644
|
||||
--- a/llvm/include/llvm/Support/raw_ostream.h
|
||||
+++ b/llvm/include/llvm/Support/raw_ostream.h
|
||||
@@ -24,6 +24,7 @@
|
||||
@@ -20,7 +20,7 @@ index 95019180a9deb406ed4f2991c664a4cc4e956dac..e7526e016a858ad728feb7cf1c5014b9
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@@ -261,12 +262,24 @@ public:
|
||||
@@ -274,12 +275,24 @@ public:
|
||||
return write(Str.data(), Str.size());
|
||||
}
|
||||
|
||||
@@ -45,8 +45,8 @@ index 95019180a9deb406ed4f2991c664a4cc4e956dac..e7526e016a858ad728feb7cf1c5014b9
|
||||
|
||||
/// indent - Insert 'NumSpaces' spaces.
|
||||
raw_ostream &indent(unsigned NumSpaces);
|
||||
@@ -617,6 +630,108 @@ public:
|
||||
}
|
||||
@@ -641,6 +654,108 @@ public:
|
||||
static bool classof(const raw_ostream *OS);
|
||||
};
|
||||
|
||||
+/// A raw_ostream that writes to a vector. This is a
|
||||
@@ -155,11 +155,11 @@ index 95019180a9deb406ed4f2991c664a4cc4e956dac..e7526e016a858ad728feb7cf1c5014b9
|
||||
class raw_null_ostream : public raw_pwrite_stream {
|
||||
/// See raw_ostream::write_impl.
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index c65fb70a4d22db51f4140b910c308333289b6248..57d3091fd5cc5b416e814f9f33811f0fa7afe9cf 100644
|
||||
index ee9d2b0cda0a4f338e4b089304203f220a5ed1c4..6c330c92e7dbeb27310b053d1a82de73b42ee6f8 100644
|
||||
--- a/llvm/lib/Support/raw_ostream.cpp
|
||||
+++ b/llvm/lib/Support/raw_ostream.cpp
|
||||
@@ -668,6 +668,53 @@ void raw_svector_ostream::pwrite_impl(const char *Ptr, size_t Size,
|
||||
memcpy(OS.data() + Offset, Ptr, Size);
|
||||
@@ -677,6 +677,53 @@ bool raw_svector_ostream::classof(const raw_ostream *OS) {
|
||||
return OS->get_kind() == OStreamKind::OK_SVecStream;
|
||||
}
|
||||
|
||||
+//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Tue, 3 May 2022 22:16:10 -0400
|
||||
Subject: [PATCH 12/36] Extra collections features
|
||||
Subject: [PATCH 12/37] Extra collections features
|
||||
|
||||
---
|
||||
llvm/lib/Support/raw_ostream.cpp | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index 57d3091fd5cc5b416e814f9f33811f0fa7afe9cf..5bec803ccc76ce287b7ff3ea037d5e490a7af20c 100644
|
||||
index 6c330c92e7dbeb27310b053d1a82de73b42ee6f8..7086368a3598ccad9502112f734c9ad81252ebec 100644
|
||||
--- a/llvm/lib/Support/raw_ostream.cpp
|
||||
+++ b/llvm/lib/Support/raw_ostream.cpp
|
||||
@@ -77,6 +77,14 @@ constexpr raw_ostream::Colors raw_ostream::WHITE;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Wed, 4 May 2022 00:01:00 -0400
|
||||
Subject: [PATCH 13/36] EpochTracker ABI macro
|
||||
Subject: [PATCH 13/37] EpochTracker ABI macro
|
||||
|
||||
---
|
||||
llvm/include/llvm/ADT/EpochTracker.h | 2 +-
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Thu, 5 May 2022 18:09:45 -0400
|
||||
Subject: [PATCH 14/36] Delete numbers from MathExtras
|
||||
Subject: [PATCH 14/37] Delete numbers from MathExtras
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/MathExtras.h | 36 --------------------------
|
||||
1 file changed, 36 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
|
||||
index 7541447fa2db5e1634d952b1f39957eb725611f4..60b3b9012a32dda5e7c3ba1dc5923ffa68df8215 100644
|
||||
index 6028ba8ead7627b4821aa8642f5069b305605c5e..b9084182158757647cc9896320a353a373b0f9ec 100644
|
||||
--- a/llvm/include/llvm/Support/MathExtras.h
|
||||
+++ b/llvm/include/llvm/Support/MathExtras.h
|
||||
@@ -24,42 +24,6 @@
|
||||
|
||||
namespace llvm {
|
||||
@@ -40,42 +40,6 @@ template <typename T, typename U, typename = enableif_int<T, U>>
|
||||
using common_sint =
|
||||
std::common_type_t<std::make_signed_t<T>, std::make_signed_t<U>>;
|
||||
|
||||
-/// Mathematical constants.
|
||||
-namespace numbers {
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Tue, 3 May 2022 22:50:24 -0400
|
||||
Subject: [PATCH 15/36] Add lerp and sgn
|
||||
Subject: [PATCH 15/37] Add lerp and sgn
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/MathExtras.h | 20 ++++++++++++++++++++
|
||||
1 file changed, 20 insertions(+)
|
||||
llvm/include/llvm/Support/MathExtras.h | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
|
||||
index 60b3b9012a32dda5e7c3ba1dc5923ffa68df8215..daa79d99578e934ca001d1de5d2772ff961b8fc3 100644
|
||||
index b9084182158757647cc9896320a353a373b0f9ec..4033e032b5979a4f25b4c16f3988fb11087ed6bb 100644
|
||||
--- a/llvm/include/llvm/Support/MathExtras.h
|
||||
+++ b/llvm/include/llvm/Support/MathExtras.h
|
||||
@@ -617,6 +617,26 @@ std::enable_if_t<std::is_signed_v<T>, T> MulOverflow(T X, T Y, T &Result) {
|
||||
return UX > (static_cast<U>((std::numeric_limits<T>::max)())) / UY;
|
||||
}
|
||||
@@ -751,6 +751,27 @@ using stack_float_t = volatile float;
|
||||
using stack_float_t = float;
|
||||
#endif
|
||||
|
||||
+// Typesafe implementation of the signum function.
|
||||
+// Returns -1 if negative, 1 if positive, 0 if 0.
|
||||
@@ -35,6 +35,7 @@ index 60b3b9012a32dda5e7c3ba1dc5923ffa68df8215..daa79d99578e934ca001d1de5d2772ff
|
||||
+constexpr T Lerp(const T& startValue, const T& endValue, double t) {
|
||||
+ return startValue + (endValue - startValue) * t;
|
||||
+}
|
||||
} // End llvm namespace
|
||||
+
|
||||
} // namespace llvm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 16:38:11 -0400
|
||||
Subject: [PATCH 16/36] Fixup includes
|
||||
Subject: [PATCH 16/37] Fixup includes
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/PointerLikeTypeTraits.h | 1 +
|
||||
llvm/lib/Support/ConvertUTFWrapper.cpp | 1 +
|
||||
llvm/lib/Support/ErrorHandling.cpp | 7 +++----
|
||||
llvm/lib/Support/ErrorHandling.cpp | 9 ++++-----
|
||||
llvm/lib/Support/raw_ostream.cpp | 11 ++++++-----
|
||||
llvm/unittests/ADT/SmallPtrSetTest.cpp | 2 ++
|
||||
llvm/unittests/ADT/SmallVectorTest.cpp | 1 +
|
||||
llvm/unittests/Support/ConvertUTFTest.cpp | 2 ++
|
||||
7 files changed, 16 insertions(+), 9 deletions(-)
|
||||
7 files changed, 17 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/llvm/include/llvm/Support/PointerLikeTypeTraits.h b/llvm/include/llvm/Support/PointerLikeTypeTraits.h
|
||||
index 1b15f930bd87d97d51824af5e62ea5f222a6b4c9..acadd5e89a1651cfbad67a5b1b0933d1f288d094 100644
|
||||
@@ -38,7 +38,7 @@ index d53462e742e61d3476915d5b2c5aa63772e78a8a..34054140489e4d536ace4650207c783d
|
||||
#include "llvm/Support/SwapByteOrder.h"
|
||||
#include <span>
|
||||
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
|
||||
index 0b87b375de67dc18647e3ebe646bf323dd05e8c5..3a88178cfbbcf7062a958c7de820247bc913ab33 100644
|
||||
index ea8d60426ead7163550b73e0fdc32cb11bb089cb..5f53ec03a1c1e91659143f12abec145b95627826 100644
|
||||
--- a/llvm/lib/Support/ErrorHandling.cpp
|
||||
+++ b/llvm/lib/Support/ErrorHandling.cpp
|
||||
@@ -28,12 +28,11 @@
|
||||
@@ -57,8 +57,17 @@ index 0b87b375de67dc18647e3ebe646bf323dd05e8c5..3a88178cfbbcf7062a958c7de820247b
|
||||
#endif
|
||||
|
||||
using namespace llvm;
|
||||
@@ -210,7 +209,7 @@ void LLVMResetFatalErrorHandler() {
|
||||
#ifdef _WIN32
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
-#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
+#include "Windows/WindowsSupport.h"
|
||||
#undef WIN32_NO_STATUS
|
||||
#include <ntstatus.h>
|
||||
#include <winerror.h>
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index 5bec803ccc76ce287b7ff3ea037d5e490a7af20c..ae5428825f7f62ad8e742490448d40aea7506990 100644
|
||||
index 7086368a3598ccad9502112f734c9ad81252ebec..e173687cafdd04894c27ccd5efb109a7411f1398 100644
|
||||
--- a/llvm/lib/Support/raw_ostream.cpp
|
||||
+++ b/llvm/lib/Support/raw_ostream.cpp
|
||||
@@ -15,6 +15,8 @@
|
||||
@@ -96,7 +105,7 @@ index 5bec803ccc76ce287b7ff3ea037d5e490a7af20c..ae5428825f7f62ad8e742490448d40ae
|
||||
|
||||
using namespace llvm;
|
||||
diff --git a/llvm/unittests/ADT/SmallPtrSetTest.cpp b/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
index 531f81ab5b3fc1dcff731230f3cb7649cb90aedf..3db8b6e37d31a0a3cc304da8fc4cbbe1d89252b5 100644
|
||||
index a6c2b329f072639706aa221feb8c08e33533f813..4c1a144a7a52eb38c7af2d20749901974b29f962 100644
|
||||
--- a/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
+++ b/llvm/unittests/ADT/SmallPtrSetTest.cpp
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 16:42:09 -0400
|
||||
Subject: [PATCH 17/36] Use std::is_trivially_copy_constructible
|
||||
Subject: [PATCH 17/37] Use std::is_trivially_copy_constructible
|
||||
|
||||
---
|
||||
llvm/include/llvm/Support/type_traits.h | 16 ----------------
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Tue, 3 May 2022 20:22:38 -0400
|
||||
Subject: [PATCH 18/36] Windows support
|
||||
Subject: [PATCH 18/37] Windows support
|
||||
|
||||
---
|
||||
.../llvm/Support/Windows/WindowsSupport.h | 45 +++++----
|
||||
@@ -204,10 +204,10 @@ index bc04c5ab5113563fb82d7b3b168985369b611f4b..57eb64a6017a6964ab14b40b8c6b3563
|
||||
|
||||
ConvertUTF_RESTORE_WARNINGS
|
||||
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
||||
index ae5428825f7f62ad8e742490448d40aea7506990..9ea41cad8fed864b53e2e463450c066fb4e00131 100644
|
||||
index e173687cafdd04894c27ccd5efb109a7411f1398..6ed93793a64c523102626d581656d2f9509f7d5d 100644
|
||||
--- a/llvm/lib/Support/raw_ostream.cpp
|
||||
+++ b/llvm/lib/Support/raw_ostream.cpp
|
||||
@@ -535,7 +535,6 @@ void raw_fd_ostream::write_impl(const char *Ptr, size_t Size) {
|
||||
@@ -532,7 +532,6 @@ void raw_fd_ostream::write_impl(const char *Ptr, size_t Size) {
|
||||
DWORD WinLastError = GetLastError();
|
||||
if (WinLastError == ERROR_BROKEN_PIPE ||
|
||||
(WinLastError == ERROR_NO_DATA && errno == EINVAL)) {
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Tyler Veness <calcmogul@gmail.com>
|
||||
Date: Tue, 17 Sep 2024 21:19:52 -0700
|
||||
Subject: [PATCH 19/37] Remove call to RtlGetLastNtStatus()
|
||||
|
||||
---
|
||||
llvm/lib/Support/ErrorHandling.cpp | 23 -----------------------
|
||||
1 file changed, 23 deletions(-)
|
||||
|
||||
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
|
||||
index 5f53ec03a1c1e91659143f12abec145b95627826..c795f13065c820de772b56be7f59aab63f6ee084 100644
|
||||
--- a/llvm/lib/Support/ErrorHandling.cpp
|
||||
+++ b/llvm/lib/Support/ErrorHandling.cpp
|
||||
@@ -214,34 +214,11 @@ void LLVMResetFatalErrorHandler() {
|
||||
#include <ntstatus.h>
|
||||
#include <winerror.h>
|
||||
|
||||
-// This is equivalent to NtCurrentTeb()->LastStatusValue, but the public
|
||||
-// _TEB definition does not expose the LastStatusValue field directly.
|
||||
-// Avoid offsetting into this structure by calling RtlGetLastNtStatus
|
||||
-// from ntdll.dll.
|
||||
-//
|
||||
-// The return of this function will roughly match that of
|
||||
-// GetLastError, but this lower level API disambiguates some cases
|
||||
-// that GetLastError does not.
|
||||
-//
|
||||
-// For more information, see:
|
||||
-// https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/pebteb/teb/index.htm
|
||||
-// https://github.com/llvm/llvm-project/issues/89137
|
||||
-extern "C" NTSYSAPI NTSTATUS NTAPI RtlGetLastNtStatus();
|
||||
-
|
||||
// This function obtains the last error code and maps it. It may call
|
||||
// RtlGetLastNtStatus, which is a lower level API that can return a
|
||||
// more specific error code than GetLastError.
|
||||
std::error_code llvm::mapLastWindowsError() {
|
||||
unsigned EV = ::GetLastError();
|
||||
- // The mapping of NTSTATUS to Win32 error loses some information; special
|
||||
- // case the generic ERROR_ACCESS_DENIED code to check the underlying
|
||||
- // NTSTATUS and potentially return a more accurate error code.
|
||||
- if (EV == ERROR_ACCESS_DENIED) {
|
||||
- llvm::errc code = RtlGetLastNtStatus() == STATUS_DELETE_PENDING
|
||||
- ? errc::delete_pending
|
||||
- : errc::permission_denied;
|
||||
- return make_error_code(code);
|
||||
- }
|
||||
return mapWindowsError(EV);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: PJ Reiniger <pj.reiniger@gmail.com>
|
||||
Date: Sun, 8 May 2022 16:46:20 -0400
|
||||
Subject: [PATCH 19/36] Prefer fmtlib
|
||||
Subject: [PATCH 20/37] Prefer fmtlib
|
||||
|
||||
---
|
||||
llvm/lib/Support/ErrorHandling.cpp | 20 ++++++--------------
|
||||
1 file changed, 6 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/llvm/lib/Support/ErrorHandling.cpp b/llvm/lib/Support/ErrorHandling.cpp
|
||||
index 3a88178cfbbcf7062a958c7de820247bc913ab33..4d992442d153d088f6a7a1fc13e3c84012c45a06 100644
|
||||
index c795f13065c820de772b56be7f59aab63f6ee084..9b292a51dbd59ad700da22d008a5bcac1c334b26 100644
|
||||
--- a/llvm/lib/Support/ErrorHandling.cpp
|
||||
+++ b/llvm/lib/Support/ErrorHandling.cpp
|
||||
@@ -22,7 +22,7 @@
|
||||
@@ -37,7 +37,7 @@ index 3a88178cfbbcf7062a958c7de820247bc913ab33..4d992442d153d088f6a7a1fc13e3c840
|
||||
}
|
||||
|
||||
// If we reached here, we are failing ungracefully. Run the interrupt handlers
|
||||
@@ -176,11 +168,11 @@ void llvm::llvm_unreachable_internal(const char *msg, const char *file,
|
||||
@@ -177,11 +169,11 @@ void llvm::llvm_unreachable_internal(const char *msg, const char *file,
|
||||
// llvm_unreachable is intended to be used to indicate "impossible"
|
||||
// situations, and not legitimate runtime errors.
|
||||
if (msg)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user