Skip to content

Commit c030778

Browse files
brunodf-snpsnikic
authored andcommitted
[AST] Switch to MemoryLocation in add method (NFC)
Pass MemoryLocation as one argument, instead of passing all its parts separately.
1 parent a897700 commit c030778

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

llvm/include/llvm/Analysis/AliasSetTracker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ class AliasSetTracker {
330330
/// These methods return true if inserting the instruction resulted in the
331331
/// addition of a new alias set (i.e., the pointer did not alias anything).
332332
///
333-
void add(Value *Ptr, LocationSize Size, const AAMDNodes &AAInfo); // Add a loc
333+
void add(const MemoryLocation &Loc);
334334
void add(LoadInst *LI);
335335
void add(StoreInst *SI);
336336
void add(VAArgInst *VAAI);

llvm/include/llvm/LinkAllPasses.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ namespace {
148148
llvm::AliasAnalysis AA(TLI);
149149
llvm::BatchAAResults BAA(AA);
150150
llvm::AliasSetTracker X(BAA);
151-
X.add(nullptr, llvm::LocationSize::beforeOrAfterPointer(),
152-
llvm::AAMDNodes()); // for -print-alias-sets
151+
X.add(llvm::MemoryLocation()); // for -print-alias-sets
153152
(void) llvm::AreStatisticsEnabled();
154153
(void) llvm::sys::RunningOnValgrind();
155154
}

llvm/lib/Analysis/AliasSetTracker.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,8 @@ AliasSet &AliasSetTracker::getAliasSetFor(const MemoryLocation &MemLoc) {
375375
return AliasSets.back();
376376
}
377377

378-
void AliasSetTracker::add(Value *Ptr, LocationSize Size,
379-
const AAMDNodes &AAInfo) {
380-
addPointer(MemoryLocation(Ptr, Size, AAInfo), AliasSet::NoAccess);
378+
void AliasSetTracker::add(const MemoryLocation &Loc) {
379+
addPointer(Loc, AliasSet::NoAccess);
381380
}
382381

383382
void AliasSetTracker::add(LoadInst *LI) {

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ class AccessAnalysis {
666666
/// Register a load and whether it is only read from.
667667
void addLoad(MemoryLocation &Loc, Type *AccessTy, bool IsReadOnly) {
668668
Value *Ptr = const_cast<Value*>(Loc.Ptr);
669-
AST.add(Ptr, LocationSize::beforeOrAfterPointer(), Loc.AATags);
669+
AST.add(Loc.getWithNewSize(LocationSize::beforeOrAfterPointer()));
670670
Accesses[MemAccessInfo(Ptr, false)].insert(AccessTy);
671671
if (IsReadOnly)
672672
ReadOnlyPtr.insert(Ptr);
@@ -675,7 +675,7 @@ class AccessAnalysis {
675675
/// Register a store.
676676
void addStore(MemoryLocation &Loc, Type *AccessTy) {
677677
Value *Ptr = const_cast<Value*>(Loc.Ptr);
678-
AST.add(Ptr, LocationSize::beforeOrAfterPointer(), Loc.AATags);
678+
AST.add(Loc.getWithNewSize(LocationSize::beforeOrAfterPointer()));
679679
Accesses[MemAccessInfo(Ptr, true)].insert(AccessTy);
680680
}
681681

0 commit comments

Comments
 (0)