OLD | NEW |
1 //===-- llvm/InstrTypes.h - Important Instruction subclasses ----*- C++ -*-===// | 1 //===-- llvm/InstrTypes.h - Important Instruction subclasses ----*- C++ -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines various meta classes of instructions that exist in the VM | 10 // This file defines various meta classes of instructions that exist in the VM |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 | 649 |
650 /// @brief Return the source type, as a convenience | 650 /// @brief Return the source type, as a convenience |
651 Type* getSrcTy() const { return getOperand(0)->getType(); } | 651 Type* getSrcTy() const { return getOperand(0)->getType(); } |
652 /// @brief Return the destination type, as a convenience | 652 /// @brief Return the destination type, as a convenience |
653 Type* getDestTy() const { return getType(); } | 653 Type* getDestTy() const { return getType(); } |
654 | 654 |
655 /// This method can be used to determine if a cast from S to DstTy using | 655 /// This method can be used to determine if a cast from S to DstTy using |
656 /// Opcode op is valid or not. | 656 /// Opcode op is valid or not. |
657 /// @returns true iff the proposed cast is valid. | 657 /// @returns true iff the proposed cast is valid. |
658 /// @brief Determine if a cast is valid without creating one. | 658 /// @brief Determine if a cast is valid without creating one. |
659 static bool castIsValid(Instruction::CastOps op, Value *S, Type *DstTy); | 659 // @LOCALMOD-BEGIN |
| 660 static bool castIsValid(Instruction::CastOps op, Type *SrcTy, Type *DstTy); |
| 661 |
| 662 static bool castIsValid(Instruction::CastOps op, Value *S, Type *DstTy) { |
| 663 return castIsValid(op, S->getType(), DstTy); |
| 664 } |
| 665 // @LOCALMOD-END |
660 | 666 |
661 /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: | 667 /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: |
662 static inline bool classof(const Instruction *I) { | 668 static inline bool classof(const Instruction *I) { |
663 return I->isCast(); | 669 return I->isCast(); |
664 } | 670 } |
665 static inline bool classof(const Value *V) { | 671 static inline bool classof(const Value *V) { |
666 return isa<Instruction>(V) && classof(cast<Instruction>(V)); | 672 return isa<Instruction>(V) && classof(cast<Instruction>(V)); |
667 } | 673 } |
668 }; | 674 }; |
669 | 675 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 // FIXME: these are redundant if CmpInst < BinaryOperator | 897 // FIXME: these are redundant if CmpInst < BinaryOperator |
892 template <> | 898 template <> |
893 struct OperandTraits<CmpInst> : public FixedNumOperandTraits<CmpInst, 2> { | 899 struct OperandTraits<CmpInst> : public FixedNumOperandTraits<CmpInst, 2> { |
894 }; | 900 }; |
895 | 901 |
896 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CmpInst, Value) | 902 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CmpInst, Value) |
897 | 903 |
898 } // End llvm namespace | 904 } // End llvm namespace |
899 | 905 |
900 #endif | 906 #endif |
OLD | NEW |