aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/DataStructure/FunctionRepBuilder.cpp18
-rw-r--r--lib/Analysis/DataStructure/NodeImpl.cpp3
-rw-r--r--lib/Analysis/Expressions.cpp2
-rw-r--r--lib/Analysis/InductionVariable.cpp2
4 files changed, 14 insertions, 11 deletions
diff --git a/lib/Analysis/DataStructure/FunctionRepBuilder.cpp b/lib/Analysis/DataStructure/FunctionRepBuilder.cpp
index 965185a344..eda16bc694 100644
--- a/lib/Analysis/DataStructure/FunctionRepBuilder.cpp
+++ b/lib/Analysis/DataStructure/FunctionRepBuilder.cpp
@@ -143,26 +143,28 @@ void FunctionRepBuilder::initializeWorkList(Function *Func) {
// the worklists...
//
for (Function::ArgumentListType::iterator I = Func->getArgumentList().begin(),
- E = Func->getArgumentList().end(); I != E; ++I)
+ E = Func->getArgumentList().end(); I != E; ++I) {
+ Value *Arg = (Value*)(*I);
// Only process arguments that are of pointer type...
- if (PointerType *PT = dyn_cast<PointerType>((*I)->getType())) {
- ArgDSNode *Arg = new ArgDSNode(*I);
- ArgNodes.push_back(Arg);
+ if (PointerType *PT = dyn_cast<PointerType>(Arg->getType())) {
+ ArgDSNode *ArgNode = new ArgDSNode(*I);
+ ArgNodes.push_back(ArgNode);
// Add a critical shadow value for it to represent what it is pointing
// to and add this to the value map...
ShadowDSNode *Shad = new ShadowDSNode(PT->getElementType(),
Func->getParent(), true);
ShadowNodes.push_back(Shad);
- ValueMap[*I].add(PointerVal(Shad), *I);
+ ValueMap[Arg].add(PointerVal(Shad), Arg);
// The value of the argument is the shadow value...
- Arg->getLink(0).add(Shad);
+ ArgNode->getLink(0).add(Shad);
// Make sure that all users of the argument are processed...
- addAllUsesToWorkList(*I);
+ addAllUsesToWorkList(Arg);
}
-
+ }
+
// Iterate over the instructions in the method. Create nodes for malloc and
// call instructions. Add all uses of these to the worklist of instructions
// to process.
diff --git a/lib/Analysis/DataStructure/NodeImpl.cpp b/lib/Analysis/DataStructure/NodeImpl.cpp
index 05ed8844ac..6c986fe1db 100644
--- a/lib/Analysis/DataStructure/NodeImpl.cpp
+++ b/lib/Analysis/DataStructure/NodeImpl.cpp
@@ -11,6 +11,7 @@
#include "llvm/BasicBlock.h"
#include "llvm/iMemory.h"
#include "llvm/iOther.h"
+#include "llvm/Argument.h"
#include "Support/STLExtras.h"
#include <algorithm>
#include <sstream>
@@ -288,7 +289,7 @@ void CallDSNode::mapNode(map<const DSNode*, DSNode*> &NodeMap,
MapPVS(ArgLinks[i], Old->ArgLinks[i], NodeMap);
}
-ArgDSNode::ArgDSNode(FunctionArgument *FA)
+ArgDSNode::ArgDSNode(Argument *FA)
: DSNode(ArgNode, FA->getType()), FuncArg(FA) {
}
diff --git a/lib/Analysis/Expressions.cpp b/lib/Analysis/Expressions.cpp
index 0f37c5fb7e..e78fb1e690 100644
--- a/lib/Analysis/Expressions.cpp
+++ b/lib/Analysis/Expressions.cpp
@@ -245,7 +245,7 @@ ExprType analysis::ClassifyExpression(Value *Expr) {
std::cerr << "Bizarre thing to expr classify: " << Expr << "\n";
return Expr;
case Value::GlobalVariableVal: // Global Variable & Function argument:
- case Value::FunctionArgumentVal: // nothing known, return variable itself
+ case Value::ArgumentVal: // nothing known, return variable itself
return Expr;
case Value::ConstantVal: // Constant value, just return constant
Constant *CPV = cast<Constant>(Expr);
diff --git a/lib/Analysis/InductionVariable.cpp b/lib/Analysis/InductionVariable.cpp
index 11d1a2c860..155017480b 100644
--- a/lib/Analysis/InductionVariable.cpp
+++ b/lib/Analysis/InductionVariable.cpp
@@ -28,7 +28,7 @@ using analysis::ExprType;
static bool isLoopInvariant(const Value *V, const cfg::Loop *L) {
- if (isa<Constant>(V) || isa<FunctionArgument>(V) || isa<GlobalValue>(V))
+ if (isa<Constant>(V) || isa<Argument>(V) || isa<GlobalValue>(V))
return true;
const Instruction *I = cast<Instruction>(V);