forked from OSchip/llvm-project
Use a reference instead of a pointer. NFC.
llvm-svn: 272719
This commit is contained in:
parent
c565cfaac9
commit
07543a8c2d
|
@ -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);
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue