diff options
author | Sam Clegg <sbc@chromium.org> | 2018-10-22 08:35:39 +0000 |
---|---|---|
committer | Sam Clegg <sbc@chromium.org> | 2018-10-22 08:35:39 +0000 |
commit | ea656472545d53f4dba0f0524716805797253ea1 (patch) | |
tree | 68c7e3aeed22e77eb33277f6cbc3e1ad071a2d34 | |
parent | ad980a75c4e9ad6f39b08e808ea10edfabb55437 (diff) | |
download | bcm5719-llvm-ea656472545d53f4dba0f0524716805797253ea1.tar.gz bcm5719-llvm-ea656472545d53f4dba0f0524716805797253ea1.zip |
Use llvm::arrayRefFromStringRef
Differential Revision: https://reviews.llvm.org/D53432
llvm-svn: 344888
-rw-r--r-- | lld/ELF/InputFiles.cpp | 2 | ||||
-rw-r--r-- | lld/include/lld/Common/Strings.h | 3 | ||||
-rw-r--r-- | lld/wasm/Writer.cpp | 2 |
3 files changed, 2 insertions, 5 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index c82bef50d4c..212cb853166 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -1188,7 +1188,7 @@ static ELFKind getELFKind(MemoryBufferRef MB) { } void BinaryFile::parse() { - ArrayRef<uint8_t> Data = toArrayRef(MB.getBuffer()); + ArrayRef<uint8_t> Data = arrayRefFromStringRef(MB.getBuffer()); auto *Section = make<InputSection>(this, SHF_ALLOC | SHF_WRITE, SHT_PROGBITS, 8, Data, ".data"); Sections.push_back(Section); diff --git a/lld/include/lld/Common/Strings.h b/lld/include/lld/Common/Strings.h index e17b2576378..566030e43aa 100644 --- a/lld/include/lld/Common/Strings.h +++ b/lld/include/lld/Common/Strings.h @@ -41,9 +41,6 @@ private: std::vector<llvm::GlobPattern> Patterns; }; -inline llvm::ArrayRef<uint8_t> toArrayRef(llvm::StringRef S) { - return {reinterpret_cast<const uint8_t *>(S.data()), S.size()}; -} } // namespace lld #endif diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index 3d44bce8fdf..64dce4c6d4a 100644 --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -979,7 +979,7 @@ void Writer::createCtorFunction() { OS << BodyContent; } - ArrayRef<uint8_t> Body = toArrayRef(Saver.save(FunctionBody)); + ArrayRef<uint8_t> Body = arrayRefFromStringRef(Saver.save(FunctionBody)); cast<SyntheticFunction>(WasmSym::CallCtors->Function)->setBody(Body); } |