[PATCH] D103904: [TableGen] Eliminate dead code in ParseForeachDeclaration [NFC]

Paul C. Anagnostopoulos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 8 08:55:33 PDT 2021


Paul-C-Anagnostopoulos created this revision.
Paul-C-Anagnostopoulos added a reviewer: RKSimon.
Herald added a subscriber: hiraditya.
Paul-C-Anagnostopoulos requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This little patch eliminates some dead code in ParseForEachDeclaration. It tested the TI variable for non-null, but after the function already returned on non-null.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103904

Files:
  llvm/lib/TableGen/TGParser.cpp


Index: llvm/lib/TableGen/TGParser.cpp
===================================================================
--- llvm/lib/TableGen/TGParser.cpp
+++ llvm/lib/TableGen/TGParser.cpp
@@ -2787,10 +2787,7 @@
       break;
     }
 
-    std::string Type;
-    if (TI)
-      Type = (Twine("' of type '") + TI->getType()->getAsString()).str();
-    Error(ValueLoc, "expected a list, got '" + I->getAsString() + Type + "'");
+    Error(ValueLoc, "expected a list, got '" + I->getAsString() + "'");
     if (CurMultiClass) {
       PrintNote({}, "references to multiclass template arguments cannot be "
                 "resolved at this time");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103904.350620.patch
Type: text/x-patch
Size: 633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210608/710602b6/attachment.bin>


More information about the llvm-commits mailing list