Translate -mcmodel=X to -code-model X and pass it to clang-cc. Patch by Pawel Worach!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78190 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Driver/Options.def b/include/clang/Driver/Options.def
index 406e62d..4632722 100644
--- a/include/clang/Driver/Options.def
+++ b/include/clang/Driver/Options.def
@@ -503,6 +503,7 @@
OPTION("-m3dnow", m3dnow, Flag, m_x86_Features_Group, INVALID, "", 0, 0, 0)
OPTION("-m64", m64, Flag, m_Group, INVALID, "d", 0, 0, 0)
OPTION("-march=", march_EQ, Joined, m_Group, INVALID, "d", 0, 0, 0)
+OPTION("-mcmodel=", mcmodel_EQ, Joined, m_Group, INVALID, "d", 0, 0, 0)
OPTION("-mconstant-cfstrings", mconstant_cfstrings, Flag, clang_ignored_m_Group, INVALID, "", 0, 0, 0)
OPTION("-mdynamic-no-pic", mdynamic_no_pic, Joined, m_Group, INVALID, "q", 0, 0, 0)
OPTION("-mfix-and-continue", mfix_and_continue, Flag, clang_ignored_m_Group, INVALID, "", 0, 0, 0)
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 69fc722..64ed0e8 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -367,6 +367,11 @@
}
}
+ if (Arg *A = Args.getLastArg(options::OPT_mcmodel_EQ)) {
+ CmdArgs.push_back("-code-model");
+ CmdArgs.push_back(A->getValue(Args));
+ }
+
// FIXME: Use iterator.
for (ArgList::const_iterator
it = Args.begin(), ie = Args.end(); it != ie; ++it) {