[llvm] r253942 - Use make_unique [NFC]

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 16:32:00 PST 2015


Author: davidxl
Date: Mon Nov 23 18:32:00 2015
New Revision: 253942

URL: http://llvm.org/viewvc/llvm-project?rev=253942&view=rev
Log:
Use make_unique [NFC]

Modified:
    llvm/trunk/include/llvm/ProfileData/InstrProf.h

Modified: llvm/trunk/include/llvm/ProfileData/InstrProf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProf.h?rev=253942&r1=253941&r2=253942&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/InstrProf.h (original)
+++ llvm/trunk/include/llvm/ProfileData/InstrProf.h Mon Nov 23 18:32:00 2015
@@ -18,6 +18,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSet.h"
+#include "llvm/ADT/STLExtras.h"
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/ProfileData/InstrProfData.inc"
 #include "llvm/Support/Endian.h"
@@ -367,7 +368,7 @@ InstrProfRecord::getValueForSite(uint32_
   if (N == 0)
     return std::unique_ptr<InstrProfValueData[]>(nullptr);
 
-  std::unique_ptr<InstrProfValueData[]> VD(new InstrProfValueData[N]);
+  auto VD = llvm::make_unique<InstrProfValueData[]>(N);
   uint32_t I = 0;
   for (auto V : getValueSitesForKind(ValueKind)[Site].ValueData) {
     VD[I] = V;




More information about the llvm-commits mailing list