|
This replaces each reference to a TLS variable "foo" with the LLVM IR
equivalent of the expression:
((struct tls_template *) __nacl_read_tp())->foo
This pass fills out the global variables __tls_template_start,
__tls_template_end etc. which are used by src/untrusted/nacl/tls.c.
These are the symbols that are otherwise defined by a binutils linker
script.
In order to handle the case of TLS variables that occur inside
ConstantExprs, we have a helper pass, ExpandTlsConstantExpr.
BUG=http://code.google.com/p/nativeclient/issues/detail?id=2837
TEST=test/Transforms/NaCl/expand-tls*.ll
Review URL: https://chromiumcodereview.appspot.com/10896042
|