Index: lld/trunk/ELF/InputFiles.cpp =================================================================== --- lld/trunk/ELF/InputFiles.cpp +++ lld/trunk/ELF/InputFiles.cpp @@ -1188,7 +1188,7 @@ } void BinaryFile::parse() { - ArrayRef Data = toArrayRef(MB.getBuffer()); + ArrayRef Data = arrayRefFromStringRef(MB.getBuffer()); auto *Section = make(this, SHF_ALLOC | SHF_WRITE, SHT_PROGBITS, 8, Data, ".data"); Sections.push_back(Section); Index: lld/trunk/include/lld/Common/Strings.h =================================================================== --- lld/trunk/include/lld/Common/Strings.h +++ lld/trunk/include/lld/Common/Strings.h @@ -41,9 +41,6 @@ std::vector Patterns; }; -inline llvm::ArrayRef toArrayRef(llvm::StringRef S) { - return {reinterpret_cast(S.data()), S.size()}; -} } // namespace lld #endif Index: lld/trunk/wasm/Writer.cpp =================================================================== --- lld/trunk/wasm/Writer.cpp +++ lld/trunk/wasm/Writer.cpp @@ -979,7 +979,7 @@ OS << BodyContent; } - ArrayRef Body = toArrayRef(Saver.save(FunctionBody)); + ArrayRef Body = arrayRefFromStringRef(Saver.save(FunctionBody)); cast(WasmSym::CallCtors->Function)->setBody(Body); }