-
Notifications
You must be signed in to change notification settings - Fork 750
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
base: main
Are you sure you want to change the base?
Make dxcompiler target build with ClangCL 19.1.1 #7351
Conversation
You can test this locally with the following command:git-clang-format --diff ea3d8466d807fccbee1a3dc16d4b15bafd12d4fe 155a31a1b711e2106a5930f9663b7cf03878a1c8 -- include/dxc/Support/dxcapi.use.h include/llvm/CodeGen/SchedulerRegistry.h lib/IR/Core.cpp lib/MSSupport/MSFileSystemImpl.cpp View the diff from clang-format here.diff --git a/include/dxc/Support/dxcapi.use.h b/include/dxc/Support/dxcapi.use.h
index 747a7ca2..dee10503 100644
--- a/include/dxc/Support/dxcapi.use.h
+++ b/include/dxc/Support/dxcapi.use.h
@@ -34,7 +34,8 @@ protected:
m_dll = LoadLibraryA(dllName);
if (m_dll == nullptr)
return HRESULT_FROM_WIN32(GetLastError());
- m_createFn = reinterpret_cast<DxcCreateInstanceProc>(reinterpret_cast<void *>(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());
@@ -64,7 +65,8 @@ protected:
fnName2[s] = '2';
fnName2[s + 1] = '\0';
#ifdef _WIN32
- m_createFn2 = reinterpret_cast<DxcCreateInstance2Proc>(reinterpret_cast<void *>(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
diff --git a/include/llvm/CodeGen/SchedulerRegistry.h b/include/llvm/CodeGen/SchedulerRegistry.h
index 04d24412..5e26252d 100644
--- a/include/llvm/CodeGen/SchedulerRegistry.h
+++ b/include/llvm/CodeGen/SchedulerRegistry.h
@@ -40,8 +40,11 @@ public:
static MachinePassRegistry Registry;
RegisterScheduler(const char *N, const char *D, FunctionPassCtor C)
- : MachinePassRegistryNode(N, D, reinterpret_cast<MachinePassCtor>(reinterpret_cast<void *>(C)))
- { Registry.Add(this); }
+ : MachinePassRegistryNode(
+ N, D,
+ reinterpret_cast<MachinePassCtor>(reinterpret_cast<void *>(C))) {
+ Registry.Add(this);
+ }
~RegisterScheduler() { Registry.Remove(this); }
@@ -54,10 +57,12 @@ public:
return (RegisterScheduler *)Registry.getList();
}
static FunctionPassCtor getDefault() {
- return reinterpret_cast<FunctionPassCtor>(reinterpret_cast<void *>(Registry.getDefault()));
+ return reinterpret_cast<FunctionPassCtor>(
+ reinterpret_cast<void *>(Registry.getDefault()));
}
static void setDefault(FunctionPassCtor C) {
- Registry.setDefault(reinterpret_cast<MachinePassCtor>(reinterpret_cast<void *>(C)));
+ Registry.setDefault(
+ reinterpret_cast<MachinePassCtor>(reinterpret_cast<void *>(C)));
}
static void setListener(MachinePassRegistryListener *L) {
Registry.setListener(L);
diff --git a/lib/MSSupport/MSFileSystemImpl.cpp b/lib/MSSupport/MSFileSystemImpl.cpp
index ca734f7b..e75019be 100644
--- a/lib/MSSupport/MSFileSystemImpl.cpp
+++ b/lib/MSSupport/MSFileSystemImpl.cpp
@@ -323,8 +323,7 @@ typedef BOOLEAN(WINAPI *PtrCreateSymbolicLinkW)(
PtrCreateSymbolicLinkW create_symbolic_link_api =
PtrCreateSymbolicLinkW(reinterpret_cast<void *>(::GetProcAddress(
- ::GetModuleHandleW(L"Kernel32.dll"),
- "CreateSymbolicLinkW")));
+ ::GetModuleHandleW(L"Kernel32.dll"), "CreateSymbolicLinkW")));
} // namespace
#endif
|
@microsoft-github-policy-service agree [company="Devsh Graphics Programming Sp. z O.O."] |
@microsoft-github-policy-service agree company="Devsh Graphics Programming Sp. z O.O." |
this is so that DXC can compile on Clang without |
and logs with what it fixed
|
Fixed clang 19.1.1 (Visual Studio) build. There were issues with function type casts after invoking ::GetProcAddress to get a function pointer (FARPROC -> desired type).