[PATCH] D96678: [llvm-dwp] Join dwo paths correctly when DWOPath is absolute
Simonas Kazlauskas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 15 14:43:32 PST 2021
nagisa added a comment.
> Please add/include test coverage.
Added a test and verified it reproduces the issue without this change and passes now. Let me know if this approach is not what you were thinking of.
================
Comment at: llvm/tools/llvm-dwp/llvm-dwp.cpp:529
if (!DWOCompDir.empty()) {
- SmallString<16> DWOPath;
- sys::path::append(DWOPath, DWOCompDir, DWOName);
+ SmallString<16> DWOPath{std::move(DWOName)};
+ sys::fs::make_absolute(DWOCompDir, DWOPath);
----------------
dblaikie wrote:
> Generally prefer `=` init syntax over `{}` or `()` (this avoids any invocation of explicit conversions, for instance - making the code a bit simpler/easier to understand)
The `=` fails to build, because the conversion is necessary (`DWOName` is a `std::string`). Is there a better way to get this conversion happen?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96678/new/
https://reviews.llvm.org/D96678
More information about the llvm-commits
mailing list