diff options
author | Rui Ueyama <ruiu@google.com> | 2015-08-05 23:51:50 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2015-08-05 23:51:50 +0000 |
commit | cb8474edaef076194a44f0ffb13edcbfc4196692 (patch) | |
tree | 0e3f50c1d1ec9051d7e3362f4e289b0e483b1f46 /lld/ELF/Writer.cpp | |
parent | e03437c756220fe802c67b17bda8f142f86e9cdc (diff) | |
download | bcm5719-llvm-cb8474edaef076194a44f0ffb13edcbfc4196692.tar.gz bcm5719-llvm-cb8474edaef076194a44f0ffb13edcbfc4196692.zip |
COFF, ELF2: Pass output file path implicitly using Config global variable.
Various parameters are passed implicitly using Config global variable
already. Output file path is no different from others, so there was no
special reason to handle that differnetly.
This patch changes the signature of writeResult(SymbolTable *, StringRef)
to writeResult(SymbolTable *).
llvm-svn: 244180
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r-- | lld/ELF/Writer.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index b7bfd462210..e4c5617f147 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "Chunks.h" +#include "Config.h" #include "Driver.h" #include "SymbolTable.h" #include "Writer.h" @@ -28,7 +29,7 @@ namespace { template <class ELFT> class Writer { public: typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t; - Writer(SymbolTable *T, StringRef S) : Symtab(T), OutputPath(S) {} + Writer(SymbolTable *T) : Symtab(T) {} void run(); private: @@ -39,7 +40,6 @@ private: void writeSections(); SymbolTable *Symtab; - StringRef OutputPath; std::unique_ptr<llvm::FileOutputBuffer> Buffer; llvm::SpecificBumpPtrAllocator<OutputSection> CAlloc; std::vector<OutputSection *> OutputSections; @@ -80,14 +80,12 @@ private: }; template <class ELFT> -void writeResult(SymbolTable *Symtab, StringRef Path) { - Writer<ELFT>(Symtab, Path).run(); -} +void writeResult(SymbolTable *Symtab) { Writer<ELFT>(Symtab).run(); } -template void writeResult<ELF32LE>(SymbolTable *, StringRef); -template void writeResult<ELF32BE>(SymbolTable *, StringRef); -template void writeResult<ELF64LE>(SymbolTable *, StringRef); -template void writeResult<ELF64BE>(SymbolTable *, StringRef); +template void writeResult<ELF32LE>(SymbolTable *); +template void writeResult<ELF32BE>(SymbolTable *); +template void writeResult<ELF64LE>(SymbolTable *); +template void writeResult<ELF64BE>(SymbolTable *); } // namespace elf2 } // namespace lld @@ -96,7 +94,7 @@ template void writeResult<ELF64BE>(SymbolTable *, StringRef); template <class ELFT> void Writer<ELFT>::run() { createSections(); assignAddresses(); - openFile(OutputPath); + openFile(Config->OutputFile); writeHeader(); writeSections(); error(Buffer->commit()); |