[PATCH] D92437: [mac/lld] Include archive name in diagnostics
Jez Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 1 19:56:59 PST 2020
int3 accepted this revision.
int3 added a comment.
sgtm
================
Comment at: lld/MachO/InputFiles.h:74
+ // We use this string for creating error messages.
+ std::string archiveName;
+
----------------
thakis wrote:
> int3 wrote:
> > why `std::string` over `StringRef`?
> Because it's a potential foot gun: addFile() sets this to `path`, which is a StringRef param and there's no guarantee that that stays alive. In fact, OPT_l calls findLibrary() which seems to return a temp string and pass that in. Since there are relatively few InputFiles, might as well not have a footgun here.
bang bang yeah good point
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92437/new/
https://reviews.llvm.org/D92437
More information about the llvm-commits
mailing list