Skip to content

Commit 2d39906

Browse files
committed
address remaining comments
1 parent d922fa7 commit 2d39906

File tree

6 files changed

+7
-38
lines changed

6 files changed

+7
-38
lines changed

include/dxc/DxilContainer/DxcContainerBuilder.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ class DxcContainerBuilder : public IDxcContainerBuilder {
4545
return DoBasicQueryInterface<IDxcContainerBuilder>(this, riid, ppvObject);
4646
}
4747

48-
void Init(const char *warning = nullptr) {
49-
m_warning = warning;
48+
void Init() {
5049
m_RequireValidation = false;
5150
m_HasPrivateData = false;
5251
m_HashFunction = nullptr;
@@ -67,7 +66,6 @@ class DxcContainerBuilder : public IDxcContainerBuilder {
6766

6867
PartList m_parts;
6968
CComPtr<IDxcBlob> m_pContainer;
70-
const char *m_warning;
7169
bool m_RequireValidation;
7270
bool m_HasPrivateData;
7371
// Function to compute hash when valid dxil container is built

include/dxc/Support/dxcapi.use.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
#define __DXCAPI_USE_H__
1414

1515
#include "dxc/dxcapi.h"
16-
#include <cstdlib> // for getenv
17-
#include <dxc/Support/Global.h> // for hresult handling with DXC_FAILED
18-
#include <filesystem> // C++17 and later
19-
#include <string>
2016

2117
namespace dxc {
2218

@@ -30,7 +26,7 @@ class DxcDllSupport {
3026
DxcCreateInstanceProc m_createFn;
3127
DxcCreateInstance2Proc m_createFn2;
3228

33-
HRESULT virtual InitializeInternal(LPCSTR dllName, LPCSTR fnName) {
29+
HRESULT InitializeInternal(LPCSTR dllName, LPCSTR fnName) {
3430
if (m_dll != nullptr)
3531
return S_OK;
3632

lib/DxilContainer/DxcContainerBuilder.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,14 @@ DxcContainerBuilder::SerializeContainer(IDxcOperationResult **ppResult) {
146146
// Combine existing warnings and errors from validation
147147
CComPtr<IDxcBlobEncoding> pErrorBlob;
148148
CDxcMallocHeapPtr<char> errorHeap(m_pMalloc);
149-
SIZE_T warningLength = m_warning ? strlen(m_warning) : 0;
150-
SIZE_T valErrorLength =
149+
SIZE_T totalErrorLength =
151150
pValErrorUtf8 ? pValErrorUtf8->GetStringLength() : 0;
152-
SIZE_T totalErrorLength = warningLength + valErrorLength;
153151
if (totalErrorLength) {
154152
SIZE_T errorSizeInBytes = totalErrorLength + 1;
155153
errorHeap.AllocateBytes(errorSizeInBytes);
156-
if (warningLength)
157-
memcpy(errorHeap.m_pData, m_warning, warningLength);
158-
if (valErrorLength)
159-
memcpy(errorHeap.m_pData + warningLength,
160-
pValErrorUtf8->GetStringPointer(), valErrorLength);
154+
155+
memcpy(errorHeap.m_pData, pValErrorUtf8->GetStringPointer(),
156+
totalErrorLength);
161157
errorHeap.m_pData[totalErrorLength] = L'\0';
162158
IFT(hlsl::DxcCreateBlobWithEncodingOnMalloc(errorHeap.m_pData, m_pMalloc,
163159
errorSizeInBytes, DXC_CP_UTF8,

tools/clang/tools/dxcompiler/dxcapi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ HRESULT CreateDxcContainerBuilder(REFIID riid, _Out_ LPVOID *ppv) {
7272
CComPtr<DxcContainerBuilder> Result =
7373
DxcContainerBuilder::Alloc(DxcGetThreadMallocNoRef());
7474
IFROOM(Result.p);
75-
Result->Init(warning);
75+
Result->Init();
7676
return Result->QueryInterface(riid, ppv);
7777
}
7878

tools/clang/tools/dxcompiler/dxcompilerobj.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,13 +1319,6 @@ class DxcCompiler : public IDxcCompiler3,
13191319
CComPtr<IDxcResult> pResult;
13201320
hr = e.hr;
13211321
std::string msg("Internal Compiler error: ");
1322-
switch (hr) {
1323-
case DXC_E_VALIDATOR_MISSING:
1324-
msg = "Error: DXIL.dll not found.";
1325-
break;
1326-
default:
1327-
break;
1328-
}
13291322
msg += e.msg;
13301323
if (SUCCEEDED(DxcResult::Create(
13311324
e.hr, DXC_OUT_NONE,

tools/clang/tools/dxcompiler/dxcutil.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -151,20 +151,6 @@ HRESULT ValidateAndAssembleToContainer(AssembleInputs &inputs) {
151151
CComPtr<IDxcValidator> pValidator;
152152
CreateValidator(pValidator);
153153

154-
CComPtr<IDxcValidator2> pValidator2;
155-
pValidator.QueryInterface(&pValidator2);
156-
157-
if (pValidator2) {
158-
// If IDxcValidator2 is supported in the given validator,
159-
// we'll use the modules directly. In this case, we'll want
160-
// to make a clone to avoid SerializeDxilContainerForModule stripping all
161-
// the debug info. The debug info will be stripped from the orginal module,
162-
// but preserved in the cloned module.
163-
if (llvm::getDebugMetadataVersionFromModule(*inputs.pM) != 0) {
164-
llvmModuleWithDebugInfo.reset(llvm::CloneModule(inputs.pM.get()));
165-
}
166-
}
167-
168154
// Verify validator version can validate this module
169155
CComPtr<IDxcVersionInfo> pValidatorVersion;
170156
IFT(pValidator->QueryInterface(&pValidatorVersion));

0 commit comments

Comments
 (0)