[llvm] [TableGen] Add PrintError family overload that take a print function (PR #107333)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 5 08:27:29 PDT 2024
================
@@ -1600,18 +1601,13 @@ static TreePatternNode &getOperandNum(unsigned OpNo, TreePatternNode &N,
return N;
}
- OpNo -= NumResults;
-
- if (OpNo >= N.getNumChildren()) {
- std::string S;
- raw_string_ostream OS(S);
- OS << "Invalid operand number in type constraint " << (OpNo + NumResults)
- << " ";
- N.print(OS);
- PrintFatalError(S);
+ if (OpNo - NumResults >= N.getNumChildren()) {
+ PrintFatalError([&N, OpNo](raw_ostream &OS) {
+ OS << formatv("Invalid operand number {0} in type constraint ", OpNo);
----------------
jurahul wrote:
Done.
https://github.com/llvm/llvm-project/pull/107333
More information about the llvm-commits
mailing list