|
@@ -19,6 +19,7 @@
|
|
#include "dxc/DxilPIXPasses/DxilPIXVirtualRegisters.h"
|
|
#include "dxc/DxilPIXPasses/DxilPIXVirtualRegisters.h"
|
|
#include "dxc/Support/Unicode.h"
|
|
#include "dxc/Support/Unicode.h"
|
|
#include "llvm/ADT/DenseMap.h"
|
|
#include "llvm/ADT/DenseMap.h"
|
|
|
|
+#include "llvm/ADT/STLExtras.h"
|
|
#include "llvm/IR/Constants.h"
|
|
#include "llvm/IR/Constants.h"
|
|
#include "llvm/IR/DebugInfo.h"
|
|
#include "llvm/IR/DebugInfo.h"
|
|
#include "llvm/IR/DebugInfoMetadata.h"
|
|
#include "llvm/IR/DebugInfoMetadata.h"
|
|
@@ -610,7 +611,7 @@ public:
|
|
std::vector<llvm::DIType *> m_Layout;
|
|
std::vector<llvm::DIType *> m_Layout;
|
|
DWORD m_dwCurrentSizeInBytes = 0;
|
|
DWORD m_dwCurrentSizeInBytes = 0;
|
|
};
|
|
};
|
|
- using TypeToInfoMap = llvm::DenseMap<llvm::DIType *, TypeInfo>;
|
|
|
|
|
|
+ using TypeToInfoMap = llvm::DenseMap<llvm::DIType *, std::unique_ptr<TypeInfo> >;
|
|
|
|
|
|
// Because of the way the VarToID map is constructed, the
|
|
// Because of the way the VarToID map is constructed, the
|
|
// vector<LocalVarInfo> may need to grow. The Symbol Constructor for local
|
|
// vector<LocalVarInfo> may need to grow. The Symbol Constructor for local
|
|
@@ -658,7 +659,7 @@ private:
|
|
template<typename Factory, typename... Args>
|
|
template<typename Factory, typename... Args>
|
|
HRESULT AddType(DWORD dwParentID, llvm::DIType *T, DWORD *pNewSymID, Args&&... args) {
|
|
HRESULT AddType(DWORD dwParentID, llvm::DIType *T, DWORD *pNewSymID, Args&&... args) {
|
|
IFR(AddSymbol<Factory>(dwParentID, pNewSymID, std::forward<Args>(args)...));
|
|
IFR(AddSymbol<Factory>(dwParentID, pNewSymID, std::forward<Args>(args)...));
|
|
- if (!m_TypeToInfo.insert(std::make_pair(T, TypeInfo(*pNewSymID))).second) {
|
|
|
|
|
|
+ if (!m_TypeToInfo.insert(std::make_pair(T, llvm::make_unique<TypeInfo>(*pNewSymID))).second) {
|
|
return E_FAIL;
|
|
return E_FAIL;
|
|
}
|
|
}
|
|
return S_OK;
|
|
return S_OK;
|
|
@@ -1113,7 +1114,7 @@ HRESULT dxil_dia::hlsl_symbols::SymbolManagerInit::GetTypeInfo(llvm::DIType *T,
|
|
return E_FAIL;
|
|
return E_FAIL;
|
|
}
|
|
}
|
|
|
|
|
|
- *TI = &tyInfoIt->second;
|
|
|
|
|
|
+ *TI = tyInfoIt->second.get();
|
|
return S_OK;
|
|
return S_OK;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1259,7 +1260,7 @@ HRESULT dxil_dia::hlsl_symbols::SymbolManagerInit::CreateType(llvm::DIType *Type
|
|
|
|
|
|
auto lsIT = m_TypeToInfo.find(Type);
|
|
auto lsIT = m_TypeToInfo.find(Type);
|
|
if (lsIT != m_TypeToInfo.end()) {
|
|
if (lsIT != m_TypeToInfo.end()) {
|
|
- *pNewTypeID = lsIT->second.GetTypeID();
|
|
|
|
|
|
+ *pNewTypeID = lsIT->second->GetTypeID();
|
|
return S_OK;
|
|
return S_OK;
|
|
}
|
|
}
|
|
|
|
|