[PATCH] D44921: [PowerPC] Option for secure plt mode

Strahinja Petrovic via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 28 03:46:18 PDT 2018


spetrovic added inline comments.


================
Comment at: include/clang/Driver/Options.td:1941
 def mno_vsx : Flag<["-"], "mno-vsx">, Group<m_ppc_Features_Group>;
+def msecure_plt : Flag<["-"], "msecure-plt">, Group<m_ppc_Features_Group>;
 def mpower8_vector : Flag<["-"], "mpower8-vector">,
----------------
nemanjai wrote:
> Do we not want the negated option?
Well, I'm not sure if we need negated option. This is just switch from default mode (BSS) to SECURE PLT mode, also I didn't see that gcc has negated option for SECURE-PLT.


================
Comment at: lib/Driver/ToolChains/Arch/PPC.cpp:116
+ppc::ReadGOTPtrMode ppc::getPPCReadGOTPtrMode(const Driver &D, const ArgList &Args) {
+  ppc::ReadGOTPtrMode ReadGOT = ppc::ReadGOTPtrMode::Bss;
+  if (Args.getLastArg(options::OPT_msecure_plt))
----------------
nemanjai wrote:
> Just a style question out of curiosity. Why the temporary? Since there are just two possible values, why not just return the respective enumerator?
You are right, we don't need the temporary.


https://reviews.llvm.org/D44921





More information about the cfe-commits mailing list