[PATCH] D95259: [RGT][TextAPI] Remove a zero-trip loop and the assertions within it

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 12:17:39 PST 2021


probinson created this revision.
probinson added a reviewer: cishida.
probinson requested review of this revision.
Herald added a project: LLVM.

Found by the Rotten Green Tests project.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95259

Files:
  llvm/unittests/TextAPI/TextStubV4Tests.cpp


Index: llvm/unittests/TextAPI/TextStubV4Tests.cpp
===================================================================
--- llvm/unittests/TextAPI/TextStubV4Tests.cpp
+++ llvm/unittests/TextAPI/TextStubV4Tests.cpp
@@ -255,18 +255,9 @@
                             {Targets[0], Targets[2]});
   EXPECT_EQ(1U, File->reexportedLibraries().size());
   EXPECT_EQ(reexport, File->reexportedLibraries().front());
-  ExportedSymbolSeq Exports;
-  for (const auto *Sym : File->symbols()) {
-    EXPECT_FALSE(Sym->isWeakReferenced());
-    EXPECT_FALSE(Sym->isUndefined());
-    Exports.emplace_back(ExportedSymbol{Sym->getKind(), Sym->getName().str(),
-                                        Sym->isWeakDefined(),
-                                        Sym->isThreadLocalValue()});
-  }
-  EXPECT_EQ(0U, Exports.size());
+  EXPECT_TRUE(File->symbols().empty());
 
   // Check Inlined Document
-  Exports.clear();
   Targets.clear();
   Uuids.clear();
   PlatformKind Platform = PlatformKind::macOS;
@@ -292,6 +283,7 @@
   EXPECT_TRUE(Document->isApplicationExtensionSafe());
   EXPECT_FALSE(Document->isInstallAPI());
 
+  ExportedSymbolSeq Exports;
   ExportedSymbolSeq Reexports, Undefineds;
   for (const auto *Sym : Document->symbols()) {
     ExportedSymbol Temp =


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95259.318608.patch
Type: text/x-patch
Size: 1262 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210122/df8166e4/attachment.bin>


More information about the llvm-commits mailing list