[llvm-commits] [llvm] r140277 - /llvm/trunk/lib/CodeGen/ShadowStackGC.cpp

Bill Wendling wendling at apple.com
Thu Sep 22 10:58:28 PDT 2011


\
On Sep 22, 2011, at 1:02 AM, Duncan Sands wrote:

> Hi Bill,
> 
>> Attempt to update the shadow stack GC pass to the new EH model.
>> 
>> This inserts a cleanup landingpad instruction and a resume to mimic the old
>> unwind instruction.
> 
>> --- llvm/trunk/lib/CodeGen/ShadowStackGC.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/ShadowStackGC.cpp Wed Sep 21 17:14:28 2011
>> @@ -141,9 +141,21 @@
>>            return 0;
>> 
>>          // Create a cleanup block.
>> -        BasicBlock *CleanupBB = BasicBlock::Create(F.getContext(),
>> -                                                   CleanupBBName,&F);
>> -        UnwindInst *UI = new UnwindInst(F.getContext(), CleanupBB);
>> +        LLVMContext&C = F.getContext();
>> +        BasicBlock *CleanupBB = BasicBlock::Create(C, CleanupBBName,&F);
>> +        Type *ExnTy = StructType::get(Type::getInt8PtrTy(C),
>> +                                      Type::getInt32Ty(C), NULL);
>> +        // FIXME: Assuming the C++ personality function probably isn't the best
>> +        //        thing in the world.
>> +        Constant *PersFn =
>> +          F.getParent()->
>> +          getOrInsertFunction("__gxx_personality_v0",
> 
> you should use the C personality function.  It can handle cleanups and is
> provided by libgcc.  It's called __gcc_personality_v0.
> 
Done. Thanks! :-)

-bw





More information about the llvm-commits mailing list