This patch handles the case where a variable has multiple aliases.
AIX's assembly directive .set is not usable for aliasing purpose, and using different labels allows AIX to emulate symbol aliases. If there is data emitted between any two labels, meaning they are not aligned, XCOFF will automatically calculate the offset for them.
This patch implements:
- Emits the label of the alias just before emitting the value of the sub-element that the alias referred to.
- A set of aliases that refers to the same offset should be aligned.
- We didn't emit aliasing labels for common and zero-initialized local symbols in PPCAIXAsmPrinter::emitGlobalVariableHelper, but emitted linkage for them in AsmPrinter::emitGlobalAlias, which caused a FAILURE. This patch fixes the bug by blocking emitting linkage for the alias without a label.
Nit: do we need to doc this comment? If so, you may need /// instead of //