[PATCH] D103490: [SystemZ][z/OS] Add support for TXT records in the GOFF reader
Yusra Syeda via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 15 14:36:55 PDT 2021
yusra.syeda marked 3 inline comments as done.
yusra.syeda added inline comments.
================
Comment at: llvm/lib/Object/GOFFObjectFile.cpp:519-520
+
+ StringRef Res = StringRef(Data);
+ return arrayRefFromStringRef(Res);
+}
----------------
jhenderson wrote:
> jhenderson wrote:
> > Why not simply `return arrayRefFromStringRef(StringRef(Data));`? In fact, could you get away with returning simply `Data.data()` or similar?
> > In fact, could you get away with returning simply Data.data() or similar?
>
> Any response to this part of the comment? I'm pretty sure you could just do `return {Err.data(), Err.size()}` without needing to jump through the StringRef constructor.
Seems I can do something like this to avoid the StringRef constructor:
```
ArrayRef<uint8_t> temp(reinterpret_cast<const unsigned char *>(Data.data()), Data.size());
return temp;
```
If you prefer this, I can update it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103490/new/
https://reviews.llvm.org/D103490
More information about the llvm-commits
mailing list