From 221d688a5ef21a22c2368c9fff0e92d7966c95e5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 12 Feb 2002 21:07:25 +0000 Subject: 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1746 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineFunction.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/CodeGen/MachineFunction.cpp') diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index 3ff3e8ceea..4bb17f15fe 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/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 @@ -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(*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(*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; } -- cgit v1.2.3-18-g5258