From 48d3b17b2bbc11a1b65a502bf45d2c1409578599 Mon Sep 17 00:00:00 2001 From: Vishal Sharma <3507248+vcsharma@users.noreply.github.com> Date: Wed, 13 Nov 2019 12:59:01 -0800 Subject: [PATCH] Fix DXIL linker issue (#2588) --- lib/HLSL/DxilLinker.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/HLSL/DxilLinker.cpp b/lib/HLSL/DxilLinker.cpp index ce917863d..6ec500acb 100644 --- a/lib/HLSL/DxilLinker.cpp +++ b/lib/HLSL/DxilLinker.cpp @@ -125,7 +125,7 @@ public: DxilModule &GetDxilModule() { return m_DM; } void LazyLoadFunction(Function *F); void BuildGlobalUsage(); - void CollectUsedInitFunctions(StringSet<> &addedFunctionSet, + void CollectUsedInitFunctions(SetVector &addedFunctionSet, SmallVector &workList); private: @@ -159,7 +159,7 @@ private: bool AttachLib(DxilLib *lib); bool DetachLib(DxilLib *lib); bool AddFunctions(SmallVector &workList, - DenseSet &libSet, StringSet<> &addedFunctionSet, + SetVector &libSet, SetVector &addedFunctionSet, DxilLinkJob &linkJob, bool bLazyLoadDone, bool bAllowFuncionDecls); // Attached libs to link. @@ -284,7 +284,7 @@ void DxilLib::BuildGlobalUsage() { m_resourceMap, m_DM); } -void DxilLib::CollectUsedInitFunctions(StringSet<> &addedFunctionSet, +void DxilLib::CollectUsedInitFunctions(SetVector &addedFunctionSet, SmallVector &workList) { // Add init functions to used functions. for (Function *Ctor : m_initFuncSet) { @@ -353,7 +353,7 @@ private: void AddFunctions(DxilModule &DM, ValueToValueMapTy &vmap); bool AddResource(DxilResourceBase *res, llvm::GlobalVariable *GV); void AddResourceToDM(DxilModule &DM); - std::unordered_map m_functionDefs; + llvm::MapVector m_functionDefs; llvm::StringMap m_functionDecls; // New created functions. llvm::StringMap m_newFunctions; @@ -1168,8 +1168,8 @@ bool DxilLinkerImpl::DetachLib(DxilLib *lib) { } bool DxilLinkerImpl::AddFunctions(SmallVector &workList, - DenseSet &libSet, - StringSet<> &addedFunctionSet, + SetVector &libSet, + SetVector &addedFunctionSet, DxilLinkJob &linkJob, bool bLazyLoadDone, bool bAllowFuncionDecls) { while (!workList.empty()) { @@ -1241,8 +1241,8 @@ DxilLinkerImpl::Link(StringRef entry, StringRef profile, dxilutil::ExportMap &ex DxilLinkJob linkJob(m_ctx, exportMap, m_valMajor, m_valMinor); - DenseSet libSet; - StringSet<> addedFunctionSet; + SetVector libSet; + SetVector addedFunctionSet; bool bIsLib = pSM->IsLib(); if (!bIsLib) {