Skip to content

Commit b2ac274

Browse files
MichaelSimonsam11
andauthored
Add support for building with Clang 19 (#109198)
Co-authored-by: Adeel Mujahid <[email protected]>
1 parent c844b49 commit b2ac274

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/coreclr/vm/comreflectioncache.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ template <class Element, class CacheType, int CacheSize> class ReflectionCache
2626

2727
void Init();
2828

29+
#ifndef DACCESS_COMPILE
2930
BOOL GetFromCache(Element *pElement, CacheType& rv)
3031
{
3132
CONTRACTL
@@ -102,6 +103,7 @@ template <class Element, class CacheType, int CacheSize> class ReflectionCache
102103
AdjustStamp(TRUE);
103104
this->LeaveWrite();
104105
}
106+
#endif // !DACCESS_COMPILE
105107

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

146+
#ifndef DACCESS_COMPILE
144147
void AdjustStamp(BOOL hasWriterLock)
145148
{
146149
CONTRACTL
@@ -170,6 +173,7 @@ template <class Element, class CacheType, int CacheSize> class ReflectionCache
170173
if (!hasWriterLock)
171174
this->LeaveWrite();
172175
}
176+
#endif // !DACCESS_COMPILE
173177

174178
void UpdateHashTable(SIZE_T hash, int slot)
175179
{

src/native/libs/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
128128
add_compile_options(-Wno-cast-align)
129129
add_compile_options(-Wno-typedef-redefinition)
130130
add_compile_options(-Wno-c11-extensions)
131+
132+
check_c_compiler_flag(-Wpre-c11-compat COMPILER_SUPPORTS_W_PRE_C11_COMPAT)
133+
if (COMPILER_SUPPORTS_W_PRE_C11_COMPAT)
134+
add_compile_options(-Wno-pre-c11-compat)
135+
endif()
136+
131137
add_compile_options(-Wno-thread-safety-analysis)
132138
if (CLR_CMAKE_TARGET_BROWSER)
133139
add_compile_options(-Wno-unsafe-buffer-usage)

0 commit comments

Comments
 (0)