From 12ebb47f2aeb66470a37ba8f02b467f0bcdd1ed1 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Sat, 19 Dec 2015 01:48:43 +0000 Subject: [PATCH] Use a command line alias to remove the need to rewrite a subtarget feature for command line compatibility. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256076 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Driver/Options.td | 6 ++++-- lib/Driver/Tools.cpp | 8 -------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 1bcc060417..ba65203f5e 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -1414,8 +1414,10 @@ def mcmpb : Flag<["-"], "mcmpb">, Group; def mno_cmpb : Flag<["-"], "mno-cmpb">, Group; def misel : Flag<["-"], "misel">, Group; def mno_isel : Flag<["-"], "mno-isel">, Group; -def mmfcrf : Flag<["-"], "mmfcrf">, Group; -def mno_mfcrf : Flag<["-"], "mno-mfcrf">, Group; +def mmfocrf : Flag<["-"], "mmfocrf">, Group; +def mmfcrf : Flag<["-"], "mmfcrf">, Alias; +def mno_mfocrf : Flag<["-"], "mno-mfocrf">, Group; +def mno_mfcrf : Flag<["-"], "mno-mfcrf">, Alias; def mpopcntd : Flag<["-"], "mpopcntd">, Group; def mno_popcntd : Flag<["-"], "mno-popcntd">, Group; def mqpx : Flag<["-"], "mqpx">, Group; diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index a86308d9c3..042a0ff266 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1421,14 +1421,6 @@ static void getPPCTargetFeatures(const Driver &D, const llvm::Triple &Triple, bool IsNegative = Name.startswith("no-"); if (IsNegative) Name = Name.substr(3); - - // Note that gcc calls this mfcrf and LLVM calls this mfocrf so we - // pass the correct option to the backend while calling the frontend - // option the same. - // TODO: Change the LLVM backend option maybe? - if (Name == "mfcrf") - Name = "mfocrf"; - Features.push_back(Args.MakeArgString((IsNegative ? "-" : "+") + Name)); } -- 2.40.0