search for: 6f93d3d9

Displaying 2 results from an estimated 2 matches for "6f93d3d9".

2013 Aug 22
2
[LLVMdev] Crash in CreateShl() method
Hi All, AllocaInst * AI = builder.CreateAlloca(type, 0, BBName); StoreInst* ST= builderTF.CreateStore(ConstantInt::get(type,1),AI); Value * Vresult = (Value*)ST; Vresult = builderWait.CreateShl(Vresult, 1); I need to make one bit shift left to the variable stored in the second step I've got crash in this step opt: /home/xx/llvm2/llvm/include/llvm/Support/Casting.h:237: typename
2013 Aug 22
0
[LLVMdev] Crash in CreateShl() method
> How could this crash be fixed? What you've basically written is: %AI = alloca i32 %Vresult = store i32 1, i32* %AI %res = shl i32 %Vresult, 1 The problem is that stores don't produce values that can be used elsewhere (they have type "void"). If you want to shift a variable like "AI" in LLVM you have to load it, do the shift and then store it again.