Add a 'normalize' method to the Triple class, which takes a mucked up
[oota-llvm.git] / include / llvm / User.h
index 1a88ce0cce853b2dba3478cd7ac577df91784d4f..f8277952ee4ba9fa7cd03e8ee116c4a4fbb9f5fa 100644 (file)
@@ -41,7 +41,6 @@ struct OperandTraits<User> {
   struct Layout {
     typedef U overlay;
   };
-  static inline void *allocate(unsigned);
 };
 
 class User : public Value {
@@ -62,6 +61,7 @@ protected:
   unsigned NumOperands;
 
   void *operator new(size_t s, unsigned Us);
+  void *operator new(size_t s, unsigned Us, bool Prefix);
   User(const Type *ty, unsigned vty, Use *OpList, unsigned NumOps)
     : Value(ty, vty), OperandList(OpList), NumOperands(NumOps) {}
   Use *allocHungoffUses(unsigned) const;
@@ -74,7 +74,8 @@ protected:
   }
 public:
   ~User() {
-    Use::zap(OperandList, OperandList + NumOperands);
+    if ((intptr_t(OperandList) & 1) == 0)
+      Use::zap(OperandList, OperandList + NumOperands);
   }
   /// operator delete - free memory allocated for User and Use objects
   void operator delete(void *Usr);
@@ -82,6 +83,10 @@ public:
   void operator delete(void*, unsigned) {
     assert(0 && "Constructor throws?");
   }
+  /// placement delete - required by std, but never called.
+  void operator delete(void*, unsigned, bool) {
+    assert(0 && "Constructor throws?");
+  }
 protected:
   template <int Idx, typename U> static Use &OpFrom(const U *that) {
     return Idx < 0