[LLVMdev] LLVMBuilder vs LLVMFoldingBuilder

Gordon Henriksen gordonhenriksen at mac.com
Sat Apr 12 21:45:42 PDT 2008


On 2008-04-12, at 03:10, Dominic Hamon wrote:

> The only changes that I'm not 100% happy with are the  
> ShadowStackCollector changes. The code will currently assert if the  
> BasePtr passed in to the ShadowStackCollector is a constant as the  
> GEP will be a constant.


These utilities are only ever used with AllocaInst*'s; your assertion  
and dyn_cast are respectively dead and unnecessary. Please try  
dropping the dyn_cast and the dead assertion in favor of just relaxing  
the return type:

-    static GetElementPtrInst *CreateGEP(LLVMBuilder &B, Value *BasePtr,
+    static Value *CreateGEP(IRBuilder &B, Value *BasePtr,

— Gordon





More information about the llvm-dev mailing list