X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FOperator.h;h=3aae586f1448c778bdfa59e6b8dd865846b28ac2;hb=24312230ada6f4cfa8776351dafb12eea8a81b33;hp=06eb243418ec82a3f06b9f0656a14474d08a218d;hpb=f8dbee7cea072eb63ae343759975109553697bcb;p=oota-llvm.git diff --git a/include/llvm/Operator.h b/include/llvm/Operator.h index 06eb243418e..3aae586f144 100644 --- a/include/llvm/Operator.h +++ b/include/llvm/Operator.h @@ -57,8 +57,8 @@ public: } static inline bool classof(const Operator *) { return true; } - static inline bool classof(const Instruction *I) { return true; } - static inline bool classof(const ConstantExpr *I) { 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) { return isa(V) || isa(V); } @@ -99,7 +99,7 @@ public: /// hasNoSignedWrap - Test whether this operation is known to never /// undergo signed overflow, aka the nsw property. bool hasNoSignedWrap() const { - return SubclassOptionalData & NoSignedWrap; + return (SubclassOptionalData & NoSignedWrap) != 0; } static inline bool classof(const OverflowingBinaryOperator *) { return true; } @@ -274,6 +274,18 @@ public: return true; } + /// hasAllConstantIndices - Return true if all of the indices of this GEP are + /// constant integers. If so, the result pointer and the first operand have + /// a constant offset between them. + bool hasAllConstantIndices() const { + for (const_op_iterator I = idx_begin(), E = idx_end(); I != E; ++I) { + if (!isa(I)) + return false; + } + return true; + } + + // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const GEPOperator *) { return true; } static inline bool classof(const GetElementPtrInst *) { return true; }