// Other operators...
FIRST_OTHER_INST(26)
-HANDLE_OTHER_INST(26, PHINode, PHINode ) // PHI node instruction
+HANDLE_OTHER_INST(26, PHI , PHINode ) // PHI node instruction
HANDLE_OTHER_INST(27, Cast , CastInst ) // Type cast
HANDLE_OTHER_INST(28, Call , CallInst ) // Call a function
public:
PHINode(const Type *Ty, const std::string &Name = "",
Instruction *InsertBefore = 0)
- : Instruction(Ty, Instruction::PHINode, Name, InsertBefore) {
+ : Instruction(Ty, Instruction::PHI, Name, InsertBefore) {
}
virtual Instruction *clone() const { return new PHINode(*this); }
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const PHINode *) { return true; }
static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::PHINode;
+ return I->getOpcode() == Instruction::PHI;
}
static inline bool classof(const Value *V) {
return isa<Instruction>(V) && classof(cast<Instruction>(V));
case Instruction::GetElementPtr:
case Instruction::Call:
case Instruction::Invoke:
- case Instruction::PHINode:
+ case Instruction::PHI:
return true;
}
return false;
setle { RET_TOK(BinaryOpVal, SetLE, SETLE); }
setge { RET_TOK(BinaryOpVal, SetGE, SETGE); }
-phi { RET_TOK(OtherOpVal, PHINode, PHI); }
+phi { RET_TOK(OtherOpVal, PHI, PHI_TOK); }
call { RET_TOK(OtherOpVal, Call, CALL); }
cast { RET_TOK(OtherOpVal, Cast, CAST); }
shl { RET_TOK(OtherOpVal, Shl, SHL); }
// Other Operators
%type <OtherOpVal> ShiftOps
-%token <OtherOpVal> PHI CALL CAST SHL SHR VAARG VANEXT
+%token <OtherOpVal> PHI_TOK CALL CAST SHL SHR VAARG VANEXT
%token VA_ARG // FIXME: OBSOLETE
%start Module
$$ = new VANextInst($2, *$4);
delete $4;
}
- | PHI PHIList {
+ | PHI_TOK PHIList {
const Type *Ty = $2->front().first->getType();
$$ = new PHINode(Ty);
$$->op_reserve($2->size()*2);
case Instruction::Cast:
Result = new CastInst(getValue(RI.Type, Args[0]), getType(Args[1]));
break;
- case Instruction::PHINode: {
+ case Instruction::PHI: {
if (Args.size() == 0 || (Args.size() & 1))
throw std::string("Invalid phi node encountered!\n");
InstrTreeNode* opTreeNode;
if (isa<Instruction>(operand) && operand->hasOneUse() &&
cast<Instruction>(operand)->getParent() == instr->getParent() &&
- instr->getOpcode() != Instruction::PHINode &&
+ instr->getOpcode() != Instruction::PHI &&
instr->getOpcode() != Instruction::Call)
{
// Recursively create a treeNode for it.
if (numChildren > 2)
{
unsigned instrOpcode = treeNode->getInstruction()->getOpcode();
- assert(instrOpcode == Instruction::PHINode ||
+ assert(instrOpcode == Instruction::PHI ||
instrOpcode == Instruction::Call ||
instrOpcode == Instruction::Load ||
instrOpcode == Instruction::Store ||
InstrTreeNode* opTreeNode;
if (isa<Instruction>(operand) && operand->hasOneUse() &&
cast<Instruction>(operand)->getParent() == instr->getParent() &&
- instr->getOpcode() != Instruction::PHINode &&
+ instr->getOpcode() != Instruction::PHI &&
instr->getOpcode() != Instruction::Call)
{
// Recursively create a treeNode for it.
if (numChildren > 2)
{
unsigned instrOpcode = treeNode->getInstruction()->getOpcode();
- assert(instrOpcode == Instruction::PHINode ||
+ assert(instrOpcode == Instruction::PHI ||
instrOpcode == Instruction::Call ||
instrOpcode == Instruction::Load ||
instrOpcode == Instruction::Store ||
case Instruction::Malloc:
case Instruction::Alloca:
case Instruction::GetElementPtr:
- case Instruction::PHINode:
+ case Instruction::PHI:
case Instruction::Cast:
case Instruction::Call: modelOpCode = V9::ADDi; break;
return false;
break;
}
- case Instruction::PHINode: {
+ case Instruction::PHI: {
PHINode *PN = cast<PHINode>(I);
for (unsigned i = 0; i < PN->getNumIncomingValues(); ++i)
if (!ExpressionConvertibleToType(PN->getIncomingValue(i), Ty, CTMap, TD))
break;
}
- case Instruction::PHINode: {
+ case Instruction::PHI: {
PHINode *OldPN = cast<PHINode>(I);
PHINode *NewPN = new PHINode(Ty, Name);
}
return false;
- case Instruction::PHINode: {
+ case Instruction::PHI: {
PHINode *PN = cast<PHINode>(I);
for (unsigned i = 0; i < PN->getNumIncomingValues(); ++i)
if (!ExpressionConvertibleToType(PN->getIncomingValue(i), Ty, CTMap, TD))
#endif
break;
- case Instruction::PHINode: {
+ case Instruction::PHI: {
PHINode *OldPN = cast<PHINode>(I);
PHINode *NewPN = new PHINode(NewTy, Name);
VMC.ExprMap[I] = NewPN;
}
// Miscellaneous Instructions
- case Instruction::PHINode: {
+ case Instruction::PHI: {
const PHINode &OldPN = cast<PHINode>(I);
PHINode *PN = new PHINode(ConvertType(OldPN.getType()));
for (unsigned i = 0; i < OldPN.getNumIncomingValues(); ++i)
//
return (opCode < Instruction::OtherOpsBegin &&
opCode != Instruction::Alloca &&
- opCode != Instruction::PHINode &&
+ opCode != Instruction::PHI &&
opCode != Instruction::Cast);
}
// for PHI nodes, we cannot have infinite recursion here, because there
// cannot be loops in the value graph that do not go through PHI nodes.
//
- if (I->getOpcode() == Instruction::PHINode ||
+ if (I->getOpcode() == Instruction::PHI ||
I->getOpcode() == Instruction::Alloca ||
I->getOpcode() == Instruction::Malloc || isa<TerminatorInst>(I) ||
I->mayWriteToMemory()) // Cannot move inst if it writes to memory!
//===----------------------------------------------------------------------===//
PHINode::PHINode(const PHINode &PN)
- : Instruction(PN.getType(), Instruction::PHINode) {
+ : Instruction(PN.getType(), Instruction::PHI) {
Operands.reserve(PN.Operands.size());
for (unsigned i = 0; i < PN.Operands.size(); i+=2) {
Operands.push_back(Use(PN.Operands[i], this));
case GetElementPtr: return "getelementptr";
// Other instructions...
- case PHINode: return "phi";
+ case PHI: return "phi";
case Cast: return "cast";
case Call: return "call";
case Shl: return "shl";