This is an archive of the discontinued LLVM Phabricator instance.

Make FilePath of Replacement an absolute file path when possible.
AbandonedPublic

Authored by hokein on Sep 28 2016, 1:01 AM.

Details

Summary

The FilePath of the Replacement constructed from a SourceManager can be
an absolute file path or a file path relative to the build directory (It
depends on the compliation commands).

If the FilePath is a relative path, it may caused crash issues
when applying the Replacement if the running directory of the binary is
not the same with the build directory. Have verified the crashes in
several clang-tools, e.g. clang-rename, clang-move, clang-change-name,

clang-tidy (fixed in D17335).

By making the FilePath an absolute path, it resolves the crashes.

Diff Detail

Event Timeline

hokein updated this revision to Diff 72772.Sep 28 2016, 1:01 AM
hokein retitled this revision from to Make FilePath of Replacement an absolute file path when possible..
hokein updated this object.
hokein added reviewers: klimek, djasper, ioeric.
hokein added a subscriber: cfe-commits.
hokein abandoned this revision.Sep 28 2016, 3:11 AM

As discussed offline with klimek, we should change to the correct working directory before applying the replacements. So abandon this.