forked from OSchip/llvm-project
llvm::Function argument count is not a good indicator of how many arugments does the function have at source level. If we need more space, just resize vector conservatively. This vector is only used once per function.
llvm-svn: 126957
This commit is contained in:
parent
7e200664f6
commit
4ab660b077
|
@ -2330,8 +2330,11 @@ bool DwarfDebug::addCurrentFnArgument(const MachineFunction *MF,
|
||||||
if (ArgNo == 0)
|
if (ArgNo == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (CurrentFnArguments.size() == 0)
|
size_t Size = CurrentFnArguments.size();
|
||||||
|
if (Size == 0)
|
||||||
CurrentFnArguments.resize(MF->getFunction()->arg_size());
|
CurrentFnArguments.resize(MF->getFunction()->arg_size());
|
||||||
|
else if (ArgNo > Size)
|
||||||
|
CurrentFnArguments.resize(ArgNo * 2);
|
||||||
CurrentFnArguments[ArgNo - 1] = Var;
|
CurrentFnArguments[ArgNo - 1] = Var;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue