[llvm-branch-commits] [clang] ff2cb6e - [clang] Partially revert d8cd7806310c51af912a647a6ca46de62ff13214.

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 8 09:07:33 PST 2021


Author: Brad Smith
Date: 2021-11-08T09:07:16-08:00
New Revision: ff2cb6e400c3a130a9bb9f7be1e45beb9c316160

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

LOG: [clang] Partially revert d8cd7806310c51af912a647a6ca46de62ff13214.

The C11 atomics part was wrong.

(cherry picked from commit 95e6e1cc923d6b88ebb4ac5e8f0887c2c77476cc)

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 3fe39ed64d9c..12df95c19f35 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -461,10 +461,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 43708837c4ae..5aba07860f6d 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 llvm-branch-commits mailing list