mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Inform the memory leak detector that TmpInstruction objects should not be
subject to memory leak checking. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3623 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "Support/CommandLine.h"
|
#include "Support/CommandLine.h"
|
||||||
|
#include "Support/LeakDetector.h"
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
@@ -71,6 +72,29 @@ namespace {
|
|||||||
static RegisterLLC<InstructionSelection>
|
static RegisterLLC<InstructionSelection>
|
||||||
X("instselect", "Instruction Selection", createInstructionSelectionPass);
|
X("instselect", "Instruction Selection", createInstructionSelectionPass);
|
||||||
|
|
||||||
|
TmpInstruction::TmpInstruction(Value *s1, Value *s2, const std::string &name)
|
||||||
|
: Instruction(s1->getType(), Instruction::UserOp1, name) {
|
||||||
|
Operands.push_back(Use(s1, this)); // s1 must be nonnull
|
||||||
|
if (s2) {
|
||||||
|
Operands.push_back(Use(s2, this));
|
||||||
|
}
|
||||||
|
|
||||||
|
// TmpInstructions should not be garbage checked.
|
||||||
|
LeakDetector::removeGarbageObject(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Constructor that requires the type of the temporary to be specified.
|
||||||
|
// Both S1 and S2 may be NULL.(
|
||||||
|
TmpInstruction::TmpInstruction(const Type *Ty, Value *s1, Value* s2,
|
||||||
|
const std::string &name)
|
||||||
|
: Instruction(Ty, Instruction::UserOp1, name) {
|
||||||
|
if (s1) { Operands.push_back(Use(s1, this)); }
|
||||||
|
if (s2) { Operands.push_back(Use(s2, this)); }
|
||||||
|
|
||||||
|
// TmpInstructions should not be garbage checked.
|
||||||
|
LeakDetector::removeGarbageObject(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool InstructionSelection::runOnFunction(Function &F)
|
bool InstructionSelection::runOnFunction(Function &F)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "Support/CommandLine.h"
|
#include "Support/CommandLine.h"
|
||||||
|
#include "Support/LeakDetector.h"
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
@@ -71,6 +72,29 @@ namespace {
|
|||||||
static RegisterLLC<InstructionSelection>
|
static RegisterLLC<InstructionSelection>
|
||||||
X("instselect", "Instruction Selection", createInstructionSelectionPass);
|
X("instselect", "Instruction Selection", createInstructionSelectionPass);
|
||||||
|
|
||||||
|
TmpInstruction::TmpInstruction(Value *s1, Value *s2, const std::string &name)
|
||||||
|
: Instruction(s1->getType(), Instruction::UserOp1, name) {
|
||||||
|
Operands.push_back(Use(s1, this)); // s1 must be nonnull
|
||||||
|
if (s2) {
|
||||||
|
Operands.push_back(Use(s2, this));
|
||||||
|
}
|
||||||
|
|
||||||
|
// TmpInstructions should not be garbage checked.
|
||||||
|
LeakDetector::removeGarbageObject(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Constructor that requires the type of the temporary to be specified.
|
||||||
|
// Both S1 and S2 may be NULL.(
|
||||||
|
TmpInstruction::TmpInstruction(const Type *Ty, Value *s1, Value* s2,
|
||||||
|
const std::string &name)
|
||||||
|
: Instruction(Ty, Instruction::UserOp1, name) {
|
||||||
|
if (s1) { Operands.push_back(Use(s1, this)); }
|
||||||
|
if (s2) { Operands.push_back(Use(s2, this)); }
|
||||||
|
|
||||||
|
// TmpInstructions should not be garbage checked.
|
||||||
|
LeakDetector::removeGarbageObject(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool InstructionSelection::runOnFunction(Function &F)
|
bool InstructionSelection::runOnFunction(Function &F)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user