Clang Project

clang_source_code/lib/Driver/ToolChains/Arch/Mips.h
1//===--- Mips.h - Mips-specific Tool Helpers ----------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_MIPS_H
10#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_MIPS_H
11
12#include "clang/Driver/Driver.h"
13#include "llvm/ADT/StringRef.h"
14#include "llvm/ADT/Triple.h"
15#include "llvm/Option/Option.h"
16#include <string>
17#include <vector>
18
19namespace clang {
20namespace driver {
21namespace tools {
22
23namespace mips {
24typedef enum { Legacy = 1Std2008 = 2 } IEEE754Standard;
25
26enum class FloatABI {
27  Invalid,
28  Soft,
29  Hard,
30};
31
32IEEE754Standard getIEEE754Standard(StringRef &CPU);
33bool hasCompactBranches(StringRef &CPU);
34void getMipsCPUAndABI(const llvm::opt::ArgList &Args,
35                      const llvm::Triple &TripleStringRef &CPUName,
36                      StringRef &ABIName);
37void getMIPSTargetFeatures(const Driver &Dconst llvm::Triple &Triple,
38                           const llvm::opt::ArgList &Args,
39                           std::vector<StringRef> &Features);
40StringRef getGnuCompatibleMipsABIName(StringRef ABI);
41mips::FloatABI getMipsFloatABI(const Driver &Dconst llvm::opt::ArgList &Args);
42std::string getMipsABILibSuffix(const llvm::opt::ArgList &Args,
43                                const llvm::Triple &Triple);
44bool hasMipsAbiArg(const llvm::opt::ArgList &Argsconst char *Value);
45bool isUCLibc(const llvm::opt::ArgList &Args);
46bool isNaN2008(const llvm::opt::ArgList &Argsconst llvm::Triple &Triple);
47bool isFP64ADefault(const llvm::Triple &TripleStringRef CPUName);
48bool isFPXXDefault(const llvm::Triple &TripleStringRef CPUName,
49                   StringRef ABINamemips::FloatABI FloatABI);
50bool shouldUseFPXX(const llvm::opt::ArgList &Argsconst llvm::Triple &Triple,
51                   StringRef CPUNameStringRef ABIName,
52                   mips::FloatABI FloatABI);
53bool supportsIndirectJumpHazardBarrier(StringRef &CPU);
54
55// end namespace mips
56// end namespace target
57// end namespace driver
58// end namespace clang
59
60#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_MIPS_H
61