X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=include%2Fllvm%2FGlobalValue.h;h=317aa486a4070d9b2cf84a630796c3d2ff552b0a;hb=eb0107af86b9dde84cc1f57876f0cefc6707a919;hp=9dab3f82f082b72ac04615972aca74f8811036b2;hpb=18feb92e917a029b72a338e91b5b93f74d26f406;p=oota-llvm.git diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index 9dab3f82f08..317aa486a40 100644 --- a/include/llvm/GlobalValue.h +++ b/include/llvm/GlobalValue.h @@ -55,8 +55,10 @@ protected: } Module *Parent; - LinkageTypes Linkage : 4; // The linkage of this global - VisibilityTypes Visibility : 1; // The visibility style of this global + // Note: VC++ treats enums as signed, so an extra bit is required to prevent + // Linkage and Visibility from turning into negative values. + LinkageTypes Linkage : 5; // The linkage of this global + unsigned Visibility : 1; // The visibility style of this global unsigned Alignment : 16; // Alignment of this symbol, must be power of two std::string Section; // Section to emit this into, empty mean default public: @@ -70,7 +72,7 @@ public: Alignment = Align; } - VisibilityTypes getVisibility() const { return Visibility; } + VisibilityTypes getVisibility() const { return (VisibilityTypes)Visibility; } bool hasHiddenVisibility() const { return Visibility == HiddenVisibility; } void setVisibility(VisibilityTypes V) { Visibility = V; } @@ -119,6 +121,16 @@ public: /// value is outside of the current translation unit... virtual bool isDeclaration() const = 0; + /// removeFromParent - This method unlinks 'this' from the containing module, + /// but does not delete it. + /// + virtual void removeFromParent() = 0; + + /// eraseFromParent - This method unlinks 'this' from the containing module + /// and deletes it. + /// + virtual void eraseFromParent() = 0; + /// getParent - Get the module that this global value is contained inside /// of... inline Module *getParent() { return Parent; } @@ -134,7 +146,8 @@ public: static inline bool classof(const GlobalValue *) { return true; } static inline bool classof(const Value *V) { return V->getValueID() == Value::FunctionVal || - V->getValueID() == Value::GlobalVariableVal; + V->getValueID() == Value::GlobalVariableVal || + V->getValueID() == Value::GlobalAliasVal; } };