summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/AliasAnalysisCounter.cpp7
-rw-r--r--llvm/lib/Analysis/AliasAnalysisEvaluator.cpp7
-rw-r--r--llvm/lib/Analysis/AliasSetTracker.cpp5
-rw-r--r--llvm/lib/Analysis/DominanceFrontier.cpp5
-rw-r--r--llvm/lib/Analysis/IPA/FindUsedTypes.cpp1
-rw-r--r--llvm/lib/Analysis/IVUsers.cpp7
-rw-r--r--llvm/lib/Analysis/Lint.cpp3
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp1
-rw-r--r--llvm/lib/Analysis/MemDepPrinter.cpp3
-rw-r--r--llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp1
-rw-r--r--llvm/lib/Analysis/PostDominators.cpp1
-rw-r--r--llvm/lib/Analysis/RegionInfo.cpp5
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp17
-rw-r--r--llvm/lib/Analysis/Trace.cpp3
14 files changed, 26 insertions, 40 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysisCounter.cpp b/llvm/lib/Analysis/AliasAnalysisCounter.cpp
index 2649836f573..0211be19abb 100644
--- a/llvm/lib/Analysis/AliasAnalysisCounter.cpp
+++ b/llvm/lib/Analysis/AliasAnalysisCounter.cpp
@@ -14,7 +14,6 @@
#include "llvm/Analysis/Passes.h"
#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
@@ -138,10 +137,10 @@ AliasAnalysisCounter::alias(const Location &LocA, const Location &LocB) {
if (PrintAll || (PrintAllFailures && R == MayAlias)) {
errs() << AliasString << ":\t";
errs() << "[" << LocA.Size << "B] ";
- WriteAsOperand(errs(), LocA.Ptr, true, M);
+ LocA.Ptr->printAsOperand(errs(), true, M);
errs() << ", ";
errs() << "[" << LocB.Size << "B] ";
- WriteAsOperand(errs(), LocB.Ptr, true, M);
+ LocB.Ptr->printAsOperand(errs(), true, M);
errs() << "\n";
}
@@ -164,7 +163,7 @@ AliasAnalysisCounter::getModRefInfo(ImmutableCallSite CS,
if (PrintAll || (PrintAllFailures && R == ModRef)) {
errs() << MRString << ": Ptr: ";
errs() << "[" << Loc.Size << "B] ";
- WriteAsOperand(errs(), Loc.Ptr, true, M);
+ Loc.Ptr->printAsOperand(errs(), true, M);
errs() << "\t<->" << *CS.getInstruction() << '\n';
}
return R;
diff --git a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp b/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
index 15bf9732b54..482119d3036 100644
--- a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
+++ b/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
@@ -24,7 +24,6 @@
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
@@ -94,8 +93,8 @@ static void PrintResults(const char *Msg, bool P, const Value *V1,
std::string o1, o2;
{
raw_string_ostream os1(o1), os2(o2);
- WriteAsOperand(os1, V1, true, M);
- WriteAsOperand(os2, V2, true, M);
+ V1->printAsOperand(os1, true, M);
+ V2->printAsOperand(os2, true, M);
}
if (o2 < o1)
@@ -111,7 +110,7 @@ PrintModRefResults(const char *Msg, bool P, Instruction *I, Value *Ptr,
Module *M) {
if (P) {
errs() << " " << Msg << ": Ptr: ";
- WriteAsOperand(errs(), Ptr, true, M);
+ Ptr->printAsOperand(errs(), true, M);
errs() << "\t<->" << *I << '\n';
}
}
diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp
index 76693bed3ec..035d16e4e47 100644
--- a/llvm/lib/Analysis/AliasSetTracker.cpp
+++ b/llvm/lib/Analysis/AliasSetTracker.cpp
@@ -18,7 +18,6 @@
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Type.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
@@ -566,7 +565,7 @@ void AliasSet::print(raw_ostream &OS) const {
OS << "Pointers: ";
for (iterator I = begin(), E = end(); I != E; ++I) {
if (I != begin()) OS << ", ";
- WriteAsOperand(OS << "(", I.getPointer());
+ I.getPointer()->printAsOperand(OS << "(");
OS << ", " << I.getSize() << ")";
}
}
@@ -574,7 +573,7 @@ void AliasSet::print(raw_ostream &OS) const {
OS << "\n " << UnknownInsts.size() << " Unknown instructions: ";
for (unsigned i = 0, e = UnknownInsts.size(); i != e; ++i) {
if (i) OS << ", ";
- WriteAsOperand(OS, UnknownInsts[i]);
+ UnknownInsts[i]->printAsOperand(OS);
}
}
OS << "\n";
diff --git a/llvm/lib/Analysis/DominanceFrontier.cpp b/llvm/lib/Analysis/DominanceFrontier.cpp
index bd94641224d..74cd15815f9 100644
--- a/llvm/lib/Analysis/DominanceFrontier.cpp
+++ b/llvm/lib/Analysis/DominanceFrontier.cpp
@@ -9,7 +9,6 @@
#include "llvm/Analysis/DominanceFrontier.h"
#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
@@ -114,7 +113,7 @@ void DominanceFrontierBase::print(raw_ostream &OS, const Module* ) const {
for (const_iterator I = begin(), E = end(); I != E; ++I) {
OS << " DomFrontier for BB ";
if (I->first)
- WriteAsOperand(OS, I->first, false);
+ I->first->printAsOperand(OS, false);
else
OS << " <<exit node>>";
OS << " is:\t";
@@ -125,7 +124,7 @@ void DominanceFrontierBase::print(raw_ostream &OS, const Module* ) const {
I != E; ++I) {
OS << ' ';
if (*I)
- WriteAsOperand(OS, *I, false);
+ (*I)->printAsOperand(OS, false);
else
OS << "<<exit node>>";
}
diff --git a/llvm/lib/Analysis/IPA/FindUsedTypes.cpp b/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
index 704fa9ac7eb..d94ce686e3f 100644
--- a/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
+++ b/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
@@ -17,7 +17,6 @@
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Module.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Support/InstIterator.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
diff --git a/llvm/lib/Analysis/IVUsers.cpp b/llvm/lib/Analysis/IVUsers.cpp
index 9a8ff2235cd..f56196f7ff5 100644
--- a/llvm/lib/Analysis/IVUsers.cpp
+++ b/llvm/lib/Analysis/IVUsers.cpp
@@ -24,7 +24,6 @@
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Type.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
@@ -248,7 +247,7 @@ bool IVUsers::runOnLoop(Loop *l, LPPassManager &LPM) {
void IVUsers::print(raw_ostream &OS, const Module *M) const {
OS << "IV Users for loop ";
- WriteAsOperand(OS, L->getHeader(), false);
+ L->getHeader()->printAsOperand(OS, false);
if (SE->hasLoopInvariantBackedgeTakenCount(L)) {
OS << " with backedge-taken count "
<< *SE->getBackedgeTakenCount(L);
@@ -258,13 +257,13 @@ void IVUsers::print(raw_ostream &OS, const Module *M) const {
for (ilist<IVStrideUse>::const_iterator UI = IVUses.begin(),
E = IVUses.end(); UI != E; ++UI) {
OS << " ";
- WriteAsOperand(OS, UI->getOperandValToReplace(), false);
+ UI->getOperandValToReplace()->printAsOperand(OS, false);
OS << " = " << *getReplacementExpr(*UI);
for (PostIncLoopSet::const_iterator
I = UI->PostIncLoops.begin(),
E = UI->PostIncLoops.end(); I != E; ++I) {
OS << " (post-inc with loop ";
- WriteAsOperand(OS, (*I)->getHeader(), false);
+ (*I)->getHeader()->printAsOperand(OS, false);
OS << ")";
}
OS << " in ";
diff --git a/llvm/lib/Analysis/Lint.cpp b/llvm/lib/Analysis/Lint.cpp
index 693ea2d48b6..0e94df4a6a5 100644
--- a/llvm/lib/Analysis/Lint.cpp
+++ b/llvm/lib/Analysis/Lint.cpp
@@ -46,7 +46,6 @@
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IntrinsicInst.h"
-#include "llvm/IR/Writer.h"
#include "llvm/InstVisitor.h"
#include "llvm/Pass.h"
#include "llvm/PassManager.h"
@@ -129,7 +128,7 @@ namespace {
if (isa<Instruction>(V)) {
MessagesStr << *V << '\n';
} else {
- WriteAsOperand(MessagesStr, V, true, Mod);
+ V->printAsOperand(MessagesStr, true, Mod);
MessagesStr << '\n';
}
}
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index e64b3fcb683..e406546e688 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -24,7 +24,6 @@
#include "llvm/IR/Constants.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Metadata.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
diff --git a/llvm/lib/Analysis/MemDepPrinter.cpp b/llvm/lib/Analysis/MemDepPrinter.cpp
index 06c498fa360..55dea6ad5ea 100644
--- a/llvm/lib/Analysis/MemDepPrinter.cpp
+++ b/llvm/lib/Analysis/MemDepPrinter.cpp
@@ -14,7 +14,6 @@
#include "llvm/ADT/SetVector.h"
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
#include "llvm/IR/LLVMContext.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/InstIterator.h"
@@ -177,7 +176,7 @@ void MemDepPrinter::print(raw_ostream &OS, const Module *M) const {
OS << DepTypeStr[type];
if (DepBB) {
OS << " in block ";
- WriteAsOperand(OS, DepBB, /*PrintType=*/false, M);
+ DepBB->printAsOperand(OS, /*PrintType=*/false, M);
}
if (DepInst) {
OS << " from: ";
diff --git a/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp b/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp
index 88bb17c4012..38498aa5d25 100644
--- a/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp
+++ b/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp
@@ -19,7 +19,6 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/DebugInfo.h"
#include "llvm/IR/Function.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Pass.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
diff --git a/llvm/lib/Analysis/PostDominators.cpp b/llvm/lib/Analysis/PostDominators.cpp
index 0b672693a6f..2bcfed11ccf 100644
--- a/llvm/lib/Analysis/PostDominators.cpp
+++ b/llvm/lib/Analysis/PostDominators.cpp
@@ -18,7 +18,6 @@
#include "llvm/ADT/SetOperations.h"
#include "llvm/Analysis/DominatorInternals.h"
#include "llvm/IR/Instructions.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/Debug.h"
using namespace llvm;
diff --git a/llvm/lib/Analysis/RegionInfo.cpp b/llvm/lib/Analysis/RegionInfo.cpp
index 8470d316f7a..f732ffdde07 100644
--- a/llvm/lib/Analysis/RegionInfo.cpp
+++ b/llvm/lib/Analysis/RegionInfo.cpp
@@ -15,7 +15,6 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/RegionIterator.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
@@ -215,7 +214,7 @@ std::string Region::getNameStr() const {
if (getEntry()->getName().empty()) {
raw_string_ostream OS(entryName);
- WriteAsOperand(OS, getEntry(), false);
+ getEntry()->printAsOperand(OS, false);
} else
entryName = getEntry()->getName();
@@ -223,7 +222,7 @@ std::string Region::getNameStr() const {
if (getExit()->getName().empty()) {
raw_string_ostream OS(exitName);
- WriteAsOperand(OS, getExit(), false);
+ getExit()->printAsOperand(OS, false);
} else
exitName = getExit()->getName();
} else
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 6c2400c490b..86f6784eece 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -77,7 +77,6 @@
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Operator.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ConstantRange.h"
#include "llvm/Support/Debug.h"
@@ -138,7 +137,7 @@ void SCEV::dump() const {
void SCEV::print(raw_ostream &OS) const {
switch (getSCEVType()) {
case scConstant:
- WriteAsOperand(OS, cast<SCEVConstant>(this)->getValue(), false);
+ cast<SCEVConstant>(this)->getValue()->printAsOperand(OS, false);
return;
case scTruncate: {
const SCEVTruncateExpr *Trunc = cast<SCEVTruncateExpr>(this);
@@ -174,7 +173,7 @@ void SCEV::print(raw_ostream &OS) const {
if (AR->getNoWrapFlags(FlagNW) &&
!AR->getNoWrapFlags((NoWrapFlags)(FlagNUW | FlagNSW)))
OS << "nw><";
- WriteAsOperand(OS, AR->getLoop()->getHeader(), /*PrintType=*/false);
+ AR->getLoop()->getHeader()->printAsOperand(OS, /*PrintType=*/false);
OS << ">";
return;
}
@@ -229,13 +228,13 @@ void SCEV::print(raw_ostream &OS) const {
Constant *FieldNo;
if (U->isOffsetOf(CTy, FieldNo)) {
OS << "offsetof(" << *CTy << ", ";
- WriteAsOperand(OS, FieldNo, false);
+ FieldNo->printAsOperand(OS, false);
OS << ")";
return;
}
// Otherwise just print it normally.
- WriteAsOperand(OS, U->getValue(), false);
+ U->getValue()->printAsOperand(OS, false);
return;
}
case scCouldNotCompute:
@@ -7321,7 +7320,7 @@ static void PrintLoopInfo(raw_ostream &OS, ScalarEvolution *SE,
PrintLoopInfo(OS, SE, *I);
OS << "Loop ";
- WriteAsOperand(OS, L->getHeader(), /*PrintType=*/false);
+ L->getHeader()->printAsOperand(OS, /*PrintType=*/false);
OS << ": ";
SmallVector<BasicBlock *, 8> ExitBlocks;
@@ -7337,7 +7336,7 @@ static void PrintLoopInfo(raw_ostream &OS, ScalarEvolution *SE,
OS << "\n"
"Loop ";
- WriteAsOperand(OS, L->getHeader(), /*PrintType=*/false);
+ L->getHeader()->printAsOperand(OS, /*PrintType=*/false);
OS << ": ";
if (!isa<SCEVCouldNotCompute>(SE->getMaxBackedgeTakenCount(L))) {
@@ -7359,7 +7358,7 @@ void ScalarEvolution::print(raw_ostream &OS, const Module *) const {
ScalarEvolution &SE = *const_cast<ScalarEvolution *>(this);
OS << "Classifying expressions for: ";
- WriteAsOperand(OS, F, /*PrintType=*/false);
+ F->printAsOperand(OS, /*PrintType=*/false);
OS << "\n";
for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
if (isSCEVable(I->getType()) && !isa<CmpInst>(*I)) {
@@ -7390,7 +7389,7 @@ void ScalarEvolution::print(raw_ostream &OS, const Module *) const {
}
OS << "Determining loop execution counts for: ";
- WriteAsOperand(OS, F, /*PrintType=*/false);
+ F->printAsOperand(OS, /*PrintType=*/false);
OS << "\n";
for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I)
PrintLoopInfo(OS, &SE, *I);
diff --git a/llvm/lib/Analysis/Trace.cpp b/llvm/lib/Analysis/Trace.cpp
index 3b3bacd6d09..5a1acc00fb9 100644
--- a/llvm/lib/Analysis/Trace.cpp
+++ b/llvm/lib/Analysis/Trace.cpp
@@ -17,7 +17,6 @@
#include "llvm/Analysis/Trace.h"
#include "llvm/IR/Function.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
@@ -37,7 +36,7 @@ void Trace::print(raw_ostream &O) const {
O << "; Trace from function " << F->getName() << ", blocks:\n";
for (const_iterator i = begin(), e = end(); i != e; ++i) {
O << "; ";
- WriteAsOperand(O, *i, true, getModule());
+ (*i)->printAsOperand(O, true, getModule());
O << "\n";
}
O << "; Trace parent function: \n" << *F;
OpenPOWER on IntegriCloud