John,
I think there is a bug in the existing code in lib/CodeGen/Blocks.cpp:1181
unsigned align = getContext().getDeclAlign(variable).getQuantity();
llvm::AllocaInst *alloca =
CreateMemTemp(variable->getType(), "block.captured-const");
alloca->setAlignment(align);
Builder.CreateStore(capture.getConstant(), alloca, align);
^^^^^
The third argument of IRBuilder::CreateStore() is the “volatile” flag.
http://llvm.org/doxygen/classllvm_1_1IRBuilder.html
I assume that “align” is usually nonzero — so it would likely output a "store
volatile". Do you think that’s unintentional and it’s safe to replace it with
false? Or is the volatile modifier needed here?
Adrian
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits