X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FOperator.h;h=bc5da8e8aa389abd6f96d8b9ada3cffdc166a704;hb=6e006d3de882784527d4d9cc92b1a91f6773505e;hp=cf6d8e2c37937574e73559187842ff56352db0b8;hpb=0cb0a3533788c6c622518cb030048012eb69af15;p=oota-llvm.git diff --git a/include/llvm/Operator.h b/include/llvm/Operator.h index cf6d8e2c379..bc5da8e8aa3 100644 --- a/include/llvm/Operator.h +++ b/include/llvm/Operator.h @@ -16,6 +16,7 @@ #define LLVM_OPERATOR_H #include "llvm/Constants.h" +#include "llvm/DerivedTypes.h" #include "llvm/Instruction.h" #include "llvm/Type.h" @@ -35,7 +36,9 @@ private: void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION; void *operator new(size_t s) LLVM_DELETED_FUNCTION; Operator() LLVM_DELETED_FUNCTION; - ~Operator() LLVM_DELETED_FUNCTION; + // NOTE: cannot use LLVM_DELETED_FUNCTION because gcc errors when deleting + // an override of a non-deleted function. + ~Operator(); public: /// getOpcode - Return the opcode for this Instruction or ConstantExpr. @@ -57,7 +60,6 @@ public: return Instruction::UserOp1; } - static inline bool classof(const Operator *) { return true; } static inline bool classof(const Instruction *) { return true; } static inline bool classof(const ConstantExpr *) { return true; } static inline bool classof(const Value *V) { @@ -77,7 +79,7 @@ public: }; private: - ~OverflowingBinaryOperator() LLVM_DELETED_FUNCTION; + ~OverflowingBinaryOperator(); // DO NOT IMPLEMENT friend class BinaryOperator; friend class ConstantExpr; @@ -103,7 +105,6 @@ public: return (SubclassOptionalData & NoSignedWrap) != 0; } - static inline bool classof(const OverflowingBinaryOperator *) { return true; } static inline bool classof(const Instruction *I) { return I->getOpcode() == Instruction::Add || I->getOpcode() == Instruction::Sub || @@ -131,7 +132,7 @@ public: }; private: - ~PossiblyExactOperator() LLVM_DELETED_FUNCTION; + ~PossiblyExactOperator(); // DO NOT IMPLEMENT friend class BinaryOperator; friend class ConstantExpr; @@ -168,7 +169,7 @@ public: /// information about relaxed accuracy requirements attached to them. class FPMathOperator : public Operator { private: - ~FPMathOperator() LLVM_DELETED_FUNCTION; + ~FPMathOperator(); // DO NOT IMPLEMENT public: @@ -177,7 +178,6 @@ public: /// default precision. float getFPAccuracy() const; - static inline bool classof(const FPMathOperator *) { return true; } static inline bool classof(const Instruction *I) { return I->getType()->isFPOrFPVectorTy(); } @@ -193,9 +193,6 @@ template class ConcreteOperator : public SuperClass { ~ConcreteOperator() LLVM_DELETED_FUNCTION; public: - static inline bool classof(const ConcreteOperator *) { - return true; - } static inline bool classof(const Instruction *I) { return I->getOpcode() == Opc; } @@ -288,6 +285,12 @@ public: return getPointerOperand()->getType(); } + /// getPointerAddressSpace - Method to return the address space of the + /// pointer operand. + unsigned getPointerAddressSpace() const { + return cast(getPointerOperandType())->getAddressSpace(); + } + unsigned getNumIndices() const { // Note: always non-negative return getNumOperands() - 1; }