[PECOFF] Simplify IdataPass. No functionality change.

llvm-svn: 219348
This commit is contained in:
Rui Ueyama 2014-10-08 22:33:00 +00:00
parent ffcbe9b048
commit aa5add859d
2 changed files with 5 additions and 5 deletions

View File

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

View File

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