mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
[PM/AA] Remove the Location typedef from the AliasAnalysis class now
that it is its own entity in the form of MemoryLocation, and update all the callers. This is an entirely mechanical change. References to "Location" within AA subclases become "MemoryLocation", and elsewhere "AliasAnalysis::Location" becomes "MemoryLocation". Hope that helps out-of-tree folks update. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239885 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -58,7 +58,8 @@ ObjCARCAliasAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
}
|
||||
|
||||
AliasAnalysis::AliasResult
|
||||
ObjCARCAliasAnalysis::alias(const Location &LocA, const Location &LocB) {
|
||||
ObjCARCAliasAnalysis::alias(const MemoryLocation &LocA,
|
||||
const MemoryLocation &LocB) {
|
||||
if (!EnableARCOpts)
|
||||
return AliasAnalysis::alias(LocA, LocB);
|
||||
|
||||
@@ -67,8 +68,8 @@ ObjCARCAliasAnalysis::alias(const Location &LocA, const Location &LocB) {
|
||||
const Value *SA = GetRCIdentityRoot(LocA.Ptr);
|
||||
const Value *SB = GetRCIdentityRoot(LocB.Ptr);
|
||||
AliasResult Result =
|
||||
AliasAnalysis::alias(Location(SA, LocA.Size, LocA.AATags),
|
||||
Location(SB, LocB.Size, LocB.AATags));
|
||||
AliasAnalysis::alias(MemoryLocation(SA, LocA.Size, LocA.AATags),
|
||||
MemoryLocation(SB, LocB.Size, LocB.AATags));
|
||||
if (Result != MayAlias)
|
||||
return Result;
|
||||
|
||||
@@ -77,7 +78,7 @@ ObjCARCAliasAnalysis::alias(const Location &LocA, const Location &LocB) {
|
||||
const Value *UA = GetUnderlyingObjCPtr(SA, *DL);
|
||||
const Value *UB = GetUnderlyingObjCPtr(SB, *DL);
|
||||
if (UA != SA || UB != SB) {
|
||||
Result = AliasAnalysis::alias(Location(UA), Location(UB));
|
||||
Result = AliasAnalysis::alias(MemoryLocation(UA), MemoryLocation(UB));
|
||||
// We can't use MustAlias or PartialAlias results here because
|
||||
// GetUnderlyingObjCPtr may return an offsetted pointer value.
|
||||
if (Result == NoAlias)
|
||||
@@ -89,24 +90,23 @@ ObjCARCAliasAnalysis::alias(const Location &LocA, const Location &LocB) {
|
||||
return MayAlias;
|
||||
}
|
||||
|
||||
bool
|
||||
ObjCARCAliasAnalysis::pointsToConstantMemory(const Location &Loc,
|
||||
bool OrLocal) {
|
||||
bool ObjCARCAliasAnalysis::pointsToConstantMemory(const MemoryLocation &Loc,
|
||||
bool OrLocal) {
|
||||
if (!EnableARCOpts)
|
||||
return AliasAnalysis::pointsToConstantMemory(Loc, OrLocal);
|
||||
|
||||
// First, strip off no-ops, including ObjC-specific no-ops, and try making
|
||||
// a precise alias query.
|
||||
const Value *S = GetRCIdentityRoot(Loc.Ptr);
|
||||
if (AliasAnalysis::pointsToConstantMemory(Location(S, Loc.Size, Loc.AATags),
|
||||
OrLocal))
|
||||
if (AliasAnalysis::pointsToConstantMemory(
|
||||
MemoryLocation(S, Loc.Size, Loc.AATags), OrLocal))
|
||||
return true;
|
||||
|
||||
// If that failed, climb to the underlying object, including climbing through
|
||||
// ObjC-specific no-ops, and try making an imprecise alias query.
|
||||
const Value *U = GetUnderlyingObjCPtr(S, *DL);
|
||||
if (U != S)
|
||||
return AliasAnalysis::pointsToConstantMemory(Location(U), OrLocal);
|
||||
return AliasAnalysis::pointsToConstantMemory(MemoryLocation(U), OrLocal);
|
||||
|
||||
// If that failed, fail. We don't need to chain here, since that's covered
|
||||
// by the earlier precise query.
|
||||
@@ -135,7 +135,8 @@ ObjCARCAliasAnalysis::getModRefBehavior(const Function *F) {
|
||||
}
|
||||
|
||||
AliasAnalysis::ModRefResult
|
||||
ObjCARCAliasAnalysis::getModRefInfo(ImmutableCallSite CS, const Location &Loc) {
|
||||
ObjCARCAliasAnalysis::getModRefInfo(ImmutableCallSite CS,
|
||||
const MemoryLocation &Loc) {
|
||||
if (!EnableARCOpts)
|
||||
return AliasAnalysis::getModRefInfo(CS, Loc);
|
||||
|
||||
|
@@ -56,12 +56,14 @@ namespace objcarc {
|
||||
}
|
||||
|
||||
void getAnalysisUsage(AnalysisUsage &AU) const override;
|
||||
AliasResult alias(const Location &LocA, const Location &LocB) override;
|
||||
bool pointsToConstantMemory(const Location &Loc, bool OrLocal) override;
|
||||
AliasResult alias(const MemoryLocation &LocA,
|
||||
const MemoryLocation &LocB) override;
|
||||
bool pointsToConstantMemory(const MemoryLocation &Loc,
|
||||
bool OrLocal) override;
|
||||
ModRefBehavior getModRefBehavior(ImmutableCallSite CS) override;
|
||||
ModRefBehavior getModRefBehavior(const Function *F) override;
|
||||
ModRefResult getModRefInfo(ImmutableCallSite CS,
|
||||
const Location &Loc) override;
|
||||
const MemoryLocation &Loc) override;
|
||||
ModRefResult getModRefInfo(ImmutableCallSite CS1,
|
||||
ImmutableCallSite CS2) override;
|
||||
};
|
||||
|
@@ -200,7 +200,7 @@ static StoreInst *findSafeStoreForStoreStrongContraction(LoadInst *Load,
|
||||
bool SawRelease = false;
|
||||
|
||||
// Get the location associated with Load.
|
||||
AliasAnalysis::Location Loc = MemoryLocation::get(Load);
|
||||
MemoryLocation Loc = MemoryLocation::get(Load);
|
||||
|
||||
// Walk down to find the store and the release, which may be in either order.
|
||||
for (auto I = std::next(BasicBlock::iterator(Load)),
|
||||
|
Reference in New Issue
Block a user