]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/lib/Driver/ToolChains/Arch/Mips.h
Merge clang trunk r300422 and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / lib / Driver / ToolChains / Arch / Mips.h
1 //===--- Mips.h - Mips-specific Tool Helpers ----------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_MIPS_H
11 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_MIPS_H
12
13 #include "clang/Driver/Driver.h"
14 #include "llvm/ADT/StringRef.h"
15 #include "llvm/ADT/Triple.h"
16 #include "llvm/Option/Option.h"
17 #include <string>
18 #include <vector>
19
20 namespace clang {
21 namespace driver {
22 namespace tools {
23
24 bool isMipsArch(llvm::Triple::ArchType Arch);
25
26 namespace mips {
27 typedef enum { NanLegacy = 1, Nan2008 = 2 } NanEncoding;
28
29 enum class FloatABI {
30   Invalid,
31   Soft,
32   Hard,
33 };
34
35 NanEncoding getSupportedNanEncoding(StringRef &CPU);
36 bool hasCompactBranches(StringRef &CPU);
37 void getMipsCPUAndABI(const llvm::opt::ArgList &Args,
38                       const llvm::Triple &Triple, StringRef &CPUName,
39                       StringRef &ABIName);
40 void getMIPSTargetFeatures(const Driver &D, const llvm::Triple &Triple,
41                            const llvm::opt::ArgList &Args,
42                            std::vector<StringRef> &Features);
43 StringRef getGnuCompatibleMipsABIName(StringRef ABI);
44 mips::FloatABI getMipsFloatABI(const Driver &D, const llvm::opt::ArgList &Args);
45 std::string getMipsABILibSuffix(const llvm::opt::ArgList &Args,
46                                 const llvm::Triple &Triple);
47 bool hasMipsAbiArg(const llvm::opt::ArgList &Args, const char *Value);
48 bool isUCLibc(const llvm::opt::ArgList &Args);
49 bool isNaN2008(const llvm::opt::ArgList &Args, const llvm::Triple &Triple);
50 bool isFP64ADefault(const llvm::Triple &Triple, StringRef CPUName);
51 bool isFPXXDefault(const llvm::Triple &Triple, StringRef CPUName,
52                    StringRef ABIName, mips::FloatABI FloatABI);
53 bool shouldUseFPXX(const llvm::opt::ArgList &Args, const llvm::Triple &Triple,
54                    StringRef CPUName, StringRef ABIName,
55                    mips::FloatABI FloatABI);
56
57 } // end namespace mips
58 } // end namespace target
59 } // end namespace driver
60 } // end namespace clang
61
62 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_MIPS_H