This is an archive of the discontinued LLVM Phabricator instance.

Files in a compilation database using relative paths are not being transformed
Needs ReviewPublic

Authored by arielbernal on Oct 4 2013, 9:29 AM.

Details

Reviewers
revane
tareqsiraj
Summary

This patch fixes the path for the YAML files, and complements D1800 which makes replacements independent of the location.

Diff Detail

Event Timeline

revane requested changes to this revision.Oct 4 2013, 1:37 PM

Could you expand "rel" to relative wherever it appears? LLVM style is shorthand-averse.

clang-modernize/Core/Transform.cpp
102–105

Wouldn't it be better to do this once per source file in ClangModernizer.cpp instead of once per source per transform here?

@revane sure, I'll rename those files files.

clang-modernize/Core/Transform.cpp
102–105

No problem, but I'm not convinced that this is the right approach, if we move the YAML files to a folder this will go away.

@revane, Sources are made absolute in ClangModernizer.cpp but Filename here is coming from the command line in the compilation database and that path is relative to the directory so in order to make this change only once we should parse the compilation database command and fix the path. I guess this could be the best solution but could involve some re-factoring since ClangTool assumes that the files are provided relative to the directory in the compilation database and changes directories so everything would be relative to the current directory.
CurrentSource is just used for YAML files to be created in the correct place since D1800 is fixing the replacements for relative paths.

arielbernal updated this revision to Unknown Object (????).Oct 7 2013, 9:18 AM

Addressed comments

arielbernal added inline comments.Oct 7 2013, 10:23 AM
clang-modernize/Core/Transform.cpp
103

@revane Please disregard these Overrides lines, they got mixed up in a merge. They are not anymore there.

revane accepted this revision.Oct 7 2013, 10:32 AM

Looks like patch was not committed, but may be irrelevant these days.

This revision now requires review to proceed.Oct 4 2016, 6:25 PM