[llvm-commits] [llvm] r58673 - in /llvm/trunk: include/llvm/CodeGen/Passes.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/StackProtector.cpp

Chris Lattner clattner at apple.com
Thu Nov 6 10:24:55 PST 2008


On Nov 4, 2008, at 11:44 AM, Bill Wendling wrote:
> On Tue, Nov 4, 2008 at 10:13 AM, Dan Gohman <gohman at apple.com> wrote:
>> On Nov 4, 2008, at 10:06 AM, Evan Cheng wrote:
>>> On Nov 4, 2008, at 5:28 AM, Chris Lattner wrote:
>>>>
>>>>
>>>>> +  StackProtFrameSlot = new
>>>>> AllocaInst(PointerType::getUnqual(Type::Int8Ty),
>>>>> +                                      "StackProt_Frame",
>>>>> &InsertPt);
>>>>
>>>> What ensures that this alloca ends up in the right place in the  
>>>> stack
>>>> frame at codegen time?
>>>
>>> This is unclear.Can we give it a special name that starts with "__"
>>> and sdisel will mark the corresponding stack object. PEI will have  
>>> to
>>> make sure it's in the right location. I don't particularly like it  
>>> but
>>> I can't think of anything better. Any ideas?
>>
>> Names aren't always preserved. How about replacing the Alloca with
>> an intrinsic that does the allocation?
>>
> I'm not sure that that's necessary. It should be possible to keep
> track of the alloca instruction from this pass through code gen. Once
> it's lowered, then I'll know what FI it's at, etc. Then PEI can
> perform its magic.

Good idea, how about something like this:

%tmp = alloca ...
call llvm.makestackcanary(%tmp)

?  A better name is prefered :)

-Chris



More information about the llvm-commits mailing list