You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rather than running clang-tidy as part of the pre-commit hook (which requires replicating a whole build environment and tool), this runs clang-tidy as a side effect of building cuda-core. It therefore will raise its lint errors on compiling (which should be as noisy as a commit hook) and should always run in exactly the same configuration as the build.
This also helps for macOS support (where there are no nvidia-cuda-* Python wheels).
The other change from #3250 is to revert the "fix" for not leaking when an exception is raised inside of create_graph_handle. Two different coding agents were confused by it (especially seeing how GraphBox() can raise on Windows), but that's a separate issue from getting clang-tidy working well and we can separately try to get agents to be less alarmed (probably simply with the right comment).
Added static analysis checks to the native build process, with warnings treated as errors.
Improved consistency and clarity in internal C++ code and error-message buffer sizing.
The C++ package adds a clang-tidy configuration and runs clang-tidy on handwritten C++ compile commands during builds. Runtime C++ code also adopts shared buffer-size constants and other check-related adjustments.
Defines shared operation-name and error-message buffer sizes and uses them in runtime reporting paths.
Update runtime C++ checks cuda_core/cuda/core/_cpp/rt/*
Updates declarations, locking, handle types, and lint annotations across runtime C++ code. The summaries describe the existing error and IPC behavior as unchanged.
Run clang-tidy during compilation cuda_core/build_hooks.py, cuda_core/setup.py
Locates clang-tidy and checks handwritten C++ compile commands through the build extension wrapper.
Possibly related PRs
NVIDIA/cuda-python#3250: Adds the clang-tidy configuration and C++ lint fixes that this PR follows with build-time clang-tidy checks.
NVIDIA/cuda-python#3133: Establishes C++ formatting hooks for files checked here and identifies clang-tidy as follow-up work.
Suggested labels:CI/CD, cuda.core
Priority: Normal
Change: Feature
Merge Risk: Moderate · up to 30f1a
The new build-time lint check does not run on Windows and may not run from a symlinked checkout. It can also miss header diagnostics on Windows. Source builds on older Linux systems may need an LLVM build to get the new dependency. Resolve these before relying on the check as a build gate.
Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
important: Resolve the package directory before comparing paths. If the checkout is accessed through a symlink, path.resolve() uses the physical path but _PACKAGE_DIR retains the symlink path. Every handwritten source then fails this comparison, so the build silently skips clang-tidy. Resolve both paths before comparing them.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Quick win
Supported by static analysis
Script executed:
sed -n '80,120p' cuda_core/setup.py
sed -n '700,765p' cuda_core/build_hooks.py
rg -n '/Tp'$(python -c "import setuptools,os;print(os.path.dirname(setuptools.__file__))")/_distutils | head
Repository: NVIDIA/cuda-python
Length of output: 4915
important: Recognize MSVC /Tp source arguments.
MSVC compile commands pass each C++ source as /Tp<path>. _is_handwritten_cpp(arg) receives that full string, so it rejects every MSVC compile command. check_with_clang_tidy then returns early, and Windows builds skip clang-tidy.
Strip the /Tp prefix before matching, and pass the stripped path to clang-tidy as the source.
🐛 Suggested fix
+def _source_path(arg) -> str:+ """The source path of a compiler argument. MSVC passes sources as /Tp<path>."""+ return arg[len("/Tp"):] if arg.startswith("/Tp") else arg++
def check_with_clang_tidy(compile_command) -> None:
@@
- sources = [arg for arg in compile_command if _is_handwritten_cpp(arg)]+ sources = [src for src in map(_source_path, compile_command) if _is_handwritten_cpp(src)]
The reason will be displayed to describe this comment to others. Learn more.
Major · Stability & Availability · Heavy lift
Supported by static analysis
Script executed:
sed -n '1,40p' cuda_core/pyproject.toml
rg -n 'manylinux|glibc' .github ci cuda_core 2>/dev/null | head -40
Repository: NVIDIA/cuda-python
Length of output: 8963
Web query:
PyPI clang-tidy 22.1.8 wheels manylinux musllinux file list platform tags
Result:
<source_evidence>
<source kind="open_page">
<title>clang-tidy · PyPI</title>
<location>https://pypi.org/project/clang-tidy/22.1.8/</location>
<excerpt>citeturn1view0 [wordlim: 200] Crawled: today; Content type: text/html; Source: open({"ref_id":"https://pypi.org/project/clang-tidy/22.1.8/","lineno":null}); Total lines: 1370
L0: 【0†Skip to main content】
L1:
L2: Warning Some features may not work without JavaScript. Please try enabling it if you encounter problems.
L3:
L4: Search PyPI [Input: Type '/' to search projects] Search
L5:
L6: * 【1†Blog†blog.pypi.org】
L7: * 【2†Docs†docs.pypi.org】
L8: * 【3†Log in】
L9: * 【4†Register】
L10:
L11: * 【1†Blog†blog.pypi.org】
L12: * 【2†Docs†docs.pypi.org】
L13: * 【3†Log in】
L14: * 【4†Register】
L15: * [Button: Deutsch ]
L16: * English
L17: * [Button: español ]
L18: * [Button: Esperanto ]
L19: * [Button: français ]
L20: * [Button: português (Brasil) ]
L21: * [Button: Ελληνικά ]
L22: * [Button: русский ]
L23: * [Button: українська ]
L24: * [Button: עברית ]
L25: * [Button: 中文 (简体) ]
L26: * [Button: 中文 (繁體) ]
L27: * [Button: 日本語 ]
L28: * [Button: 한국어 ]
L29:
L30: Search PyPI [Input: Search projects] Search
L31:
L32: * 【5†Description】
L33: * 【6†Metadata】
L34: * 【7†Release files】
L35: * 【8†Security】
L36: * 【9†Release history】
L37: # clang-tidy Python distribution
L38:
L39: This project packages the `clang-tidy` utility and related tools as a Python package. It allows you to install `clang-tidy` directly from PyPI:
L40:
L41: `python -m pip install clang-tidy
L42: `
L43:
L44: The tools provided are:
L45: * `clang-tidy`: lints C++ source code using configurable rules
L46: * `clang-apply-replacements`: applies "fixes" that have been exported by `clang-tidy` in YAML format
L47: * `run-clang-tidy.py`: runs `clang-tidy` over all files in a compilation database or a specified path, with parallelism
L48: * `clang-tidy-diff.py`: applies `clang-tidy` to the changed lines in a user-provided diff
L49:
L50: This projects intends to release a new PyPI package for each major and minor release of `clang-tidy`.
L51: ## Use with pipx
L52:
L53: You can use `pipx` to run clang-tidy, as well. For example, `pipx run clang-tidy <args>` will run clang-tidy without any previous install required on any machine with pipx (including all default GitHub Actions / Azure runners, avoiding requiring a pre-install step or even `actions/setup-python`).
L54: ## Building new releases
L55:
L56: The 【10†clang-tidy-wheel repository†github.com】 provides the logic to build and publish binary wheels of the `clang-tidy` utility.
L57:
L58: In order to add a new release, the following steps are necessary:
L59:
L60: * Edit the 【11†version file†github.com】 to reflect the new version.
L61: * Make a GitHub release to trigger the 【12†GitHub Actions release workflow†github.com】. Alternatively, the workflow can be triggered manually.
L62:
L63: On manual triggers, the following input variables are available:
L64: * `use_qemu`: Whether to build targets that require emulation (default: `true`)
L65: * `llvm_version`: Override the LLVM version (default: `""`)
L66: * `wheel_version`: Override the wheel packaging version (default `"0"`)
L67: * `deploy_to_testpypi`: Whether to deploy to TestPyPI instead of PyPI (default: `false`)
L68:
L69: The repository with the precommit hook is automatically updated using a scheduled Github Actions workflow.
L70: ## Acknowledgments
L71:
L72: This repository extends the great work of several other projects:
L73: * `clang-tidy` itself is 【13†provided by the LLVM project†github.com】 under the Apache 2.0 License with LLVM exceptions.
L74: * The build logic is based on 【14†scikit-build†github.com】 which greatly reduces the amount of low level code necessary to package `clang-tidy`.
L75: * The `scikit-build` packaging examples of 【15†CMake†github.com】 and 【16†Ninja†github.com】 were very helpful in packaging `clang-tidy`.
L76: * The CI build process is controlled by 【17†cibuildwheel†github.com】 which makes building wheels across a number of platforms a pleasant experience (!)
L77: We are grateful for the generous provisioning with CI resources that GitHub currently offers to Open Source projects.
L78: ## Troubleshooting
L79:
L80: To see which clang-tidy binary the package is using you can set `CLANG_TIDY_WHEEL_VERBOSE` to `1` in your environment.
L81:
L82: ## Project links
L83:
L84: Data verified by PyPI on Jul 14, 2026
L85:
L86: Data provided by the project maintainers, verified at the time the release was uploaded to PyPI.
L87:
L88: * 【10†Source†github.com】
L89:
L90: * 【18†Clang†clang.llvm.org】
L91: * 【19†Documentation†clang.llvm.org】
L92: * 【20†Download†github.com】
L93: ## Key dates
L94:
L95: PyPI data
L96:
L97: Data sourced directly from PyPI's database.
L98:
L99: * Released: Jul 14, 2026
L100: 【21†Newer release available (23.1.4)】
L101:
L102: ## 2 maintainers
L103:
L104: PyPI data
L105:
L106: Data sourced directly from PyPI's database.
L107:
L108: 【22†dkempf】 【23†koshi】
L109:
L110: ## Credits
L111:
L112: Author: Dominic Kempf (ssc@iwr.uni-heidelberg.de)
L113: ## GitHub Statistics
L114:
L115: Data verified by PyPI on Jul 14, 2026
L116:
L117: The GitHub source repository was provided by the project maintainers and verified by PyPI at the time of upload. Stars, forks, and open issues/PRs are derived from that repository and have not been independently verified.
L118: ## Provenance
L119:
L120: Data verified by PyPI on Jul 14, 2026
L121:
L122: Data provided by the project maintainers and verified by PyPI at the time of upload.
L123:
L124: Full provenance
L125:
L126: All 12 files in this release have provenance metadata.
L127:
L128: 【8†View provenance details】
L129:
L130: ## License
L131:
L132: Apache Software License (Apache 2.0)
L133: ## Classifiers
L134:
L135: * Intended Audience
L136: * 【24†Developers】
L137: * License
L138: * 【25†OSI Approved :: Apache Software License】
L139: * Operating System
L140: * 【26†OS Independent】
L141: * Programming Language
L142: * 【27†C】
L143: * 【28†C++】
L144: * Topic
L145: * 【29†Software Development :: Quality Assurance】
L146:
L147: ## Metadata
L148: ## Project links
L149:
L150: Data verified by PyPI on Jul 14, 2026
L151:
L152: Data provided by the project maintainers, verified at the time the release was uploaded to PyPI.
L153:
L154: * 【10†Source†github.com】
L155:
L156: * 【18†Clang†clang.llvm.org】
L157: * 【19†Documentation†clang.llvm.org】
L158: * 【20†Download†github.com】
L159:
L160: ## Key dates
L161:
L162: PyPI data
L163:
L164: Data sourced directly from PyPI's database.
L165:
L166: * Released: Jul 14, 2026
L167: 【21†Newer release available (23.1.4)】
L168: ## 2 maintainers
L169:
L170: PyPI data
L171:
L172: Data sourced directly from PyPI's database.
L173:
L174: 【22†dkempf】 【23†koshi】
L175:
L176: ## Credits
L177:
L178: Author: Dominic Kempf (ssc@iwr.uni-heidelberg.de)
L179:
L180: ## GitHub Statistics
L181:
L182: Data verified by PyPI on Jul 14, 2026
L183:
L184: The GitHub source repository was provided by the project maintainers and verified by PyPI at the time of upload. Stars, forks, and open issues/PRs are derived from that repository and have not been independently verified.
L185: ## Provenance
L186:
L187: Data verified by PyPI on Jul 14, 2026
L188:
L189: Data provided by the project maintainers and verified by PyPI at the time of upload.
L190:
L191: Full provenance
L192:
L193: All 12 files in this release have provenance metadata.
L194:
L195: 【8†View provenance details】
L196:
L197: ## License
L198:
L199: Apache Software License (Apache 2.0)
L200: ## Classifiers
L201:
L202: * Intended Audience
L203: * 【24†Developers】
L204: * License
L205: * 【25†OSI Approved :: Apache Software License】
L206: * Operating System
L207: * 【26†OS Independent】
L208: * Programming Language
L209: * 【27†C】
L210: * 【28†C++】
L211: * Topic
L212: * 【29†Software Development :: Quality Assurance】
L213:
L214: ## Release files for clang-tidy 22.1.8
L215:
L216: For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the 【30†package formats documentation†packaging.python.org】.
L217: ### Source distribution (sdist)
L218:
L219: Source distribution for clang-tidy 22.1.8
L220: File | Size | Uploaded | Provenance |
L221: --- | --- | --- | --- | ---
L222: 【31†clang_tidy-22.1.8.tar.gz†files.pythonhosted.org】 | 11.7 kB | Jul 14, 2026 | With provenance | 【32†Details】
L223:
L224: * * *
L225: ### Built distributions (wheels)
L226:
L227: Enable javascript to be able to filter the list of wheel files.
L228: Table of built distributions (wheels) for clang-tidy 22.1.8
L229: File | Interpreter [Select] | ABI [Select] | Platform [Select] |
L230: --- | --- | --- | --- | ---
L231: 【33†clang_tidy-22.1.8-py2.py3-none-win_amd64.whl†files.pythonhosted.org】 26.7 MB Jul 14, 2026 With provenance | Python 3, Python 2 | none | Windows x86-64 | 【34†Details】
L232: 【35†clang_tidy-22.1.8-py2.py3-none-win32.whl†files.pythonhosted.org】 23.6 MB Jul 14, 2026 With provenance | Python 2, Python 3 | none | Windows x86-32 | 【36†Details】
L233: 【37†clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_x86_64.whl†files.pythonhosted.org】 46.7 MB Jul 14, 2026 With provenance | Python 3, Python 2 | none | Linux musl 1.2+ x86-64 | 【38†Details】
L234: 【39†clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_i686.whl†files.pythonhosted.org】 51.9 MB Jul 14, 2026 With provenance | Python 3, Python 2 | none | Linux musl 1.2+ x86-32 | 【40†Details】
L235: 【41†clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_armv7l.whl†files.pythonhosted.org】 41.3 MB Jul 14, 2026 With provenance | Python 3, Python 2 | none | Linux musl 1.2+ ARMv7l | 【42†Details】
L236: 【43†clang_tidy-22.1.8-py2.py3-none-manylinux_2_31_armv7l.whl†files.pythonhosted.org】 40.4 MB Jul 14, 2026 With provenance | Python 3, Python 2 | none | Linux glibc 2.31+ ARMv7l | 【44†Details】
L237: 【45†clang_tidy-22.1.8-py2.py3-none-manylinux_2_28_i686.whl†files.pythonhosted.org】 49.7 MB Jul 14, 2026 With provenance | Python 3, Python 2 | none | Linux glibc 2.28+ x86-32 | 【46†Details】
L238: 【47†clang_tidy-22.1.8-py2.py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl†files.pythonhosted.org】 44.1 MB Jul 14, 2026 With provenance | Python 2, Python 3 | none | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | 【48†Details】
L239: 【49†clang_tidy-22.1.8-py2.py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl†files.pythonhosted.org】 42.2 MB Jul 14, 2026 With provenance | Python 3, Python 2 | none | Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 | 【50†Details】
L240: 【51†clang_tidy-22.1.8-py2.py3-none-macosx_11_0_arm64.whl†files.pythonhosted.org】 30.8 MB Jul 14, 2026 With provenance | Python 2, Python 3 | none | macOS 11.0+ ARM64 | 【52†Details】
L241: 【53†clang_tidy-22.1.8-py2.py3-none-macosx_10_9_x86_64.whl†files.pythonhosted.org】 31.7 MB Jul 14, 2026 With provenance | Python 3, Python 2 | none | macOS 10.9+ x86-64 | 【54†Details】
L242: * * *
L243:
L244: Total release size: 429.1 MB
L245: ## 【7†Release files】 / clang_tidy-22.1.8.tar.gz
L246: Download URL | 【31†clang_tidy-22.1.8.tar.gz†files.pythonhosted.org】
L247: Size | 11.7 kB
L248: Tags | Source
L249: SHA-256 checksum
L250: 【55†How to use checksums†pip.pypa.io】 | ` d81205d15cc82eea10e9e3b65e99732bb0bc77144535648a4a1f77d9cb4eda50 `
L251: BLAKE2b-256 checksum
L252: 【55†How to use checksums†pip.pypa.io】 | ` b9d0f9dc63658854dc4508270daab0e10a34a61330d35c53cfe679b692e57560 `
L253: Upload date | Jul 14, 2026
L254: Uploaded using Trusted Publishing?
L255: 【56†What is trusted publishing?†docs.pypi.org】 | Yes
L256: Uploaded via | `twine/6.1.0 CPython/3.13.13`
L257: ### Provenance
L258:
L259: Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. 【57†View details, limitations and caveats.†docs.pypi.org】
L260:
L261: 【58†Image】 【59†Image】
L262:
L263: #### 【60†PyPI Publish†docs.pypi.org】 Attestation
L264:
L265: PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
L266:
L267: Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
L268:
L269: 【61†Transparency log†search.sigstore.dev】
L270: ##### Identity
L271:
L272: Publishing platform
L273: GitHub Actions
L274: Publishing repository
L275: 【10†github.com/ssciwr/clang-tidy-wheel†github.com】
L276: Publishing commit
L277: 【62†github.com/ssciwr/clang-tidy-wheel/tree/0dc6a6edd1f404d5f0b84b59872f9b6d22211134†github.com】
L278: ##### Workflow
L279:
L280: Publishing configuration
L281: 【63†github.com/ssciwr/clang-tidy-wheel/blob/0dc6a6edd1f404d5f0b84b59872f9b6d22211134/.github/workflows/release.yml†github.com】
L282: Publishing logs
L283: 【64†github.com/ssciwr/clang-tidy-wheel/actions/runs/29317126770/attempts/1†github.com】
L284:
L285: ##### Artifact
L286:
L287: Subject
L288: `clang_tidy-22.1.8.tar.gz`
L289: SHA-256 checksum
L290: ` d81205d15cc82eea10e9e3b65e99732bb0bc77144535648a4a1f77d9cb4eda50 ` 【65†Verifying attestations†docs.pypi.org】
L291: ## 【7†Release files】 / clang_tidy-22.1.8-py2.py3-none-win_amd64.whl
L292: Download URL | 【33†clang_tidy-22.1.8-py2.py3-none-win_amd64.whl†files.pythonhosted.org】
L293: Size | 26.7 MB
L294: Tags | Python 2 Python 3 Windows x86-64
L295: SHA-256 checksum
L296: 【55†How to use checksums†pip.pypa.io】 | ` df9bf841ecbf501d08b6fa34523be840f59b1a76d16b6ee5edb0e5c7c22b59c2 `
L297: BLAKE2b-256 checksum
L298: 【55†How to use checksums†pip.pypa.io】 | ` 54af0580f6145d8a0c218844208a6c90ce539a4bdf65a66b672e6b4604a81c0a `
L299: Upload date | Jul 14, 2026
L300: Uploaded using Trusted Publishing?
L301: 【56†What is trusted publishing?†docs.pypi.org】 | Yes
L302: Uploaded via | `twine/6.1.0 CPython/3.13.13`
L303: ### Provenance
L304:
L305: Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. 【57†View details, limitations and caveats.†docs.pypi.org】
L306:
L307: 【58†Image】 【59†Image】
L308:
L309: #### 【60†PyPI Publish†docs.pypi.org】 Attestation
L310:
L311: PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
L312:
L313: Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
L314:
L315: 【66†Transparency log†search.sigstore.dev】
L316: ##### Identity
L317:
L318: Publishing platform
L319: GitHub Actions
L320: Publishing repository
L321: 【10†github.com/ssciwr/clang-tidy-wheel†github.com】
L322: Publishing commit
L323: 【62†github.com/ssciwr/clang-tidy-wheel/tree/0dc6a6edd1f404d5f0b84b59872f9b6d22211134†github.com】
L324: ##### Workflow
L325:
L326: Publishing configuration
L327: 【63†github.com/ssciwr/clang-tidy-wheel/blob/0dc6a6edd1f404d5f0b84b59872f9b6d22211134/.github/workflows/release.yml†github.com】
L328: Publishing logs
L329: 【64†github.com/ssciwr/clang-tidy-wheel/actions/runs/29317126770/attempts/1†github.com】
L330:
L331: ##### Artifact
L332:
L333: Subject
L334: `clang_tidy-22.1.8-py2.py3-none-win_amd64.whl`
L335: SHA-256 checksum
L336: ` df9bf841ecbf501d08b6fa34523be840f59b1a76d16b6ee5edb0e5c7c22b59c2 ` 【65†Verifying attestations†docs.pypi.org】
L337: ## 【7†Release files】 / clang_tidy-22.1.8-py2.py3-none-win32.whl
L338: Download URL | 【35†clang_tidy-22.1.8-py2.py3-none-win32.whl†files.pythonhosted.org】
L339: Size | 23.6 MB
L340: Tags | Python 2 Python 3 Windows x86-32
L341: SHA-256 checksum
L342: 【55†How to use checksums†pip.pypa.io】 | ` 182dc0b73688add32cd02595d510c0b010f77a645774dbb04e296d347c1a014f `
L343: BLAKE2b-256 checksum
L344: 【55†How to use checksums†pip.pypa.io】 | ` c1ad6bb2c2a0a7255ca624dca7ee172678b215c62ce79891a487f8ccc90bc48b `
L345: Upload date | Jul 14, 2026
L346: Uploaded using Trusted Publishing?
L347: 【56†What is trusted publishing?†docs.pypi.org】 | Yes
L348: Uploaded via | `twine/6.1.0 CPython/3.13.13`
L349: ### Provenance
L350:
L351: Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. 【57†View details, limitations and caveats.†docs.pypi.org】
L352:
L353: 【58†Image】 【59†Image】
L354:
L355: #### 【60†PyPI Publish†docs.pypi.org】 Attestation
L356:
L357: PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
L358:
L359: Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
L360:
L361: 【67†Transparency log†search.sigstore.dev】
L362: ##### Identity
L363:
L364: Publishing platform
L365: GitHub Actions
L366: Publishing repository
L367: 【10†github.com/ssciwr/clang-tidy-wheel†github.com】
L368: Publishing commit
L369: 【62†github.com/ssciwr/clang-tidy-wheel/tree/0dc6a6edd1f404d5f0b84b59872f9b6d22211134†github.com】
L370: ##### Workflow
L371:
L372: Publishing configuration
L373: 【63†github.com/ssciwr/clang-tidy-wheel/blob/0dc6a6edd1f404d5f0b84b59872f9b6d22211134/.github/workflows/release.yml†github.com】
L374: Publishing logs
L375: 【64†github.com/ssciwr/clang-tidy-wheel/actions/runs/29317126770/attempts/1†github.com】
L376:
L377: ##### Artifact
L378:
L379: Subject
L380: `clang_tidy-22.1.8-py2.py3-none-win32.whl`
L381: SHA-256 checksum
L382: ` 182dc0b73688add32cd02595d510c0b010f77a645774dbb04e296d347c1a014f ` 【65†Verifying attestations†docs.pypi.org】
L383: ## 【7†Release files】 / clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_x86_64.whl
L384: Download URL | 【37†clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_x86_64.whl†files.pythonhosted.org】
L385: Size | 46.7 MB
L386: Tags | Linux musl 1.2+ x86-64 Python 2 Python 3
L387: SHA-256 checksum
L388: 【55†How to use checksums†pip.pypa.io】 | ` 19d11334f5f9af90a655e5ca46b1e472d44ec025a8d10fef95accb3ea19b8c60 `
L389: BLAKE2b-256 checksum
L390: 【55†How to use checksums†pip.pypa.io】 | ` 8dd1a8019bfe6dcb103a081ffc0a869cb2b463a826e5005030d0abf211278b53 `
L391: Upload date | Jul 14, 2026
L392: Uploaded using Trusted Publishing?
L393: 【56†What is trusted publishing?†docs.pypi.org】 | Yes
L394: Uploaded via | `twine/6.1.0 CPython/3.13.13`
L395: ### Provenance
L396:
L397: Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. 【57†View details, limitations and caveats.†docs.pypi.org】
L398:
L399: 【58†Image】 【59†Image】
L400:
L401: #### 【60†PyPI Publish†docs.pypi.org】 Attestation
L402:
L403: PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
L404:
L405: Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
L406:
L407: 【68†Transparency log†search.sigstore.dev】
L408: ##### Identity
L409:
L410: Publishing platform
L411: GitHub Actions
L412: Publishing repository
L413: 【10†github.com/ssciwr/clang-tidy-wheel†github.com】
L414: Publishing commit
L415: 【62†github.com/ssciwr/clang-tidy-wheel/tree/0dc6a6edd1f404d5f0b84b59872f9b6d22211134†github.com】
L416: ##### Workflow
L417:
L418: Publishing configuration
L419: 【63†github.com/ssciwr/clang-tidy-wheel/blob/0dc6a6edd1f404d5f0b84b59872f9b6d22211134/.github/workflows/release.yml†github.com】
L420: Publishing logs
L421: 【64†github.com/ssciwr/clang-tidy-wheel/actions/runs/29317126770/attempts/1†github.com】
L422:
L423: ##### Artifact
L424:
L425: Subject
L426: `clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_x86_64.whl`
L427: SHA-256 checksum
L428: ` 19d11334f5f9af90a655e5ca46b1e472d44ec025a8d10fef95accb3ea19b8c60 ` 【65†Verifying attestations†docs.pypi.org】
L429: ## 【7†Release files】 / clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_i686.whl
L430: Download URL | 【39†clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_i686.whl†files.pythonhosted.org】
L431: Size | 51.9 MB
L432: Tags | Linux musl 1.2+ x86-32 Python 2 Python 3
L433: SHA-256 checksum
L434: 【55†How to use checksums†pip.pypa.io】 | ` 8ad32751aa4697575fb34faabe70ee497aa32d31d4dfffe25f2655797dff1c2c `
L435: BLAKE2b-256 checksum
L436: 【55†How to use checksums†pip.pypa.io】 | ` 9734223288ebf27f33b3842ab750ab5915ef3244f7802d4f7633dacf7a195ab2 `
L437: Upload date | Jul 14, 2026
L438: Uploaded using Trusted Publishing?
L439: 【56†What is trusted publishing?†docs.pypi.org】 | Yes
L440: Uploaded via | `twine/6.1.0 CPython/3.13.13`
L441: ### Provenance
L442:
L443: Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. 【57†View details, limitations and caveats.†docs.pypi.org】
L444:
L445: 【58†Image】 【59†Image】
L446:
L447: #### 【60†PyPI Publish†docs.pypi.org】 Attestation
L448:
L449: PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
L450:
L451: Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
L452:
L453: 【69†Transparency log†search.sigstore.dev】
L454: ##### Identity
L455:
L456: Publishing platform
L457: GitHub Actions
L458: Publishing repository
L459: 【10†github.com/ssciwr/clang-tidy-wheel†github.com】
L460: Publishing commit
L461: 【62†github.com/ssciwr/clang-tidy-wheel/tree/0dc6a6edd1f404d5f0b84b59872f9b6d22211134†github.com】
L462: ##### Workflow
L463:
L464: Publishing configuration
L465: 【63†github.com/ssciwr/clang-tidy-wheel/blob/0dc6a6edd1f404d5f0b84b59872f9b6d22211134/.github/workflows/release.yml†github.com】
L466: Publishing logs
L467: 【64†github.com/ssciwr/clang-tidy-wheel/actions/runs/29317126770/attempts/1†github.com】
L468:
L469: ##### Artifact
L470:
L471: Subject
L472: `clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_i686.whl`
L473: SHA-256 checksum
L474: ` 8ad32751aa4697575fb34faabe70ee497aa32d31d4dfffe25f2655797dff1c2c ` 【65†Verifying attestations†docs.pypi.org】
L475: ## 【7†Release files】 / clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_armv7l.whl
L476: Download URL | 【41†clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_armv7l.whl†files.pythonhosted.org】
L477: Size | 41.3 MB
L478: Tags | Linux musl 1.2+ ARMv7l Python 2 Python 3
L479: SHA-256 checksum
L480: 【55†How to use checksums†pip.pypa.io】 | ` 788200119549b80e3b3cc4c1ecc422b6bec6e2559ea2116494fe6c72092ec4c2 `
L481: BLAKE2b-256 checksum
</excerpt>
</source>
<source kind="search">
<title>clang-tidy · PyPI</title>
<location>https://pypi.org/project/clang-tidy/</location>
<excerpt>citeturn0search0 [wordlim: 200] Published: 3 months ago; Crawled: 3 weeks ago; It allows you to install `clang-tidy` directly from PyPI: ... clang_tidy-22.1.8-py2.py3-none-win_amd64.whl 26.7 MB Jul 14, 2026 | Python 2, Python 3 | none | Windows x86-64 | Details
</excerpt>
</source>
<source kind="search">
<title>piwheels - clang-tidy</title>
<location>https://www.piwheels.org/project/clang-tidy/</location>
<excerpt>citeturn0search1 [wordlim: 200] Crawled: last month; PyPI page ... piwheels.org/project/clang-tidy/json ... 22.1.8 | 2026-07-14 | | | ... | Build succeeded; file since deleted
</excerpt>
</source>
<source kind="search">
<title>ctidy · PyPI</title>
<location>https://pypi.org/project/ctidy/</location>
<excerpt>citeturn0search2 [wordlim: 200] Published: 7 months ago; Crawled: yesterday; `ctidy` packages `clang-tidy`, `clang-apply-replacements`, resource headers, and a bundled `run-clang-tidy.py` into a Python wheel so the tool can be invoked with: ... PyPI releases are wheel-only for now. `ctidy` does not publish an `sdist`.
</excerpt>
</source>
<source kind="search">
<title>clang-tidy — SkillFed</title>
<location>https://skillfed.io/packages/clang-tidy</location>
<excerpt>citeturn0search3 [wordlim: 200] Crawled: 2 months ago; Requires a C++ source file or compilation database to analyze; clang-tidy itself is bundled but you need C++ code to lint. ... Install friction | medium — platform-specific wheel ... Evidence: clang_tidy-22.1.8-py2.py3-none-macosx_10_9_x86_64.whl; clang_tidy-22.1.8-py2.py3-none-macosx_11_0_arm64.whl; clang_tidy-22.1.8-py2.py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; clang_tidy-22.1.8-py2.py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; clang_tidy-22.1.8-py2.py3-none-manylinux_2_28_i686.whl; clang_tidy-22.1.8-py2.py3-none-manylinux_2_31_armv7l.whl; clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_armv7l.whl; clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_i686.whl; clang_tidy-22.1.8-py2.py3-none-musllinux_1_2_x86_64.whl; clang_tidy-22.1.8-py2.py3-none-win32.whl; clang_tidy-22.1.8-py2.py3-none-win_amd64.whl
</excerpt>
</source>
<omitted_sources count="24">Additional source records were omitted from this bounded result.</omitted_sources>
</source_evidence>
Citations:
- 1: https://pypi.org/project/clang-tidy/22.1.8/
important: Keep clang-tidy optional for older Linux source builds.
clang-tidy==22.1.8 has no x86-64 glibc wheel for glibc 2.24–2.26. Source and editable builds therefore resolve its sdist and may build LLVM before compiling cuda-core. This does not affect installation of published cuda-core wheels, which target manylinux_2_24.
If lint remains optional, guard the compiler hook as well as the build requirement; removing only the requirement still causes _find_clang_tidy() to raise.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Supported by static analysis
Script executed:
sed -n '55,75p' cuda_core/.clang-tidy
sed -n '700,765p' cuda_core/build_hooks.py
Repository: NVIDIA/cuda-python
Length of output: 3745
Web query:
clang-tidy HeaderFilterRegex Windows backslash path separators matching normalize forward slashes
Result:
<source_evidence>
<source kind="find_in_page">
<title>llvm-project/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp at main · llvm/llvm-project · GitHub</title>
<location>https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp</location>
<excerpt>citeturn3view1 [wordlim: 200] Crawled: today; Content type: text/html; Source: find({"ref_id":"turn2view0","pattern":"Filter.matches"}); Total lines: 3373
No matching text found for "Filter.matches"</excerpt>
</source>
<source kind="open_page">
<title>llvm-project/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp at main · llvm/llvm-project · GitHub</title>
<location>https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp</location>
<excerpt>citeturn2view0 [wordlim: 200] Crawled: 2 days ago; Content type: text/html; Source: open({"ref_id":"https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp","lineno":null}); Total lines: 3394
L0: 【0†Skip to content】
L1: ## Navigation Menu
L2:
L3: 【1†Sign in】
L4:
L5: Appearance settings
L6:
L7: * Platform
L8:
L9: * AI CODE CREATION
L10: * 【2†GitHub CopilotWrite better code with AI】
L11: * 【3†GitHub Copilot appDirect agents from issue to merge】
L12: * 【4†MCP RegistryIntegrate external tools】
L13:
L14: * DEVELOPER WORKFLOWS
L15: * 【5†ActionsAutomate any workflow】
L16: * 【6†CodespacesInstant dev environments】
L17: * 【7†IssuesPlan and track work】
L18: * 【8†Code ReviewManage code changes】
L19: * 【9†Code QualityEnforce quality at merge】
L20: * APPLICATION SECURITY
L21: * 【10†GitHub Advanced SecurityFind and fix vulnerabilities】
L22: * 【11†Code securitySecure your code as you build】
L23: * 【12†Secret protectionStop leaks before they start】
L24:
L25: * EXPLORE
L26: * 【13†Why GitHub】
L27: * 【14†Documentation†docs.github.com】
L28: * 【15†Blog†github.blog】
L29: * 【16†Changelog†github.blog】
L30: * 【17†Marketplace】
L31:
L32: 【18†View all features】
L33:
L34: * Solutions
L35: * BY COMPANY SIZE
L36: * 【19†Enterprises】
L37: * 【20†Small and medium teams】
L38: * 【21†Startups】
L39: * 【22†Nonprofits】
L40:
L41: * BY USE CASE
L42: * 【23†App Modernization】
L43: * 【24†DevSecOps】
L44: * 【25†DevOps】
L45: * 【26†CI/CD】
L46: * 【27†View all use cases】
L47:
L48: * BY INDUSTRY
L49: * 【28†Healthcare】
L50: * 【29†Financial services】
L51: * 【30†Manufacturing】
L52: * 【31†Government】
L53: * 【32†See all industries】
L54:
L55: 【33†View all solutions】
L56:
L57: * Resources
L58: * EXPLORE BY TOPIC
L59: * 【34†AI】
L60: * 【35†Software Development】
L61: * 【36†DevOps】
L62: * 【37†Security】
L63: * 【38†View all topics】
L64:
L65: * EXPLORE BY TYPE
L66: * 【39†Customer stories】
L67: * 【40†Events & webinars】
L68: * 【41†Ebooks & reports】
L69: * 【42†Business insights】
L70: * 【43†GitHub Skills†skills.github.com】
L71: * SUPPORT & SERVICES
L72: * 【14†Documentation†docs.github.com】
L73: * 【44†Customer support†support.github.com】
L74: * 【45†Community forum】
L75: * 【46†Trust center】
L76: * 【47†Partners】
L77:
L78: 【48†View all resources】
L79:
L80: * Open Source
L81:
L82: * COMMUNITY
L83: * 【49†GitHub SponsorsFund open source developers】
L84: * PROGRAMS
L85: * 【50†Security Lab†securitylab.github.com】
L86: * 【51†Maintainer Community†maintainers.github.com】
L87: * 【52†GitHub Stars†stars.github.com】
L88: * 【53†Archive Program†archiveprogram.github.com】
L89:
L90: * REPOSITORIES
L91: * 【54†Topics】
L92: * 【55†Trending】
L93: * 【56†Collections】
L94:
L95: * Enterprise
L96:
L97: * ENTERPRISE SOLUTIONS
L98: * 【19†Enterprise platformAI-powered developer platform】
L99: * AVAILABLE ADD-ONS
L100: * 【10†GitHub Advanced SecurityEnterprise-grade security features】
L101: * 【57†Copilot for BusinessEnterprise-grade AI features】
L102: * 【58†Premium SupportEnterprise-grade 24/7 support】
L103:
L104: * 【59†Pricing】
L105:
L106: Search`/`
L107:
L108: 【1†Sign in】
L109:
L110: 【60†Sign up】
L111:
L112: Appearance settings
L113: You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
L114:
L115: 1. 【61†llvm】
L116: 2. 【62†llvm-project】
L117: ## Repository navigation
L118:
L119: * * 【62†Code】
L120: * 【63†Issues5k+ (5k+)】
L121: * 【64†Pull requests5k+ (5k+)】
L122: * 【65†Actions】
L123: * 【66†Security and quality】
L124: * 【67†Insights】
L125:
L126: More items
L127:
L128: ## Files Expand file tree
L129:
L130: main
L131:
L132: ## Breadcrumbs
L133:
L134: 1. 【68†llvm-project】
L135: 2. /【69†clang-tools-extra】
L136: 3. /【70†clang-tidy】
L137:
L138: /
L139:
L140: # ClangTidyDiagnosticConsumer.cpp
L141:
L142: Copy path
L143:
L144: [Input: Go to file]
L145:
L146: Blame More file actions
L147:
L148: Blame More file actions
L149:
L150: ## Latest commit
L151:
L152:
L153:
L154: ## History
L155:
L156: History
L157:
L158: main
L159: ## Breadcrumbs
L160:
L161: 1. 【68†llvm-project】
L162: 2. /【69†clang-tools-extra】
L163: 3. /【70†clang-tidy】
L164:
L165: /
L166:
L167: # ClangTidyDiagnosticConsumer.cpp
L168:
L169: Copy path
L170:
L171: Top
L172: ## File metadata and controls
L173:
L174: * Code
L175:
L176: * Blame
L177:
L178: 862 lines (775 loc) · 32.9 KB
L179:
L180: 【71†Raw】
L181:
L182: Copy raw file
L183:
L184: Download raw file
L185:
L186: Open symbols panel
L187:
L188: Edit and raw actions
L189:
L190: 1
L191:
L192: 2
L193:
L194: 3
L195:
L196: 4
L197:
L198: 5
L199:
L200: 6
L201:
L202: 7
L203:
L204: 8
L205:
L206: 9
L207:
L208: 10
L209:
L210: 11
L211:
L212: 12
L213:
L214: 13
L215:
L216: 14
L217:
L218: 15
L219:
L220: 16
L221:
L222: 17
L223:
L224: 18
L225:
L226: 19
L227:
L228: 20
L229:
L230: 21
L231:
L232: 22
L233:
L234: 23
L235:
L236: 24
L237:
L238: 25
L239:
L240: 26
L241:
L242: 27
L243:
L244: 28
L245:
L246: 29
L247:
L248: 30
L249:
L250: 31
L251:
L252: 32
L253:
L254: 33
L255:
L256: 34
L257:
L258: 35
L259:
L260: 36
L261:
L262: 37
L263:
L264: 38
L265:
L266: 39
L267:
L268: 40
L269:
L270: 41
L271:
L272: 42
L273:
L274: 43
L275:
L276: 44
L277:
L278: 45
L279:
L280: 46
L281:
L282: 47
L283:
L284: 48
L285:
L286: 49
L287:
L288: 50
L289:
L290: 51
L291:
L292: 52
L293:
L294: 53
L295:
L296: 54
L297:
L298: 55
L299:
L300: 56
L301:
L302: 57
L303:
L304: 58
L305:
L306: 59
L307:
L308: 60
L309:
L310: 61
L311:
L312: 62
L313:
L314: 63
L315:
L316: 64
L317:
L318: 65
L319:
L320: 66
L321:
L322: 67
L323:
L324: 68
L325:
L326: 69
L327:
L328: 70
L329:
L330: 71
L331:
L332: 72
L333:
L334: 73
L335:
L336: 74
L337:
L338: 75
L339:
L340: 76
L341:
L342: 77
L343:
L344: 78
L345:
L346: 79
L347:
L348: 80
L349:
L350: 81
L351:
L352: 82
L353:
L354: 83
L355:
L356: 84
L357:
L358: 85
L359:
L360: 86
L361:
L362: 87
L363:
L364: 88
L365: 89
L366:
L367: 90
L368:
L369: 91
L370:
L371: 92
L372:
L373: 93
L374:
L375: 94
L376:
L377: 95
L378:
L379: 96
L380:
L381: 97
L382:
L383: 98
L384:
L385: 99
L386:
L387: 100
L388:
L389: 101
L390:
L391: 102
L392:
L393: 103
L394:
L395: 104
L396:
L397: 105
L398:
L399: 106
L400:
L401: 107
L402:
L403: 108
L404:
L405: 109
L406:
L407: 110
L408:
L409: 111
L410:
L411: 112
L412:
L413: 113
L414:
L415: 114
L416:
L417: 115
L418:
L419: 116
L420:
L421: 117
L422:
L423: 118
L424:
L425: 119
L426:
L427: 120
L428:
L429: 121
L430:
L431: 122
L432:
L433: 123
L434:
L435: 124
L436:
L437: 125
L438:
L439: 126
L440:
L441: 127
L442:
L443: 128
L444:
L445: 129
L446:
L447: 130
L448:
L449: 131
L450:
L451: 132
L452:
L453: 133
L454:
L455: 134
L456:
L457: 135
L458:
L459: 136
L460:
L461: 137
L462:
L463: 138
L464:
L465: 139
L466:
L467: 140
L468:
L469: 141
L470:
L471: 142
L472:
L473: 143
L474:
L475: 144
L476:
L477: 145
L478:
L479: 146
L480:
L481: 147
L482:
L483: 148
L484:
L485: 149
L486:
L487: 150
L488:
L489: 151
L490:
L491: 152
L492:
L493: 153
L494:
L495: 154
L496:
L497: 155
L498:
L499: 156
L500:
L501: 157
L502:
L503: 158
L504:
L505: 159
L506:
L507: 160
L508:
L509: 161
L510:
L511: 162
L512:
L513: 163
L514:
L515: 164
L516:
L517: 165
L518:
L519: 166
L520:
L521: 167
L522:
L523: 168
L524:
L525: 169
L526:
L527: 170
L528:
L529: 171
L530:
L531: 172
L532:
L533: 173
L534:
L535: 174
L536:
L537: 175
L538:
L539: 176
L540:
L541: 177
L542:
L543: 178
L544:
L545: 179
L546:
L547: 180
L548:
L549: 181
L550:
L551: 182
L552:
L553: 183
L554:
L555: 184
L556:
L557: 185
L558:
L559: 186
L560:
L561: 187
L562:
L563: 188
L564:
L565: 189
L566:
L567: 190
L568:
L569: 191
L570:
L571: 192
L572: 193
L573:
L574: 194
L575:
L576: 195
L577:
L578: 196
L579:
L580: 197
L581:
L582: 198
L583:
L584: 199
L585:
L586: 200
L587:
L588: 201
L589:
L590: 202
L591:
L592: 203
L593:
L594: 204
L595:
L596: 205
L597:
L598: 206
L599:
L600: 207
L601:
L602: 208
L603:
L604: 209
L605:
L606: 210
L607:
L608: 211
L609:
L610: 212
L611:
L612: 213
L613:
L614: 214
L615:
L616: 215
L617:
L618: 216
L619:
L620: 217
L621:
L622: 218
L623:
L624: 219
L625:
L626: 220
L627:
L628: 221
L629:
L630: 222
L631:
L632: 223
L633:
L634: 224
L635:
L636: 225
L637:
L638: 226
L639:
L640: 227
L641:
L642: 228
L643:
L644: 229
L645:
L646: 230
L647:
L648: 231
L649:
L650: 232
L651:
L652: 233
L653:
L654: 234
L655:
L656: 235
L657:
L658: 236
L659:
L660: 237
L661:
L662: 238
L663:
L664: 239
L665:
L666: 240
L667:
L668: 241
L669:
L670: 242
L671:
L672: 243
L673:
L674: 244
L675:
L676: 245
L677:
L678: 246
L679:
L680: 247
L681:
L682: 248
L683:
L684: 249
L685:
L686: 250
L687:
L688: 251
L689:
L690: 252
L691:
L692: 253
L693:
L694: 254
L695:
L696: 255
L697:
L698: 256
L699:
L700: 257
L701:
L702: 258
L703:
L704: 259
L705:
L706: 260
L707:
L708: 261
L709:
L710: 262
L711:
L712: 263
L713:
L714: 264
L715:
L716: 265
L717:
L718: 266
L719:
L720: 267
L721:
L722: 268
L723:
L724: 269
L725:
L726: 270
L727:
L728: 271
L729:
L730: 272
L731:
L732: 273
L733:
L734: 274
L735:
L736: 275
L737:
L738: 276
L739:
L740: 277
L741:
L742: 278
L743:
L744: 279
L745:
L746: 280
L747:
L748: 281
L749:
L750: 282
L751:
L752: 283
L753:
L754: 284
L755:
L756: 285
L757:
L758: 286
L759:
L760: 287
L761:
L762: 288
L763:
L764: 289
L765:
L766: 290
L767:
L768: 291
L769:
L770: 292
L771:
L772: 293
L773:
L774: 294
L775: 295
L776:
L777: 296
L778:
L779: 297
L780:
L781: 298
L782:
L783: 299
L784:
L785: 300
L786:
L787: 301
L788:
L789: 302
L790:
L791: 303
L792:
L793: 304
L794:
L795: 305
L796:
L797: 306
L798:
L799: 307
L800:
L801: 308
L802:
L803: 309
L804:
L805: 310
L806:
L807: 311
L808:
L809: 312
L810:
L811: 313
L812:
L813: 314
L814:
L815: 315
L816:
L817: 316
L818:
L819: 317
L820:
L821: 318
L822:
L823: 319
L824:
L825: 320
L826:
L827: 321
L828:
L829: 322
L830:
L831: 323
L832:
L833: 324
L834:
L835: 325
L836:
L837: 326
L838:
L839: 327
L840:
L841: 328
L842:
L843: 329
L844:
L845: 330
L846:
L847: 331
L848:
L849: 332
L850:
L851: 333
L852:
L853: 334
L854:
L855: 335
L856:
L857: 336
L858:
L859: 337
L860:
L861: 338
L862:
L863: 339
L864:
L865: 340
L866:
L867: 341
L868:
L869: 342
L870:
L871: 343
L872:
L873: 344
L874:
L875: 345
L876:
L877: 346
L878:
L879: 347
L880:
L881: 348
L882:
L883: 349
L884:
L885: 350
L886:
L887: 351
L888:
L889: 352
L890:
L891: 353
L892:
L893: 354
L894:
L895: 355
L896:
L897: 356
L898:
L899: 357
L900:
L901: 358
L902:
L903: 359
L904:
L905: 360
L906:
L907: 361
L908:
L909: 362
L910:
L911: 363
L912:
L913: 364
L914:
L915: 365
L916:
L917: 366
L918:
L919: 367
L920:
L921: 368
L922:
L923: 369
L924:
L925: 370
L926:
L927: 371
L928:
L929: 372
L930:
L931: 373
L932:
L933: 374
L934:
L935: 375
L936:
L937: 376
L938:
L939: 377
L940:
L941: 378
L942:
L943: 379
L944:
L945: 380
L946:
L947: 381
L948:
L949: 382
L950:
L951: 383
L952:
L953: 384
L954:
L955: 385
L956:
L957: 386
L958:
L959: 387
L960:
L961: 388
L962:
L963: 389
L964:
L965: 390
L966:
L967: 391
L968:
L969: 392
L970:
L971: 393
L972:
L973: 394
L974:
L975: 395
L976:
L977: 396
L978: 397
L979:
L980: 398
L981:
L982: 399
L983:
L984: 400
L985:
L986: 401
L987:
L988: 402
L989:
L990: 403
L991:
L992: 404
L993:
L994: 405
L995:
L996: 406
L997:
L998: 407
L999:
L1000: 408
L1001:
L1002: 409
L1003:
L1004: 410
L1005:
L1006: 411
L1007:
L1008: 412
L1009:
L1010: 413
L1011:
L1012: 414
L1013:
L1014: 415
L1015:
L1016: 416
L1017:
L1018: 417
L1019:
L1020: 418
L1021:
L1022: 419
L1023:
L1024: 420
L1025:
L1026: 421
L1027:
L1028: 422
L1029:
L1030: 423
L1031:
L1032: 424
L1033:
L1034: 425
L1035:
L1036: 426
L1037:
L1038: 427
L1039:
L1040: 428
L1041:
L1042: 429
L1043:
L1044: 430
L1045:
L1046: 431
L1047:
L1048: 432
L1049:
L1050: 433
L1051:
L1052: 434
L1053:
L1054: 435
L1055:
L1056: 436
L1057:
L1058: 437
L1059:
L1060: 438
L1061:
L1062: 439
L1063:
L1064: 440
L1065:
L1066: 441
L1067:
L1068: 442
L1069:
L1070: 443
L1071:
L1072: 444
L1073:
L1074: 445
L1075:
L1076: 446
L1077:
L1078: 447
L1079:
L1080: 448
L1081:
L1082: 449
L1083:
L1084: 450
L1085:
L1086: 451
L1087:
L1088: 452
L1089:
L1090: 453
L1091:
L1092: 454
L1093:
L1094: 455
L1095:
L1096: 456
L1097:
L1098: 457
L1099:
L1100: 458
L1101:
L1102: 459
L1103:
L1104: 460
L1105:
L1106: 461
L1107:
L1108: 462
L1109:
L1110: 463
L1111:
L1112: 464
L1113:
L1114: 465
L1115:
L1116: 466
L1117:
L1118: 467
L1119:
L1120: 468
L1121:
L1122: 469
L1123:
L1124: 470
L1125:
L1126: 471
L1127:
L1128: 472
L1129:
L1130: 473
L1131:
L1132: 474
L1133:
L1134: 475
L1135:
L1136: 476
L1137:
L1138: 477
L1139:
L1140: 478
L1141:
L1142: 479
L1143:
L1144: 480
L1145:
L1146: 481
L1147:
L1148: 482
L1149:
L1150: 483
L1151:
L1152: 484
L1153:
L1154: 485
L1155:
L1156: 486
L1157:
L1158: 487
L1159:
L1160: 488
L1161:
L1162: 489
L1163:
L1164: 490
L1165:
L1166: 491
L1167:
L1168: 492
L1169:
L1170: 493
L1171:
L1172: 494
L1173:
L1174: 495
L1175:
L1176: 496
L1177:
L1178: 497
L1179:
L1180: 498
L1181: 499
L1182:
L1183: 500
L1184:
L1185: 501
L1186:
L1187: 502
L1188:
L1189: 503
L1190:
L1191: 504
L1192:
L1193: 505
L1194:
L1195: 506
L1196:
L1197: 507
L1198:
L1199: 508
L1200:
L1201: 509
L1202:
L1203: 510
L1204:
L1205: 511
L1206:
L1207: 512
L1208:
L1209: 513
L1210:
L1211: 514
L1212:
L1213: 515
L1214:
L1215: 516
L1216:
L1217: 517
L1218:
L1219: 518
L1220:
L1221: 519
L1222:
L1223: 520
L1224:
L1225: 521
L1226:
L1227: 522
L1228:
L1229: 523
L1230:
L1231: 524
L1232:
L1233: 525
L1234:
L1235: 526
L1236:
L1237: 527
L1238:
L1239: 528
L1240:
L1241: 529
L1242:
L1243: 530
L1244:
L1245: 531
L1246:
L1247: 532
L1248:
L1249: 533
L1250:
L1251: 534
L1252:
L1253: 535
L1254:
L1255: 536
L1256:
L1257: 537
L1258:
L1259: 538
L1260:
L1261: 539
L1262:
L1263: 540
L1264:
L1265: 541
L1266:
L1267: 542
L1268:
L1269: 543
L1270:
L1271: 544
L1272:
L1273: 545
L1274:
L1275: 546
L1276:
L1277: 547
L1278:
L1279: 548
L1280:
L1281: 549
L1282:
L1283: 550
L1284:
L1285: 551
L1286:
L1287: 552
L1288:
L1289: 553
L1290:
L1291: 554
L1292:
L1293: 555
L1294:
L1295: 556
L1296:
L1297: 557
L1298:
L1299: 558
L1300:
L1301: 559
L1302:
L1303: 560
L1304:
L1305: 561
L1306:
L1307: 562
L1308:
L1309: 563
L1310:
L1311: 564
L1312:
L1313: 565
L1314:
L1315: 566
L1316:
L1317: 567
L1318:
L1319: 568
L1320:
L1321: 569
L1322:
L1323: 570
L1324:
L1325: 571
L1326:
L1327: 572
L1328:
L1329: 573
L1330:
L1331: 574
L1332:
L1333: 575
L1334:
L1335: 576
L1336:
L1337: 577
L1338:
L1339: 578
L1340:
L1341: 579
L1342:
L1343: 580
L1344:
L1345: 581
L1346:
L1347: 582
L1348:
L1349: 583
L1350:
L1351: 584
L1352:
L1353: 585
L1354:
L1355: 586
L1356:
L1357: 587
L1358:
L1359: 588
L1360:
L1361: 589
L1362:
L1363: 590
L1364:
L1365: 591
L1366:
L1367: 592
L1368:
L1369: 593
L1370:
L1371: 594
L1372:
L1373: 595
L1374:
L1375: 596
L1376:
</excerpt>
</source>
<source kind="search">
<title>9faf317eff5ef76aff7addfbd0360f380e803026 - external/github.com/llvm/llvm-project - Git at Google</title>
<location>https://chromium.googlesource.com/external/github.com/llvm/llvm-project/%2B/9faf317eff5ef76aff7addfbd0360f380e803026</location>
<excerpt>citeturn1search2 [wordlim: 200] Published: last month; Crawled: last month; [clang-tidy] Normalize windows line filter paths (#217038) ... git.exe diff -U0 main -- . | python clang-tidy-diff.py -p1 -path .\build" ... before matching the compilation database. ... it run in a nested directory to exercise the issue
chromium/external/github.com/llvm/llvm-project/9faf317eff5ef76aff7addfbd0360f380e803026
commit
9faf317eff5ef76aff7addfbd0360f380e803026
[log]
author
Chris Apple <cja-private@pm.me>
Sat Sep 05 00:05:04 2026
committer
GitHub <noreply@github.com>
Sat Sep 05 00:05:04 2026
tree
5110e7c7bd06c1a00712c921da230f17786e9027
parent
2cbdbc9ad7ff40457023c8f353161069df8eb57f [diff]
[clang-tidy] Normalize windows line filter paths (#217038)
`git | clang-tidy-diff.py` emits line-filter paths with forward slashes,
while Windows compilation databases use a mix of forwards and backwards
slashes. These paths are then silently rejected (and no report is
emitted).
Reproduce on windows via:
```
git.exe diff -U0 main -- . | python clang-tidy-diff.py -p1 -path .\build"
```
Git will produce a path like:
```
my/source/file.cpp
```
The compilation database has files with entries like this:
```
"file": "C:\\dev\\repo\\my\\source\\file.cpp",
"output": "my\\source\\CMakeFiles\\source.dir\\file.cpp.obj"
```
Clang tidy tries to match these paths, but fails on the slash
comparison.
Do a few things to fix this:
* Normalize filter paths with `llvm::sys::path::convert_to_slash()`
before matching the compilation database. This is a no-op on posix, but
converts windows forward slashes to backwards.
* Normalize `Filter.Name` paths when parsed
* Write a couple more unit tests for windows specific paths that expose
this behavior
* Enable another UNSUPPORTED test for windows clang-tidy-diff (and make
it run in a nested directory to exercise the issue
Fixes https://github.com/llvm/llvm-project/issues/112038.
* clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp[diff]
* clang-tools-extra/clang-tidy/ClangTidyOptions.cpp[diff]
* clang-tools-extra/docs/ReleaseNotes.md[diff]
</excerpt>
</source>
<source kind="search">
<title>[llvm-branch-commits] [clang-tools-extra] [clang-tidy] Normalize windows line filter paths (#217038) (PR #221500)</title>
<location>https://www.mail-archive.com/llvm-branch-commits%40lists.llvm.org/msg91801.html</location>
<excerpt>citeturn0search0 [wordlim: 200] Published: last month; Crawled: last month; Subject: [PATCH] [clang-tidy] Normalize windows line filter paths (#217038)
`git | clang-tidy-diff.py` emits line-filter paths with forward slashes, ... * Normalize filter paths with `llvm::sys::path::convert_to_slash()` ... #include "llvm/Support/Regex.h"
>From 48718953e78be555defdaa65f9af154f6a4aea00 Mon Sep 17 00:00:00 2001
From: Chris Apple <[email protected]>
Date: Fri, 4 Sep 2026 17:05:04 -0700
Subject: [PATCH] [clang-tidy] Normalize windows line filter paths (#217038)
`git | clang-tidy-diff.py` emits line-filter paths with forward slashes,
while Windows compilation databases use a mix of forwards and backwards
slashes. These paths are then silently rejected (and no report is
emitted).
Reproduce on windows via:
```
git.exe diff -U0 main -- . | python clang-tidy-diff.py -p1 -path .\build"
```
Git will produce a path like:
```
my/source/file.cpp
```
The compilation database has files with entries like this:
```
"file": "C:\\dev\\repo\\my\\source\\file.cpp",
"output": "my\\source\\CMakeFiles\\source.dir\\file.cpp.obj"
```
Clang tidy tries to match these paths, but fails on the slash
comparison.
Do a few things to fix this:
* Normalize filter paths with `llvm::sys::path::convert_to_slash()`
before matching the compilation database. This is a no-op on posix, but
converts windows forward slashes to backwards.
* Normalize `Filter.Name` paths when parsed
* Write a couple more unit tests for windows specific paths that expose
this behavior
* Enable another UNSUPPORTED test for windows clang-tidy-diff (and make
it run in a nested directory to exercise the issue
Fixes https://github.com/llvm/llvm-project/issues/112038.
---
.../ClangTidyDiagnosticConsumer.cpp | 5 +-
.../clang-tidy/ClangTidyOptions.cpp | 7 +-
clang-tools-extra/docs/ReleaseNotes.rst | 5 ++
.../infrastructure/clang-tidy-diff.cpp | 16 ++---
.../ClangTidyDiagnosticConsumerTest.cpp | 70 +++++++++++++++++++
clang::tidy::ClangTidyGlobalOptions &Options) {
llvm::yaml::Input Input(LineFilter);
Input >> Options.LineFilter;
- return Input.error();
+ if (const std::error_code &Error = Input.error())
+ return Error;
+
+ for (FileFilter &Filter : Options.LineFilter)
+ Filter.Name = llvm::sys::path::convert_to_slash(Filter.Name);
+ return {};
}
llvm::ErrorOr<ClangTidyOptions>
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst
b/clang-tools-extra/docs/ReleaseNotes.rst
index 697f13f99f617..c58e57e1e99d4 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -322,6 +322,11 @@ Improvements to clang-tidy
checks are `clang-diagnostic-*` ones. This allows using
:program:`clang-tidy` purely as a frontend to Clang's builtin warnings.
+- On Windows, :program:`clang-tidy` will now better match mixes of forwards and
+ backwards slashes when using the `--line-filter` option. This also improves
+ piping from :program:`git` to :program:`clang-tidy-diff.py`, where slashes
+ will now be automatically normalized.
+
New checks
^^^^^^^^^^
diff --git
a/clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-diff.cpp
b/clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-diff.cpp
index 43b7d781e6a7a..a5311adaaf190 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-diff.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-diff.cpp
@@ -1,13 +1,13 @@
-// UNSUPPORTED: system-windows
-// RUN: sed 's/placeholder_for_f/f/' %s > %t.cpp
-// RUN: clang-tidy -checks=-*,modernize-use-override %t.cpp -- -std=c++11 |
</excerpt>
</source>
<source kind="search">
<title>Extra Clang Tools 24.0.0git (In-Progress) Release Notes - Extra Clang Tools</title>
<location>https://clang.llvm.org/extra/ReleaseNotes.html</location>
<excerpt>citeturn0search1 [wordlim: 200] Crawled: yesterday; * On Windows, clang-tidy will now better match mixes of forwards and backwards slashes when using the `--line-filter` option. ... * Fixed a crash in clang-tidy when `HeaderFileExtensions` or `ImplementationFileExtensions` contains an invalid entry, such as one with a leading dot. ... * New llvm-invalid-regex-pattern check.
### Improvements to clang-doc#
### Improvements to clang-query#
### Improvements to clang-tidy#
* Improved check_clang_tidy.py by adding support of `-std=cXX-or-earlier` values, mirroring the existing `-std=cXX-or-later`. New construct expands to the given standard and every earlier one.
* On Windows, clang-tidy will now better match mixes of forwards and backwards slashes when using the `--line-filter` option. This also improves piping from git to clang-tidy-diff.py, where slashes will now be automatically normalized.
* Fixed a crash in clang-tidy when `HeaderFileExtensions` or `ImplementationFileExtensions` contains an invalid entry, such as one with a leading dot. The invalid option is now reported as a warning.
#### New checks#
* New llvm-invalid-regex-pattern check.
Detects malformed regex patterns defined in a single string literal.
* New modernize-use-if-consteval check.
Replaces direct `std::is_constant_evaluated()` checks in `if` statements with C++23’s `if consteval` syntax.
</excerpt>
</source>
<omitted_sources count="64">Additional source records were omitted from this bounded result.</omitted_sources>
</source_evidence>
Citations:
- 1: https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
- 2: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/%2B/9faf317eff5ef76aff7addfbd0360f380e803026?utm_source=openai
Script executed:
set -eu
printf'%s\n''--- changed config and hook with line numbers ---'
nl -ba cuda_core/.clang-tidy | sed -n '60,72p'
nl -ba cuda_core/build_hooks.py | sed -n '730,770p'printf'%s\n''--- clang-tidy dependency declarations ---'
rg -n -i -F --glob 'pyproject.toml' --glob 'requirements*.txt' --glob '*.lock' -e 'clang-tidy' -e 'clang_tidy'.||test"$?" -eq 1
printf'%s\n''--- relevant hook callers ---'
rg -n -F --glob '*.py' -e 'check_with_clang_tidy' -e 'compile_command' cuda_core
Repository: NVIDIA/cuda-python
Length of output: 3667
Web query:
LLVM clang-tidy HeaderFilterRegex implementation Windows path normalization source ClangTidyDiagnosticConsumer.cpp HeaderFilterRegex
Result:
<source_evidence>
<source kind="search">
<title>llvm-project/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp at main · llvm/llvm-project · GitHub</title>
<location>https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp</location>
<excerpt>citeturn0search0 [wordlim: 200] Crawled: last week; llvm::Regex *ClangTidyDiagnosticConsumer::getExcludeHeaderFilter() {
Level, (Description + " [" + CheckName + "]").str());
CheckNamesByDiagnosticID.try_emplace(ID, CheckName);
return DiagEngine->Report(Loc, ID);
}
DiagnosticBuilder ClangTidyContext::diag(
StringRef CheckName, StringRef Description,
DiagnosticIDs::Level Level /* = DiagnosticIDs::Warning*/) {
const unsigned ID = DiagEngine->getDiagnosticIDs()->getCustomDiagID(
Level, (Description + " [" + CheckName + "]").str());
CheckNamesByDiagnosticID.try_emplace(ID, CheckName);
return DiagEngine->Report(ID);
}
DiagnosticBuilder ClangTidyContext::diag(const tooling::Diagnostic &Error) {
SourceManager &SM = DiagEngine->getSourceManager();
FileManager &FM = SM.getFileManager();
const FileEntryRef File =
llvm::cantFail(FM.getFileRef(Error.Message.FilePath));
const FileID ID = SM.getOrCreateFileID(File, SrcMgr::C_User);
const SourceLocation FileStartLoc = SM.getLocForStartOfFile(ID);
const SourceLocation Loc = FileStartLoc.getLocWithOffset(
static_cast<SourceLocation::IntTy>(Error.Message.FileOffset));
return diag(Error.DiagnosticName, Loc, Error.Message.Message,
static_cast<DiagnosticIDs::Level>(Error.DiagLevel));
}
DiagnosticBuilder ClangTidyContext::configurationDiag(
StringRef Message,
DiagnosticIDs::Level Level /* = DiagnosticIDs::Warning*/) {
return diag("clang-tidy-config", Message, Level);
}
bool ClangTidyContext::shouldSuppressDiagnostic(
DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info,
SmallVectorImpl<tooling::Diagnostic> &NoLintErrors, bool AllowIO,
bool EnableNoLintBlocks) {
const std::string CheckName = getCheckName(Info.getID());
return NoLintHandler.shouldSuppress(DiagLevel, Info, CheckName, NoLintErrors,
AllowIO, EnableNoLintBlocks);
}
void ClangTidyContext::setSourceManager(SourceManager *SourceMgr) {
DiagEngine->setSourceManager(SourceMgr);
}
static bool parseFileExtensions(llvm::ArrayRef<std::string> AllFileExtensions,
FileExtensionsSet &FileExtensions) {
FileExtensions.clear();
for (const StringRef Suffix : AllFileExtensions) {
StringRef Extension = Suffix.trim();
if (!llvm::all_of(Extension, isAlphanumeric))
return false;
FileExtensions.insert(Extension);
}
return true;
}
void ClangTidyContext::setCurrentFile(StringRef File) {
CurrentFile = std::string(File);
CurrentOptions = getOptionsForFile(CurrentFile);
CheckFilter = std::make_unique<CachedGlobList>(
StringRef(getOptions().Checks.value_or("")));
WarningAsErrorFilter = std::make_unique<CachedGlobList>(
StringRef(getOptions().WarningsAsErrors.value_or("")));
static const std::vector<std::string> EmptyFileExtensions;
if (!parseFileExtensions(getOptions().HeaderFileExtensions
? *getOptions().HeaderFileExtensions
: EmptyFileExtensions,
HeaderFileExtensions))
this->configurationDiag("Invalid header file extensions");
if (!parseFileExtensions(getOptions().ImplementationFileExtensions
? *getOptions().ImplementationFileExtensions
: EmptyFileExtensions,
ImplementationFileExtensions))
this->configurationDiag("Invalid implementation file extensions");
}
void ClangTidyContext::setASTContext(ASTContext *Context) {
DiagEngine->SetArgToStringFn(&FormatASTNodeDiagnosticArgument, Context);
LangOpts = Context->getLangOpts();
void ClangTidyDiagnosticConsumer::forwardDiagnostic(const Diagnostic &Info) {
// Acquire a diagnostic ID also in the external diagnostics engine.
const auto DiagLevelAndFormatString =
Context.getDiagLevelAndFormatString(Info.getID(), Info.getLocation());
const unsigned ExternalID =
ExternalDiagEngine->getDiagnosticIDs()->getCustomDiagID(
DiagLevelAndFormatString.first, DiagLevelAndFormatString.second);
// Forward the details.
const auto Builder =
ExternalDiagEngine->Report(Info.getLocation(), ExternalID);
for (const FixItHint &Hint : Info.getFixItHints())
Builder << Hint;
for (const auto Range : Info.getRanges())
Builder << Range;
for (unsigned Index = 0; Index < Info.getNumArgs(); ++Index) {
const DiagnosticsEngine::ArgumentKind Kind = Info.getArgKind(Index);
switch (Kind) {
case DiagnosticsEngine::ak_std_string:
Builder << Info.getArgStdStr(Index);
break;
case DiagnosticsEngine::ak_c_string:
Builder << Info.getArgCStr(Index);
break;
case DiagnosticsEngine::ak_sint:
Builder << Info.getArgSInt(Index);
Builder << reinterpret_cast<AttributeCommonInfo *>(Info.getRawArg(Index));
break;
case DiagnosticsEngine::ak_addrspace:
Builder << static_cast<LangAS>(Info.getRawArg(Index));
break;
case DiagnosticsEngine::ak_expr:
Builder << reinterpret_cast<const Expr *>(Info.getRawArg(Index));
}
}
}
void ClangTidyDiagnosticConsumer::checkFilters(SourceLocation Location,
unsigned DiagnosticID,
const SourceManager &Sources) {
// Invalid location may mean a diagnostic in a command line, don't skip these.
if (!Location.isValid()) {
LastErrorRelatesToUserCode = true;
LastErrorPassesLineFilter = true;
return;
}
if (!Context.getOptions().SystemHeaders.value_or(false)) {
if (Context.isCompilerDiagnostic(DiagnosticID)) {
if (Context.DiagEngine->getDiagnosticIDs()->shouldSuppressAsSystemWarning(
DiagnosticID, Location, *Context.DiagEngine))
return;
} else {
if (Sources.isInSystemHeader(Location) ||
Sources.isInSystemMacro(Location))
return;
}
}
// FIXME: We start with a conservative approach here, but the actual type of
// location needed depends on the check (in particular, where this check wants
// to apply fixes).
const FileID FID = Sources.getDecomposedExpansionLoc(Location).first;
OptionalFileEntryRef File = Sources.getFileEntryRefForID(FID);
// -DMACRO definitions on the command line have locations in a virtual buffer
// that doesn't have a FileEntry. Don't skip these as well.
if (!File) {
LastErrorRelatesToUserCode = true;
LastErrorPassesLineFilter = true;
return;
}
const StringRef FileName(File->getName());
LastErrorRelatesToUserCode = LastErrorRelatesToUserCode ||
Sources.isInMainFile(Location) ||
(getHeaderFilter()->match(FileName) &&
!getExcludeHeaderFilter()->match(FileName));
const unsigned LineNumber = Sources.getExpansionLineNumber(Location);
LastErrorPassesLineFilter =
LastErrorPassesLineFilter || passesLineFilter(FileName, LineNumber);
}
llvm::Regex *ClangTidyDiagnosticConsumer::getHeaderFilter() {
if (!HeaderFilter)
HeaderFilter = std::make_unique<llvm::Regex>(
Context.getOptions().HeaderFilterRegex.value_or(""));
return HeaderFilter.get();
}
llvm::Regex *ClangTidyDiagnosticConsumer::getExcludeHeaderFilter() {
if (!ExcludeHeaderFilter)
ExcludeHeaderFilter = std::make_unique<llvm::Regex>(
switch (Type) {
case ET_Begin:
Priority = {Begin, Type, -End, -ErrorSize, ErrorId};
break;
case ET_Insert:
Priority = {Begin, Type, -End, ErrorSize, ErrorId};
break;
case ET_End:
Priority = {End, Type, -Begin, ErrorSize, ErrorId};
break;
}
}
bool operator<(const Event &Other) const {
return Priority < Other.Priority;
}
// Determines if this event is the begin or the end of an interval.
EventType Type;
// The index of the error to which the interval that generated this event
// belongs.
unsigned ErrorId;
// The events will be sorted based on this field.
std::tuple<unsigned, EventType, int, int, unsigned> Priority;
};
// Compute error sizes.
std::vector<int> Sizes;
std::vector<
std::pair<ClangTidyError *, llvm::StringMap<tooling::Replacements> *>>
ErrorFixes;
for (auto &Error : Errors)
if (const auto *Fix = getFixIt(Error, GetFixesFromNotes))
ErrorFixes.emplace_back(
&Error, const_cast<llvm::StringMap<tooling::Replacements> *>(Fix));
for (const auto &ErrorAndFix : ErrorFixes) {
int Size = 0;
for (const auto &FileAndReplaces : *ErrorAndFix.second)
for (const auto &Replace : FileAndReplaces.second)
Size += Replace.getLength();
Sizes.push_back(Size);
}
// Build events from error intervals.
llvm::StringMap<std::vector<Event>> FileEvents;
for (unsigned I = 0; I < ErrorFixes.size(); ++I) {
for (const auto &FileAndReplace : *ErrorFixes[I].second) {
for (const auto &Replace : FileAndReplace.second) {
const unsigned Begin = Replace.getOffset();
const unsigned End = Begin + Replace.getLength();
auto &Events = FileEvents[Replace.getFilePath()];
if (Begin == End) {
Events.emplace_back(Begin, End, Event::ET_Insert, I, Sizes[I]);
} else {
Events.emplace_back(Begin, End, Event::ET_Begin, I, Sizes[I]);
Events.emplace_back(Begin, End, Event::ET_End, I, Sizes[I]);
}
}
}
}
llvm::BitVector Apply(ErrorFixes.size(), true);
for (auto &FileAndEvents : FileEvents) {
std::vector<Event> &Events = FileAndEvents.second;
// Sweep.
</excerpt>
</source>
<source kind="search">
<title>clang-tools: ClangTidyDiagnosticConsumer.cpp Source File</title>
<location>https://clang.llvm.org/extra/doxygen/ClangTidyDiagnosticConsumer_8cpp_source.html</location>
<excerpt>citeturn0search3 [wordlim: 200] Crawled: last week; 386 void ClangTidyDiagnosticConsumer::EndSourceFile() { ... 635 llvm::Regex *ClangTidyDiagnosticConsumer::getExcludeHeaderFilter() { ... Definition ClangTidyDiagnosticConsumer.cpp:298
488 bool ClangTidyDiagnosticConsumer::passesLineFilter(StringRef FileName,
489 unsigned LineNumber) const {
490 if (Context.getGlobalOptions().LineFilter.empty())
491 return true;
492 const std::string NormalizedFileName =
493 llvm::sys::path::convert_to_slash(FileName);
494 for (const FileFilter &Filter : Context.getGlobalOptions().LineFilter) {
495 if (StringRef(NormalizedFileName).ends_with(Filter.Name)) {
496 if (Filter.LineRanges.empty())
497 return true;
498 return llvm::any_of(
499 Filter.LineRanges, [&](const FileFilter::LineRange &Range) {
500 return Range.first <= LineNumber && LineNumber <= Range.second;
501 });
502 }
503 }
504 return false;
505}
507 void ClangTidyDiagnosticConsumer::forwardDiagnostic(const Diagnostic &Info) {
508 // Acquire a diagnostic ID also in the external diagnostics engine.
509 const auto DiagLevelAndFormatString =
510 Context.getDiagLevelAndFormatString(Info.getID(), Info.getLocation());
File) {
612 LastErrorRelatesToUserCode = true;
613 LastErrorPassesLineFilter = true;
614 return;
615 }
616
617 const StringRef FileName(File->getName());
618 LastErrorRelatesToUserCode = LastErrorRelatesToUserCode ||
619 Sources.isInMainFile(Location) ||
620 (getHeaderFilter()->match(FileName) &&
621 !getExcludeHeaderFilter()->match(FileName));
622
623 const unsigned LineNumber = Sources.getExpansionLineNumber(Location);
624 LastErrorPassesLineFilter =
625 LastErrorPassesLineFilter || passesLineFilter(FileName, LineNumber);
626}
627
628 llvm::Regex *ClangTidyDiagnosticConsumer::getHeaderFilter() {
629 if (!HeaderFilter)
630 HeaderFilter = std::make_unique<llvm::Regex>(
631 Context.getOptions().HeaderFilterRegex.value_or(""));
632 return HeaderFilter.get();
633}
634
635 llvm::Regex *ClangTidyDiagnosticConsumer::getExcludeHeaderFilter() {
636 if (!ExcludeHeaderFilter)
637 ExcludeHeaderFilter = std::make_unique<llvm::Regex>(
638 Context.getOptions().ExcludeHeaderFilterRegex.value_or(""));
639 return ExcludeHeaderFilter.get();
640}
</excerpt>
</source>
<source kind="search">
<title>clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp - llvm-project - Git at Google</title>
<location>https://llvm.googlesource.com/llvm-project/%2B/cc54129b983799e1aaea77aa0ff3040dc30cbc8c/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp</location>
<excerpt>citeturn0search1 [wordlim: 200] Crawled: 3 weeks ago; | ExcludeHeaderFilter = std::make_unique<llvm::Regex>( ... | void ClangTidyDiagnosticConsumer::finalizeLastError() {
| bool RemoveIncompatibleErrors, bool GetFixesFromNotes,
| bool EnableNolintBlocks)
| : Context(Ctx), ExternalDiagEngine(ExternalDiagEngine),
| RemoveIncompatibleErrors(RemoveIncompatibleErrors),
| GetFixesFromNotes(GetFixesFromNotes),
| EnableNolintBlocks(EnableNolintBlocks) {
|
| if (Context.getOptions().HeaderFilterRegex &&
| !Context.getOptions().HeaderFilterRegex->empty())
| HeaderFilter =
| std::make_unique<llvm::Regex>(*Context.getOptions().HeaderFilterRegex);
|
| if (Context.getOptions().ExcludeHeaderFilterRegex &&
| !Context.getOptions().ExcludeHeaderFilterRegex->empty())
| ExcludeHeaderFilter = std::make_unique<llvm::Regex>(
| *Context.getOptions().ExcludeHeaderFilterRegex);
| }
|
| void ClangTidyDiagnosticConsumer::finalizeLastError() {
| if (!Errors.empty()) {
| ClangTidyError &Error = Errors.back();
| if (Error.DiagnosticName == "clang-tidy-config") {
| // Never ignore these.
| } else if (!Context.isCheckEnabled(Error.DiagnosticName) &&
| Error.DiagLevel != ClangTidyError::Error) {
| ++Context.Stats.ErrorsIgnoredCheckFilter;
| Errors.pop_back();
| } else if (!LastErrorRelatesToUserCode) {
| ++Context.Stats.ErrorsIgnoredNonUserCode;
| Errors.pop_back();
| } else if (!LastErrorPassesLineFilter) {
| ++Context.Stats.ErrorsIgnoredLineFilter;
| Errors.pop_back();
| } else {
| ++Context.Stats.ErrorsDisplayed;
| }
| }
| LastErrorRelatesToUserCode = false;
| LastErrorPassesLineFilter = false;
| }
|
| namespace clang::tidy {
|
| const llvm::StringMap<tooling::Replacements> *
| getFixIt(const tooling::Diagnostic &Diagnostic, bool AnyFix) {
| if (!Diagnostic.Message.Fix.empty())
| return &Diagnostic.Message.Fix;
| if (!AnyFix)
| return nullptr;
| const llvm::StringMap<tooling::Replacements> *Result = nullptr;
| for (const auto &Note : Diagnostic.Notes) {
| if (!Note.Fix.empty()) {
| if (Result)
| // We have 2 different fixes in notes, bail out.
| return nullptr;
| Result = &Note.Fix;
</excerpt>
</source>
<source kind="search">
<title>[clang-tidy] -line-filter only works with windows path separators on Windows · Issue #112038 · llvm/llvm-project · GitHub</title>
<location>GitHub issue 112038 in llvm/llvm-project (link omitted to avoid creating a cross-reference)</location>
<excerpt>citeturn0search2 [wordlim: 200] Published: 2.0 years ago; Crawled: last month; llvm-project/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp ... I got it to work by using windows path separators (that had to be escaped), i.e. `src\\subfolder\\myfile.cpp` instead of `src/subfolder/myfile.cpp`. (even when using MINGW64/Git bash that is included in Git for Windows, this solution is neccessary) ... to join this conversation on GitHub.
To ensure unique file names in the filter, I wanted to use paths with folders (instead of `myfile.cpp` use `src/subfolder/myfile.cpp`. I saw in the source that `endswith` is used on the file name (which I assume is a relative or absolute file path).
llvm-project/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
Line 468 in 58d9703
| if (FileName.ends_with(Filter.Name)) {
I got it to work by using windows path separators (that had to be escaped), i.e. `src\\subfolder\\myfile.cpp` instead of `src/subfolder/myfile.cpp`. (even when using MINGW64/Git bash that is included in Git for Windows, this solution is neccessary)
`-line-filter='[{"name":"subfolder\\myfile.cpp","lines":[[10,35]]}]'`
This is a problem because I want to use `clang-tidy-diff.py`. It does work by modifying `clang-tidy-diff.py`
from
`lines_by_file.setdefault(filename, []).append([start_line, end_line])`
to
`lines_by_file.setdefault(filename.replace("/", "\\"), []).append([start_line, end_line])`
but it doesn't feel right that clang-tidy can't handle this internally.
The example usage of `clang-tidy-diff.py` is with git diff, which outputs unix path separators `/`.
## Activity
to join this conversation on GitHub. Already have an account? Sign in to comment
## Metadata
## Metadata
### Assignees
No one assigned
### Labels
clang-tidyenhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing feature
### Type
No type
### Projects
* LLVM Release Status
Status
Done
Show more project fields
### Milestone
* LLVM 23.x ReleaseNo due date
### Relationships
None yet
### Development
No branches or pull requests</excerpt>
</source>
<source kind="search">
<title>⚙ D34654 Allow passing a regex for headers to exclude from clang-tidy</title>
<location>https://reviews.llvm.org/D34654</location>
<excerpt>citeturn0search4 [wordlim: 200] Published: 9.3 years ago; Crawled: 2.9 years ago; ClangTidyDiagnosticConsumer.cpp ... llvm::Regex *ClangTidyDiagnosticConsumer::getExcludeHeaderFilter() {
std::unique_ptr<llvm::Regex> ExcludeHeaderFilter;
bool LastErrorRelatesToUserCode; bool LastErrorRelatesToUserCode;
bool LastErrorPassesLineFilter; bool LastErrorPassesLineFilter;
bool LastErrorWasIgnored; bool LastErrorWasIgnored;
}; };
} // end namespace tidy } // end namespace tidy
} // end namespace clang } // end namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYDIAGNOSTICCONSUMER_H #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYDIAGNOSTICCONSUMER_H
# clang-tidy/ClangTidyDiagnosticConsumer.cpp
Show First 20 Lines • Show All 467 Lines • ▼ Show 20 Lines if (!File) {
LastErrorRelatesToUserCode = true; LastErrorRelatesToUserCode = true;
LastErrorPassesLineFilter = true; LastErrorPassesLineFilter = true;
return; return;
} }
StringRef FileName(File->getName()); StringRef FileName(File->getName());
LastErrorRelatesToUserCode = LastErrorRelatesToUserCode || LastErrorRelatesToUserCode = LastErrorRelatesToUserCode ||
Sources.isInMainFile(Location) || Sources.isInMainFile(Location) ||
</excerpt>
</source>
<omitted_sources count="25">Additional source records were omitted from this bounded result.</omitted_sources>
</source_evidence>
Citations:
- 1: https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp?utm_source=openai
- 2: https://clang.llvm.org/extra/doxygen/ClangTidyDiagnosticConsumer_8cpp_source.html?utm_source=openai
- 3: https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp?utm_source=openai
Web query:
llvmorg-22.1.8 ClangTidyDiagnosticConsumer.cpp HeaderFilterRegex File->getName Windows path separator FileEntry getName
Result:
<source_evidence>
<source kind="find_in_page">
<title>llvm-project/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp at llvmorg-22.1.8 · llvm/llvm-project · GitHub</title>
<location>https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp</location>
<excerpt>citeturn2view1 [wordlim: 200] Crawled: today; Content type: text/html; Source: find({"ref_id":"turn1view0","pattern":"HeaderFilter->match"}); Total lines: 3269
No matching text found for "HeaderFilter->match"</excerpt>
</source>
<source kind="find_in_page">
<title>llvm-project/llvm/include/llvm/Support/Path.h at llvmorg-22.1.8 · llvm/llvm-project · GitHub</title>
<location>https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/llvm/include/llvm/Support/Path.h</location>
<excerpt>citeturn2view2 [wordlim: 200] Crawled: today; Content type: text/html; Source: find({"ref_id":"turn1view1","pattern":"convert_to_slash"}); Total lines: 2342
L1785: Style style = Style::native);
L1786:
L1787: /// Convert path to the native form in place. This is used to give paths to
L1788:
L1789: /// users and operating system calls in the platform's normal way. For example,
L1790:
L1791: /// on Windows all '/' are converted to '\'.
L1792:
L1793: ///
L1794:
L1795: /// @param path A path that is transformed to native format.
L1796:
L1797: LLVM_ABI void native(SmallVectorImpl<char> &path, Style style = Style::native);
L1798:
L1799: /// For Windows path styles, convert path to use the preferred path separators.
L1800:
L1801: /// For other styles, do nothing.
L1802:
L1803: ///
L1804: /// @param path A path that is transformed to preferred format.
L1805:
L1806: inline void make_preferred(SmallVectorImpl<char> &path,
L1807:
L1808: Style style = Style::native) {
L1809:
L1810: if (!is_style_windows(style))
L1811:
L1812: return;
L1813:
L1814: native(path, style);
L1815:
L1816: }
L1817:
L1818: /// Replaces backslashes with slashes if Windows.
L1819:
L1820: ///
L1821:
L1822: /// @param path processed path
L1823:
L1824: /// @result The result of replacing backslashes with forward slashes if Windows.
L1825:
L1826: /// On Unix, this function is a no-op because backslashes are valid path
L1827:
L1828: /// chracters.
L1829: LLVM_ABI std::string convert_to_slash(StringRef path,
L1830:
L1831: Style style = Style::native);
L1832:
L1833: /// @}
L1834:
L1835: /// @name Lexical Observers
L1836:
L1837: /// @{
L1838:
L1839: /// Get root name.
L1840:
L1841: ///
L1842:
L1843: /// @code
L1844:
L1845: /// //net/hello => //net
L1846:
L1847: /// c:/hello => c: (on Windows, on other platforms nothing)
L1848:
L1849: /// /hello => <empty>
L1850:
L1851: /// @endcode
L1852:
L1853: ///
L1854:
L1855: /// @param path Input path.
L1856:
L1857: /// @result The root name of \a path if it has one, otherwise "".
L1858:
L1859: LLVM_ABI StringRef root_name(StringRef path LLVM_LIFETIME_BOUND,
L1860:
L1861: Style style = Style::native);
L1862: /// Get root directory.
L1863:
L1864: ///
L1865:
L1866: /// @code
L1867:
L1868: /// /goo/hello => /
L1869:
L1870: /// c:/hello => /
L1871:
L1872: /// d/file.txt => <empty>
L1873:
L1874: /// @endcode
L1875:
L1876: ///
L1877:
L1878: /// @param path Input path.
L1879:
L1880: /// @result The root directory of \a path if it has one, otherwise
L1881:
L1882: /// "".
L1883:
L1884: LLVM_ABI StringRef root_directory(StringRef path LLVM_LIFETIME_BOUND,
L1885:
L1886: Style style = Style::native);
L1887:
L1888: /// Get root path.
L1889:
L1890: ///
L1891:
L1892: /// Equivalent to root_name + root_directory.
L1893:
L1894: ///
L1895:
L1896: /// @param path Input path.
L1897:
L1898: /// @result The root path of \a path if it has one, otherwise "".
L1899: LLVM_ABI StringRef root_path(StringRef path LLVM_LIFETIME_BOUND,
L1900:
L1901: Style style = Style::native);
L1902:
L1903: /// Get relative path.
L1904:
L1905: ///
L1906:
L1907: /// @code
L1908:
L1909: /// C:\hello\world => hello\world
L1910:
L1911: /// foo/bar => foo/bar
L1912:
L1913: /// /foo/bar => foo/bar
L1914:
L1915: /// @endcode
L1916:
L1917: ///
L1918:
L1919: /// @param path Input path.
L1920:
L1921: /// @result The path starting after root_path if one exists, otherwise "".
L1922:
L1923: LLVM_ABI StringRef relative_path(StringRef path LLVM_LIFETIME_BOUND,
L1924:
L1925: Style style = Style::native);
L1926:
L1927: /// Get parent path.
L1928:
L1929: ///
L1930:
L1931: /// @code
L1932:
L1933: /// / => <empty>
L1934: /// /foo => /
L1935:
L1936: /// foo/../bar => foo/..
L1937:
L1938: /// @endcode
L1939:
L1940: ///
L1941:
L1942: /// @param path Input path.
L1943:
L1944: /// @result The parent path of \a path if one exists, otherwise "".
L1945:
L1946: LLVM_ABI StringRef parent_path(StringRef path LLVM_LIFETIME_BOUND,
L1947:
L1948: Style style = Style::native);
L1949:
L1950: /// Get filename.
L1951:
L1952: ///
L1953:
L1954: /// @code
L1955:
L1956: /// /foo.txt => foo.txt
L1957:
L1958: /// . => .
L1959:
L1960: /// .. => ..
L1961:
L1962: /// / => /
L1963:
L1964: /// @endcode
L1965:
L1966: ///
L1967:
L1968: /// @param path Input path.
L1969:
L1970: /// @result The filename part of \a path. This is defined as the last component
L1971: /// of \a path. Similar to the POSIX "basename" utility.
L1972:
L1973: LLVM_ABI StringRef filename(StringRef path LLVM_LIFETIME_BOUND,
L1974:
L1975: Style style = Style::native);
L1976:
L1977: /// Get stem.
L1978:
L1979: ///
L1980:
L1981: /// If filename contains a dot but not solely one or two dots, result is the
L1982:
L1983: /// substring of filename ending at (but not including) the last dot. Otherwise
L1984:
L1985: /// it is filename.
L1986:
L1987: ///
L1988:
L1989: /// @code
L1990:
L1991: /// /foo/bar.txt => bar
L1992:
L1993: /// /foo/bar => bar
L1994:
L1995: /// /foo/.txt => <empty>
L1996:
L1997: /// /foo/. => .
L1998:
L1999: /// /foo/.. => ..
L2000:
L2001: /// @endcode
L2002:
L2003: ///
L2004: /// @param path Input path.
L2005:
L2006: /// @result The stem of \a path.
L2007:
L2008: LLVM_ABI StringRef stem(StringRef path LLVM_LIFETIME_BOUND,
L2009:
L2010: Style style = Style::native);
L2011:
L2012: /// Get extension.
L2013:
L2014: ///
L2015:
</excerpt>
</source>
<source kind="find_in_page">
<title>llvm-project/clang/include/clang/Basic/FileManager.h at llvmorg-22.1.8 · llvm/llvm-project · GitHub</title>
<location>https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang/include/clang/Basic/FileManager.h</location>
<excerpt>citeturn2view3 [wordlim: 200] Crawled: today; Content type: text/html; Source: find({"ref_id":"turn1view2","pattern":"getName() const"}); Total lines: 1385
No matching text found for "getName() const"</excerpt>
</source>
<source kind="open_page">
<title>llvm-project/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp at llvmorg-22.1.8 · llvm/llvm-project · GitHub</title>
<location>https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp</location>
<excerpt>citeturn1view0 [wordlim: 200] Crawled: last week; Content type: text/html; Source: open({"ref_id":"https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp","lineno":null}); Total lines: 3290
L0: 【0†Skip to content】
L1: ## Navigation Menu
L2:
L3: 【1†Sign in】
L4:
L5: Appearance settings
L6:
L7: * Platform
L8:
L9: * AI CODE CREATION
L10: * 【2†GitHub CopilotWrite better code with AI】
L11: * 【3†GitHub Copilot appDirect agents from issue to merge】
L12: * 【4†MCP RegistryIntegrate external tools】
L13:
L14: * DEVELOPER WORKFLOWS
L15: * 【5†ActionsAutomate any workflow】
L16: * 【6†CodespacesInstant dev environments】
L17: * 【7†IssuesPlan and track work】
L18: * 【8†Code ReviewManage code changes】
L19: * 【9†Code QualityEnforce quality at merge】
L20: * APPLICATION SECURITY
L21: * 【10†GitHub Advanced SecurityFind and fix vulnerabilities】
L22: * 【11†Code securitySecure your code as you build】
L23: * 【12†Secret protectionStop leaks before they start】
L24:
L25: * EXPLORE
L26: * 【13†Why GitHub】
L27: * 【14†Documentation†docs.github.com】
L28: * 【15†Blog†github.blog】
L29: * 【16†Changelog†github.blog】
L30: * 【17†Marketplace】
L31:
L32: 【18†View all features】
L33:
L34: * Solutions
L35: * BY COMPANY SIZE
L36: * 【19†Enterprises】
L37: * 【20†Small and medium teams】
L38: * 【21†Startups】
L39: * 【22†Nonprofits】
L40:
L41: * BY USE CASE
L42: * 【23†App Modernization】
L43: * 【24†DevSecOps】
L44: * 【25†DevOps】
L45: * 【26†CI/CD】
L46: * 【27†View all use cases】
L47:
L48: * BY INDUSTRY
L49: * 【28†Healthcare】
L50: * 【29†Financial services】
L51: * 【30†Manufacturing】
L52: * 【31†Government】
L53: * 【32†View all industries】
L54:
L55: 【33†View all solutions】
L56:
L57: * Resources
L58: * EXPLORE BY TOPIC
L59: * 【34†AI】
L60: * 【35†Software Development】
L61: * 【36†DevOps】
L62: * 【37†Security】
L63: * 【38†View all topics】
L64:
L65: * EXPLORE BY TYPE
L66: * 【39†Customer stories】
L67: * 【40†Events & webinars】
L68: * 【41†Ebooks & reports】
L69: * 【42†Business insights】
L70: * 【43†GitHub Skills†skills.github.com】
L71: * SUPPORT & SERVICES
L72: * 【14†Documentation†docs.github.com】
L73: * 【44†Customer support†support.github.com】
L74: * 【45†Community forum】
L75: * 【46†Trust center】
L76: * 【47†Partners】
L77:
L78: 【48†View all resources】
L79:
L80: * Open Source
L81:
L82: * COMMUNITY
L83: * 【49†GitHub SponsorsFund open source developers】
L84: * PROGRAMS
L85: * 【50†Security Lab†securitylab.github.com】
L86: * 【51†Maintainer Community†maintainers.github.com】
L87: * 【52†GitHub Stars†stars.github.com】
L88: * 【53†Archive Program†archiveprogram.github.com】
L89:
L90: * REPOSITORIES
L91: * 【54†Topics】
L92: * 【55†Trending】
L93: * 【56†Collections】
L94:
L95: * Enterprise
L96:
L97: * ENTERPRISE SOLUTIONS
L98: * 【19†Enterprise platformAI-powered developer platform】
L99: * AVAILABLE ADD-ONS
L100: * 【10†GitHub Advanced SecurityEnterprise-grade security features】
L101: * 【57†Copilot for BusinessEnterprise-grade AI features】
L102: * 【58†Premium SupportEnterprise-grade 24/7 support】
L103:
L104: * 【59†Pricing】
L105:
L106: Search`/`
L107:
L108: 【1†Sign in】
L109:
L110: 【60†Sign up】
L111:
L112: Appearance settings
L113: You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
L114:
L115: 1. 【61†llvm】
L116: 2. 【62†llvm-project】
L117: ## Repository navigation
L118:
L119: * * 【62†Code】
L120: * 【63†Issues5k+ (5k+)】
L121: * 【64†Pull requests5k+ (5k+)】
L122: * 【65†Actions】
L123: * 【66†Security and quality】
L124: * 【67†Insights】
L125:
L126: More items
L127:
L128: ## Files Expand file tree
L129:
L130: llvmorg-22.1.8
L131:
L132: ## Breadcrumbs
L133:
L134: 1. 【68†llvm-project】
L135: 2. /【69†clang-tools-extra】
L136: 3. /【70†clang-tidy】
L137:
L138: /
L139:
L140: # ClangTidyDiagnosticConsumer.cpp
L141:
L142: Copy path
L143:
L144: [Input: Go to file]
L145:
L146: Blame More file actions
L147:
L148: Blame More file actions
L149:
L150: ## Latest commit
L151:
L152:
L153:
L154: ## History
L155:
L156: History
L157:
L158: llvmorg-22.1.8
L159: ## Breadcrumbs
L160:
L161: 1. 【68†llvm-project】
L162: 2. /【69†clang-tools-extra】
L163: 3. /【70†clang-tidy】
L164:
L165: /
L166:
L167: # ClangTidyDiagnosticConsumer.cpp
L168:
L169: Copy path
L170:
L171: Top
L172: ## File metadata and controls
L173:
L174: * Code
L175:
L176: * Blame
L177:
L178: 835 lines (749 loc) · 31.8 KB
L179:
L180: 【71†Raw】
L181:
L182: Copy raw file
L183:
L184: Download raw file
L185:
L186: Open symbols panel
L187:
L188: Edit and raw actions
L189:
L190: 1
L191:
L192: 2
L193:
L194: 3
L195:
L196: 4
L197:
L198: 5
L199:
L200: 6
L201:
L202: 7
L203:
L204: 8
L205:
L206: 9
L207:
L208: 10
L209:
L210: 11
L211:
L212: 12
L213:
L214: 13
L215:
L216: 14
L217:
L218: 15
L219:
L220: 16
L221:
L222: 17
L223:
L224: 18
L225:
L226: 19
L227:
L228: 20
L229:
L230: 21
L231:
L232: 22
L233:
L234: 23
L235:
L236: 24
L237:
L238: 25
L239:
L240: 26
L241:
L242: 27
L243:
L244: 28
L245:
L246: 29
L247:
L248: 30
L249:
L250: 31
L251:
L252: 32
L253:
L254: 33
L255:
L256: 34
L257:
L258: 35
L259:
L260: 36
L261:
L262: 37
L263:
L264: 38
L265:
L266: 39
L267:
L268: 40
L269:
L270: 41
L271:
L272: 42
L273:
L274: 43
L275:
L276: 44
L277:
L278: 45
L279:
L280: 46
L281:
L282: 47
L283:
L284: 48
L285:
L286: 49
L287:
L288: 50
L289:
L290: 51
L291:
L292: 52
L293:
L294: 53
L295:
L296: 54
L297:
L298: 55
L299:
L300: 56
L301:
L302: 57
L303:
L304: 58
L305:
L306: 59
L307:
L308: 60
L309:
L310: 61
L311:
L312: 62
L313:
L314: 63
L315:
L316: 64
L317:
L318: 65
L319:
L320: 66
L321:
L322: 67
L323:
L324: 68
L325:
L326: 69
L327:
L328: 70
L329:
L330: 71
L331:
L332: 72
L333:
L334: 73
L335:
L336: 74
L337:
L338: 75
L339:
L340: 76
L341:
L342: 77
L343:
L344: 78
L345:
L346: 79
L347:
L348: 80
L349:
L350: 81
L351:
L352: 82
L353:
L354: 83
L355:
L356: 84
L357:
L358: 85
L359:
L360: 86
L361:
L362: 87
L363:
L364: 88
</excerpt>
</source>
<source kind="open_page">
<title>llvm-project/llvm/include/llvm/Support/Path.h at llvmorg-22.1.8 · llvm/llvm-project · GitHub</title>
<location>https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/llvm/include/llvm/Support/Path.h</location>
<excerpt>citeturn1view1 [wordlim: 200] Crawled: today; Content type: text/html; Source: open({"ref_id":"https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/llvm/include/llvm/Support/Path.h","lineno":null}); Total lines: 2342
L0: 【0†Skip to content】
L1: ## Navigation Menu
L2:
L3: * Products
L4:
L5: * * 【1†GitHubRepository hosting, code review, and collaboration】
L6: * 【2†CopilotAI coding agent for tasks, projects and automated work】
L7:
L8: * Build & Ship
L9: * 【3†ActionsCI/CD and automation】
L10: * 【4†Code QualityQuality analysis, fixes, and enforcement】
L11: * 【5†CodespacesCloud development environments】
L12:
L13: * Secure
L14: * 【6†Code SecurityVulnerability detection and remediation】
L15: * 【7†Secret ProtectionSecret scanning and leak prevention】
L16: 【8†All Features】
L17:
L18: * Developers
L19:
L20: * Learn
L21: * 【9†Documentation†docs.github.com】
L22: * 【10†Training†learn.github.com】
L23: * 【11†Certifications†learn.github.com】
L24:
L25: * Build
L26: * 【12†Build with Copilot】
L27: * 【13†Customize Copilot†docs.github.com】
L28: * 【14†Integrations】
L29:
L30: * Explore
L31: * 【15†Trending repos】
L32: * 【16†GitHub Sponsors】
L33: * 【17†Events】
L34: * * 【18†ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.†github.blog】
L35:
L36: * Businesses
L37:
L38: * By Stage
L39: * 【19†Enterprises】
L40: * 【20†Team】
L41: * 【21†Startups】
L42: * 【22†Nonprofits】
L43:
L44: * By Industry
L45: * 【23†Healthcare】
L46: * 【24†Financial services】
L47: * 【25†Manufacturing】
L48: * 【26†Government】
L49: * 【27†See all industries】
L50: * Evaluate GitHub
L51: * 【28†Why GitHub】
L52: * 【29†Customer Stories】
L53: * 【30†Business insights】
L54: * 【31†Trust Center】
L55:
L56: * Add-ons
L57: * 【32†GitHub Advanced SecurityEnterprise-grade code security】
L58: * 【33†Copilot for businessEnterprise-grade AI features】
L59: * 【34†Premium SupportEnterprise-grade 24/7 support】
L60:
L61: * Resources
L62: * Learn & Connect
L63: * 【9†Documentation†docs.github.com】
L64: * 【35†Resource center】
L65: * 【36†Blog†github.blog】
L66: * 【17†Events & webinars】
L67: * 【37†Community Forum】
L68: * 【29†Customer Stories】
L69: * 【14†Integrations】
L70:
L71: * Support
L72: * 【38†Customer support†help.github.com】
L73: * 【10†Training†learn.github.com】
L74: * 【39†GitHub Status†www.githubstatus.com】
L75:
L76: * Company
L77: * 【40†About】
L78: * 【41†Partners】
L79: * 【18†Changelog†github.blog】
L80: * * 【42†GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.†githubuniverse.com】
L81:
L82: * 【43†Pricing】
L83:
L84: Search`/`
L85:
L86: 【44†Sign in】
L87:
L88: 【45†Sign up】
L89:
L90: Appearance settings
L91:
L92: You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
L93:
L94: 1. 【46†llvm】
L95: 2. 【47†llvm-project】
L96: ## Repository navigation
L97:
L98: * * 【47†Code】
L99: * 【48†Issues5k+ (5k+)】
L100: * 【49†Pull requests5k+ (5k+)】
L101: * 【50†Actions】
L102: * 【51†Security and quality】
L103: * 【52†Insights】
L104:
L105: More items
L106:
L107: ## Files Expand file tree
L108:
L109: llvmorg-22.1.8
L110:
L111: ## Breadcrumbs
L112:
L113: 1. 【53†llvm-project】
L114: 2. /【54†llvm】
L115: 3. /【55†include】
L116: 4. /【56†llvm】
L117: 5. /【57†Support】
L118:
L119: /
L120:
L121: # Path.h
L122:
L123: Copy path
L124:
L125: [Input: Go to file]
L126:
L127: Blame More file actions
L128:
L129: Blame More file actions
L130:
L131: ## Latest commit
L132:
L133:
L134:
L135: ## History
L136:
L137: History
L138:
L139: llvmorg-22.1.8
L140: ## Breadcrumbs
L141:
L142: 1. 【53†llvm-project】
L143: 2. /【54†llvm】
L144: 3. /【55†include】
L145: 4. /【56†llvm】
L146: 5. /【57†Support】
L147:
L148: /
L149:
L150: # Path.h
L151:
L152: Copy path
L153:
L154: Top
L155: ## File metadata and controls
L156:
L157: * Code
L158:
L159: * Blame
L160:
L161: 585 lines (523 loc) · 19.7 KB
L162:
L163: 【58†Raw】
L164:
L165: Copy raw file
L166:
L167: Download raw file
L168:
L169: Open symbols panel
L170:
L171: Edit and raw actions
L172:
L173: 1
L174:
L175: 2
L176:
L177: 3
L178:
L179: 4
L180:
L181: 5
L182:
L183: 6
L184:
L185: 7
L186:
L187: 8
L188:
L189: 9
L190:
L191: 10
L192:
L193: 11
L194:
L195: 12
L196:
L197: 13
L198:
L199: 14
L200:
L201: 15
L202:
L203: 16
L204:
L205: 17
L206:
L207: 18
L208:
L209: 19
L210:
L211: 20
L212:
L213: 21
L214:
L215: 22
L216:
L217: 23
L218:
L219: 24
L220:
L221: 25
L222:
L223: 26
L224:
L225: 27
L226:
L227: 28
L228:
L229: 29
L230:
L231: 30
L232:
L233: 31
L234:
L235: 32
L236:
L237: 33
L238:
L239: 34
L240:
L241: 35
L242:
L243: 36
L244:
L245: 37
L246:
L247: 38
L248:
L249: 39
L250:
L251: 40
L252:
L253: 41
L254:
L255: 42
L256:
L257: 43
L258:
L259: 44
L260:
L261: 45
L262:
L263: 46
L264:
L265: 47
L266:
L267: 48
L268:
L269: 49
L270:
L271: 50
L272:
L273: 51
L274:
L275: 52
L276:
L277: 53
L278:
L279: 54
L280:
L281: 55
L282:
L283: 56
L284:
L285: 57
L286:
L287: 58
L288:
L289: 59
L290:
L291: 60
L292:
L293: 61
L294:
L295: 62
L296:
L297: 63
L298:
L299: 64
L300:
L301: 65
L302:
L303: 66
L304:
L305: 67
L306:
L307: 68
L308:
L309: 69
L310:
L311: 70
L312:
L313: 71
L314:
L315: 72
L316:
L317: 73
L318:
L319: 74
L320:
L321: 75
L322:
L323: 76
L324:
L325: 77
L326:
L327: 78
L328:
L329: 79
L330:
L331: 80
L332:
L333: 81
L334:
L335: 82
L336:
L337: 83
L338:
L339: 84
L340:
L341: 85
L342:
L343: 86
L344:
L345: 87
L346:
L347: 88
L348: 89
L349:
L350: 90
L351:
L352: 91
L353:
L354: 92
L355:
L356: 93
L357:
L358: 94
L359:
L360: 95
L361:
L362: 96
L363:
L364: 97
L365:
L366: 98
L367:
L368: 99
L369:
L370: 100
L371:
L372: 101
L373:
L374: 102
L375:
L376: 103
L377:
L378: 104
L379:
L380: 105
L381:
L382: 106
L383:
L384: 107
L385:
L386: 108
L387:
</excerpt>
</source>
<omitted_sources count="29">Additional source records were omitted from this bounded result.</omitted_sources>
</source_evidence>
Citations:
- 1: https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
- 2: https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp?utm_source=openai
- 3: https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
Web query:
llvmorg-22.1.8 clang FileEntry getName FileManager Windows native path separator source
Result:
<source_evidence>
<source kind="find_in_page">
<title>llvm-project/clang/include/clang/Basic/FileEntry.h at llvmorg-22.1.8 · llvm/llvm-project · GitHub</title>
<location>https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang/include/clang/Basic/FileEntry.h</location>
<excerpt>citeturn2view1 [wordlim: 200] Crawled: today; Content type: text/html; Source: find({"ref_id":"turn1view0","pattern":"The name of this FileEntry"}); Total lines: 1477
L959: #include <utility>
L960:
L961: namespace llvm {
L962:
L963: class MemoryBuffer;
L964:
L965: namespace vfs {
L966:
L967: class File;
L968:
L969: } // namespace vfs
L970:
L971: } // namespace llvm
L972:
L973: namespace clang {
L974:
L975: class FileEntryRef;
L976:
L977: namespace optional_detail {
L978:
L979: /// Forward declare a template specialization for OptionalStorage.
L980:
L981: template <> class OptionalStorage<clang::FileEntryRef>;
L982:
L983: } // namespace optional_detail
L984:
L985: class FileEntry;
L986:
L987: /// A reference to a \c FileEntry that includes the name of the file as it was
L988:
L989: /// accessed by the FileManager's client.
L990: class FileEntryRef {
L991:
L992: public:
L993:
L994: /// The name of this FileEntry. If a VFS uses 'use-external-name', this is
L995:
L996: /// the redirected name. See getRequestedName().
L997:
L998: StringRef getName() const { return getBaseMapEntry().first(); }
L999:
L1000: /// The name of this FileEntry, as originally requested without applying any
L1001:
L1002: /// remappings for VFS 'use-external-name'.
L1003:
L1004: ///
L1005:
L1006: /// FIXME: this should be the semantics of getName(). See comment in
L1007:
L1008: /// FileManager::getFileRef().
L1009: StringRef getNameAsRequested() const { return ME->first(); }
L1010:
L1011: const FileEntry &getFileEntry() const {
L1012:
L1013: return *cast<FileEntry *>(getBaseMapEntry().second->V);
L1014:
L1015: }
L1016:
L1017: // This function is used if the buffer size needs to be increased
L1018:
L1019: // due to potential z/OS EBCDIC -> UTF-8 conversion
L1020:
L1021: inline void updateFileEntryBufferSize(unsigned BufferSize);
L1022:
L1023: DirectoryEntryRef getDir() const { return ME->second->Dir; }
L1024:
L1025: inline off_t getSize() const;
L1026:
L1027: inline unsigned getUID() const;
L1028: inline const llvm::sys::fs::UniqueID &getUniqueID() const;
L1029:
L1030: inline time_t getModificationTime() const;
L1031:
L1032: inline bool isNamedPipe() const;
L1033:
L1034: inline bool isDeviceFile() const;
L1035:
L1036: inline void closeFile() const;
L1037:
L1038: /// Check if the underlying FileEntry is the same, intentially ignoring
L1039:
L1040: /// whether the file was referenced with the same spelling of the filename.
L1041:
L1042: friend bool operator==(const FileEntryRef &LHS, const FileEntryRef &RHS) {
L1043:
L1044: return &LHS.getFileEntry() == &RHS.getFileEntry();
L1045:
L1046: }
L1047: friend bool operator==(const FileEntry *LHS, const FileEntryRef &RHS) {
L1048:
L1049: return LHS == &RHS.getFileEntry();
L1050:
L1051: }
L1052:
L1053: friend bool operator==(const FileEntryRef &LHS, const FileEntry *RHS) {
L1054:
L1055: return &LHS.getFileEntry() == RHS;
L1056:
L1057: }
L1058:
L1059: friend bool operator!=(const FileEntryRef &LHS, const FileEntryRef &RHS) {
L1060:
L1061: return !(LHS == RHS);
L1062:
L1063: }
L1064:
L1065: friend bool operator!=(const FileEntry *LHS, const FileEntryRef &RHS) {
L1066:
L1067: return !(LHS == RHS);
L1068:
L1069: }
L1070:
L1071: friend bool operator!=(const FileEntryRef &LHS, const FileEntry *RHS) {
L1072: return !(LHS == RHS);
L1073:
L1074: }
L1075:
L1076: /// Hash code is based on the FileEntry, not the specific named reference,
L1077:
L1078: /// just like operator==.
L1079:
L1080: friend llvm::hash_code hash_value(FileEntryRef Ref) {
L1081:
L1082: return llvm::hash_value(&Ref.getFileEntry());
L1083:
L1084: }
L1085:
L1086: struct MapValue;
L1087:
L1088: /// Type used in the StringMap.
L1089:
L1090: using MapEntry = llvm::StringMapEntry<llvm::ErrorOr<MapValue>>;
L1091:
L1092: /// Type stored in the StringMap.
L1093:
L1094: struct MapValue {
L1095:
L1096: /// The pointer at another MapEntry is used when the FileManager should
L1097: /// silently forward from one name to another, which occurs in Redirecting
L1098:
L1099: /// VFSs that use external names. In that case, the \c FileEntryRef
L1100:
L1101: /// returned by the \c FileManager will have the external name, and not the
L1102:
L1103: /// name that was used to lookup the file.
L1104:
L1105: llvm::PointerUnion<FileEntry *, const MapEntry *> V;
L1106:
L1107: /// Directory the file was found in.
L1108:
L1109: DirectoryEntryRef Dir;
L1110:
L1111: MapValue() = delete;
L1112:
L1113: MapValue(FileEntry &FE, DirectoryEntryRef Dir) : V(&FE), Dir(Dir) {}
</excerpt>
</source>
<source kind="find_in_page">
<title>llvm-project/clang/lib/Basic/FileManager.cpp at llvmorg-22.1.8 · llvm/llvm-project · GitHub</title>
<location>https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang/lib/Basic/FileManager.cpp</location>
<excerpt>citeturn2view3 [wordlim: 200] Crawled: today; Content type: text/html; Source: find({"ref_id":"turn1view1","pattern":"FileEntryRef::getName"}); Total lines: 2707
L2037: // - Switch the meaning of `FileEntryRef::getName()` to get the requested
L2038:
L2039: // name, not the external name. Once that sticks, revert callers that
L2040:
L2041: // want the requested name back to calling `getName()`.
L2042:
L2043: // - Update the VFS to always return the requested name. This could also
L2044:
L2045: // return the external name, or just have an API to request it
L2046:
L2047: // lazily. The latter has the benefit of making accesses of the
L2048:
L2049: // external path easily tracked, but may also require extra work than
L2050:
L2051: // just returning up front.
L2052: // - (Optionally) Add an API to VFS to get the external filename lazily
L2053:
L2054: // and update `FileManager::getExternalPath()` to use it instead. This
L2055:
L2056: // has the benefit of making such accesses easily tracked, though isn't
L2057:
L2058: // necessarily required (and could cause extra work than just adding to
L2059:
L2060: // eg. `vfs::Status` up front).
L2061:
L2062: auto &Redirection =
L2063:
L2064: *SeenFileEntries
L2065:
L2066: .insert({Status.getName(), FileEntryRef::MapValue(*UFE, DirInfo)})
L2067:
L2068: .first;
L2069:
L2070: assert(isa<FileEntry *>(Redirection.second->V) &&
</excerpt>
</source>
<source kind="find_in_page">
<title>llvm-project/llvm/lib/Support/Path.cpp at llvmorg-22.1.8 · llvm/llvm-project · GitHub</title>
<location>https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/llvm/lib/Support/Path.cpp</location>
<excerpt>citeturn2view4 [wordlim: 200] Crawled: today; Content type: text/html; Source: find({"ref_id":"turn1view2","pattern":"void native"}); Total lines: 3775
L3002: StringRef NewPrefix, Style style) {
L3003:
L3004: if (OldPrefix.empty() && NewPrefix.empty())
L3005:
L3006: return false;
L3007:
L3029: Path.swap(NewPath);
L3030:
L3031: return true;
L3032:
L3033: }
L3034:
L3035: void native(const Twine &path, SmallVectorImpl<char> &result, Style style) {
L3036:
L3037: assert((!path.isSingleStringRef() ||
L3038:
L3039: path.getSingleStringRef().data() != result.data()) &&
L3040:
L3041: "path and result are not allowed to overlap!");
L3042:
L3043: // Clear result.
L3044:
L3045: result.clear();
L3046:
L3047: path.toVector(result);
L3048:
L3049: native(result, style);
L3050:
L3051: }
L3052:
L3053: void native(SmallVectorImpl<char> &Path, Style style) {
L3054:
L3055: if (Path.empty())
L3056:
L3057: return;
L3058:
L3059: if (is_style_windows(style)) {
L3060:
L3061: for (char &Ch : Path)
L3062: if (is_separator(Ch, style))
L3063:
L3064: Ch = preferred_separator(style);
L3065:
L3066: if (Path[0] == '~' && (Path.size() == 1 || is_separator(Path[1], style))) {
L3067:
L3068: SmallString<128> PathHome;
L3069:
L3070: home_directory(PathHome);
L3071:
L3072: PathHome.append(Path.begin() + 1, Path.end());
L3073:
L3074: Path = PathHome;
L3075:
L3076: }
L3077:
L3078: } else {
L3079:
L3080: llvm::replace(Path, '\\', '/');
L3081:
L3082: }
L3083:
L3084: }
L3085:
L3086: std::string convert_to_slash(StringRef path, Style style) {
L3087:
L3088: if (is_style_posix(style))
L3089:
L3090: return std::string(path);
L3091:
L3092: std::string s = path.str();
L3093:
L3094: llvm::replace(s, '\\', '/');
L3095:
L3096: return s;
L3097:
L3098: }
</excerpt>
</source>
<source kind="open_page">
<title>llvm-project/clang/include/clang/Basic/FileEntry.h at llvmorg-22.1.8 · llvm/llvm-project · GitHub</title>
<location>https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang/include/clang/Basic/FileEntry.h</location>
<excerpt>citeturn1view0 [wordlim: 200] Crawled: today; Content type: text/html; Source: open({"ref_id":"https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang/include/clang/Basic/FileEntry.h","lineno":null}); Total lines: 1477
L0: 【0†Skip to content】
L1: ## Navigation Menu
L2:
L3: * Products
L4:
L5: * * 【1†GitHubRepository hosting, code review, and collaboration】
L6: * 【2†CopilotAI coding agent for tasks, projects and automated work】
L7:
L8: * Build & Ship
L9: * 【3†ActionsCI/CD and automation】
L10: * 【4†Code QualityQuality analysis, fixes, and enforcement】
L11: * 【5†CodespacesCloud development environments】
L12:
L13: * Secure
L14: * 【6†Code SecurityVulnerability detection and remediation】
L15: * 【7†Secret ProtectionSecret scanning and leak prevention】
L16: 【8†All Features】
L17:
L18: * Developers
L19:
L20: * Learn
L21: * 【9†Documentation†docs.github.com】
L22: * 【10†Training†learn.github.com】
L23: * 【11†Certifications†learn.github.com】
L24:
L25: * Build
L26: * 【12†Build with Copilot】
L27: * 【13†Customize Copilot†docs.github.com】
L28: * 【14†Integrations】
L29:
L30: * Explore
L31: * 【15†Trending repos】
L32: * 【16†GitHub Sponsors】
L33: * 【17†Events】
L34: * * 【18†ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.†github.blog】
L35:
L36: * Businesses
L37:
L38: * By Stage
L39: * 【19†Enterprises】
L40: * 【20†Team】
L41: * 【21†Startups】
L42: * 【22†Nonprofits】
L43:
L44: * By Industry
L45: * 【23†Healthcare】
L46: * 【24†Financial services】
L47: * 【25†Manufacturing】
L48: * 【26†Government】
L49: * 【27†See all industries】
L50: * Evaluate GitHub
L51: * 【28†Why GitHub】
L52: * 【29†Customer Stories】
L53: * 【30†Business insights】
L54: * 【31†Trust Center】
L55:
L56: * Add-ons
L57: * 【32†GitHub Advanced SecurityEnterprise-grade code security】
L58: * 【33†Copilot for businessEnterprise-grade AI features】
L59: * 【34†Premium SupportEnterprise-grade 24/7 support】
L60:
L61: * Resources
L62: * Learn & Connect
L63: * 【9†Documentation†docs.github.com】
L64: * 【35†Resource center】
L65: * 【36†Blog†github.blog】
L66: * 【17†Events & webinars】
L67: * 【37†Community Forum】
L68: * 【29†Customer Stories】
L69: * 【14†Integrations】
L70:
L71: * Support
L72: * 【38†Customer support†help.github.com】
L73: * 【10†Training†learn.github.com】
L74: * 【39†GitHub Status†www.githubstatus.com】
L75:
L76: * Company
L77: * 【40†About】
L78: * 【41†Partners】
L79: * 【18†Changelog†github.blog】
L80: * * 【42†GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.†githubuniverse.com】
L81:
L82: * 【43†Pricing】
L83:
L84: Search`/`
L85:
L86: 【44†Sign in】
L87:
L88: 【45†Sign up】
L89:
L90: Appearance settings
L91:
L92: You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
L93:
L94: 1. 【46†llvm】
L95: 2. 【47†llvm-project】
L96: ## Repository navigation
L97:
L98: * * 【47†Code】
L99: * 【48†Issues5k+ (5k+)】
L100: * 【49†Pull requests5k+ (5k+)】
L101: * 【50†Actions】
L102: * 【51†Security and quality】
L103: * 【52†Insights】
L104:
L105: More items
L106:
L107: ## Files Expand file tree
L108:
L109: llvmorg-22.1.8
L110:
L111: ## Breadcrumbs
L112:
L113: 1. 【53†llvm-project】
L114: 2. /【54†clang】
L115: 3. /【55†include】
L116: 4. /【56†clang】
L117: 5. /【57†Basic】
L118:
L119: /
L120:
L121: # FileEntry.h
L122:
L123: Copy path
L124:
L125: [Input: Go to file]
L126:
L127: Blame More file actions
L128:
L129: Blame More file actions
L130:
L131: ## Latest commit
L132:
L133:
L134:
L135: ## History
L136:
L137: History
L138:
L139: llvmorg-22.1.8
L140: ## Breadcrumbs
L141:
L142: 1. 【53†llvm-project】
L143: 2. /【54†clang】
L144: 3. /【55†include】
L145: 4. /【56†clang】
L146: 5. /【57†Basic】
L147:
L148: /
L149:
L150: # FileEntry.h
L151:
L152: Copy path
L153:
L154: Top
L155: ## File metadata and controls
L156:
L157: * Code
L158:
L159: * Blame
L160:
L161: 371 lines (295 loc) · 12 KB
L162:
L163: 【58†Raw】
L164:
L165: Copy raw file
L166:
L167: Download raw file
L168:
L169: Open symbols panel
L170:
L171: Edit and raw actions
L172:
L173: 1
L174:
L175: 2
L176:
L177: 3
L178:
L179: 4
L180:
L181: 5
L182:
L183: 6
L184:
L185: 7
L186:
L187: 8
L188:
L189: 9
L190:
L191: 10
L192:
L193: 11
L194:
L195: 12
L196:
L197: 13
L198:
L199: 14
L200:
L201: 15
L202:
L203: 16
L204:
L205: 17
L206:
L207: 18
L208:
L209: 19
L210:
L211: 20
L212:
L213: 21
L214:
L215: 22
L216:
L217: 23
L218:
L219: 24
L220:
L221: 25
L222:
L223: 26
L224:
L225: 27
L226:
L227: 28
L228:
L229: 29
L230:
L231: 30
L232:
L233: 31
L234:
L235: 32
L236:
L237: 33
L238:
L239: 34
L240:
L241: 35
L242:
L243: 36
L244:
L245: 37
L246:
L247: 38
L248:
L249: 39
L250:
L251: 40
L252:
L253: 41
L254:
L255: 42
L256:
L257: 43
L258:
L259: 44
L260:
L261: 45
L262:
L263: 46
L264:
L265: 47
L266:
L267: 48
L268:
L269: 49
L270:
L271: 50
L272:
L273: 51
L274:
L275: 52
L276:
L277: 53
L278:
L279: 54
L280:
L281: 55
L282:
L283: 56
L284:
L285: 57
L286:
L287: 58
L288:
L289: 59
L290:
L291: 60
L292:
L293: 61
L294:
L295: 62
L296:
L297: 63
L298:
L299: 64
L300:
L301: 65
L302:
L303: 66
L304:
L305: 67
L306:
L307: 68
L308:
L309: 69
L310:
L311: 70
L312:
L313: 71
L314:
L315: 72
L316:
L317: 73
L318:
L319: 74
L320:
L321: 75
L322:
L323: 76
L324:
L325: 77
L326:
L327: 78
L328:
L329: 79
L330:
L331: 80
L332:
L333: 81
L334:
L335: 82
L336:
L337: 83
L338:
L339: 84
L340:
L341: 85
L342:
L343: 86
L344:
L345: 87
L346:
L347: 88
</excerpt>
</source>
<source kind="open_page">
<title>llvm-project/clang/lib/Basic/FileManager.cpp at llvmorg-22.1.8 · llvm/llvm-project · GitHub</title>
<location>https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang/lib/Basic/FileManager.cpp</location>
<excerpt>citeturn1view1 [wordlim: 200] Crawled: today; Content type: text/html; Source: open({"ref_id":"https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang/lib/Basic/FileManager.cpp","lineno":null}); Total lines: 2707
L0: 【0†Skip to content】
L1: ## Navigation Menu
L2:
L3: * Products
L4:
L5: * * 【1†GitHubRepository hosting, code review, and collaboration】
L6: * 【2†CopilotAI coding agent for tasks, projects and automated work】
L7:
L8: * Build & Ship
L9: * 【3†ActionsCI/CD and automation】
L10: * 【4†Code QualityQuality analysis, fixes, and enforcement】
L11: * 【5†CodespacesCloud development environments】
L12:
L13: * Secure
L14: * 【6†Code SecurityVulnerability detection and remediation】
L15: * 【7†Secret ProtectionSecret scanning and leak prevention】
L16: 【8†All Features】
L17:
L18: * Developers
L19:
L20: * Learn
L21: * 【9†Documentation†docs.github.com】
L22: * 【10†Training†learn.github.com】
L23: * 【11†Certifications†learn.github.com】
L24:
L25: * Build
L26: * 【12†Build with Copilot】
L27: * 【13†Customize Copilot†docs.github.com】
L28: * 【14†Integrations】
L29:
L30: * Explore
L31: * 【15†Trending repos】
L32: * 【16†GitHub Sponsors】
L33: * 【17†Events】
L34: * * 【18†ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.†github.blog】
L35:
L36: * Businesses
L37:
L38: * By Stage
L39: * 【19†Enterprises】
L40: * 【20†Team】
L41: * 【21†Startups】
L42: * 【22†Nonprofits】
L43:
L44: * By Industry
L45: * 【23†Healthcare】
L46: * 【24†Financial services】
L47: * 【25†Manufacturing】
L48: * 【26†Government】
L49: * 【27†See all industries】
L50: * Evaluate GitHub
L51: * 【28†Why GitHub】
L52: * 【29†Customer Stories】
L53: * 【30†Business insights】
L54: * 【31†Trust Center】
L55:
L56: * Add-ons
L57: * 【32†GitHub Advanced SecurityEnterprise-grade code security】
L58: * 【33†Copilot for businessEnterprise-grade AI features】
L59: * 【34†Premium SupportEnterprise-grade 24/7 support】
L60:
L61: * Resources
L62: * Learn & Connect
L63: * 【9†Documentation†docs.github.com】
L64: * 【35†Resource center】
L65: * 【36†Blog†github.blog】
L66: * 【17†Events & webinars】
L67: * 【37†Community Forum】
L68: * 【29†Customer Stories】
L69: * 【14†Integrations】
L70:
L71: * Support
L72: * 【38†Customer support†help.github.com】
L73: * 【10†Training†learn.github.com】
L74: * 【39†GitHub Status†www.githubstatus.com】
L75:
L76: * Company
L77: * 【40†About】
L78: * 【41†Partners】
L79: * 【18†Changelog†github.blog】
L80: * * 【42†GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.†githubuniverse.com】
L81:
L82: * 【43†Pricing】
L83:
L84: Search`/`
L85:
L86: 【44†Sign in】
L87:
L88: 【45†Sign up】
L89:
L90: Appearance settings
L91:
L92: You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
L93:
L94: 1. 【46†llvm】
L95: 2. 【47†llvm-project】
L96: ## Repository navigation
L97:
L98: * * 【47†Code】
L99: * 【48†Issues5k+ (5k+)】
L100: * 【49†Pull requests5k+ (5k+)】
L101: * 【50†Actions】
L102: * 【51†Security and quality】
L103: * 【52†Insights】
L104:
L105: More items
L106:
L107: ## Files Expand file tree
L108:
L109: llvmorg-22.1.8
L110:
L111: ## Breadcrumbs
L112:
L113: 1. 【53†llvm-project】
L114: 2. /【54†clang】
L115: 3. /【55†lib】
L116: 4. /【56†Basic】
L117:
L118: /
L119:
L120: # FileManager.cpp
L121:
L122: Copy path
L123:
L124: [Input: Go to file]
L125:
L126: Blame More file actions
L127:
L128: Blame More file actions
L129:
L130: ## Latest commit
L131:
L132:
L133:
L134: ## History
L135:
L136: History
L137:
L138: llvmorg-22.1.8
L139: ## Breadcrumbs
L140:
L141: 1. 【53†llvm-project】
L142: 2. /【54†clang】
L143: 3. /【55†lib】
L144: 4. /【56†Basic】
L145:
L146: /
L147:
L148: # FileManager.cpp
L149:
L150: Copy path
L151:
L152: Top
L153: ## File metadata and controls
L154:
L155: * Code
L156:
L157: * Blame
L158:
L159: 695 lines (602 loc) · 26.7 KB
L160:
L161: 【57†Raw】
L162:
L163: Copy raw file
L164:
L165: Download raw file
L166:
L167: Open symbols panel
L168:
L169: Edit and raw actions
L170:
L171: 1
L172:
L173: 2
L174:
L175: 3
L176:
L177: 4
L178:
L179: 5
L180:
L181: 6
L182:
L183: 7
L184:
L185: 8
L186:
L187: 9
L188:
L189: 10
L190:
L191: 11
L192:
L193: 12
L194:
L195: 13
L196:
L197: 14
L198:
L199: 15
L200:
L201: 16
L202:
L203: 17
L204:
L205: 18
L206:
L207: 19
L208:
L209: 20
L210:
L211: 21
L212:
L213: 22
L214:
L215: 23
L216:
L217: 24
L218:
L219: 25
L220:
L221: 26
L222:
L223: 27
L224:
L225: 28
L226:
L227: 29
L228:
L229: 30
L230:
L231: 31
L232:
L233: 32
L234:
L235: 33
L236:
L237: 34
L238:
L239: 35
L240:
L241: 36
L242:
L243: 37
L244:
L245: 38
L246:
L247: 39
L248:
L249: 40
L250:
L251: 41
L252:
L253: 42
L254:
L255: 43
L256:
L257: 44
L258:
L259: 45
L260:
L261: 46
L262:
L263: 47
L264:
L265: 48
L266:
L267: 49
L268:
L269: 50
L270:
L271: 51
L272:
L273: 52
L274:
L275: 53
L276:
L277: 54
L278:
L279: 55
L280:
L281: 56
L282:
L283: 57
L284:
L285: 58
L286:
L287: 59
L288:
L289: 60
L290:
L291: 61
L292:
L293: 62
L294:
L295: 63
L296:
L297: 64
L298:
L299: 65
L300:
L301: 66
L302:
L303: 67
L304:
L305: 68
L306:
L307: 69
L308:
L309: 70
L310:
L311: 71
L312:
L313: 72
L314:
L315: 73
L316:
L317: 74
L318:
L319: 75
L320:
L321: 76
L322:
L323: 77
L324:
L325: 78
L326:
L327: 79
L328:
L329: 80
L330:
L331: 81
L332:
L333: 82
L334:
L335: 83
L336:
L337: 84
L338:
L339: 85
L340:
L341: 86
L342:
L343: 87
L344:
L345: 88
</excerpt>
</source>
<omitted_sources count="25">Additional source records were omitted from this bounded result.</omitted_sources>
</source_evidence>
Citations:
- 1: https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang/include/clang/Basic/FileEntry.h
- 2: https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/clang/lib/Basic/FileManager.cpp
- 3: https://github.com/llvm/llvm-project/blob/llvmorg-22.1.8/llvm/lib/Support/Path.cpp
Script executed:
nl -ba cuda_core/setup.py | sed -n '88,112p'
Repository: NVIDIA/cuda-python
Length of output: 1259
important: Match native Windows separators in HeaderFilterRegex.
clang-tidy==22.1.8 matches HeaderFilterRegex against FileEntryRef::getName() without path normalization. Native Windows paths can use backslashes, but this regex matches only forward slashes. Diagnostics from project headers can therefore be filtered out during Windows builds.
IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Suggested change
CheckOptions:
# Records whose members are all public (the *Box and guard structs) are plain
# data holders; only a mix of public and private members is flagged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CI/CDCI/CD infrastructurecuda.coreEverything related to the cuda.core module
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an alternative to #3250.
Rather than running clang-tidy as part of the pre-commit hook (which requires replicating a whole build environment and tool), this runs
clang-tidyas a side effect of buildingcuda-core. It therefore will raise its lint errors on compiling (which should be as noisy as a commit hook) and should always run in exactly the same configuration as the build.This also helps for macOS support (where there are no nvidia-cuda-* Python wheels).
The other change from #3250 is to revert the "fix" for not leaking when an exception is raised inside of
create_graph_handle. Two different coding agents were confused by it (especially seeing howGraphBox()can raise on Windows), but that's a separate issue from gettingclang-tidyworking well and we can separately try to get agents to be less alarmed (probably simply with the right comment).