summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/DemoteRegToStack.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-29 15:12:27 +0000
committerChris Lattner <sabre@nondot.org>2003-05-29 15:12:27 +0000
commitab2b328c78cd59d663358c550d7b951b55059c3d (patch)
tree883f956a00eb2f8da773db822b049b7bfc5fc7ee /lib/Transforms/Utils/DemoteRegToStack.cpp
parentca398dc3989d35e8516489fd163e012133bd41cb (diff)
downloadllvm-ab2b328c78cd59d663358c550d7b951b55059c3d.tar.gz
llvm-ab2b328c78cd59d663358c550d7b951b55059c3d.tar.bz2
llvm-ab2b328c78cd59d663358c550d7b951b55059c3d.tar.xz
Eliminate unnecessary ->get calls that are now automatically handled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/DemoteRegToStack.cpp')
-rw-r--r--lib/Transforms/Utils/DemoteRegToStack.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/Transforms/Utils/DemoteRegToStack.cpp b/lib/Transforms/Utils/DemoteRegToStack.cpp
index 76725ec14e..0f54702896 100644
--- a/lib/Transforms/Utils/DemoteRegToStack.cpp
+++ b/lib/Transforms/Utils/DemoteRegToStack.cpp
@@ -1,14 +1,14 @@
//===- 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"
@@ -16,7 +16,6 @@
#include "Support/hash_set"
#include <stack>
-
//----------------------------------------------------------------------------
// function DemoteRegToStack()
//
@@ -28,11 +27,10 @@ typedef hash_set<PHINode*>::iterator PhiSetIterator;
// 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);