Skip to content

[NFC] [hwasan] also be more consistent when getting pointer types #84399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ class HWAddressSanitizer {
ShadowMapping Mapping;

Type *VoidTy = Type::getVoidTy(M.getContext());
Type *IntptrTy;
PointerType *PtrTy;
Type *IntptrTy = M.getDataLayout().getIntPtrType(M.getContext());
PointerType *PtrTy = PointerType::getUnqual(M.getContext());
Type *Int8Ty = Type::getInt8Ty(M.getContext());
Type *Int32Ty = Type::getInt32Ty(M.getContext());
Type *Int64Ty = Type::getInt64Ty(M.getContext());
Expand Down Expand Up @@ -594,8 +594,6 @@ void HWAddressSanitizer::createHwasanCtorComdat() {
/// inserts a call to __hwasan_init to the module's constructor list.
void HWAddressSanitizer::initializeModule() {
LLVM_DEBUG(dbgs() << "Init " << M.getName() << "\n");
auto &DL = M.getDataLayout();

TargetTriple = Triple(M.getTargetTriple());

// x86_64 currently has two modes:
Expand All @@ -613,8 +611,6 @@ void HWAddressSanitizer::initializeModule() {

C = &(M.getContext());
IRBuilder<> IRB(*C);
IntptrTy = IRB.getIntPtrTy(DL);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need getPtrTy with opaque ptrs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave this NFC

PtrTy = IRB.getPtrTy();

HwasanCtorFunction = nullptr;

Expand Down