+ ~GlobalValue() {
+ removeDeadConstantUsers(); // remove any dead constants using this.
+ }
+
+ unsigned getAlignment() const { return Alignment; }
+ void setAlignment(unsigned Align) {
+ assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!");
+ Alignment = Align;
+ }
+
+ VisibilityTypes getVisibility() const { return VisibilityTypes(Visibility); }
+ bool hasHiddenVisibility() const { return Visibility == HiddenVisibility; }
+ bool hasProtectedVisibility() const {
+ return Visibility == ProtectedVisibility;
+ }
+ void setVisibility(VisibilityTypes V) { Visibility = V; }
+
+ bool hasSection() const { return !Section.empty(); }
+ const std::string &getSection() const { return Section; }
+ void setSection(const std::string &S) { Section = S; }
+
+ /// If the usage is empty (except transitively dead constants), then this
+ /// global value can can be safely deleted since the destructor will
+ /// delete the dead constants as well.
+ /// @brief Determine if the usage of this global value is empty except
+ /// for transitively dead constants.
+ bool use_empty_except_constants();