Fix .rs.dtor scoping bug.

BUG=5267595

This change makes sure to scope any helper variables (like rsIntIter) to the
enclosing function (and not make them global). Prior to this change, if an
array iterator was created, it would be marked as a global symbol. The
libbcc library then sometimes removed this global as it was not able to
determine that it was actually used (.rs.dtor is not guaranteed to be called).
A fix should be made to libbcc as well, but the proper fix for llvm-rs-cc is
to scope any helper variable declarations to the calling function.

Change-Id: Ia46654cb0a114f6f5495e32ad1508d7d01e2084b
2 files changed