Skip to content

Commit 79e0cbd

Browse files
committed
[TSAR, Memory] Remove DataLayout from printLocationSource()
1 parent 5a4081e commit 79e0cbd

File tree

5 files changed

+12
-18
lines changed

5 files changed

+12
-18
lines changed

include/tsar/Unparse/Utils.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ void printLocationSource(llvm::raw_ostream &O, const llvm::MemoryLocation &Loc,
7979
/// Print information available from a source code for the specified memory
8080
/// location and its size (<location, size>).
8181
void printLocationSource(llvm::raw_ostream &O, const MemoryLocationRange &Loc,
82-
const llvm::DominatorTree *DT = nullptr,
83-
const llvm::DataLayout *DL = nullptr,
84-
bool IsDebug = false);
82+
const llvm::DominatorTree *DT = nullptr, bool IsDebug = false);
8583

8684
/// Print information available from a source code for the specified memory
8785
/// location and its size (<location, size>).

lib/Analysis/Memory/DefinedMemory.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,7 @@ std::pair<MemoryLocationRange, bool> aggregate(
586586
"Array location must be of the `collapsed` kind!");
587587
LLVM_DEBUG(
588588
dbgs() << "[AGGREGATE] Aggregated location: ";
589-
printLocationSource(dbgs(), ResLoc, &Fwk->getDomTree(),
590-
&Fwk->getDataLayout(), true);
589+
printLocationSource(dbgs(), ResLoc, &Fwk->getDomTree(), true);
591590
dbgs() << "\n";
592591
);
593592
ResLoc.Kind |= Loc.Kind & LocKind::Auxiliary;
@@ -730,16 +729,16 @@ void intializeDefUseSetLog(
730729
}
731730
dbgs() << "Outward exposed must define locations:\n";
732731
for (auto &Loc : DU.getDefs())
733-
printLocationSource(dbgs(), Loc, &DT, &DL, true), dbgs() << "\n";
732+
printLocationSource(dbgs(), Loc, &DT, true), dbgs() << "\n";
734733
dbgs() << "Outward exposed may define locations:\n";
735734
for (auto &Loc : DU.getMayDefs())
736-
printLocationSource(dbgs(), Loc, &DT, &DL,true), dbgs() << "\n";
735+
printLocationSource(dbgs(), Loc, &DT, true), dbgs() << "\n";
737736
dbgs() << "Outward exposed uses:\n";
738737
for (auto &Loc : DU.getUses())
739-
printLocationSource(dbgs(), Loc, &DT, &DL,true), dbgs() << "\n";
738+
printLocationSource(dbgs(), Loc, &DT, true), dbgs() << "\n";
740739
dbgs() << "Explicitly accessed locations:\n";
741740
for (auto &Loc : DU.getExplicitAccesses())
742-
printLocationSource(dbgs(), Loc, &DT, &DL, true), dbgs() << "\n";
741+
printLocationSource(dbgs(), Loc, &DT, true), dbgs() << "\n";
743742
for (auto *I : DU.getExplicitUnknowns())
744743
I->print(dbgs()), dbgs() << "\n";
745744
dbgs() << "[END DEFUSE]\n";

lib/Analysis/Memory/LiveMemory.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,10 @@ bool DataFlowTraits<LiveDFFwk*>::transferFunction(
155155
}
156156
dbgs() << "IN:\n";
157157
for (auto &Loc : newIn)
158-
(printLocationSource(dbgs(), Loc, DFF->getDomTree(), nullptr, true),
159-
dbgs() << "\n");
158+
(printLocationSource(dbgs(), Loc, DFF->getDomTree(), true), dbgs() << "\n");
160159
dbgs() << "OUT:\n";
161160
for (auto &Loc : LS->getOut())
162-
(printLocationSource(dbgs(), Loc, DFF->getDomTree(), nullptr, true),
163-
dbgs() << "\n");
161+
(printLocationSource(dbgs(), Loc, DFF->getDomTree(), true), dbgs() << "\n");
164162
dbgs() << "[END LIVE]\n";
165163
);
166164
if (LS->getIn() != newIn) {

lib/Analysis/Memory/MemoryLocationRange.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,9 +819,9 @@ llvm::Optional<MemoryLocationRange> intersect(
819819
// exactly.
820820
LLVM_DEBUG(
821821
llvm::dbgs() << "[INTERSECT] Intersect locations:\n";
822-
printLocationSource(llvm::dbgs() << "\t", LHS, nullptr, nullptr, true);
822+
printLocationSource(llvm::dbgs() << "\t", LHS, nullptr, true);
823823
llvm::dbgs() << "\n";
824-
printLocationSource(llvm::dbgs() << "\t", RHS, nullptr, nullptr, true);
824+
printLocationSource(llvm::dbgs() << "\t", RHS, nullptr, true);
825825
llvm::dbgs() << "\n";
826826
);
827827
if (LHS.Ptr != RHS.Ptr)

lib/Unparse/Utils.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void printLocationSource(llvm::raw_ostream &O, const llvm::MemoryLocation &Loc,
6262
}
6363

6464
void printLocationSource(llvm::raw_ostream &O, const MemoryLocationRange &Loc,
65-
const DominatorTree *DT, const llvm::DataLayout *DL, bool IsDebug) {
65+
const DominatorTree *DT, bool IsDebug) {
6666
O << "<";
6767
printLocationSource(O, Loc.Ptr, DT);
6868
O << ", ";
@@ -98,8 +98,7 @@ void printLocationSource(llvm::raw_ostream &O, const MemoryLocationRange &Loc,
9898
}
9999
O << " (" << Loc.getKindAsString() << ") ";
100100
O << " [" << Loc.Ptr << "]";
101-
if (DL)
102-
O << " [Underlying: " << getUnderlyingObject(Loc.Ptr, 0) << "]";
101+
O << " [Underlying: " << getUnderlyingObject(Loc.Ptr, 0) << "]";
103102
}
104103
}
105104
void printLocationSource(llvm::raw_ostream &O, const EstimateMemory &EM,

0 commit comments

Comments
 (0)