X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FVMCore%2FInstrTypes.cpp;h=954719aa95070aae6b73a402213c899122b10670;hb=95586b8c833aeca112907e69f545a6ea6e2103ff;hp=69a703c0c7461d2443f93c033857224282e837d2;hpb=7061dc50b2513731d7b346ab16183cda4a44619f;p=oota-llvm.git diff --git a/lib/VMCore/InstrTypes.cpp b/lib/VMCore/InstrTypes.cpp index 69a703c0c74..954719aa950 100644 --- a/lib/VMCore/InstrTypes.cpp +++ b/lib/VMCore/InstrTypes.cpp @@ -6,8 +6,7 @@ #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 // find @@ -21,31 +20,16 @@ TerminatorInst::TerminatorInst(Instruction::TermOps iType) } TerminatorInst::TerminatorInst(const Type *Ty, Instruction::TermOps iType, - const string &Name = "") + const std::string &Name) : Instruction(Ty, iType, Name) { } -//===----------------------------------------------------------------------===// -// MethodArgument Class -//===----------------------------------------------------------------------===// - -// Specialize setName to take care of symbol table majik -void MethodArgument::setName(const 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 string &name) +PHINode::PHINode(const Type *Ty, const std::string &name) : Instruction(Ty, Instruction::PHINode, name) { } @@ -59,6 +43,8 @@ PHINode::PHINode(const PHINode &PN) } void PHINode::addIncoming(Value *D, BasicBlock *BB) { + assert(getType() == D->getType() && + "All operands to PHI node must be the same type as the PHI node!"); Operands.push_back(Use(D, this)); Operands.push_back(Use(BB, this)); }