X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=include%2Fllvm%2FIR%2FGlobalValue.h;h=aeaaef4bd8b967626decb0f9986e98c427f4ae77;hb=2c3e0051c31c3f5b2328b447eadf1cf9c4427442;hp=002e5e79fd46a4b1351af3e6d49ac19220c32758;hpb=e1bc145815f4334641be19f1c45ecf85d25b6e5a;p=android-x86%2Fexternal-llvm.git diff --git a/include/llvm/IR/GlobalValue.h b/include/llvm/IR/GlobalValue.h index 002e5e79fd4..aeaaef4bd8b 100644 --- a/include/llvm/IR/GlobalValue.h +++ b/include/llvm/IR/GlobalValue.h @@ -61,7 +61,7 @@ public: }; protected: - GlobalValue(Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, + GlobalValue(PointerType *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name) : Constant(Ty, VTy, Ops, NumOps), Linkage(Linkage), Visibility(DefaultVisibility), UnnamedAddr(0), @@ -104,7 +104,7 @@ public: LocalExecTLSModel }; - ~GlobalValue() { + ~GlobalValue() override { removeDeadConstantUsers(); // remove any dead constants using this. } @@ -165,9 +165,9 @@ public: const char *getSection() const; /// Global values are always pointers. - inline PointerType *getType() const { - return cast(User::getType()); - } + PointerType *getType() const { return cast(User::getType()); } + + Type *getValueType() const { return getType()->getElementType(); } static LinkageTypes getLinkOnceLinkage(bool ODR) { return ODR ? LinkOnceODRLinkage : LinkOnceAnyLinkage; @@ -343,11 +343,11 @@ public: virtual void eraseFromParent() = 0; /// Get the module that this global value is contained inside of... - inline Module *getParent() { return Parent; } - inline const Module *getParent() const { return Parent; } + Module *getParent() { return Parent; } + const Module *getParent() const { return Parent; } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() == Value::FunctionVal || V->getValueID() == Value::GlobalVariableVal || V->getValueID() == Value::GlobalAliasVal;