aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Instruction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-06-27 18:38:48 +0000
committerChris Lattner <sabre@nondot.org>2004-06-27 18:38:48 +0000
commit40515dba1bcbde16ee79657c6053232bc4562554 (patch)
tree36b16feca0451725bed0716db854c7bacf5efe3f /lib/VMCore/Instruction.cpp
parent7da38ec915010576685200089c75a2135bd3fa97 (diff)
Fold iType into Value::VTy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14435 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instruction.cpp')
-rw-r--r--lib/VMCore/Instruction.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index 5ddf284354..1350f05b9b 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/VMCore/Instruction.cpp
@@ -25,9 +25,7 @@ void Instruction::init()
Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
Instruction *InsertBefore)
- : User(ty, Value::InstructionVal, Name),
- Parent(0),
- iType(it) {
+ : User(ty, Value::InstructionVal + it, Name), Parent(0) {
init();
// If requested, insert this instruction into a basic block...
@@ -40,9 +38,7 @@ Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
BasicBlock *InsertAtEnd)
- : User(ty, Value::InstructionVal, Name),
- Parent(0),
- iType(it) {
+ : User(ty, Value::InstructionVal + it, Name), Parent(0) {
init();
// append this instruction into the basic block
@@ -50,6 +46,10 @@ Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
InsertAtEnd->getInstList().push_back(this);
}
+void Instruction::setOpcode(unsigned opc) {
+ setValueType(Value::InstructionVal + opc);
+}
+
void Instruction::setParent(BasicBlock *P) {
if (getParent()) {
if (!P) LeakDetector::addGarbageObject(this);