mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
Add a 'deleteModule' method to the Linker class.
This deletes the Module ivar instead of having the LTO code generater do it. It also sets the pointer to 'NULL', so that if it's used again it will abort quickly. llvm-svn: 192778
This commit is contained in:
parent
ab81f8a305
commit
b373627ae3
@ -32,7 +32,9 @@ class Linker {
|
||||
|
||||
Linker(Module *M);
|
||||
~Linker();
|
||||
|
||||
Module *getModule() const { return Composite; }
|
||||
void deleteModule();
|
||||
|
||||
/// \brief Link \p Src into the composite. The source is destroyed if
|
||||
/// \p Mode is DestroySource and preserved if it is PreserveSource.
|
||||
|
@ -66,7 +66,10 @@ LTOCodeGenerator::LTOCodeGenerator()
|
||||
LTOCodeGenerator::~LTOCodeGenerator() {
|
||||
delete TargetMach;
|
||||
delete NativeObjectFile;
|
||||
delete Linker.getModule();
|
||||
TargetMach = NULL;
|
||||
NativeObjectFile = NULL;
|
||||
|
||||
Linker.deleteModule();
|
||||
|
||||
for (std::vector<char *>::iterator I = CodegenOptions.begin(),
|
||||
E = CodegenOptions.end();
|
||||
|
@ -1352,6 +1352,11 @@ Linker::Linker(Module *M) : Composite(M) {
|
||||
Linker::~Linker() {
|
||||
}
|
||||
|
||||
void Linker::deleteModule() {
|
||||
delete Composite;
|
||||
Composite = NULL;
|
||||
}
|
||||
|
||||
bool Linker::linkInModule(Module *Src, unsigned Mode, std::string *ErrorMsg) {
|
||||
ModuleLinker TheLinker(Composite, IdentifiedStructTypes, Src, Mode);
|
||||
if (TheLinker.run()) {
|
||||
|
Loading…
Reference in New Issue
Block a user