[clang] 95e6e1c - [clang] Partially revert d8cd7806310c51af912a647a6ca46de62ff13214.

Brad Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 28 23:44:46 PDT 2021


Author: Brad Smith
Date: 2021-10-29T02:41:54-04:00
New Revision: 95e6e1cc923d6b88ebb4ac5e8f0887c2c77476cc

URL: https://github.com/llvm/llvm-project/commit/95e6e1cc923d6b88ebb4ac5e8f0887c2c77476cc
DIFF: https://github.com/llvm/llvm-project/commit/95e6e1cc923d6b88ebb4ac5e8f0887c2c77476cc.diff

LOG: [clang] Partially revert d8cd7806310c51af912a647a6ca46de62ff13214.

The C11 atomics part was wrong.

Added: 
    

Modified: 
    clang/lib/Basic/Targets/OSTargets.h
    clang/test/Preprocessor/init.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Targets/OSTargets.h
index f49e2200cd5b8..7fbe2cbc56538 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -464,10 +464,8 @@ class LLVM_LIBRARY_VISIBILITY OpenBSDTargetInfo : public OSTargetInfo<Target> {
     if (this->HasFloat128)
       Builder.defineMacro("__FLOAT128__");
 
-    if (Opts.C11) {
-      Builder.defineMacro("__STDC_NO_ATOMICS__");
+    if (Opts.C11)
       Builder.defineMacro("__STDC_NO_THREADS__");
-    }
   }
 
 public:

diff  --git a/clang/test/Preprocessor/init.c b/clang/test/Preprocessor/init.c
index 6a3cb9b8ff6a9..8bbfe85b9ba74 100644
--- a/clang/test/Preprocessor/init.c
+++ b/clang/test/Preprocessor/init.c
@@ -1467,11 +1467,9 @@
 // RUN: %clang_cc1 -x c -std=c11 -E -dM -ffreestanding -triple=amd64-unknown-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD-STDC %s
 // RUN: %clang_cc1 -x c -std=gnu11 -E -dM -ffreestanding -triple=amd64-unknown-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD-STDC %s
 // RUN: %clang_cc1 -x c -std=c17 -E -dM -ffreestanding -triple=amd64-unknown-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD-STDC %s
-// OPENBSD-STDC:#define __STDC_NO_ATOMICS__ 1
 // OPENBSD-STDC:#define __STDC_NO_THREADS__ 1
 //
 // RUN: %clang_cc1 -x c -std=c99 -E -dM -ffreestanding -triple=amd64-unknown-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD-STDC-N %s
-// OPENBSD-STDC-N-NOT:#define __STDC_NO_ATOMICS__ 1
 // OPENBSD-STDC-N-NOT:#define __STDC_NO_THREADS__ 1
 //
 // RUN: %clang_cc1 -E -dM -ffreestanding -triple=xcore-none-none < /dev/null | FileCheck -match-full-lines -check-prefix XCORE %s


        


More information about the cfe-commits mailing list