Skip to content

Commit

Permalink
Add support for building with Clang 19 (#109198)
Browse files Browse the repository at this point in the history
Co-authored-by: Adeel Mujahid <[email protected]>
  • Loading branch information
MichaelSimons and am11 authored Dec 3, 2024
1 parent c844b49 commit b2ac274
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/coreclr/vm/comreflectioncache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ template <class Element, class CacheType, int CacheSize> class ReflectionCache

void Init();

#ifndef DACCESS_COMPILE
BOOL GetFromCache(Element *pElement, CacheType& rv)
{
CONTRACTL
Expand Down Expand Up @@ -102,6 +103,7 @@ template <class Element, class CacheType, int CacheSize> class ReflectionCache
AdjustStamp(TRUE);
this->LeaveWrite();
}
#endif // !DACCESS_COMPILE

private:
// Lock must have been taken before calling this.
Expand Down Expand Up @@ -141,6 +143,7 @@ template <class Element, class CacheType, int CacheSize> class ReflectionCache
return CacheSize;
}

#ifndef DACCESS_COMPILE
void AdjustStamp(BOOL hasWriterLock)
{
CONTRACTL
Expand Down Expand Up @@ -170,6 +173,7 @@ template <class Element, class CacheType, int CacheSize> class ReflectionCache
if (!hasWriterLock)
this->LeaveWrite();
}
#endif // !DACCESS_COMPILE

void UpdateHashTable(SIZE_T hash, int slot)
{
Expand Down
6 changes: 6 additions & 0 deletions src/native/libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
add_compile_options(-Wno-cast-align)
add_compile_options(-Wno-typedef-redefinition)
add_compile_options(-Wno-c11-extensions)

check_c_compiler_flag(-Wpre-c11-compat COMPILER_SUPPORTS_W_PRE_C11_COMPAT)
if (COMPILER_SUPPORTS_W_PRE_C11_COMPAT)
add_compile_options(-Wno-pre-c11-compat)
endif()

add_compile_options(-Wno-thread-safety-analysis)
if (CLR_CMAKE_TARGET_BROWSER)
add_compile_options(-Wno-unsafe-buffer-usage)
Expand Down

0 comments on commit b2ac274

Please sign in to comment.