[ELF] Remove unused xxxWriter class fields

llvm-svn: 234357
This commit is contained in:
Simon Atanasyan 2015-04-07 21:12:18 +00:00
parent 073e9fb5e1
commit 3dba8a2d96
5 changed files with 7 additions and 21 deletions

View File

@ -34,15 +34,12 @@ private:
}; };
std::unique_ptr<GOTFile> _gotFile; std::unique_ptr<GOTFile> _gotFile;
AArch64LinkingContext &_ctx;
TargetLayout<ELFT> &_layout;
}; };
template <class ELFT> template <class ELFT>
AArch64DynamicLibraryWriter<ELFT>::AArch64DynamicLibraryWriter( AArch64DynamicLibraryWriter<ELFT>::AArch64DynamicLibraryWriter(
AArch64LinkingContext &ctx, TargetLayout<ELFT> &layout) AArch64LinkingContext &ctx, TargetLayout<ELFT> &layout)
: DynamicLibraryWriter<ELFT>(ctx, layout), _gotFile(new GOTFile(ctx)), : DynamicLibraryWriter<ELFT>(ctx, layout), _gotFile(new GOTFile(ctx)) {}
_ctx(ctx), _layout(layout) {}
template <class ELFT> template <class ELFT>
void AArch64DynamicLibraryWriter<ELFT>::createImplicitFiles( void AArch64DynamicLibraryWriter<ELFT>::createImplicitFiles(

View File

@ -33,22 +33,19 @@ private:
}; };
std::unique_ptr<GOTFile> _gotFile; std::unique_ptr<GOTFile> _gotFile;
AArch64LinkingContext &_ctx;
TargetLayout<ELFT> &_layout;
}; };
template <class ELFT> template <class ELFT>
AArch64ExecutableWriter<ELFT>::AArch64ExecutableWriter( AArch64ExecutableWriter<ELFT>::AArch64ExecutableWriter(
AArch64LinkingContext &ctx, TargetLayout<ELFT> &layout) AArch64LinkingContext &ctx, TargetLayout<ELFT> &layout)
: ExecutableWriter<ELFT>(ctx, layout), _gotFile(new GOTFile(ctx)), : ExecutableWriter<ELFT>(ctx, layout), _gotFile(new GOTFile(ctx)) {}
_ctx(ctx), _layout(layout) {}
template <class ELFT> template <class ELFT>
void AArch64ExecutableWriter<ELFT>::createImplicitFiles( void AArch64ExecutableWriter<ELFT>::createImplicitFiles(
std::vector<std::unique_ptr<File>> &result) { std::vector<std::unique_ptr<File>> &result) {
ExecutableWriter<ELFT>::createImplicitFiles(result); ExecutableWriter<ELFT>::createImplicitFiles(result);
_gotFile->addAtom(*new (_gotFile->_alloc) GlobalOffsetTableAtom(*_gotFile)); _gotFile->addAtom(*new (_gotFile->_alloc) GlobalOffsetTableAtom(*_gotFile));
if (_ctx.isDynamic()) if (this->_ctx.isDynamic())
_gotFile->addAtom(*new (_gotFile->_alloc) DynamicAtom(*_gotFile)); _gotFile->addAtom(*new (_gotFile->_alloc) DynamicAtom(*_gotFile));
result.push_back(std::move(_gotFile)); result.push_back(std::move(_gotFile));
} }

View File

@ -32,15 +32,12 @@ private:
}; };
std::unique_ptr<GOTFile> _gotFile; std::unique_ptr<GOTFile> _gotFile;
X86LinkingContext &_ctx;
TargetLayout<ELFT> &_layout;
}; };
template <class ELFT> template <class ELFT>
X86DynamicLibraryWriter<ELFT>::X86DynamicLibraryWriter( X86DynamicLibraryWriter<ELFT>::X86DynamicLibraryWriter(
X86LinkingContext &ctx, TargetLayout<ELFT> &layout) X86LinkingContext &ctx, TargetLayout<ELFT> &layout)
: DynamicLibraryWriter<ELFT>(ctx, layout), _gotFile(new GOTFile(ctx)), : DynamicLibraryWriter<ELFT>(ctx, layout), _gotFile(new GOTFile(ctx)) {}
_ctx(ctx), _layout(layout) {}
template <class ELFT> template <class ELFT>
void X86DynamicLibraryWriter<ELFT>::createImplicitFiles( void X86DynamicLibraryWriter<ELFT>::createImplicitFiles(

View File

@ -23,16 +23,12 @@ public:
protected: protected:
// Add any runtime files and their atoms to the output // Add any runtime files and their atoms to the output
void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override; void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
private:
X86LinkingContext &_ctx;
TargetLayout<ELFT> &_layout;
}; };
template <class ELFT> template <class ELFT>
X86ExecutableWriter<ELFT>::X86ExecutableWriter(X86LinkingContext &ctx, X86ExecutableWriter<ELFT>::X86ExecutableWriter(X86LinkingContext &ctx,
TargetLayout<ELFT> &layout) TargetLayout<ELFT> &layout)
: ExecutableWriter<ELFT>(ctx, layout), _ctx(ctx), _layout(layout) {} : ExecutableWriter<ELFT>(ctx, layout) {}
template <class ELFT> template <class ELFT>
void X86ExecutableWriter<ELFT>::createImplicitFiles( void X86ExecutableWriter<ELFT>::createImplicitFiles(

View File

@ -19,7 +19,7 @@ namespace elf {
class X86_64ExecutableWriter : public ExecutableWriter<X86_64ELFType> { class X86_64ExecutableWriter : public ExecutableWriter<X86_64ELFType> {
public: public:
X86_64ExecutableWriter(X86_64LinkingContext &ctx, X86_64TargetLayout &layout) X86_64ExecutableWriter(X86_64LinkingContext &ctx, X86_64TargetLayout &layout)
: ExecutableWriter(ctx, layout), _gotFile(new GOTFile(ctx)), _ctx(ctx) {} : ExecutableWriter(ctx, layout), _gotFile(new GOTFile(ctx)) {}
protected: protected:
// Add any runtime files and their atoms to the output // Add any runtime files and their atoms to the output
@ -28,7 +28,7 @@ protected:
ExecutableWriter::createImplicitFiles(result); ExecutableWriter::createImplicitFiles(result);
_gotFile->addAtom(*new (_gotFile->_alloc) _gotFile->addAtom(*new (_gotFile->_alloc)
GlobalOffsetTableAtom(*_gotFile)); GlobalOffsetTableAtom(*_gotFile));
if (_ctx.isDynamic()) if (this->_ctx.isDynamic())
_gotFile->addAtom(*new (_gotFile->_alloc) DynamicAtom(*_gotFile)); _gotFile->addAtom(*new (_gotFile->_alloc) DynamicAtom(*_gotFile));
result.push_back(std::move(_gotFile)); result.push_back(std::move(_gotFile));
} }
@ -41,7 +41,6 @@ private:
}; };
std::unique_ptr<GOTFile> _gotFile; std::unique_ptr<GOTFile> _gotFile;
X86_64LinkingContext &_ctx;
}; };
} // namespace elf } // namespace elf