[PATCH] D119147: [AIX][clang][driver] Check the command string to the linker for exportlist opts and
    Digger Lin via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Wed Apr 20 12:01:43 PDT 2022
    
    
  
DiggerLin added inline comments.
================
Comment at: clang/lib/Driver/ToolChains/AIX.cpp:80
+static bool hasExportListLinkerOpts(const ArgStringList &CmdArgs) {
+  for (size_t i = 0, Size = CmdArgs.size(); i < Size; ++i) {
+    llvm::StringRef ArgString(CmdArgs[i]);
----------------
stevewan wrote:
> Since `!=` is preferred, let's switch to that.
I do not think there is a benefit "i != Size" over "i < Size" ,https://llvm.org/docs/CodingStandards.html#don-t-evaluate-end-every-time-through-a-loop 
I use the Size = CmdArgs.size() to avoid  the evaluating the CmdArgs.size() every time through a loop.
================
Comment at: clang/lib/Driver/ToolChains/AIX.cpp:88
+    // If we split -b option, check the next opt.
+    if (ArgString == "-b" && i + 1 < CmdArgs.size()) {
+      ++i;
----------------
stevewan wrote:
> 
thanks
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119147/new/
https://reviews.llvm.org/D119147
    
    
More information about the cfe-commits
mailing list