|
@@ -128,11 +128,8 @@ DxcLinker::RegisterLibrary(_In_opt_ LPCWSTR pLibName, // Name of the library.
|
|
try {
|
|
try {
|
|
std::unique_ptr<llvm::Module> pModule, pDebugModule;
|
|
std::unique_ptr<llvm::Module> pModule, pDebugModule;
|
|
|
|
|
|
- CComPtr<IMalloc> pMalloc;
|
|
|
|
CComPtr<AbstractMemoryStream> pDiagStream;
|
|
CComPtr<AbstractMemoryStream> pDiagStream;
|
|
-
|
|
|
|
- IFT(CoGetMalloc(1, &pMalloc));
|
|
|
|
- IFT(CreateMemoryStream(pMalloc, &pDiagStream));
|
|
|
|
|
|
+ IFT(CreateMemoryStream(DxcGetThreadMallocNoRef(), &pDiagStream));
|
|
|
|
|
|
raw_stream_ostream DiagStream(pDiagStream);
|
|
raw_stream_ostream DiagStream(pDiagStream);
|
|
|
|
|
|
@@ -180,12 +177,10 @@ HRESULT STDMETHODCALLTYPE DxcLinker::Link(
|
|
|
|
|
|
HRESULT hr = S_OK;
|
|
HRESULT hr = S_OK;
|
|
try {
|
|
try {
|
|
- CComPtr<IMalloc> pMalloc;
|
|
|
|
CComPtr<IDxcBlob> pOutputBlob;
|
|
CComPtr<IDxcBlob> pOutputBlob;
|
|
CComPtr<AbstractMemoryStream> pDiagStream;
|
|
CComPtr<AbstractMemoryStream> pDiagStream;
|
|
|
|
|
|
- IFT(CoGetMalloc(1, &pMalloc));
|
|
|
|
- IFT(CreateMemoryStream(pMalloc, &pOutputStream));
|
|
|
|
|
|
+ IFT(CreateMemoryStream(DxcGetThreadMallocNoRef(), &pOutputStream));
|
|
|
|
|
|
// Read and validate options.
|
|
// Read and validate options.
|
|
int argCountInt;
|
|
int argCountInt;
|
|
@@ -207,7 +202,7 @@ HRESULT STDMETHODCALLTYPE DxcLinker::Link(
|
|
|
|
|
|
std::string warnings;
|
|
std::string warnings;
|
|
//llvm::raw_string_ostream w(warnings);
|
|
//llvm::raw_string_ostream w(warnings);
|
|
- IFT(CreateMemoryStream(pMalloc, &pDiagStream));
|
|
|
|
|
|
+ IFT(CreateMemoryStream(DxcGetThreadMallocNoRef(), &pDiagStream));
|
|
raw_stream_ostream DiagStream(pDiagStream);
|
|
raw_stream_ostream DiagStream(pDiagStream);
|
|
llvm::DiagnosticPrinterRawOStream DiagPrinter(DiagStream);
|
|
llvm::DiagnosticPrinterRawOStream DiagPrinter(DiagStream);
|
|
PrintDiagnosticContext DiagContext(DiagPrinter);
|
|
PrintDiagnosticContext DiagContext(DiagPrinter);
|
|
@@ -273,9 +268,8 @@ HRESULT STDMETHODCALLTYPE DxcLinker::Link(
|
|
// Validation.
|
|
// Validation.
|
|
HRESULT valHR = S_OK;
|
|
HRESULT valHR = S_OK;
|
|
dxcutil::AssembleInputs inputs(
|
|
dxcutil::AssembleInputs inputs(
|
|
- std::move(pM), pOutputBlob, pMalloc, SerializeFlags,
|
|
|
|
- pOutputStream,
|
|
|
|
- opts.DebugFile, &Diag);
|
|
|
|
|
|
+ std::move(pM), pOutputBlob, DxcGetThreadMallocNoRef(),
|
|
|
|
+ SerializeFlags, pOutputStream, opts.DebugFile, &Diag);
|
|
if (needsValidation) {
|
|
if (needsValidation) {
|
|
valHR = dxcutil::ValidateAndAssembleToContainer(inputs);
|
|
valHR = dxcutil::ValidateAndAssembleToContainer(inputs);
|
|
} else {
|
|
} else {
|