llvm-project/lld/include/lld/ReaderWriter/CoreLinkingContext.h
Greg Fitzgerald 4b6a7e355b Fix five of the shared library build targets
Before this patch there was a cyclic dependency between lldCore and
lldReaderWriter.  Only lldConfig could be built as a shared library.

* Moved Reader and Writer base classes into lldCore.
* The following shared libraries can now be built:
     lldCore
     lldYAML
     lldNative
     lldPasses
     lldReaderWriter

Differential Revision: http://reviews.llvm.org/D7105

From: Greg Fitzgerald <garious@gmail.com>
llvm-svn: 226732
2015-01-21 22:54:56 +00:00

48 lines
1.2 KiB
C++

//===- lld/ReaderWriter/CoreLinkingContext.h ------------------------------===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLD_READER_WRITER_CORE_LINKER_CONTEXT_H
#define LLD_READER_WRITER_CORE_LINKER_CONTEXT_H
#include "lld/Core/LinkingContext.h"
#include "lld/Core/Reader.h"
#include "lld/Core/Writer.h"
#include "llvm/Support/ErrorHandling.h"
namespace lld {
class CoreLinkingContext : public LinkingContext {
public:
CoreLinkingContext();
enum {
TEST_RELOC_CALL32 = 1,
TEST_RELOC_PCREL32 = 2,
TEST_RELOC_GOT_LOAD32 = 3,
TEST_RELOC_GOT_USE32 = 4,
TEST_RELOC_LEA32_WAS_GOT = 5,
};
bool validateImpl(raw_ostream &diagnostics) override;
void addPasses(PassManager &pm) override;
void addPassNamed(StringRef name) { _passNames.push_back(name); }
protected:
Writer &writer() const override;
private:
std::unique_ptr<Writer> _writer;
std::vector<StringRef> _passNames;
};
} // end namespace lld
#endif