[llvm] [NFC] [HWASan] make getAndroidSlotPtr function generic (PR #86200)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 13:40:37 PDT 2024


================
@@ -273,14 +273,14 @@ Value *getFP(IRBuilder<> &IRB) {
       IRB.getIntPtrTy(M->getDataLayout()));
 }
 
-Value *getAndroidSanitizerSlotPtr(IRBuilder<> &IRB) {
+Value *getAndroidSlotPtr(IRBuilder<> &IRB, int Slot) {
   Module *M = IRB.GetInsertBlock()->getParent()->getParent();
   // Android provides a fixed TLS slot for sanitizers. See TLS_SLOT_SANITIZER
   // in Bionic's libc/private/bionic_tls.h.
   Function *ThreadPointerFunc =
       Intrinsic::getDeclaration(M, Intrinsic::thread_pointer);
   return IRB.CreateConstGEP1_32(IRB.getInt8Ty(),
----------------
fmayer wrote:

Hmm, in which case `getPtrTy` is probably more correct, because that's what it is in AOSP https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/private/bionic_tls.h;l=60;drc=f5f04b19fe59f6ac3f0b94fc890d0ccff6821fa8

https://github.com/llvm/llvm-project/pull/86200


More information about the llvm-commits mailing list