[llvm] 0a614ca - Fix "unknown pragma 'GCC'" MSVC warning. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 15 11:01:06 PDT 2021


Author: Simon Pilgrim
Date: 2021-07-15T18:50:19+01:00
New Revision: 0a614ca22522d6a77356f491a90171b5de916bc7

URL: https://github.com/llvm/llvm-project/commit/0a614ca22522d6a77356f491a90171b5de916bc7
DIFF: https://github.com/llvm/llvm-project/commit/0a614ca22522d6a77356f491a90171b5de916bc7.diff

LOG: Fix "unknown pragma 'GCC'" MSVC warning. NFCI.

Added: 
    

Modified: 
    llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
index f9c0c86ffe35..014a0ce85aa8 100644
--- a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
@@ -194,20 +194,26 @@ namespace {
 
 bool shouldUsePageAliases(const Triple &TargetTriple) {
   return ClUsePageAliases && TargetTriple.getArch() == Triple::x86_64;
+#ifdef __GNUC__
 // No one should use the option directly.
 #pragma GCC poison ClUsePageAliases
+#endif
 }
 
 bool shouldInstrumentStack(const Triple &TargetTriple) {
   return shouldUsePageAliases(TargetTriple) ? false : ClInstrumentStack;
+#ifdef __GNUC__
 // No one should use the option directly.
 #pragma GCC poison ClInstrumentStack
+#endif
 }
 
 bool shouldInstrumentWithCalls(const Triple &TargetTriple) {
   return ClInstrumentWithCalls || TargetTriple.getArch() == Triple::x86_64;
+#ifdef __GNUC__
 // No one should use the option directly.
 #pragma GCC poison ClInstrumentWithCalls
+#endif
 }
 
 /// An instrumentation pass implementing detection of addressability bugs


        


More information about the llvm-commits mailing list