llvm.org GIT mirror llvm / 3b237fc
Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9269 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 16 years ago
15 changed file(s) with 22 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
113113
114114 // Other operators...
115115 FIRST_OTHER_INST(26)
116 HANDLE_OTHER_INST(26, PHINode, PHINode ) // PHI node instruction
116 HANDLE_OTHER_INST(26, PHI , PHINode ) // PHI node instruction
117117 HANDLE_OTHER_INST(27, Cast , CastInst ) // Type cast
118118 HANDLE_OTHER_INST(28, Call , CallInst ) // Call a function
119119
2222 public:
2323 PHINode(const Type *Ty, const std::string &Name = "",
2424 Instruction *InsertBefore = 0)
25 : Instruction(Ty, Instruction::PHINode, Name, InsertBefore) {
25 : Instruction(Ty, Instruction::PHI, Name, InsertBefore) {
2626 }
2727
2828 virtual Instruction *clone() const { return new PHINode(*this); }
9797 /// Methods for support type inquiry through isa, cast, and dyn_cast:
9898 static inline bool classof(const PHINode *) { return true; }
9999 static inline bool classof(const Instruction *I) {
100 return I->getOpcode() == Instruction::PHINode;
100 return I->getOpcode() == Instruction::PHI;
101101 }
102102 static inline bool classof(const Value *V) {
103103 return isa(V) && classof(cast(V));
4242 case Instruction::GetElementPtr:
4343 case Instruction::Call:
4444 case Instruction::Invoke:
45 case Instruction::PHINode:
45 case Instruction::PHI:
4646 return true;
4747 }
4848 return false;
218218 setle { RET_TOK(BinaryOpVal, SetLE, SETLE); }
219219 setge { RET_TOK(BinaryOpVal, SetGE, SETGE); }
220220
221 phi { RET_TOK(OtherOpVal, PHINode, PHI); }
221 phi { RET_TOK(OtherOpVal, PHI, PHI_TOK); }
222222 call { RET_TOK(OtherOpVal, Call, CALL); }
223223 cast { RET_TOK(OtherOpVal, Cast, CAST); }
224224 shl { RET_TOK(OtherOpVal, Shl, SHL); }
784784
785785 // Other Operators
786786 %type ShiftOps
787 %token PHI CALL CAST SHL SHR VAARG VANEXT
787 %token PHI_TOK CALL CAST SHL SHR VAARG VANEXT
788788 %token VA_ARG // FIXME: OBSOLETE
789789
790790 %start Module
17461746 $$ = new VANextInst($2, *$4);
17471747 delete $4;
17481748 }
1749 | PHI PHIList {
1749 | PHI_TOK PHIList {
17501750 const Type *Ty = $2->front().first->getType();
17511751 $$ = new PHINode(Ty);
17521752 $$->op_reserve($2->size()*2);
157157 case Instruction::Cast:
158158 Result = new CastInst(getValue(RI.Type, Args[0]), getType(Args[1]));
159159 break;
160 case Instruction::PHINode: {
160 case Instruction::PHI: {
161161 if (Args.size() == 0 || (Args.size() & 1))
162162 throw std::string("Invalid phi node encountered!\n");
163163
298298 InstrTreeNode* opTreeNode;
299299 if (isa(operand) && operand->hasOneUse() &&
300300 cast(operand)->getParent() == instr->getParent() &&
301 instr->getOpcode() != Instruction::PHINode &&
301 instr->getOpcode() != Instruction::PHI &&
302302 instr->getOpcode() != Instruction::Call)
303303 {
304304 // Recursively create a treeNode for it.
333333 if (numChildren > 2)
334334 {
335335 unsigned instrOpcode = treeNode->getInstruction()->getOpcode();
336 assert(instrOpcode == Instruction::PHINode ||
336 assert(instrOpcode == Instruction::PHI ||
337337 instrOpcode == Instruction::Call ||
338338 instrOpcode == Instruction::Load ||
339339 instrOpcode == Instruction::Store ||
298298 InstrTreeNode* opTreeNode;
299299 if (isa(operand) && operand->hasOneUse() &&
300300 cast(operand)->getParent() == instr->getParent() &&
301 instr->getOpcode() != Instruction::PHINode &&
301 instr->getOpcode() != Instruction::PHI &&
302302 instr->getOpcode() != Instruction::Call)
303303 {
304304 // Recursively create a treeNode for it.
333333 if (numChildren > 2)
334334 {
335335 unsigned instrOpcode = treeNode->getInstruction()->getOpcode();
336 assert(instrOpcode == Instruction::PHINode ||
336 assert(instrOpcode == Instruction::PHI ||
337337 instrOpcode == Instruction::Call ||
338338 instrOpcode == Instruction::Load ||
339339 instrOpcode == Instruction::Store ||
364364 case Instruction::Malloc:
365365 case Instruction::Alloca:
366366 case Instruction::GetElementPtr:
367 case Instruction::PHINode:
367 case Instruction::PHI:
368368 case Instruction::Cast:
369369 case Instruction::Call: modelOpCode = V9::ADDi; break;
370370
195195 return false;
196196 break;
197197 }
198 case Instruction::PHINode: {
198 case Instruction::PHI: {
199199 PHINode *PN = cast(I);
200200 for (unsigned i = 0; i < PN->getNumIncomingValues(); ++i)
201201 if (!ExpressionConvertibleToType(PN->getIncomingValue(i), Ty, CTMap, TD))
401401 break;
402402 }
403403
404 case Instruction::PHINode: {
404 case Instruction::PHI: {
405405 PHINode *OldPN = cast(I);
406406 PHINode *NewPN = new PHINode(Ty, Name);
407407
807807 }
808808 return false;
809809
810 case Instruction::PHINode: {
810 case Instruction::PHI: {
811811 PHINode *PN = cast(I);
812812 for (unsigned i = 0; i < PN->getNumIncomingValues(); ++i)
813813 if (!ExpressionConvertibleToType(PN->getIncomingValue(i), Ty, CTMap, TD))
11401140 #endif
11411141 break;
11421142
1143 case Instruction::PHINode: {
1143 case Instruction::PHI: {
11441144 PHINode *OldPN = cast(I);
11451145 PHINode *NewPN = new PHINode(NewTy, Name);
11461146 VMC.ExprMap[I] = NewPN;
424424 }
425425
426426 // Miscellaneous Instructions
427 case Instruction::PHINode: {
427 case Instruction::PHI: {
428428 const PHINode &OldPN = cast(I);
429429 PHINode *PN = new PHINode(ConvertType(OldPN.getType()));
430430 for (unsigned i = 0; i < OldPN.getNumIncomingValues(); ++i)
179179 //
180180 return (opCode < Instruction::OtherOpsBegin &&
181181 opCode != Instruction::Alloca &&
182 opCode != Instruction::PHINode &&
182 opCode != Instruction::PHI &&
183183 opCode != Instruction::Cast);
184184 }
185185
7474 // for PHI nodes, we cannot have infinite recursion here, because there
7575 // cannot be loops in the value graph that do not go through PHI nodes.
7676 //
77 if (I->getOpcode() == Instruction::PHINode ||
77 if (I->getOpcode() == Instruction::PHI ||
7878 I->getOpcode() == Instruction::Alloca ||
7979 I->getOpcode() == Instruction::Malloc || isa(I) ||
8080 I->mayWriteToMemory()) // Cannot move inst if it writes to memory!
2424 //===----------------------------------------------------------------------===//
2525
2626 PHINode::PHINode(const PHINode &PN)
27 : Instruction(PN.getType(), Instruction::PHINode) {
27 : Instruction(PN.getType(), Instruction::PHI) {
2828 Operands.reserve(PN.Operands.size());
2929 for (unsigned i = 0; i < PN.Operands.size(); i+=2) {
3030 Operands.push_back(Use(PN.Operands[i], this));
8686 case GetElementPtr: return "getelementptr";
8787
8888 // Other instructions...
89 case PHINode: return "phi";
89 case PHI: return "phi";
9090 case Cast: return "cast";
9191 case Call: return "call";
9292 case Shl: return "shl";