xref: /freebsd/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/PPC.h (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
10b57cec5SDimitry Andric //===--- PPC.h - PPC-specific Tool Helpers ----------------------*- C++ -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_PPC_H
100b57cec5SDimitry Andric #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_PPC_H
110b57cec5SDimitry Andric 
120b57cec5SDimitry Andric #include "clang/Driver/Driver.h"
130b57cec5SDimitry Andric #include "llvm/ADT/StringRef.h"
140b57cec5SDimitry Andric #include "llvm/Option/Option.h"
150b57cec5SDimitry Andric #include <string>
160b57cec5SDimitry Andric #include <vector>
170b57cec5SDimitry Andric 
180b57cec5SDimitry Andric namespace clang {
190b57cec5SDimitry Andric namespace driver {
200b57cec5SDimitry Andric namespace tools {
210b57cec5SDimitry Andric namespace ppc {
220b57cec5SDimitry Andric 
230b57cec5SDimitry Andric bool hasPPCAbiArg(const llvm::opt::ArgList &Args, const char *Value);
240b57cec5SDimitry Andric 
250b57cec5SDimitry Andric enum class FloatABI {
260b57cec5SDimitry Andric   Invalid,
270b57cec5SDimitry Andric   Soft,
280b57cec5SDimitry Andric   Hard,
290b57cec5SDimitry Andric };
300b57cec5SDimitry Andric 
310b57cec5SDimitry Andric enum class ReadGOTPtrMode {
320b57cec5SDimitry Andric   Bss,
330b57cec5SDimitry Andric   SecurePlt,
340b57cec5SDimitry Andric };
350b57cec5SDimitry Andric 
360b57cec5SDimitry Andric FloatABI getPPCFloatABI(const Driver &D, const llvm::opt::ArgList &Args);
370b57cec5SDimitry Andric 
38*06c3fb27SDimitry Andric std::string getPPCTargetCPU(const Driver &D, const llvm::opt::ArgList &Args,
39bdd1243dSDimitry Andric                             const llvm::Triple &T);
401ac55f4cSDimitry Andric std::string getPPCTuneCPU(const llvm::opt::ArgList &Args,
411ac55f4cSDimitry Andric                           const llvm::Triple &T);
420b57cec5SDimitry Andric const char *getPPCAsmModeForCPU(StringRef Name);
430b57cec5SDimitry Andric ReadGOTPtrMode getPPCReadGOTPtrMode(const Driver &D, const llvm::Triple &Triple,
440b57cec5SDimitry Andric                                     const llvm::opt::ArgList &Args);
450b57cec5SDimitry Andric 
460b57cec5SDimitry Andric void getPPCTargetFeatures(const Driver &D, const llvm::Triple &Triple,
470b57cec5SDimitry Andric                           const llvm::opt::ArgList &Args,
480b57cec5SDimitry Andric                           std::vector<llvm::StringRef> &Features);
490b57cec5SDimitry Andric 
500b57cec5SDimitry Andric } // end namespace ppc
510b57cec5SDimitry Andric } // end namespace target
520b57cec5SDimitry Andric } // end namespace driver
530b57cec5SDimitry Andric } // end namespace clang
540b57cec5SDimitry Andric 
550b57cec5SDimitry Andric #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_PPC_H
56