[TableGen][NFC] Remove unreachable code
authorwangpc <wangpengcheng.pp@bytedance.com>
Thu, 20 Jul 2023 07:16:21 +0000 (15:16 +0800)
committerwangpc <wangpengcheng.pp@bytedance.com>
Thu, 20 Jul 2023 07:24:09 +0000 (15:24 +0800)
The removed code assumed that we can define classes inside a multiclass,
so the name of outer multiclass is concatenated to the qualified name.
But for current TableGen grammar, we can't define classes in multiclass,
so it is unnecessary.

This commit is requested in D152998.

llvm/lib/TableGen/TGParser.cpp

index 6935f6e..c9d6230 100644 (file)
@@ -117,11 +117,6 @@ static Init *QualifyName(Record &CurRec, MultiClass *CurMultiClass, Init *Name,
   Init *NewName = BinOpInit::getStrConcat(CurRec.getNameInit(),
                                           StringInit::get(RK, Scoper));
   NewName = BinOpInit::getStrConcat(NewName, Name);
-  if (CurMultiClass && Scoper != "::") {
-    Init *Prefix = BinOpInit::getStrConcat(CurMultiClass->Rec.getNameInit(),
-                                           StringInit::get(RK, "::"));
-    NewName = BinOpInit::getStrConcat(Prefix, NewName);
-  }
 
   if (BinOpInit *BinOp = dyn_cast<BinOpInit>(NewName))
     NewName = BinOp->Fold(&CurRec);