diff options
author | Chris Lattner <sabre@nondot.org> | 2002-02-12 21:07:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-02-12 21:07:25 +0000 |
commit | 60a6591d83e82990bd8097a08f4d9e51dc63f7cb (patch) | |
tree | 833b7f0a2cafb5fc45f410f40d90ffee44861794 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | 80de23155ae2e9b9f01a6ba5c42b2bb2c52f9406 (diff) | |
download | bcm5719-llvm-60a6591d83e82990bd8097a08f4d9e51dc63f7cb.tar.gz bcm5719-llvm-60a6591d83e82990bd8097a08f4d9e51dc63f7cb.zip |
Method.h no longer includes BasicBlock.h
Method::inst_* is now in llvm/Support/InstIterator.h
GraphTraits specializations for BasicBlock and Methods are now in llvm/Support/CFG.h
llvm-svn: 1746
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 3ff3e8ceea2..4bb17f15fec 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -12,6 +12,7 @@ #include "llvm/Target/MachineFrameInfo.h" #include "llvm/Target/MachineCacheInfo.h" #include "llvm/Method.h" +#include "llvm/BasicBlock.h" #include "llvm/iOther.h" #include <limits.h> @@ -56,11 +57,11 @@ ComputeMaxOptionalArgsSize(const TargetMachine& target, const Method* method) unsigned int maxSize = 0; - for (Method::const_inst_iterator I=method->inst_begin(),E=method->inst_end(); - I != E; ++I) - if ((*I)->getOpcode() == Instruction::Call) - { - CallInst* callInst = cast<CallInst>(*I); + for (Method::const_iterator MI=method->begin(), ME=method->end(); + MI != ME; ++MI) { + const BasicBlock *BB = *MI; + for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I) + if (CallInst *callInst = dyn_cast<CallInst>(*I)) { unsigned int numOperands = callInst->getNumOperands() - 1; int numExtra = (int) numOperands - frameInfo.getNumFixedOutgoingArgs(); if (numExtra <= 0) @@ -84,7 +85,7 @@ ComputeMaxOptionalArgsSize(const TargetMachine& target, const Method* method) if (maxSize < sizeForThisCall) maxSize = sizeForThisCall; } - + } return maxSize; } |