[all-commits] [llvm/llvm-project] 818848: [clang-apply-replacements] Correctly handle relati...
Adrian Vogelsgesang via All-commits
all-commits at lists.llvm.org
Thu Nov 11 10:30:32 PST 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8188484daa4195a2c8b5253765036fa2c6da7263
https://github.com/llvm/llvm-project/commit/8188484daa4195a2c8b5253765036fa2c6da7263
Author: Adrian Vogelsgesang <avogelsgesang at tableau.com>
Date: 2021-11-11 (Thu, 11 Nov 2021)
Changed paths:
M clang-tools-extra/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
A clang-tools-extra/test/clang-apply-replacements/Inputs/relative-paths/basic.h
A clang-tools-extra/test/clang-apply-replacements/Inputs/relative-paths/file1.yaml
A clang-tools-extra/test/clang-apply-replacements/Inputs/relative-paths/file2.yaml
A clang-tools-extra/test/clang-apply-replacements/relative-paths.cpp
Log Message:
-----------
[clang-apply-replacements] Correctly handle relative paths
The fixes from the YAML file can refer to relative paths.
Those relative paths are meant to be resolved relative to the
corresponding `build directory`.
However, `clang-apply-replacements` currently interprets all
paths relative to its own working directory. This causes issues,
e.g., when `clang-apply-replacements` is run from outside of
the original build directory.
This commit adjusts `clang-apply-replacements` to take the build
directory into account when resolving relative file paths.
Reviewed By: ymandel
Differential Revision: https://reviews.llvm.org/D112647
More information about the All-commits
mailing list