Use a reference instead of a pointer. NFC.

llvm-svn: 272719
This commit is contained in:
Rafael Espindola 2016-06-14 21:40:23 +00:00
parent c565cfaac9
commit 07543a8c2d
3 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -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() {

View File

@ -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;
};