forked from OSchip/llvm-project
LazyObject's file is never null, use a reference.
llvm-svn: 321196
This commit is contained in:
parent
8cd6674f5b
commit
2e5c71eadc
|
@ -563,7 +563,7 @@ void SymbolTable::addLazyObject(StringRef Name, LazyObjFile &Obj) {
|
|||
bool WasInserted;
|
||||
std::tie(S, WasInserted) = insert(Name);
|
||||
if (WasInserted) {
|
||||
replaceSymbol<LazyObject>(S, &Obj, Name, Symbol::UnknownType);
|
||||
replaceSymbol<LazyObject>(S, Obj, Name, Symbol::UnknownType);
|
||||
return;
|
||||
}
|
||||
if (!S->isUndefined())
|
||||
|
@ -571,7 +571,7 @@ void SymbolTable::addLazyObject(StringRef Name, LazyObjFile &Obj) {
|
|||
|
||||
// See comment for addLazyArchive above.
|
||||
if (S->isWeak())
|
||||
replaceSymbol<LazyObject>(S, &Obj, Name, S->Type);
|
||||
replaceSymbol<LazyObject>(S, Obj, Name, S->Type);
|
||||
else if (InputFile *F = Obj.fetch())
|
||||
addFile<ELFT>(F);
|
||||
}
|
||||
|
|
|
@ -236,9 +236,9 @@ InputFile *LazyArchive::fetch() {
|
|||
return createObjectFile(MBInfo.first, getFile()->getName(), MBInfo.second);
|
||||
}
|
||||
|
||||
LazyObjFile *LazyObject::getFile() { return cast<LazyObjFile>(File); }
|
||||
LazyObjFile &LazyObject::getFile() { return *cast<LazyObjFile>(File); }
|
||||
|
||||
InputFile *LazyObject::fetch() { return getFile()->fetch(); }
|
||||
InputFile *LazyObject::fetch() { return getFile().fetch(); }
|
||||
|
||||
uint8_t Symbol::computeBinding() const {
|
||||
if (Config->Relocatable)
|
||||
|
|
|
@ -295,12 +295,12 @@ private:
|
|||
// --start-lib and --end-lib options.
|
||||
class LazyObject : public Lazy {
|
||||
public:
|
||||
LazyObject(InputFile *File, StringRef Name, uint8_t Type)
|
||||
: Lazy(LazyObjectKind, File, Name, Type) {}
|
||||
LazyObject(InputFile &File, StringRef Name, uint8_t Type)
|
||||
: Lazy(LazyObjectKind, &File, Name, Type) {}
|
||||
|
||||
static bool classof(const Symbol *S) { return S->kind() == LazyObjectKind; }
|
||||
|
||||
LazyObjFile *getFile();
|
||||
LazyObjFile &getFile();
|
||||
InputFile *fetch();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue