[COFF] Simplify the code leveraging implicit conversion.
authorDavide Italiano <davide@freebsd.org>
Tue, 12 Apr 2016 22:05:38 +0000 (22:05 +0000)
committerDavide Italiano <davide@freebsd.org>
Tue, 12 Apr 2016 22:05:38 +0000 (22:05 +0000)
Suggested by: David Blaikie!

llvm-svn: 266140

lld/COFF/SymbolTable.cpp

index 26e2567..189c3fe 100644 (file)
@@ -430,8 +430,7 @@ std::vector<ObjectFile *> SymbolTable::createLTOObjects(LTOCodeGenerator *CG) {
 
   std::vector<ObjectFile *> ObjFiles;
   for (SmallString<0> &Obj : Objs) {
-    auto *ObjFile = new ObjectFile(
-        MemoryBufferRef(StringRef(Obj.data(), Obj.size()), "<LTO object>"));
+    auto *ObjFile = new ObjectFile(MemoryBufferRef(Obj, "<LTO object>"));
     Files.emplace_back(ObjFile);
     ObjectFiles.push_back(ObjFile);
     ObjFile->parse();