@@ -41,16 +41,16 @@ inline uint8_t extractTag(uptr Ptr) { return (Ptr >> 56) & 0xf; }
41
41
42
42
inline constexpr bool archSupportsMemoryTagging () { return false ; }
43
43
44
- inline uptr archMemoryTagGranuleSize () {
44
+ inline NORETURN uptr archMemoryTagGranuleSize () {
45
45
UNREACHABLE (" memory tagging not supported" );
46
46
}
47
47
48
- inline uptr untagPointer (uptr Ptr) {
48
+ inline NORETURN uptr untagPointer (uptr Ptr) {
49
49
(void )Ptr;
50
50
UNREACHABLE (" memory tagging not supported" );
51
51
}
52
52
53
- inline uint8_t extractTag (uptr Ptr) {
53
+ inline NORETURN uint8_t extractTag (uptr Ptr) {
54
54
(void )Ptr;
55
55
UNREACHABLE (" memory tagging not supported" );
56
56
}
@@ -109,11 +109,11 @@ inline void enableSystemMemoryTaggingTestOnly() {
109
109
110
110
inline bool systemSupportsMemoryTagging () { return false ; }
111
111
112
- inline bool systemDetectsMemoryTagFaultsTestOnly () {
112
+ inline NORETURN bool systemDetectsMemoryTagFaultsTestOnly () {
113
113
UNREACHABLE (" memory tagging not supported" );
114
114
}
115
115
116
- inline void enableSystemMemoryTaggingTestOnly () {
116
+ inline NORETURN void enableSystemMemoryTaggingTestOnly () {
117
117
UNREACHABLE (" memory tagging not supported" );
118
118
}
119
119
@@ -255,57 +255,60 @@ inline uptr loadTag(uptr Ptr) {
255
255
256
256
#else
257
257
258
- inline bool systemSupportsMemoryTagging () {
258
+ inline NORETURN bool systemSupportsMemoryTagging () {
259
259
UNREACHABLE (" memory tagging not supported" );
260
260
}
261
261
262
- inline bool systemDetectsMemoryTagFaultsTestOnly () {
262
+ inline NORETURN bool systemDetectsMemoryTagFaultsTestOnly () {
263
263
UNREACHABLE (" memory tagging not supported" );
264
264
}
265
265
266
- inline void enableSystemMemoryTaggingTestOnly () {
266
+ inline NORETURN void enableSystemMemoryTaggingTestOnly () {
267
267
UNREACHABLE (" memory tagging not supported" );
268
268
}
269
269
270
270
struct ScopedDisableMemoryTagChecks {
271
271
ScopedDisableMemoryTagChecks () {}
272
272
};
273
273
274
- inline uptr selectRandomTag (uptr Ptr, uptr ExcludeMask) {
274
+ inline NORETURN uptr selectRandomTag (uptr Ptr, uptr ExcludeMask) {
275
275
(void )Ptr;
276
276
(void )ExcludeMask;
277
277
UNREACHABLE (" memory tagging not supported" );
278
278
}
279
279
280
- inline uptr addFixedTag (uptr Ptr, uptr Tag) {
280
+ inline NORETURN uptr addFixedTag (uptr Ptr, uptr Tag) {
281
281
(void )Ptr;
282
282
(void )Tag;
283
283
UNREACHABLE (" memory tagging not supported" );
284
284
}
285
285
286
- inline uptr storeTags (uptr Begin, uptr End) {
286
+ inline NORETURN uptr storeTags (uptr Begin, uptr End) {
287
287
(void )Begin;
288
288
(void )End;
289
289
UNREACHABLE (" memory tagging not supported" );
290
290
}
291
291
292
- inline void storeTag (uptr Ptr) {
292
+ inline NORETURN void storeTag (uptr Ptr) {
293
293
(void )Ptr;
294
294
UNREACHABLE (" memory tagging not supported" );
295
295
}
296
296
297
- inline uptr loadTag (uptr Ptr) {
297
+ inline NORETURN uptr loadTag (uptr Ptr) {
298
298
(void )Ptr;
299
299
UNREACHABLE (" memory tagging not supported" );
300
300
}
301
301
302
302
#endif
303
303
304
+ #pragma clang diagnostic push
305
+ #pragma clang diagnostic ignored "-Wmissing-noreturn"
304
306
inline void setRandomTag (void *Ptr, uptr Size, uptr ExcludeMask,
305
307
uptr *TaggedBegin, uptr *TaggedEnd) {
306
308
*TaggedBegin = selectRandomTag (reinterpret_cast <uptr>(Ptr), ExcludeMask);
307
309
*TaggedEnd = storeTags (*TaggedBegin, *TaggedBegin + Size);
308
310
}
311
+ #pragma clang diagnostic pop
309
312
310
313
inline void *untagPointer (void *Ptr) {
311
314
return reinterpret_cast <void *>(untagPointer (reinterpret_cast <uptr>(Ptr)));
0 commit comments