[llvm] [Tablegen] Add keywork `dump`. (PR #68793)
Francesco Petrogalli via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 12 01:43:03 PDT 2023
================
@@ -4359,3 +4390,27 @@ LLVM_DUMP_METHOD void MultiClass::dump() const {
E.dump();
}
#endif
+
+bool TGParser::ParseDump(MultiClass *CurMultiClass, Record *CurRec) {
+ assert(Lex.getCode() == tgtok::Dump && "Unknown tok");
+ Lex.Lex(); // eat the operation
+
+ Init *Message = ParseValue(CurRec);
+ if (!Message)
+ return true;
+
+ std::string Msg;
+ if (auto SI = dyn_cast<StringInit>(Message))
+ Msg = SI->getValue();
+
+ if (!consume(tgtok::semi))
+ return TokError("expected ';'");
+
+ SMLoc Loc = Lex.getLoc();
----------------
fpetrogalli wrote:
Done - I have checked the lines in the tests.
https://github.com/llvm/llvm-project/pull/68793
More information about the llvm-commits
mailing list