[llvm] 52821f6 - IR: Add a comment at missing std::make_unique calls from b2b7cf39d596b1528cd64015575b3f5d1461c011, NFC

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 18:18:45 PDT 2020


Author: Duncan P. N. Exon Smith
Date: 2020-10-26T21:18:34-04:00
New Revision: 52821f6a71a568f966427b627839d40641653757

URL: https://github.com/llvm/llvm-project/commit/52821f6a71a568f966427b627839d40641653757
DIFF: https://github.com/llvm/llvm-project/commit/52821f6a71a568f966427b627839d40641653757.diff

LOG: IR: Add a comment at missing std::make_unique calls from b2b7cf39d596b1528cd64015575b3f5d1461c011, NFC

Added: 
    

Modified: 
    llvm/lib/IR/Constants.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index cfefd338f784..0436a6e99e3b 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -2792,11 +2792,13 @@ Constant *ConstantDataSequential::getImpl(StringRef Elements, Type *Ty) {
   // Okay, we didn't get a hit.  Create a node of the right class, link it in,
   // and return it.
   if (isa<ArrayType>(Ty)) {
+    // Use reset because std::make_unique can't access the constructor.
     Entry->reset(new ConstantDataArray(Ty, Slot.first().data()));
     return Entry->get();
   }
 
   assert(isa<VectorType>(Ty));
+  // Use reset because std::make_unique can't access the constructor.
   Entry->reset(new ConstantDataVector(Ty, Slot.first().data()));
   return Entry->get();
 }


        


More information about the llvm-commits mailing list