[llvm-commits] Enhance C bindings with volatile load/store

Chris Lattner clattner at apple.com
Wed Mar 21 20:59:32 PDT 2012


On Feb 25, 2012, at 4:40 AM, Yiannis Tsiouris wrote:

> 
>> This is close, but won't quite work.  I'd suggest something along the lines of:
>> 
>>  Value *P = unwrap<Value>(MemAccessInst);
>>  if (LoadInst *LI = dyn_cast<LoadInst>(P))
>>    return LI->isVolatile();
>>  return cast<StoreInst>(P)->isVolatile();
>> 
>> The important thing here is that "unwrap" crashes if passed something of the wrong type.
>> 
>> -Chris
>> 
> Hi Chris,
> 
> Thanks for the hints! The attached patch does it the "proper" way. :-)

Applied in r153238, thanks!

-Chris



More information about the llvm-commits mailing list