Skip to content

Make dxcompiler target build with ClangCL 19.1.1 #7351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/dxc/Support/dxcapi.use.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class DxcDllSupport {
m_dll = LoadLibraryA(dllName);
if (m_dll == nullptr)
return HRESULT_FROM_WIN32(GetLastError());
m_createFn = (DxcCreateInstanceProc)GetProcAddress(m_dll, fnName);
m_createFn = reinterpret_cast<DxcCreateInstanceProc>(reinterpret_cast<void *>(GetProcAddress(m_dll, fnName)));

if (m_createFn == nullptr) {
HRESULT hr = HRESULT_FROM_WIN32(GetLastError());
Expand Down Expand Up @@ -64,7 +64,7 @@ class DxcDllSupport {
fnName2[s] = '2';
fnName2[s + 1] = '\0';
#ifdef _WIN32
m_createFn2 = (DxcCreateInstance2Proc)GetProcAddress(m_dll, fnName2);
m_createFn2 = reinterpret_cast<DxcCreateInstance2Proc>(reinterpret_cast<void *>(GetProcAddress(m_dll, fnName2)));
#else
m_createFn2 = (DxcCreateInstance2Proc)::dlsym(m_dll, fnName2);
#endif
Expand Down
6 changes: 3 additions & 3 deletions include/llvm/CodeGen/SchedulerRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class RegisterScheduler : public MachinePassRegistryNode {
static MachinePassRegistry Registry;

RegisterScheduler(const char *N, const char *D, FunctionPassCtor C)
: MachinePassRegistryNode(N, D, (MachinePassCtor)C)
: MachinePassRegistryNode(N, D, reinterpret_cast<MachinePassCtor>(reinterpret_cast<void *>(C)))
{ Registry.Add(this); }
~RegisterScheduler() { Registry.Remove(this); }

Expand All @@ -54,10 +54,10 @@ class RegisterScheduler : public MachinePassRegistryNode {
return (RegisterScheduler *)Registry.getList();
}
static FunctionPassCtor getDefault() {
return (FunctionPassCtor)Registry.getDefault();
return reinterpret_cast<FunctionPassCtor>(reinterpret_cast<void *>(Registry.getDefault()));
}
static void setDefault(FunctionPassCtor C) {
Registry.setDefault((MachinePassCtor)C);
Registry.setDefault(reinterpret_cast<MachinePassCtor>(reinterpret_cast<void *>(C)));
}
static void setListener(MachinePassRegistryListener *L) {
Registry.setListener(L);
Expand Down
3 changes: 2 additions & 1 deletion lib/IR/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ void LLVMContextSetDiagnosticHandler(LLVMContextRef C,
LLVMDiagnosticHandler Handler,
void *DiagnosticContext) {
unwrap(C)->setDiagnosticHandler(
LLVM_EXTENSION reinterpret_cast<LLVMContext::DiagnosticHandlerTy>(Handler),
reinterpret_cast<LLVMContext::DiagnosticHandlerTy>(
reinterpret_cast<void *>(Handler)),
DiagnosticContext);
}

Expand Down
5 changes: 3 additions & 2 deletions lib/MSSupport/MSFileSystemImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,9 @@ typedef BOOLEAN(WINAPI *PtrCreateSymbolicLinkW)(
/*__in*/ DWORD dwFlags);

PtrCreateSymbolicLinkW create_symbolic_link_api =
PtrCreateSymbolicLinkW(::GetProcAddress(::GetModuleHandleW(L"Kernel32.dll"),
"CreateSymbolicLinkW"));
PtrCreateSymbolicLinkW(reinterpret_cast<void *>(::GetProcAddress(
::GetModuleHandleW(L"Kernel32.dll"),
"CreateSymbolicLinkW")));
} // namespace
#endif

Expand Down
26 changes: 11 additions & 15 deletions lib/Support/Windows/RWMutex.inc
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,16 @@ static bool loadSRW() {
sChecked = true;

if (HMODULE hLib = ::GetModuleHandleW(L"Kernel32.dll")) {
fpInitializeSRWLock =
(VOID (WINAPI *)(PSRWLOCK))::GetProcAddress(hLib,
"InitializeSRWLock");
fpAcquireSRWLockExclusive =
(VOID (WINAPI *)(PSRWLOCK))::GetProcAddress(hLib,
"AcquireSRWLockExclusive");
fpAcquireSRWLockShared =
(VOID (WINAPI *)(PSRWLOCK))::GetProcAddress(hLib,
"AcquireSRWLockShared");
fpReleaseSRWLockExclusive =
(VOID (WINAPI *)(PSRWLOCK))::GetProcAddress(hLib,
"ReleaseSRWLockExclusive");
fpReleaseSRWLockShared =
(VOID (WINAPI *)(PSRWLOCK))::GetProcAddress(hLib,
"ReleaseSRWLockShared");
fpInitializeSRWLock = reinterpret_cast<VOID (WINAPI *)(PSRWLOCK)>(
reinterpret_cast<void *>(::GetProcAddress(hLib, "InitializeSRWLock")));
fpAcquireSRWLockExclusive = reinterpret_cast<VOID (WINAPI *)(PSRWLOCK)>(
reinterpret_cast<void *>(::GetProcAddress(hLib, "AcquireSRWLockExclusive")));
fpAcquireSRWLockShared = reinterpret_cast<VOID (WINAPI *)(PSRWLOCK)>(
reinterpret_cast<void *>(::GetProcAddress(hLib, "AcquireSRWLockShared")));
fpReleaseSRWLockExclusive = reinterpret_cast<VOID (WINAPI *)(PSRWLOCK)>(
reinterpret_cast<void *>(::GetProcAddress(hLib, "ReleaseSRWLockExclusive")));
fpReleaseSRWLockShared = reinterpret_cast<VOID (WINAPI *)(PSRWLOCK)>(
reinterpret_cast<void *>(::GetProcAddress(hLib, "ReleaseSRWLockShared")));

if (fpInitializeSRWLock != NULL) {
sHasSRW = true;
Expand All @@ -73,6 +68,7 @@ static bool loadSRW() {
return sHasSRW;
}


RWMutexImpl::RWMutexImpl() {
// TODO: harden to allocation failures - HLSL Change
if (loadSRW()) {
Expand Down
Loading