[lld] r233878 - ELF: Make createWriterELF's type consistent with other functions.
Rui Ueyama
ruiu at google.com
Wed Apr 1 18:02:58 PDT 2015
Author: ruiu
Date: Wed Apr 1 20:02:58 2015
New Revision: 233878
URL: http://llvm.org/viewvc/llvm-project?rev=233878&view=rev
Log:
ELF: Make createWriterELF's type consistent with other functions.
Other createWriter<Arch> functions take <Arch>LinkingContext as arguments.
Only createWriterELF was an exception. This patch makes it consistent with
others.
Modified:
lld/trunk/include/lld/Core/Writer.h
lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
lld/trunk/lib/ReaderWriter/ELF/Writer.cpp
Modified: lld/trunk/include/lld/Core/Writer.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Writer.h?rev=233878&r1=233877&r2=233878&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/Writer.h (original)
+++ lld/trunk/include/lld/Core/Writer.h Wed Apr 1 20:02:58 2015
@@ -15,12 +15,11 @@
#include <vector>
namespace lld {
-class File;
class ELFLinkingContext;
+class File;
+class LinkingContext;
class MachOLinkingContext;
class PECOFFLinkingContext;
-class LinkingContext;
-class TargetHandler;
/// \brief The Writer is an abstract class for writing object files, shared
/// library files, and executable files. Each file format (e.g. ELF, mach-o,
@@ -42,7 +41,7 @@ protected:
Writer();
};
-std::unique_ptr<Writer> createWriterELF(TargetHandler *handler);
+std::unique_ptr<Writer> createWriterELF(const ELFLinkingContext &);
std::unique_ptr<Writer> createWriterMachO(const MachOLinkingContext &);
std::unique_ptr<Writer> createWriterPECOFF(const PECOFFLinkingContext &);
std::unique_ptr<Writer> createWriterNative();
Modified: lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp?rev=233878&r1=233877&r2=233878&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp Wed Apr 1 20:02:58 2015
@@ -79,7 +79,7 @@ bool ELFLinkingContext::validateImpl(raw
llvm_unreachable("Unimplemented");
break;
default:
- _writer = createWriterELF(&this->getTargetHandler());
+ _writer = createWriterELF(*this);
break;
}
Modified: lld/trunk/lib/ReaderWriter/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Writer.cpp?rev=233878&r1=233877&r2=233878&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Writer.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Writer.cpp Wed Apr 1 20:02:58 2015
@@ -16,8 +16,8 @@ using namespace llvm::object;
namespace lld {
-std::unique_ptr<Writer> createWriterELF(TargetHandler *handler) {
- return std::move(handler->getWriter());
+std::unique_ptr<Writer> createWriterELF(const ELFLinkingContext &ctx) {
+ return ctx.getTargetHandler().getWriter();
}
} // namespace lld
More information about the llvm-commits
mailing list