diff --git a/clang/include/clang/Driver/Util.h b/clang/include/clang/Driver/Util.h index b24b9904f2b5..c671ca47a27f 100644 --- a/clang/include/clang/Driver/Util.h +++ b/clang/include/clang/Driver/Util.h @@ -13,6 +13,10 @@ #include "clang/Basic/LLVM.h" #include "llvm/ADT/DenseMap.h" +namespace llvm { + class Triple; +} + namespace clang { class DiagnosticsEngine; @@ -26,6 +30,9 @@ namespace driver { /// ActionList - Type used for lists of actions. typedef SmallVector ActionList; +/// Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting. +const char* getARMCPUForMArch(StringRef MArch, const llvm::Triple &Triple); + } // end namespace driver } // end namespace clang diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 0d601a6bcdf0..8fc3525d445d 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -5025,9 +5025,6 @@ void hexagon::Link::ConstructJob(Compilation &C, const JobAction &JA, } // Hexagon tools end. -/// getARMCPUForMArch - Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting -// -// FIXME: tblgen this. const char *arm::getARMCPUForMArch(const ArgList &Args, const llvm::Triple &Triple) { StringRef MArch; @@ -5049,6 +5046,14 @@ const char *arm::getARMCPUForMArch(const ArgList &Args, } } + return driver::getARMCPUForMArch(MArch, Triple); +} + +/// Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting. +// +// FIXME: tblgen this. +const char *driver::getARMCPUForMArch(StringRef MArch, + const llvm::Triple &Triple) { switch (Triple.getOS()) { case llvm::Triple::NetBSD: if (MArch == "armv6")