[LLVMdev] Crash in CreateShl() method
Tim Northover
t.p.northover at gmail.com
Wed Aug 21 23:58:46 PDT 2013
> 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.
More information about the llvm-dev
mailing list