Make dxcompiler target build with ClangCL 19.1.1#7351
Open
YasInvolved wants to merge 1 commit intomicrosoft:mainfrom
Open
Make dxcompiler target build with ClangCL 19.1.1#7351YasInvolved wants to merge 1 commit intomicrosoft:mainfrom
YasInvolved wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Contributor
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.cppView 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
|
Author
|
@microsoft-github-policy-service agree [company="Devsh Graphics Programming Sp. z O.O."] |
Author
|
@microsoft-github-policy-service agree company="Devsh Graphics Programming Sp. z O.O." |
this is so that DXC can compile on Clang without |
Contributor
|
and logs with what it fixed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).