From: Argyrios Kyrtzidis Date: Thu, 10 Jul 2014 01:03:37 +0000 (+0000) Subject: [Driver] Expose getARMCPUForMArch() function in the Driver API; NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a478bb991a24b3cea8779bf91064f948a7edf920;p=clang [Driver] Expose getARMCPUForMArch() function in the Driver API; NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212666 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Util.h b/include/clang/Driver/Util.h index b24b9904f2..c671ca47a2 100644 --- a/include/clang/Driver/Util.h +++ b/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/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 0d601a6bcd..8fc3525d44 100644 --- a/lib/Driver/Tools.cpp +++ b/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")