inkwell
inkwell copied to clipboard
Passing a non-empty name to builder.build_fence results in a verifier error.
Describe the Bug
Passing a non-empty name to builder.build_fence
results in a verifier error:
Instruction has a name, but provides a void value!
%fence = fence seq_cst
To Reproduce
builder.build_fence(AtomicOrdering::SequentiallyConsistent, 0, "fence");
Expected Behavior
Either it doesn't produce a verifier error or it is not possible to pass a name at all.
LLVM Version (please complete the following information):
- LLVM Version: 7.0
Desktop (please complete the following information):
- OS: Debian Buster
hmm not sure I totally follow. You're saying even though the API accepts a string, it isn't valid to provide one?
Or maybe the name is valid for certain orderings only?
hmm not sure I totally follow. You're saying even though the API accepts a string, it isn't valid to provide one?
It seems so.
This seems like a bug with the C API to me. The FenceInst constructor sets its type to void here
FenceInst::FenceInst( ... )
: Instruction(Type::getVoidTy(C), ...) { ... }
while the verifier explicitly checks that void typed values do not have a name here
Assert(!I.getType()->isVoidTy() || !I.hasName(),
"Instruction has a name, but provides a void value!", &I);