[clang] [llvm] [PowerPC] add TargetParser for PPC target (PR #97541)
Qiu Chaofan via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 3 20:12:07 PDT 2024
================
@@ -0,0 +1,37 @@
+//===---- PPCTargetParser - Parser for target features ----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements a target parser to recognise hardware features
+// for PPC CPUs.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TARGETPARSER_PPCTARGETPARSER_H
+#define LLVM_TARGETPARSER_PPCTARGETPARSER_H
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/TargetParser/Triple.h"
+
+namespace llvm {
+namespace PPC {
+bool isValidCPU(StringRef CPU);
+void fillValidCPUList(SmallVectorImpl<StringRef> &Values);
+void fillValidTuneCPUList(SmallVectorImpl<StringRef> &Values);
+
+// Get default target CPU for PPC.
+StringRef getPPCGenericTargetCPU(const Triple &T, StringRef CPUName = "");
+// Get default tune CPU for PPC.
+StringRef getPPCGenericTuneCPU(const Triple &T, StringRef CPUName = "");
----------------
ecnelises wrote:
We should rename this method (remove `Generic` or similar). Previous `getPPCGenericTargetCPU` does not have extra CPUName as parameter. What this function does now is not only returning a generic CPU for a platform.
https://github.com/llvm/llvm-project/pull/97541
More information about the cfe-commits
mailing list