[UB] Fix a nasty place where we would pass null pointers to memcpy.
[oota-llvm.git] / include / llvm / CodeGen / LiveIntervalUnion.h
index 1381c46a2750e3550764caa379653b735a9f9a08..f0f1637dc92d0622bb1398749d01564ed082badc 100644 (file)
@@ -179,8 +179,8 @@ public:
     }
 
   private:
-    Query(const Query&) LLVM_DELETED_FUNCTION;
-    void operator=(const Query&) LLVM_DELETED_FUNCTION;
+    Query(const Query&) = delete;
+    void operator=(const Query&) = delete;
   };
 
   // Array of LiveIntervalUnions.
@@ -203,6 +203,11 @@ public:
       assert(idx <  Size && "idx out of bounds");
       return LIUs[idx];
     }
+
+    const LiveIntervalUnion& operator[](unsigned Idx) const {
+      assert(Idx < Size && "Idx out of bounds");
+      return LIUs[Idx];
+    }
   };
 };