Revert "[opaque pointer type] Pass GlobalAlias the actual pointer type rather than...
[oota-llvm.git] / lib / IR / User.cpp
index c6e4e89bb34cf3d047d7cd7ff0cf626c687c3ee7..522722d701bac5b92c68892a8bad6ec2a1bc7014 100644 (file)
@@ -42,6 +42,13 @@ void User::replaceUsesOfWith(Value *From, Value *To) {
 
 void User::allocHungoffUses(unsigned N, bool IsPhi) {
   assert(HasHungOffUses && "alloc must have hung off uses");
+
+  static_assert(AlignOf<Use>::Alignment >= AlignOf<Use::UserRef>::Alignment,
+                "Alignment is insufficient for 'hung-off-uses' pieces");
+  static_assert(AlignOf<Use::UserRef>::Alignment >=
+                    AlignOf<BasicBlock *>::Alignment,
+                "Alignment is insufficient for 'hung-off-uses' pieces");
+
   // Allocate the array of Uses, followed by a pointer (with bottom bit set) to
   // the User.
   size_t size = N * sizeof(Use) + sizeof(Use::UserRef);