[PATCH] D98546: [PowerPC] Add __PCREL__ when PC Relative is enabled.
Stefan Pintilie via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 15 13:13:39 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG86f2a3d17878: [PowerPC] Add __PCREL__ when PC Relative is enabled. (authored by stefanp).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98546/new/
https://reviews.llvm.org/D98546
Files:
clang/lib/Basic/Targets/PPC.cpp
clang/test/Preprocessor/init-ppc64.c
Index: clang/test/Preprocessor/init-ppc64.c
===================================================================
--- clang/test/Preprocessor/init-ppc64.c
+++ clang/test/Preprocessor/init-ppc64.c
@@ -633,6 +633,7 @@
// PPCPOWER10:#define _ARCH_PWR8 1
// PPCPOWER10:#define _ARCH_PWR9 1
// PPCPOWER10:#define __MMA__ 1
+// PPCPOWER10:#define __PCREL__ 1
// PPCPOWER10-NOT:#define __ROP_PROTECTION__ 1
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu future -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCFUTURE %s
@@ -652,6 +653,7 @@
// PPCFUTURE:#define _ARCH_PWR9 1
// PPCFUTURE:#define _ARCH_PWR_FUTURE 1
// PPCFUTURE:#define __MMA__ 1
+// PPCFUTURE:#define __PCREL__ 1
// PPCFUTURE-NOT:#define __ROP_PROTECTION__ 1
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-feature +mma -target-cpu power10 -fno-signed-char < /dev/null | FileCheck -check-prefix PPC-MMA %s
Index: clang/lib/Basic/Targets/PPC.cpp
===================================================================
--- clang/lib/Basic/Targets/PPC.cpp
+++ clang/lib/Basic/Targets/PPC.cpp
@@ -199,6 +199,8 @@
Builder.defineMacro("__ROP_PROTECTION__");
if (HasP10Vector)
Builder.defineMacro("__POWER10_VECTOR__");
+ if (HasPCRelativeMemops)
+ Builder.defineMacro("__PCREL__");
Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98546.330781.patch
Type: text/x-patch
Size: 1480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210315/f14f5729/attachment.bin>
More information about the cfe-commits
mailing list