From: David Blaikie Date: Fri, 29 Aug 2014 22:05:31 +0000 (+0000) Subject: Add a trivial functor for use with unique_ptrs managing memory that needs to be freed... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=3da7647d69d0ffdd1a03b345f3105f3a1d0de167;p=oota-llvm.git Add a trivial functor for use with unique_ptrs managing memory that needs to be freed rather than deleted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216790 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h index 1cef3933b5d..f69a15bdc25 100644 --- a/include/llvm/ADT/STLExtras.h +++ b/include/llvm/ADT/STLExtras.h @@ -530,6 +530,12 @@ make_unique(size_t n) { #endif +struct FreeDeleter { + void operator()(void* v) { + ::free(v); + } +}; + template struct pair_hash { size_t operator()(const std::pair &P) const {