summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/InstrSelection
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-08 21:08:43 +0000
committerChris Lattner <sabre@nondot.org>2002-09-08 21:08:43 +0000
commit16d4c60600456ea6aa507003fe081e6590e83e7e (patch)
treee554dbe1d55e1fc6be8bcbf9ce5b782576c40b17 /llvm/lib/CodeGen/InstrSelection
parentd85566e59ae3e69c8b6a63c810046eea88ea6d18 (diff)
downloadbcm5719-llvm-16d4c60600456ea6aa507003fe081e6590e83e7e.tar.gz
bcm5719-llvm-16d4c60600456ea6aa507003fe081e6590e83e7e.zip
Inform the memory leak detector that TmpInstruction objects should not be
subject to memory leak checking. llvm-svn: 3623
Diffstat (limited to 'llvm/lib/CodeGen/InstrSelection')
-rw-r--r--llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp b/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp
index d8f89813622..a6e5a77d0ea 100644
--- a/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp
+++ b/llvm/lib/CodeGen/InstrSelection/InstrSelection.cpp
@@ -19,6 +19,7 @@
#include "llvm/iPHINode.h"
#include "llvm/Pass.h"
#include "Support/CommandLine.h"
+#include "Support/LeakDetector.h"
using std::cerr;
using std::vector;
@@ -71,6 +72,29 @@ namespace {
static RegisterLLC<InstructionSelection>
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)
{
OpenPOWER on IntegriCloud