-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[IR] Replace of PointerType::getUnqual(Type) with opaque version (NFC) #123909
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,7 +50,7 @@ StructType *getDeviceImageTy(Module &M) { | |
| } | ||
|
|
||
| PointerType *getDeviceImagePtrTy(Module &M) { | ||
| return PointerType::getUnqual(getDeviceImageTy(M)); | ||
| return PointerType::getUnqual(M.getContext()); | ||
| } | ||
|
|
||
| // struct __tgt_bin_desc { | ||
|
|
@@ -70,7 +70,7 @@ StructType *getBinDescTy(Module &M) { | |
| } | ||
|
|
||
| PointerType *getBinDescPtrTy(Module &M) { | ||
| return PointerType::getUnqual(getBinDescTy(M)); | ||
| return PointerType::getUnqual(M.getContext()); | ||
| } | ||
|
Comment on lines
72
to
74
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both this and getDeviceImagePtrTy give the same type. Will look into if deduplicating makes sense. |
||
|
|
||
| /// Creates binary descriptor for the given device images. Binary descriptor | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1150,9 +1150,9 @@ bool DataFlowSanitizer::initializeModule(Module &M) { | |
| Ctx = &M.getContext(); | ||
| Int8Ptr = PointerType::getUnqual(*Ctx); | ||
| OriginTy = IntegerType::get(*Ctx, OriginWidthBits); | ||
| OriginPtrTy = PointerType::getUnqual(OriginTy); | ||
| OriginPtrTy = PointerType::getUnqual(*Ctx); | ||
| PrimitiveShadowTy = IntegerType::get(*Ctx, ShadowWidthBits); | ||
| PrimitiveShadowPtrTy = PointerType::getUnqual(PrimitiveShadowTy); | ||
| PrimitiveShadowPtrTy = PointerType::getUnqual(*Ctx); | ||
|
Comment on lines
-1153
to
+1155
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These types are also the same. Will look into if deduplicating makes sense separately. |
||
| IntptrTy = DL.getIntPtrType(*Ctx); | ||
| ZeroPrimitiveShadow = ConstantInt::getSigned(PrimitiveShadowTy, 0); | ||
| ZeroOrigin = ConstantInt::getSigned(OriginTy, 0); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a followup, this code could use same larger cleanup to use opaque pointers in the comments and remove some unnecessary stuff like the zero-offset GEP below.