Skip to content

Commit

Permalink
Add VarArgs index
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Symalla committed Dec 3, 2024
1 parent deaefdb commit 23b2983
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/TableGen/Operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ void OperationBase::emitArgumentAccessorDeclarations(llvm::raw_ostream &out,

const bool isVarArg = arg.type->isVarArgList();

if (!isVarArg)
argNames.push_back(capitalizedArgName);
argNames.push_back(capitalizedArgName + (isVarArg ? "Start" : ""));

std::string defaultDeclaration = "$0 get$1() $2;";

Expand Down
5 changes: 4 additions & 1 deletion test/example/generated/ExampleDialect.h.inc
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@ bool verifier(::llvm::raw_ostream &errs);
/// Returns a new op with the same arguments and a new tail argument list.
/// The object on which this is called will be replaced and erased.
InstNameConflictVarargsOp *replaceInstName_0(::llvm::ArrayRef<Value *>);

enum class ArgumentIndex: uint32_t {
InstName_0Start = 0,
};
::llvm::Value * getResult();


Expand Down Expand Up @@ -648,6 +650,7 @@ bool verifier(::llvm::raw_ostream &errs);
WriteVarArgOp *replaceArgs(::llvm::ArrayRef<Value *>);
enum class ArgumentIndex: uint32_t {
Data = 0,
ArgsStart = 1,
};


Expand Down

0 comments on commit 23b2983

Please sign in to comment.