[llvm] [TableGen] Support type aliases via new keyword deftype (PR #79570)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 23:03:22 PST 2024


================
@@ -1103,11 +1103,17 @@ RecTy *TGParser::ParseType() {
   case tgtok::Dag:
     Lex.Lex();
     return DagRecTy::get(Records);
-  case tgtok::Id:
+  case tgtok::Id: {
+    const std::string TypeName = Lex.getCurStrVal();
+    if (TypeAliases.count(TypeName)) {
----------------
topperc wrote:

Should we use `find` here to avoid a second lookup for the return?

https://github.com/llvm/llvm-project/pull/79570


More information about the llvm-commits mailing list