X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FIR%2FConstant.h;h=019e2b93380e36a0cf44d5c8fe0cc6ef87caf9f1;hb=7116af637cf6e3e49b6329263fb1535fb9de73bc;hp=5a3ba28447328be19a352fab24f55c6492583227;hpb=935e35d2b9f889566207b76a7026b63a1619742c;p=oota-llvm.git diff --git a/include/llvm/IR/Constant.h b/include/llvm/IR/Constant.h index 5a3ba284473..019e2b93380 100644 --- a/include/llvm/IR/Constant.h +++ b/include/llvm/IR/Constant.h @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CONSTANT_H -#define LLVM_CONSTANT_H +#ifndef LLVM_IR_CONSTANT_H +#define LLVM_IR_CONSTANT_H #include "llvm/IR/User.h" @@ -41,18 +41,23 @@ namespace llvm { class Constant : public User { void operator=(const Constant &) LLVM_DELETED_FUNCTION; Constant(const Constant &) LLVM_DELETED_FUNCTION; - virtual void anchor(); - + void anchor() override; + protected: Constant(Type *ty, ValueTy vty, Use *Ops, unsigned NumOps) : User(ty, vty, Ops, NumOps) {} void destroyConstantImpl(); + void replaceUsesOfWithOnConstantImpl(Constant *Replacement); + public: /// isNullValue - Return true if this is the value that would be returned by /// getNullValue. bool isNullValue() const; + /// \brief Returns true if the value is one. + bool isOneValue() const; + /// isAllOnesValue - Return true if this is the value that would be returned by /// getAllOnesValue. bool isAllOnesValue() const; @@ -64,6 +69,9 @@ public: /// Return true if the value is negative zero or null value. bool isZeroValue() const; + /// \brief Return true if the value is the smallest signed value. + bool isMinSignedValue() const; + /// canTrap - Return true if evaluation of this constant could trap. This is /// true for things like constant expressions that could divide by zero. bool canTrap() const; @@ -71,6 +79,9 @@ public: /// isThreadDependent - Return true if the value can vary between threads. bool isThreadDependent() const; + /// Return true if the value is dependent on a dllimport variable. + bool isDLLImportDependent() const; + /// isConstantUsed - Return true if the constant has users other than constant /// exprs and other dangling things. bool isConstantUsed() const; @@ -163,6 +174,14 @@ public: /// that want to check to see if a global is unused, but don't want to deal /// with potentially dead constants hanging off of the globals. void removeDeadConstantUsers() const; + + Constant *stripPointerCasts() { + return cast(Value::stripPointerCasts()); + } + + const Constant *stripPointerCasts() const { + return const_cast(this)->stripPointerCasts(); + } }; } // End llvm namespace