summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraph.cpp7
-rw-r--r--llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp4
-rw-r--r--llvm/lib/Analysis/IPA/FindUsedTypes.cpp3
-rw-r--r--llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp1
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp2
-rw-r--r--llvm/lib/Analysis/PostDominators.cpp1
6 files changed, 10 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp
index 244c35ea46e..04b8c2d6bc8 100644
--- a/llvm/lib/Analysis/IPA/CallGraph.cpp
+++ b/llvm/lib/Analysis/IPA/CallGraph.cpp
@@ -16,6 +16,7 @@
#include "llvm/Method.h"
#include "llvm/iOther.h"
#include "llvm/iTerminators.h"
+#include "llvm/Support/InstIterator.h"// FIXME: CallGraph should use method uses
#include "Support/STLExtras.h"
#include <algorithm>
@@ -46,8 +47,7 @@ void cfg::CallGraph::addToCallGraph(Method *M) {
if (!M->hasInternalLinkage())
Root->addCalledMethod(Node);
- for (Method::inst_iterator I = M->inst_begin(), E = M->inst_end();
- I != E; ++I) {
+ for (inst_iterator I = inst_begin(M), E = inst_end(M); I != E; ++I) {
// Dynamic calls will cause Null nodes to be created
if (CallInst *CI = dyn_cast<CallInst>(*I))
Node->addCalledMethod(getNodeFor(CI->getCalledMethod()));
@@ -138,8 +138,7 @@ bool IsLeafMethod(const Method* M, const cfg::CallGraph* CG) {
return (cgn->begin() == cgn->end());
}
- for (Method::const_inst_iterator I = M->inst_begin(), E = M->inst_end();
- I != E; ++I)
+ for (const_inst_iterator I = inst_begin(M), E = inst_end(M); I != E; ++I)
if ((*I)->getOpcode() == Instruction::Call)
return false;
return true;
diff --git a/llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp b/llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
index bc092920907..0179cbb74c8 100644
--- a/llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
+++ b/llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
@@ -22,6 +22,7 @@
#include "llvm/Instruction.h"
#include "llvm/Method.h"
#include "llvm/Module.h"
+#include "llvm/Support/InstIterator.h"
#include "Support/CommandLine.h"
AnalysisID FindUnsafePointerTypes::ID(AnalysisID::create<FindUnsafePointerTypes>());
@@ -58,8 +59,7 @@ bool FindUnsafePointerTypes::run(Module *Mod) {
for (Module::iterator MI = Mod->begin(), ME = Mod->end();
MI != ME; ++MI) {
const Method *M = *MI; // We don't need/want write access
- for (Method::const_inst_iterator I = M->inst_begin(), E = M->inst_end();
- I != E; ++I) {
+ for (const_inst_iterator I = inst_begin(M), E = inst_end(M); I != E; ++I) {
const Instruction *Inst = *I;
const Type *ITy = Inst->getType();
if (ITy->isPointerType() && !UnsafeTypes.count((PointerType*)ITy))
diff --git a/llvm/lib/Analysis/IPA/FindUsedTypes.cpp b/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
index b876e5e68d8..e02429ab977 100644
--- a/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
+++ b/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
@@ -11,6 +11,7 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
#include "llvm/Method.h"
+#include "llvm/Support/InstIterator.h"
AnalysisID FindUsedTypes::ID(AnalysisID::create<FindUsedTypes>());
AnalysisID FindUsedTypes::IncludeSymbolTableID(AnalysisID::create<FindUsedTypes>());
@@ -59,7 +60,7 @@ bool FindUsedTypes::run(Module *m) {
// Loop over all of the instructions in the method, adding their return type
// as well as the types of their operands.
//
- for (Method::const_inst_iterator II = M->inst_begin(), IE = M->inst_end();
+ for (const_inst_iterator II = inst_begin(M), IE = inst_end(M);
II != IE; ++II) {
const Instruction *I = *II;
const Type *Ty = I->getType();
diff --git a/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp b/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
index a1a2dba9fb3..b83359f94b8 100644
--- a/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
+++ b/llvm/lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
@@ -9,6 +9,7 @@
#include "BBLiveVar.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/BasicBlock.h"
+#include "llvm/Support/CFG.h"
#include "Support/PostOrderIterator.h"
#include "Support/SetOperations.h"
#include <iostream>
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index 9b34095e4f2..876161d34fc 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -9,7 +9,7 @@
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/Dominators.h"
-#include "llvm/BasicBlock.h"
+#include "llvm/Support/CFG.h"
#include "Support/DepthFirstIterator.h"
#include <algorithm>
diff --git a/llvm/lib/Analysis/PostDominators.cpp b/llvm/lib/Analysis/PostDominators.cpp
index aad6e1cb386..33e14e9fc58 100644
--- a/llvm/lib/Analysis/PostDominators.cpp
+++ b/llvm/lib/Analysis/PostDominators.cpp
@@ -7,6 +7,7 @@
#include "llvm/Analysis/Dominators.h"
#include "llvm/Transforms/UnifyMethodExitNodes.h"
#include "llvm/Method.h"
+#include "llvm/Support/CFG.h"
#include "Support/DepthFirstIterator.h"
#include "Support/STLExtras.h"
#include "Support/SetOperations.h"
OpenPOWER on IntegriCloud