[lld] r272719 - Use a reference instead of a pointer. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 14:40:23 PDT 2016


Author: rafael
Date: Tue Jun 14 16:40:23 2016
New Revision: 272719

URL: http://llvm.org/viewvc/llvm-project?rev=272719&view=rev
Log:
Use a reference instead of a pointer. NFC.

Modified:
    lld/trunk/ELF/SymbolTable.cpp
    lld/trunk/ELF/Symbols.cpp
    lld/trunk/ELF/Symbols.h

Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=272719&r1=272718&r2=272719&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Tue Jun 14 16:40:23 2016
@@ -434,7 +434,7 @@ void SymbolTable<ELFT>::addLazyArchive(
   bool WasInserted;
   std::tie(S, WasInserted) = insert(Sym.getName());
   if (WasInserted) {
-    replaceBody<LazyArchive>(S, F, Sym, SymbolBody::UnknownType);
+    replaceBody<LazyArchive>(S, *F, Sym, SymbolBody::UnknownType);
     return;
   }
   if (!S->body()->isUndefined())
@@ -448,7 +448,7 @@ void SymbolTable<ELFT>::addLazyArchive(
   // this symbol as used when we added it to the symbol table, but we also need
   // to preserve its type. FIXME: Move the Type field to Symbol.
   if (S->isWeak()) {
-    replaceBody<LazyArchive>(S, F, Sym, S->body()->Type);
+    replaceBody<LazyArchive>(S, *F, Sym, S->body()->Type);
     return;
   }
   MemoryBufferRef MBRef = F->getMember(&Sym);

Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=272719&r1=272718&r2=272719&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Tue Jun 14 16:40:23 2016
@@ -221,13 +221,13 @@ std::unique_ptr<InputFile> Lazy::getFile
 }
 
 std::unique_ptr<InputFile> LazyArchive::getFile() {
-  MemoryBufferRef MBRef = File->getMember(&Sym);
+  MemoryBufferRef MBRef = File.getMember(&Sym);
 
   // getMember returns an empty buffer if the member was already
   // read from the library.
   if (MBRef.getBuffer().empty())
     return std::unique_ptr<InputFile>(nullptr);
-  return createObjectFile(MBRef, File->getName());
+  return createObjectFile(MBRef, File.getName());
 }
 
 std::unique_ptr<InputFile> LazyObject::getFile() {

Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=272719&r1=272718&r2=272719&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Tue Jun 14 16:40:23 2016
@@ -332,9 +332,9 @@ public:
 // LazyArchive symbols represents symbols in archive files.
 class LazyArchive : public Lazy {
 public:
-  LazyArchive(ArchiveFile *F, const llvm::object::Archive::Symbol S,
+  LazyArchive(ArchiveFile &File, const llvm::object::Archive::Symbol S,
               uint8_t Type)
-      : Lazy(LazyArchiveKind, S.getName(), Type), File(F), Sym(S) {}
+      : Lazy(LazyArchiveKind, S.getName(), Type), File(File), Sym(S) {}
 
   static bool classof(const SymbolBody *S) {
     return S->kind() == LazyArchiveKind;
@@ -343,7 +343,7 @@ public:
   std::unique_ptr<InputFile> getFile();
 
 private:
-  ArchiveFile *File;
+  ArchiveFile &File;
   const llvm::object::Archive::Symbol Sym;
 };
 




More information about the llvm-commits mailing list