[PATCH] D107331: [NFC] [llvm-ar] Change use of empty to fix test on AIX

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 02:13:25 PDT 2021


qiucf created this revision.
qiucf added reviewers: nemanjai, jsji, MaskRay, hubert.reinterpretcast, abhina.sreeskantharajan, sbc100.
Herald added a subscriber: rupprecht.
qiucf requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is a workaround for building LLVM/Clang using XL compiler on AIX.

Due to internal bug in the compiler, `Filter` here will be wrongly evaluated in later `if` statement. Several tests are failing:

  LLVM :: Object/archive-extract.test
  LLVM :: Object/check_binary_output.ll
  LLVM :: tools/llvm-ar/full-path-option.test
  LLVM :: tools/llvm-ar/count.test
  LLVM :: tools/llvm-ar/print.test
  LLVM :: tools/llvm-ar/extract.test
  LLVM :: tools/llvm-ar/absolute-paths.test
  LLVM :: tools/llvm-ar/path-names.test
  LLVM :: tools/llvm-ar/response-utf8.test

We're investigating about the reason. Currently this fix will make it work properly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107331

Files:
  llvm/tools/llvm-ar/llvm-ar.cpp


Index: llvm/tools/llvm-ar/llvm-ar.cpp
===================================================================
--- llvm/tools/llvm-ar/llvm-ar.cpp
+++ llvm/tools/llvm-ar/llvm-ar.cpp
@@ -602,7 +602,7 @@
   if (Operation == Extract && OldArchive->isThin())
     fail("extracting from a thin archive is not supported");
 
-  bool Filter = !Members.empty();
+  bool Filter = Members.size() != 0;
   StringMap<int> MemberCount;
   {
     Error Err = Error::success();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107331.363655.patch
Type: text/x-patch
Size: 457 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210803/6ba19ec5/attachment.bin>


More information about the llvm-commits mailing list