mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 00:55:49 +03:00
Support generic ldc.attributes.llvmAttr UDAs for function parameters
This commit is contained in:
parent
1fdf330346
commit
cc336d6df1
5 changed files with 96 additions and 51 deletions
|
@ -121,7 +121,7 @@ static void addExplicitArguments(std::vector<LLValue *> &args, AttrSet &attrs,
|
|||
const size_t formalLLArgCount = irFty.args.size();
|
||||
|
||||
// Number of formal arguments in the D call expression (excluding varargs).
|
||||
const int formalDArgCount = Parameter::dim(formalParams);
|
||||
const size_t formalDArgCount = Parameter::dim(formalParams);
|
||||
|
||||
// The number of explicit arguments in the D call expression (including
|
||||
// varargs), not all of which necessarily generate a LLVM argument.
|
||||
|
@ -167,8 +167,10 @@ static void addExplicitArguments(std::vector<LLValue *> &args, AttrSet &attrs,
|
|||
|
||||
// Make sure to evaluate argument expressions for which there's no LL
|
||||
// parameter (e.g., empty structs for some ABIs).
|
||||
for (; dArgIndex < irArg->parametersIdx; ++dArgIndex) {
|
||||
toElem(argexps[dArgIndex]);
|
||||
if (irArg->parametersIdx < formalDArgCount) {
|
||||
for (; dArgIndex < irArg->parametersIdx; ++dArgIndex) {
|
||||
toElem(argexps[dArgIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
Expression *const argexp = argexps[dArgIndex];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue