Named registers with the constraint "=&r" currently lose the early clobber flag
and turn into "=r" when converted to LLVM-IR. This patch correctly passes it on.
Details
Diff Detail
Event Timeline
I found some regressions when I re-tested before committing. It was possible for the early-clobber flag to appear twice.
I'm about to upload a corrected version.
Fixed crashes caused by the accidental introduction of constraints like '=&&r'.
Correct test/CodeGen/arm-asm-variable.c to expect the early-clobber flag.
How did the compiler produce constraints like =&&r in the initial version of this patch? Might the CodeGenFunction::EmitAsmStmt be called twice?
The argument to SimplifyConstraint() would omit the first character (always '=') and the function preserved the '&', giving '&r' as the result of SimplifyConstraint(). Each of the paths of AddVariableConstraints() that returned Constraint unmodified would also preserve the '&'. Then the code I added would prepend '=&' for the early clobber case giving '=&&r'.