https://bugs.llvm.org/show_bug.cgi?id=50596

            Bug ID: 50596
           Summary: TGParser::ParseForeachDeclaration - dead code
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: TableGen
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

TGParser::ParseForeachDeclaration breaks early if TI is non-null, but we have
(dead) code later that uses it as part of an error message.

@arsenm - this looks like it was introduced in rGb79a25b12437

  default: {
    SMLoc ValueLoc = Lex.getLoc();
    Init *I = ParseValue(nullptr);
    if (!I)
      return nullptr;

    TypedInit *TI = dyn_cast<TypedInit>(I);
    if (TI && isa<ListRecTy>(TI->getType())) {
      ForeachListValue = I;
      IterType = cast<ListRecTy>(TI->getType())->getElementType();
      break;
    }

    if (TI) {
      if (ParseRangePiece(Ranges, TI))
        return nullptr;
      break;
    }

    std::string Type;
    if (TI)
      Type = (Twine("' of type '") + TI->getType()->getAsString()).str();
    Error(ValueLoc, "expected a list, got '" + I->getAsString() + Type + "'");
    if (CurMultiClass) {
      PrintNote({}, "references to multiclass template arguments cannot be "
                "resolved at this time");
    }
    return nullptr;
  }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to