Skip to content

Commit 4fee21f

Browse files
committed
rebase, add Type* overloads
Created using spr 1.3.7-beta.1
1 parent e740d60 commit 4fee21f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

llvm/include/llvm/IR/DataLayout.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)