diff options
author | Guanzhong Chen <gzchen@google.com> | 2019-07-18 17:53:22 +0000 |
---|---|---|
committer | Guanzhong Chen <gzchen@google.com> | 2019-07-18 17:53:22 +0000 |
commit | 801fa8e6b9eb2398a051752bb0e9d81279360d14 (patch) | |
tree | 85dbbbc175c054a527d970f9ea819f05abd0880c /clang/lib/CodeGen | |
parent | 05be1da24cd947187a8b750e9eca45e80d2e7414 (diff) | |
download | bcm5719-llvm-801fa8e6b9eb2398a051752bb0e9d81279360d14.tar.gz bcm5719-llvm-801fa8e6b9eb2398a051752bb0e9d81279360d14.zip |
[WebAssembly] Implement __builtin_wasm_tls_base intrinsic
Summary:
Add `__builtin_wasm_tls_base` so that LeakSanitizer can find the thread-local
block and scan through it for memory leaks.
Reviewers: tlively, aheejin, sbc100
Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D64900
llvm-svn: 366475
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index a300bab49f9..8c7411fc305 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -13924,6 +13924,10 @@ Value *CodeGenFunction::EmitWebAssemblyBuiltinExpr(unsigned BuiltinID, Function *Callee = CGM.getIntrinsic(Intrinsic::wasm_tls_size, ResultType); return Builder.CreateCall(Callee); } + case WebAssembly::BI__builtin_wasm_tls_base: { + Function *Callee = CGM.getIntrinsic(Intrinsic::wasm_tls_base); + return Builder.CreateCall(Callee); + } case WebAssembly::BI__builtin_wasm_throw: { Value *Tag = EmitScalarExpr(E->getArg(0)); Value *Obj = EmitScalarExpr(E->getArg(1)); |