Add capability to insert an instruction into a basic block immediately after

it is created, as part of the ctor call.

Eliminate the GenericBinaryInst class


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3653 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner committed 2002-09-10 15:45:53 +00:00
1 parent 6e65cda0ec
commit 2aa831120c
7 files changed
+88 -68

No files matched your search

+9 -1
View File
@@ -9,13 +9,21 @@
#include "llvm/Type.h"
#include "Support/LeakDetector.h"
Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name)
Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
Instruction *InsertBefore)
: User(ty, Value::InstructionVal, Name) {
Parent = 0;
iType = it;
// Make sure that we get added to a basicblock
LeakDetector::addGarbageObject(this);
// If requested, insert this instruction into a basic block...
if (InsertBefore) {
assert(InsertBefore->getParent() &&
"Instruction to insert before is not in a basic block!");
InsertBefore->getParent()->getInstList().insert(InsertBefore, this);
}
}
void Instruction::setParent(BasicBlock *P) {