When the function contains variable size objects:
E.g.
bar (int x)
{
char p[x]; push outgoing variables for foo. call foo
}
We need to generate stack adjustment instructions for outgoing arguments by
eliminateCallFramePseudoInstr when the function contains variable size
objects to avoid outgoing variables corrupt the variable size object.
Default hasReservedCallFrame will return !hasFP().
We don't want to generate extra sp adjustment instructions when hasFP()
return true, So We override hasReservedCallFrame as !hasVarSizedObjects().
I don't think copy+pasting the description from TargetFrameLowering.h adds much. It would be better to explain what is different about the RISC-V implementation (which is presumably that fact that there is no reserved call frame when there are varsized objects).
I know this is copied from elsewhere in LLVM, but also note that current guidance for Doxygen comments in LLVM is _not_ to repeat the function name at the beginning of the comment https://llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments