-//===-- InstrTypes.cpp - Implement Instruction subclasses --------*- C++ -*--=//
+//===-- InstrTypes.cpp - Implement Instruction subclasses -------*- C++ -*-===//
//
// This file implements
//
#include "llvm/iOther.h"
#include "llvm/iPHINode.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Method.h"
+#include "llvm/Function.h"
#include "llvm/SymbolTable.h"
#include "llvm/Type.h"
#include <algorithm> // find
// TerminatorInst Class
//===----------------------------------------------------------------------===//
-TerminatorInst::TerminatorInst(Instruction::TermOps iType)
- : Instruction(Type::VoidTy, iType, "") {
+TerminatorInst::TerminatorInst(Instruction::TermOps iType, Instruction *IB)
+ : Instruction(Type::VoidTy, iType, "", IB) {
}
-TerminatorInst::TerminatorInst(const Type *Ty, Instruction::TermOps iType,
- const std::string &Name = "")
- : Instruction(Ty, iType, Name) {
-}
-
-
-//===----------------------------------------------------------------------===//
-// MethodArgument Class
-//===----------------------------------------------------------------------===//
-
-// Specialize setName to take care of symbol table majik
-void MethodArgument::setName(const std::string &name, SymbolTable *ST) {
- Method *P;
- assert((ST == 0 || (!getParent() || ST == getParent()->getSymbolTable())) &&
- "Invalid symtab argument!");
- if ((P = getParent()) && hasName()) P->getSymbolTable()->remove(this);
- Value::setName(name);
- if (P && hasName()) P->getSymbolTable()->insert(this);
-}
-
-
//===----------------------------------------------------------------------===//
// PHINode Class
//===----------------------------------------------------------------------===//
-PHINode::PHINode(const Type *Ty, const std::string &name)
- : Instruction(Ty, Instruction::PHINode, name) {
-}
-
-PHINode::PHINode(const PHINode &PN)
+PHINode::PHINode(const PHINode &PN)
: Instruction(PN.getType(), Instruction::PHINode) {
Operands.reserve(PN.Operands.size());
for (unsigned i = 0; i < PN.Operands.size(); i+=2) {