File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -404,6 +404,10 @@ class DataLayout {
404404 bool hasUnstableRepresentation (unsigned AddrSpace) const {
405405 return getPointerSpec (AddrSpace).HasUnstableRepresentation ;
406406 }
407+ bool hasUnstableRepresentation (Type *Ty) const {
408+ auto *PTy = dyn_cast<PointerType>(Ty->getScalarType ());
409+ return PTy && hasUnstableRepresentation (PTy->getPointerAddressSpace ());
410+ }
407411
408412 // / Returns whether this address space has external state (implies having
409413 // / a non-integral pointer representation).
@@ -416,6 +420,10 @@ class DataLayout {
416420 bool hasExternalState (unsigned AddrSpace) const {
417421 return getPointerSpec (AddrSpace).HasExternalState ;
418422 }
423+ bool hasExternalState (Type *Ty) const {
424+ auto *PTy = dyn_cast<PointerType>(Ty->getScalarType ());
425+ return PTy && hasExternalState (PTy->getPointerAddressSpace ());
426+ }
419427
420428 // / Returns whether passes should avoid introducing `inttoptr` instructions
421429 // / for this address space.
You can’t perform that action at this time.
0 commit comments