[PATCH] D104125: [PowerPC] Moving defineXLCompatMacros() definition

Quinn Pham via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 11 09:01:02 PDT 2021


quinnp created this revision.
Herald added subscribers: shchenz, kbarton, nemanjai.
quinnp requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

[NFC] Moving the definition of the defineXLCompatMacros function from
the header file clang/lib/Basic/Targets/PPC.h to the source file
clang/lib/Basic/Targets/PPC.cpp.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104125

Files:
  clang/lib/Basic/Targets/PPC.cpp
  clang/lib/Basic/Targets/PPC.h


Index: clang/lib/Basic/Targets/PPC.h
===================================================================
--- clang/lib/Basic/Targets/PPC.h
+++ clang/lib/Basic/Targets/PPC.h
@@ -350,24 +350,6 @@
   bool isSPRegName(StringRef RegName) const override {
     return RegName.equals("r1") || RegName.equals("x1");
   }
-
-  void defineXLCompatMacros(MacroBuilder &Builder) const {
-    Builder.defineMacro("__popcntb", "__builtin_ppc_popcntb");
-    Builder.defineMacro("__eieio", "__builtin_ppc_eieio");
-    Builder.defineMacro("__iospace_eieio", "__builtin_ppc_iospace_eieio");
-    Builder.defineMacro("__isync", "__builtin_ppc_isync");
-    Builder.defineMacro("__lwsync", "__builtin_ppc_lwsync");
-    Builder.defineMacro("__iospace_lwsync", "__builtin_ppc_iospace_lwsync");
-    Builder.defineMacro("__sync", "__builtin_ppc_sync");
-    Builder.defineMacro("__iospace_sync", "__builtin_ppc_iospace_sync");
-    Builder.defineMacro("__dcbfl", "__builtin_ppc_dcbfl");
-    Builder.defineMacro("__dcbflp", "__builtin_ppc_dcbflp");
-    Builder.defineMacro("__dcbst", "__builtin_ppc_dcbst");
-    Builder.defineMacro("__dcbt", "__builtin_ppc_dcbt");
-    Builder.defineMacro("__dcbtst", "__builtin_ppc_dcbtst");
-    Builder.defineMacro("__dcbz", "__builtin_ppc_dcbz");
-    Builder.defineMacro("__icbt", "__builtin_ppc_icbt");
-  }
 };
 
 class LLVM_LIBRARY_VISIBILITY PPC32TargetInfo : public PPCTargetInfo {
Index: clang/lib/Basic/Targets/PPC.cpp
===================================================================
--- clang/lib/Basic/Targets/PPC.cpp
+++ clang/lib/Basic/Targets/PPC.cpp
@@ -81,6 +81,24 @@
   return true;
 }
 
+static void defineXLCompatMacros(MacroBuilder &Builder) {
+  Builder.defineMacro("__popcntb", "__builtin_ppc_popcntb");
+  Builder.defineMacro("__eieio", "__builtin_ppc_eieio");
+  Builder.defineMacro("__iospace_eieio", "__builtin_ppc_iospace_eieio");
+  Builder.defineMacro("__isync", "__builtin_ppc_isync");
+  Builder.defineMacro("__lwsync", "__builtin_ppc_lwsync");
+  Builder.defineMacro("__iospace_lwsync", "__builtin_ppc_iospace_lwsync");
+  Builder.defineMacro("__sync", "__builtin_ppc_sync");
+  Builder.defineMacro("__iospace_sync", "__builtin_ppc_iospace_sync");
+  Builder.defineMacro("__dcbfl", "__builtin_ppc_dcbfl");
+  Builder.defineMacro("__dcbflp", "__builtin_ppc_dcbflp");
+  Builder.defineMacro("__dcbst", "__builtin_ppc_dcbst");
+  Builder.defineMacro("__dcbt", "__builtin_ppc_dcbt");
+  Builder.defineMacro("__dcbtst", "__builtin_ppc_dcbtst");
+  Builder.defineMacro("__dcbz", "__builtin_ppc_dcbz");
+  Builder.defineMacro("__icbt", "__builtin_ppc_icbt");
+}
+
 /// PPCTargetInfo::getTargetDefines - Return a set of the PowerPC-specific
 /// #defines that are not tied to a specific subtarget.
 void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104125.351466.patch
Type: text/x-patch
Size: 2807 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210611/da13867b/attachment-0001.bin>


More information about the cfe-commits mailing list