Explorar o código

[linux-port] use std::unique_ptr and llvm::make_unique.

Ehsan Nasiri %!s(int64=7) %!d(string=hai) anos
pai
achega
60c5972f78

+ 2 - 2
lib/HLSL/DxilCondenseResources.cpp

@@ -1868,9 +1868,9 @@ void DxilLowerCreateHandleForLib::TranslateDxilResourceUses(
         // Must be instruction for multi dim array.
         // Must be instruction for multi dim array.
         std::unique_ptr<IRBuilder<> > Builder;
         std::unique_ptr<IRBuilder<> > Builder;
         if (GetElementPtrInst *GEPInst = dyn_cast<GetElementPtrInst>(GEP)) {
         if (GetElementPtrInst *GEPInst = dyn_cast<GetElementPtrInst>(GEP)) {
-          Builder = std::make_unique<IRBuilder<> >(GEPInst);
+          Builder = llvm::make_unique<IRBuilder<> >(GEPInst);
         } else {
         } else {
-          Builder = std::make_unique<IRBuilder<> >(GV->getContext());
+          Builder = llvm::make_unique<IRBuilder<> >(GV->getContext());
         }
         }
         for (; GEPIt != E; ++GEPIt) {
         for (; GEPIt != E; ++GEPIt) {
           if (GEPIt->isArrayTy()) {
           if (GEPIt->isArrayTy()) {

+ 4 - 4
lib/HLSL/DxilContainerAssembler.cpp

@@ -1043,7 +1043,7 @@ private:
   void UpdateResourceInfo(StringBufferPart &stringBufferPart) {
   void UpdateResourceInfo(StringBufferPart &stringBufferPart) {
     // Try to allocate string table for resources. String table is a sequence
     // Try to allocate string table for resources. String table is a sequence
     // of strings delimited by \0
     // of strings delimited by \0
-    m_Parts.emplace_back(std::make_unique<ResourceTable>());
+    m_Parts.emplace_back(llvm::make_unique<ResourceTable>());
     ResourceTable &resourceTable = *reinterpret_cast<ResourceTable*>(m_Parts.back().get());
     ResourceTable &resourceTable = *reinterpret_cast<ResourceTable*>(m_Parts.back().get());
     uint32_t resourceIndex = 0;
     uint32_t resourceIndex = 0;
     for (auto &resource : m_Module.GetCBuffers()) {
     for (auto &resource : m_Module.GetCBuffers()) {
@@ -1079,9 +1079,9 @@ private:
   }
   }
 
 
   void UpdateFunctionInfo(StringBufferPart &stringBufferPart) {
   void UpdateFunctionInfo(StringBufferPart &stringBufferPart) {
-    m_Parts.emplace_back(std::make_unique<FunctionTable>());
+    m_Parts.emplace_back(llvm::make_unique<FunctionTable>());
     FunctionTable &functionTable = *reinterpret_cast<FunctionTable*>(m_Parts.back().get());
     FunctionTable &functionTable = *reinterpret_cast<FunctionTable*>(m_Parts.back().get());
-    m_Parts.emplace_back(std::make_unique<IndexArraysPart>());
+    m_Parts.emplace_back(llvm::make_unique<IndexArraysPart>());
     IndexArraysPart &indexArraysPart = *reinterpret_cast<IndexArraysPart*>(m_Parts.back().get());
     IndexArraysPart &indexArraysPart = *reinterpret_cast<IndexArraysPart*>(m_Parts.back().get());
     for (auto &function : m_Module.GetModule()->getFunctionList()) {
     for (auto &function : m_Module.GetModule()->getFunctionList()) {
       if (function.isDeclaration() && !function.isIntrinsic()) {
       if (function.isDeclaration() && !function.isIntrinsic()) {
@@ -1177,7 +1177,7 @@ public:
   DxilRDATWriter(const DxilModule &module, uint32_t InfoVersion = 0)
   DxilRDATWriter(const DxilModule &module, uint32_t InfoVersion = 0)
       : m_Module(module), m_RDATBuffer(), m_Parts(), m_FuncToResNameOffset() {
       : m_Module(module), m_RDATBuffer(), m_Parts(), m_FuncToResNameOffset() {
     // It's important to keep the order of this update
     // It's important to keep the order of this update
-    m_Parts.emplace_back(std::make_unique<StringBufferPart>());
+    m_Parts.emplace_back(llvm::make_unique<StringBufferPart>());
     StringBufferPart &stringBufferPart = *reinterpret_cast<StringBufferPart*>(m_Parts.back().get());
     StringBufferPart &stringBufferPart = *reinterpret_cast<StringBufferPart*>(m_Parts.back().get());
     UpdateResourceInfo(stringBufferPart);
     UpdateResourceInfo(stringBufferPart);
     UpdateFunctionInfo(stringBufferPart);
     UpdateFunctionInfo(stringBufferPart);

+ 2 - 2
lib/HLSL/DxilLinker.cpp

@@ -738,7 +738,7 @@ DxilLinkJob::Link(std::pair<DxilFunctionLinkInfo *, DxilLib *> &entryLinkPair,
 
 
   DxilEntryPropsMap EntryPropMap;
   DxilEntryPropsMap EntryPropMap;
   std::unique_ptr<DxilEntryProps> pProps =
   std::unique_ptr<DxilEntryProps> pProps =
-          std::make_unique<DxilEntryProps>(entryDM.GetDxilEntryProps(entryFunc));
+      llvm::make_unique<DxilEntryProps>(entryDM.GetDxilEntryProps(entryFunc));
   EntryPropMap[NewEntryFunc] = std::move(pProps);
   EntryPropMap[NewEntryFunc] = std::move(pProps);
   DM.ResetEntryPropsMap(std::move(EntryPropMap));
   DM.ResetEntryPropsMap(std::move(EntryPropMap));
 
 
@@ -835,7 +835,7 @@ DxilLinkJob::LinkToLib(const ShaderModel *pSM) {
       Function *NewF = m_newFunctions[F->getName()];
       Function *NewF = m_newFunctions[F->getName()];
       DxilEntryProps &props = tmpDM.GetDxilEntryProps(F);
       DxilEntryProps &props = tmpDM.GetDxilEntryProps(F);
       std::unique_ptr<DxilEntryProps> pProps =
       std::unique_ptr<DxilEntryProps> pProps =
-          std::make_unique<DxilEntryProps>(props);
+          llvm::make_unique<DxilEntryProps>(props);
       EntryPropMap[NewF] = std::move(pProps);
       EntryPropMap[NewF] = std::move(pProps);
     }
     }
   }
   }