ARM.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //===--- ARM.h - ARM-specific (not AArch64) 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. #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_ARM_H
  9. #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_ARM_H
  10. #include "clang/Driver/ToolChain.h"
  11. #include "llvm/ADT/StringRef.h"
  12. #include "llvm/ADT/Triple.h"
  13. #include "llvm/Option/Option.h"
  14. #include "llvm/Support/ARMTargetParser.h"
  15. #include "llvm/Support/TargetParser.h"
  16. #include <string>
  17. #include <vector>
  18. namespace clang {
  19. namespace driver {
  20. namespace tools {
  21. namespace arm {
  22. std::string getARMTargetCPU(StringRef CPU, llvm::StringRef Arch,
  23. const llvm::Triple &Triple);
  24. std::string getARMArch(llvm::StringRef Arch, const llvm::Triple &Triple);
  25. StringRef getARMCPUForMArch(llvm::StringRef Arch, const llvm::Triple &Triple);
  26. llvm::ARM::ArchKind getLLVMArchKindForARM(StringRef CPU, StringRef Arch,
  27. const llvm::Triple &Triple);
  28. StringRef getLLVMArchSuffixForARM(llvm::StringRef CPU, llvm::StringRef Arch,
  29. const llvm::Triple &Triple);
  30. void appendBE8LinkFlag(const llvm::opt::ArgList &Args,
  31. llvm::opt::ArgStringList &CmdArgs,
  32. const llvm::Triple &Triple);
  33. enum class ReadTPMode {
  34. Invalid,
  35. Soft,
  36. Cp15,
  37. };
  38. enum class FloatABI {
  39. Invalid,
  40. Soft,
  41. SoftFP,
  42. Hard,
  43. };
  44. FloatABI getDefaultFloatABI(const llvm::Triple &Triple);
  45. FloatABI getARMFloatABI(const ToolChain &TC, const llvm::opt::ArgList &Args);
  46. FloatABI getARMFloatABI(const Driver &D, const llvm::Triple &Triple,
  47. const llvm::opt::ArgList &Args);
  48. void setFloatABIInTriple(const Driver &D, const llvm::opt::ArgList &Args,
  49. llvm::Triple &triple);
  50. bool isHardTPSupported(const llvm::Triple &Triple);
  51. ReadTPMode getReadTPMode(const Driver &D, const llvm::opt::ArgList &Args,
  52. const llvm::Triple &Triple, bool ForAS);
  53. void setArchNameInTriple(const Driver &D, const llvm::opt::ArgList &Args,
  54. types::ID InputType, llvm::Triple &Triple);
  55. bool useAAPCSForMachO(const llvm::Triple &T);
  56. void getARMArchCPUFromArgs(const llvm::opt::ArgList &Args,
  57. llvm::StringRef &Arch, llvm::StringRef &CPU,
  58. bool FromAs = false);
  59. void getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple,
  60. const llvm::opt::ArgList &Args,
  61. llvm::opt::ArgStringList &CmdArgs,
  62. std::vector<llvm::StringRef> &Features, bool ForAS);
  63. int getARMSubArchVersionNumber(const llvm::Triple &Triple);
  64. bool isARMMProfile(const llvm::Triple &Triple);
  65. bool isARMAProfile(const llvm::Triple &Triple);
  66. } // end namespace arm
  67. } // end namespace tools
  68. } // end namespace driver
  69. } // end namespace clang
  70. #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_ARM_H