[llvm] 3e5afba - [NFC] [hwasan] be consistent about how to get integer types (#84396)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 15:41:15 PST 2024


Author: Florian Mayer
Date: 2024-03-07T15:41:12-08:00
New Revision: 3e5afba8ef9319956d288ff755df3c442433eb88

URL: https://github.com/llvm/llvm-project/commit/3e5afba8ef9319956d288ff755df3c442433eb88
DIFF: https://github.com/llvm/llvm-project/commit/3e5afba8ef9319956d288ff755df3c442433eb88.diff

LOG: [NFC] [hwasan] be consistent about how to get integer types (#84396)

Added: 
    

Modified: 
    llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
index 236ee8910d46ab..289183ecf0f286 100644
--- a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
@@ -412,8 +412,8 @@ class HWAddressSanitizer {
   Type *VoidTy = Type::getVoidTy(M.getContext());
   Type *IntptrTy;
   PointerType *PtrTy;
-  Type *Int8Ty;
-  Type *Int32Ty;
+  Type *Int8Ty = Type::getInt8Ty(M.getContext());
+  Type *Int32Ty = Type::getInt32Ty(M.getContext());
   Type *Int64Ty = Type::getInt64Ty(M.getContext());
 
   bool CompileKernel;
@@ -615,8 +615,6 @@ void HWAddressSanitizer::initializeModule() {
   IRBuilder<> IRB(*C);
   IntptrTy = IRB.getIntPtrTy(DL);
   PtrTy = IRB.getPtrTy();
-  Int8Ty = IRB.getInt8Ty();
-  Int32Ty = IRB.getInt32Ty();
 
   HwasanCtorFunction = nullptr;
 


        


More information about the llvm-commits mailing list