[PECOFF] Simplify IdataPass. No functionality change.
llvm-svn: 219348
This commit is contained in:
parent
ffcbe9b048
commit
aa5add859d
|
@ -138,7 +138,7 @@ void IdataPass::perform(std::unique_ptr<MutableFile> &file) {
|
|||
// context.file in the IdataAtom's constructor.
|
||||
new (_alloc) idata::NullImportDirectoryAtom(context);
|
||||
|
||||
replaceSharedLibraryAtoms(context);
|
||||
replaceSharedLibraryAtoms(*file);
|
||||
}
|
||||
|
||||
std::map<StringRef, std::vector<COFFSharedLibraryAtom *> >
|
||||
|
@ -156,8 +156,8 @@ IdataPass::groupByLoadName(MutableFile &file) {
|
|||
}
|
||||
|
||||
/// Transforms a reference to a COFFSharedLibraryAtom to a real reference.
|
||||
void IdataPass::replaceSharedLibraryAtoms(idata::IdataContext &context) {
|
||||
for (const DefinedAtom *atom : context.file.defined()) {
|
||||
void IdataPass::replaceSharedLibraryAtoms(MutableFile &file) {
|
||||
for (const DefinedAtom *atom : file.defined()) {
|
||||
for (const Reference *ref : *atom) {
|
||||
const Atom *target = ref->target();
|
||||
auto *sharedAtom = dyn_cast<SharedLibraryAtom>(target);
|
||||
|
|
|
@ -135,10 +135,10 @@ public:
|
|||
void perform(std::unique_ptr<MutableFile> &file) override;
|
||||
|
||||
private:
|
||||
std::map<StringRef, std::vector<COFFSharedLibraryAtom *> >
|
||||
std::map<StringRef, std::vector<COFFSharedLibraryAtom *>>
|
||||
groupByLoadName(MutableFile &file);
|
||||
|
||||
void replaceSharedLibraryAtoms(idata::IdataContext &context);
|
||||
void replaceSharedLibraryAtoms(MutableFile &file);
|
||||
|
||||
// A dummy file with which all the atoms created in the pass will be
|
||||
// associated. Atoms need to be associated to an input file even if it's not
|
||||
|
|
Loading…
Reference in New Issue