[clang] 994bb93 - [PowerPC] Moving defineXLCompatMacros() definition
Albion Fung via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 15 12:25:56 PDT 2021
Author: Quinn Pham
Date: 2021-06-15T14:25:43-05:00
New Revision: 994bb937f020a014c7039151169649a7076ca9b1
URL: https://github.com/llvm/llvm-project/commit/994bb937f020a014c7039151169649a7076ca9b1
DIFF: https://github.com/llvm/llvm-project/commit/994bb937f020a014c7039151169649a7076ca9b1.diff
LOG: [PowerPC] Moving defineXLCompatMacros() definition
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.
Differential revision: https://reviews.llvm.org/D104125
Added:
Modified:
clang/lib/Basic/Targets/PPC.cpp
clang/lib/Basic/Targets/PPC.h
Removed:
################################################################################
diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index 9f5c615ba752..3dfc0c0751e4 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -81,6 +81,24 @@ bool PPCTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
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,
diff --git a/clang/lib/Basic/Targets/PPC.h b/clang/lib/Basic/Targets/PPC.h
index 2ceb0b0cbf1c..554f2174fee0 100644
--- a/clang/lib/Basic/Targets/PPC.h
+++ b/clang/lib/Basic/Targets/PPC.h
@@ -350,24 +350,6 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public TargetInfo {
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 {
More information about the cfe-commits
mailing list