[llvm] r182062 - Generate debug info for by-value struct args even if they are not used.
Bob Wilson
bob.wilson at apple.com
Fri May 17 12:56:34 PDT 2013
On May 17, 2013, at 12:48 PM, Eric Christopher <echristo at gmail.com> wrote:
> On Fri, May 17, 2013 at 12:35 PM, Bob Wilson <bob.wilson at apple.com> wrote:
>>
>> On May 16, 2013, at 4:44 PM, Adrian Prantl <aprantl at apple.com> wrote:
>>
>>> Author: adrian
>>> Date: Thu May 16 18:44:12 2013
>>> New Revision: 182062
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=182062&view=rev
>>> Log:
>>> Generate debug info for by-value struct args even if they are not used.
>>> radar://problem/13865940
>>>
>>> Added:
>>> llvm/trunk/test/DebugInfo/X86/byvalstruct.ll
>>> Modified:
>>> llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
>>>
>>> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=182062&r1=182061&r2=182062&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
>>> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Thu May 16 18:44:12 2013
>>> @@ -6753,9 +6753,15 @@ void SelectionDAGISel::LowerArguments(co
>>>
>>> // If this argument is unused then remember its value. It is used to generate
>>> // debugging information.
>>> - if (I->use_empty() && NumValues)
>>> + if (I->use_empty() && NumValues) {
>>> SDB->setUnusedArgValue(I, InVals[i]);
>>>
>>> + // Also remember any frame index for use in FastISel.
>>> + if (FrameIndexSDNode *FI =
>>> + dyn_cast<FrameIndexSDNode>(InVals[i].getNode()))
>>> + FuncInfo->setArgumentFrameIndex(I, FI->getIndex());
>>> + }
>>
>> dyn_cast may return 0 if the type does not match, yet you're unconditionally dereferencing the result. If you're sure of the type, it should just be a regular cast.
>
> Looks like it's under the conditional no?
Oh, you're right. I missed that (obviously). Sorry for the noise.
More information about the llvm-commits
mailing list