// The MemoryDepAnalysis does build an explicit graph, which is used internally
// here. That graph could be augmented with the other dependences above if
// desired, but for most uses there will be little need to do that.
+//
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/PgmDependenceGraph.h"
#include "llvm/Analysis/MemoryDepAnalysis.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/Function.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Instruction.h"
-
//----------------------------------------------------------------------------
if (doIncomingDeps)
for (Instruction::op_iterator E = depNode->getInstr().op_end();
ssaInEdgeIter != E &&
- (firstTarget = dyn_cast<Instruction>(ssaInEdgeIter->get()))== NULL; )
+ (firstTarget = dyn_cast<Instruction>(ssaInEdgeIter))== NULL; )
++ssaInEdgeIter;
else
for (Value::use_iterator E = depNode->getInstr().use_end();
// The MemoryDepAnalysis does build an explicit graph, which is used internally
// here. That graph could be augmented with the other dependences above if
// desired, but for most uses there will be little need to do that.
+//
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/PgmDependenceGraph.h"
#include "llvm/Analysis/MemoryDepAnalysis.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/Function.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Instruction.h"
-
//----------------------------------------------------------------------------
if (doIncomingDeps)
for (Instruction::op_iterator E = depNode->getInstr().op_end();
ssaInEdgeIter != E &&
- (firstTarget = dyn_cast<Instruction>(ssaInEdgeIter->get()))== NULL; )
+ (firstTarget = dyn_cast<Instruction>(ssaInEdgeIter))== NULL; )
++ssaInEdgeIter;
else
for (Value::use_iterator E = depNode->getInstr().use_end();
E = STy->getElementTypes().end(); I != E; ++I) {
const Type *Ty1 = I->get();
if (isa<StructType>(Ty1) || isa<ArrayType>(Ty1))
- printContainedStructs(Ty1, StructPrinted);
+ printContainedStructs(*I, StructPrinted);
}
//Print structure type out..
return;
}
- const Constant *CI = dyn_cast<Constant>(I->get());
+ const Constant *CI = dyn_cast<Constant>(I);
if (HasImplicitAddress && (!CI || !CI->isNullValue()))
Out << "(&";
E = STy->getElementTypes().end(); I != E; ++I) {
const Type *Ty1 = I->get();
if (isa<StructType>(Ty1) || isa<ArrayType>(Ty1))
- printContainedStructs(Ty1, StructPrinted);
+ printContainedStructs(*I, StructPrinted);
}
//Print structure type out..
return;
}
- const Constant *CI = dyn_cast<Constant>(I->get());
+ const Constant *CI = dyn_cast<Constant>(I);
if (HasImplicitAddress && (!CI || !CI->isNullValue()))
Out << "(&";
for (User::op_iterator OI = I->op_begin(), OE = I->op_end();
OI != OE; ++OI)
- if (Instruction *U = dyn_cast<Instruction>(OI->get())) {
+ if (Instruction *U = dyn_cast<Instruction>(OI)) {
*OI = 0;
RecursiveDelete(Cache, U);
}
//===- DemoteRegToStack.cpp - Move a virtual reg. to stack ------*- C++ -*-===//
//
-// This file provide the function DemoteRegToStack().
-// This function takes a virtual register computed by an
-// Instruction& X and replaces it with a slot in the stack frame,
-// allocated via alloca. It returns the pointer to the AllocaInst inserted.
+// This file provide the function DemoteRegToStack(). This function takes a
+// virtual register computed by an Instruction& X and replaces it with a slot in
+// the stack frame, allocated via alloca. It returns the pointer to the
+// AllocaInst inserted.
+//
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/Utils/DemoteRegToStack.h"
#include "llvm/Function.h"
-#include "llvm/BasicBlock.h"
#include "llvm/iMemory.h"
#include "llvm/iPHINode.h"
#include "llvm/iTerminators.h"
#include "Support/hash_set"
#include <stack>
-
//----------------------------------------------------------------------------
// function DemoteRegToStack()
//
// Helper function to push a phi *and* all its operands to the worklist!
// Do not push an instruction if it is already in the result set of Phis to go.
inline void PushOperandsOnWorkList(std::stack<Instruction*>& workList,
- PhiSet& phisToGo, PHINode* phiN)
-{
- for (User::op_iterator OI=phiN->op_begin(), OE=phiN->op_end();
+ PhiSet& phisToGo, PHINode* phiN) {
+ for (User::op_iterator OI = phiN->op_begin(), OE = phiN->op_end();
OI != OE; ++OI)
- if (Instruction* opI = dyn_cast<Instruction>(OI->get()))
+ if (Instruction* opI = dyn_cast<Instruction>(OI))
if (!isa<PHINode>(opI) ||
phisToGo.find(cast<PHINode>(opI)) == phisToGo.end())
workList.push(opI);