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:
Devang Patel 2011-03-03 20:02:02 +00:00
parent 7e200664f6
commit 4ab660b077
1 changed files with 4 additions and 1 deletions

View File

@ -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;
} }