PNaCl: ExpandTls: Split buildTlsTemplate() into smaller functions

I will be able to reuse this smaller version of buildTlsTemplate() for
handling TLS in the ConvertToPSO pass.

I think this also makes the code a bit more readable.

Note that we no longer need to use padToAlignment() to add the final
padding.  We can just increase TotalSize instead.

BUG=https://bugs.chromium.org/p/nativeclient/issues/detail?id=4351
TEST=test/Transforms/NaCl/expand-tls*.ll
R=smklein@chromium.org

Review URL: https://codereview.chromium.org/1778533002 .
1 file changed