summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-10-22 08:35:39 +0000
committerSam Clegg <sbc@chromium.org>2018-10-22 08:35:39 +0000
commitea656472545d53f4dba0f0524716805797253ea1 (patch)
tree68c7e3aeed22e77eb33277f6cbc3e1ad071a2d34
parentad980a75c4e9ad6f39b08e808ea10edfabb55437 (diff)
downloadbcm5719-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.cpp2
-rw-r--r--lld/include/lld/Common/Strings.h3
-rw-r--r--lld/wasm/Writer.cpp2
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);
}
OpenPOWER on IntegriCloud