[compiler-rt] 030d826 - [scudo] Wrap clang pragma to avoid GCC error

Dominic Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 17:39:56 PDT 2022


Author: Dominic Chen
Date: 2022-03-29T17:36:33-07:00
New Revision: 030d8262a6e8055660ae74bdb7e4f22c741a1e17

URL: https://github.com/llvm/llvm-project/commit/030d8262a6e8055660ae74bdb7e4f22c741a1e17
DIFF: https://github.com/llvm/llvm-project/commit/030d8262a6e8055660ae74bdb7e4f22c741a1e17.diff

LOG: [scudo] Wrap clang pragma to avoid GCC error

Fixes: [scudo] Add noreturn/pragma to suppress compiler warnings

Differential Revision: https://reviews.llvm.org/D121853

Added: 
    

Modified: 
    compiler-rt/lib/scudo/standalone/memtag.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/memtag.h b/compiler-rt/lib/scudo/standalone/memtag.h
index 6e2f887fdec9f..966bf6b9ee299 100644
--- a/compiler-rt/lib/scudo/standalone/memtag.h
+++ b/compiler-rt/lib/scudo/standalone/memtag.h
@@ -301,6 +301,7 @@ inline NORETURN uptr loadTag(uptr Ptr) {
 
 #endif
 
+#if __clang__
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wmissing-noreturn"
 inline void setRandomTag(void *Ptr, uptr Size, uptr ExcludeMask,
@@ -309,6 +310,7 @@ inline void setRandomTag(void *Ptr, uptr Size, uptr ExcludeMask,
   *TaggedEnd = storeTags(*TaggedBegin, *TaggedBegin + Size);
 }
 #pragma clang diagnostic pop
+#endif
 
 inline void *untagPointer(void *Ptr) {
   return reinterpret_cast<void *>(untagPointer(reinterpret_cast<uptr>(Ptr)));


        


More information about the llvm-commits mailing list