[PATCH] D53432: Use llvm::arrayRefFromStringRef

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 22 01:38:00 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL344888: Use llvm::arrayRefFromStringRef (authored by sbc, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D53432

Files:
  lld/trunk/ELF/InputFiles.cpp
  lld/trunk/include/lld/Common/Strings.h
  lld/trunk/wasm/Writer.cpp


Index: lld/trunk/wasm/Writer.cpp
===================================================================
--- lld/trunk/wasm/Writer.cpp
+++ lld/trunk/wasm/Writer.cpp
@@ -979,7 +979,7 @@
     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);
 }
 
Index: lld/trunk/ELF/InputFiles.cpp
===================================================================
--- lld/trunk/ELF/InputFiles.cpp
+++ lld/trunk/ELF/InputFiles.cpp
@@ -1188,7 +1188,7 @@
 }
 
 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);
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<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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53432.170376.patch
Type: text/x-patch
Size: 1383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181022/9a872c59/attachment.bin>


More information about the llvm-commits mailing list