Don't ever call materializeAllPermanently during LTO.
[oota-llvm.git] / include / llvm / IR / GlobalObject.h
index 2e042f48974964060664a53707ae81ea196b8eed..581fb966c023a186b112cea55f53496a9d811055 100644 (file)
@@ -35,12 +35,24 @@ protected:
 
   std::string Section;     // Section to emit this into, empty means default
   Comdat *ObjComdat;
+  static const unsigned AlignmentBits = 5;
+  static const unsigned GlobalObjectSubClassDataBits =
+      GlobalValueSubClassDataBits - AlignmentBits;
+
+private:
+  static const unsigned AlignmentMask = (1 << AlignmentBits) - 1;
+
 public:
   unsigned getAlignment() const {
-    return (1u << getGlobalValueSubClassData()) >> 1;
+    unsigned Data = getGlobalValueSubClassData();
+    unsigned AlignmentData = Data & AlignmentMask;
+    return (1u << AlignmentData) >> 1;
   }
   void setAlignment(unsigned Align);
 
+  unsigned getGlobalObjectSubClassData() const;
+  void setGlobalObjectSubClassData(unsigned Val);
+
   bool hasSection() const { return !StringRef(getSection()).empty(); }
   const char *getSection() const { return Section.c_str(); }
   void setSection(StringRef S);