#include "llvm/ADT/None.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Allocator.h"
#include <vector>
namespace llvm {
return Data[Length-1];
}
+ // copy - Allocate copy in BumpPtrAllocator and return ArrayRef<T> to it.
+ ArrayRef<T> copy(BumpPtrAllocator &Allocator) {
+ T *Buff = Allocator.Allocate<T>(Length);
+ std::copy(begin(), end(), Buff);
+ return ArrayRef<T>(Buff, Length);
+ }
+
/// equals - Check for element-wise equality.
bool equals(ArrayRef RHS) const {
if (Length != RHS.Length)