Cleanup the construction of attributes and fix a opt-mode bug in DenseElementsAttr when allocating an empty array buffer.

PiperOrigin-RevId: 239926824
2 files changed