JDevlieghere added inline comments.
================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:2488
+ auto RemapPath = [&](std::string &Path) {
+ Path = remapDIPath(Path);
+ StringRef Relative(Path);
----------------
aprantl wrote:
> Is this legal?
>
> remapDIPath takes a StringRef to Path. Is the sret value going to be a
> temporary or are we modifying the contents of the string while reading from
> it in remapDIPath?
No, this returns a `std::string` so you're returning a StringRef to a
stack-allocated temporary. The lambda should return a `std::string` too.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76385/new/
https://reviews.llvm.org/D76385
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits