[PATCH] D145146: [Driver][NFC] Remove some redundant code in Driver.cpp.

WangLian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 2 00:56:57 PST 2023


Jimerlife created this revision.
Jimerlife added reviewers: phosek, kazu, abrachet.
Jimerlife added a project: LLVM.
Herald added a project: All.
Jimerlife requested review of this revision.
Herald added subscribers: cfe-commits, jacquesguan, MaskRay.
Herald added a project: clang.

`options::OPT_target` has been done in `Driver::BuildCompilation`, so I think this part of code is redundant.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145146

Files:
  clang/lib/Driver/Driver.cpp


Index: clang/lib/Driver/Driver.cpp
===================================================================
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -527,10 +527,6 @@
                                         StringRef TargetTriple,
                                         const ArgList &Args,
                                         StringRef DarwinArchName = "") {
-  // FIXME: Already done in Compilation *Driver::BuildCompilation
-  if (const Arg *A = Args.getLastArg(options::OPT_target))
-    TargetTriple = A->getValue();
-
   llvm::Triple Target(llvm::Triple::normalize(TargetTriple));
 
   // GNU/Hurd's triples should have been -hurd-gnu*, but were historically made


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145146.501780.patch
Type: text/x-patch
Size: 699 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230302/c4f2b31b/attachment.bin>


More information about the cfe-commits mailing list