summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Arch/SystemZ.cpp
diff options
context:
space:
mode:
authorDavid L. Jones <dlj@google.com>2017-02-24 00:28:01 +0000
committerDavid L. Jones <dlj@google.com>2017-02-24 00:28:01 +0000
commitecc6de35fba933b1081a7847b3687f2e99b3e34c (patch)
tree0d52b76a397f2f0c1aad6535e4c73273a37d06ee /clang/lib/Driver/Arch/SystemZ.cpp
parent3e0c0688e994efe9a7d6cb302b36d88b0d77b283 (diff)
downloadbcm5719-llvm-ecc6de35fba933b1081a7847b3687f2e99b3e34c.tar.gz
bcm5719-llvm-ecc6de35fba933b1081a7847b3687f2e99b3e34c.zip
[Driver] Move architecture-specific free helper functions to their own files.
This patch moves helper functions that are CPU-specific out of Driver.cpp and to separate implementation files. The new files are named for the architecture, e.g. ARMArch.cpp. The next step after this will be to move OS-specific code, which I expect will include many of the tool implementations, to similarly separate files. Some CPU-specific functions are not being moved just yet. In cases where the only caller is the platform-specific tools, I plan to move them together. An example is Hexagon, where the only caller of the architecture-specific functions are the tools themselves. (I'm happy to revise this choice, it just seems like less churn to me.) This does mean that some functions which were previously static are now exposed through the library header Driver.h. Reviewers: rsmith, javed.absar Subscribers: aemerson, danalbert, srhines, dschuff, jyknight, nemanjai, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D30315 llvm-svn: 296056
Diffstat (limited to 'clang/lib/Driver/Arch/SystemZ.cpp')
-rw-r--r--clang/lib/Driver/Arch/SystemZ.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/clang/lib/Driver/Arch/SystemZ.cpp b/clang/lib/Driver/Arch/SystemZ.cpp
new file mode 100644
index 00000000000..d9c45775819
--- /dev/null
+++ b/clang/lib/Driver/Arch/SystemZ.cpp
@@ -0,0 +1,41 @@
+//===--- SystemZ.cpp - SystemZ Helpers for Tools ----------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "Tools.h"
+#include "clang/Driver/Options.h"
+#include "llvm/Option/ArgList.h"
+
+using namespace clang::driver;
+using namespace clang::driver::tools;
+using namespace clang;
+using namespace llvm::opt;
+
+const char *systemz::getSystemZTargetCPU(const ArgList &Args) {
+ if (const Arg *A = Args.getLastArg(clang::driver::options::OPT_march_EQ))
+ return A->getValue();
+ return "z10";
+}
+
+void systemz::getSystemZTargetFeatures(const ArgList &Args,
+ std::vector<StringRef> &Features) {
+ // -m(no-)htm overrides use of the transactional-execution facility.
+ if (Arg *A = Args.getLastArg(options::OPT_mhtm, options::OPT_mno_htm)) {
+ if (A->getOption().matches(options::OPT_mhtm))
+ Features.push_back("+transactional-execution");
+ else
+ Features.push_back("-transactional-execution");
+ }
+ // -m(no-)vx overrides use of the vector facility.
+ if (Arg *A = Args.getLastArg(options::OPT_mvx, options::OPT_mno_vx)) {
+ if (A->getOption().matches(options::OPT_mvx))
+ Features.push_back("+vector");
+ else
+ Features.push_back("-vector");
+ }
+}
OpenPOWER on IntegriCloud