mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Don't construct or delete a module on the Linker.
The linker is now responsible only for actually linking the modules, it is up to the clients to create and destroy them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181098 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bcc6ac93ba
commit
105193772d
@ -44,13 +44,6 @@ class Linker {
|
|||||||
/// @name Constructors
|
/// @name Constructors
|
||||||
/// @{
|
/// @{
|
||||||
public:
|
public:
|
||||||
/// Construct the Linker with an empty module which will be given the
|
|
||||||
/// name \p progname. \p progname will also be used for error messages.
|
|
||||||
/// @brief Construct with empty module
|
|
||||||
Linker(StringRef modulename, ///< name of linker's end-result module
|
|
||||||
LLVMContext &C ///< Context for global info
|
|
||||||
);
|
|
||||||
|
|
||||||
/// Construct the Linker with a previously defined module, \p aModule. Use
|
/// Construct the Linker with a previously defined module, \p aModule. Use
|
||||||
/// \p progname for the name of the program in error messages.
|
/// \p progname for the name of the program in error messages.
|
||||||
/// @brief Construct with existing module
|
/// @brief Construct with existing module
|
||||||
|
@ -19,13 +19,8 @@
|
|||||||
#include "llvm/Support/system_error.h"
|
#include "llvm/Support/system_error.h"
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
Linker::Linker(StringRef modname,
|
|
||||||
LLVMContext& C):
|
|
||||||
Composite(new Module(modname, C)) { }
|
|
||||||
|
|
||||||
Linker::Linker(Module* aModule) :
|
Linker::Linker(Module* aModule) :
|
||||||
Composite(aModule) { }
|
Composite(aModule) { }
|
||||||
|
|
||||||
Linker::~Linker() {
|
Linker::~Linker() {
|
||||||
delete Composite;
|
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ const char* LTOCodeGenerator::getVersionString() {
|
|||||||
|
|
||||||
LTOCodeGenerator::LTOCodeGenerator()
|
LTOCodeGenerator::LTOCodeGenerator()
|
||||||
: _context(getGlobalContext()),
|
: _context(getGlobalContext()),
|
||||||
_linker("ld-temp.o", _context), _target(NULL),
|
_linker(new Module("ld-temp.o", _context)), _target(NULL),
|
||||||
_emitDwarfDebugInfo(false), _scopeRestrictionsDone(false),
|
_emitDwarfDebugInfo(false), _scopeRestrictionsDone(false),
|
||||||
_codeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC),
|
_codeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC),
|
||||||
_nativeObjectFile(NULL) {
|
_nativeObjectFile(NULL) {
|
||||||
@ -81,6 +81,7 @@ LTOCodeGenerator::LTOCodeGenerator()
|
|||||||
LTOCodeGenerator::~LTOCodeGenerator() {
|
LTOCodeGenerator::~LTOCodeGenerator() {
|
||||||
delete _target;
|
delete _target;
|
||||||
delete _nativeObjectFile;
|
delete _nativeObjectFile;
|
||||||
|
delete _linker.getModule();
|
||||||
|
|
||||||
for (std::vector<char*>::iterator I = _codegenOptions.begin(),
|
for (std::vector<char*>::iterator I = _codegenOptions.begin(),
|
||||||
E = _codegenOptions.end(); I != E; ++I)
|
E = _codegenOptions.end(); I != E; ++I)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user