[llvm] [LLVM-Tablegen] Pretty Printing Arguments in LLVM Intrinsics (PR #162629)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 4 10:37:51 PST 2025
================
@@ -447,6 +447,29 @@ void CodeGenIntrinsic::setProperty(const Record *R) {
int64_t Lower = R->getValueAsInt("Lower");
int64_t Upper = R->getValueAsInt("Upper");
addArgAttribute(ArgNo, Range, Lower, Upper);
+ } else if (R->isSubClassOf("ArgInfo")) {
+ unsigned ArgNo = R->getValueAsInt("ArgNo");
+ if (ArgNo < 1)
+ PrintFatalError(R->getLoc(),
+ "ArgInfo requires ArgNo >= 1 (0 is return value)");
+ const ListInit *Properties = R->getValueAsListInit("Properties");
+ StringRef ArgName;
+ StringRef FuncName;
+
+ for (const Init *PropInit : Properties->getElements()) {
----------------
jurahul wrote:
In a follow up PR, it may be good to add some error checking here to make sure duplicate properties are flagged.
https://github.com/llvm/llvm-project/pull/162629
More information about the llvm-commits
mailing list