MachineBasicBlock.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. //===-- llvm/CodeGen/MachineBasicBlock.cpp ----------------------*- C++ -*-===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // Collect the sequence of machine instructions for a basic block.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #include "llvm/CodeGen/MachineBasicBlock.h"
  14. #include "llvm/BasicBlock.h"
  15. #include "llvm/CodeGen/MachineFunction.h"
  16. #include "llvm/MC/MCAsmInfo.h"
  17. #include "llvm/MC/MCContext.h"
  18. #include "llvm/Target/TargetRegisterInfo.h"
  19. #include "llvm/Target/TargetData.h"
  20. #include "llvm/Target/TargetInstrDesc.h"
  21. #include "llvm/Target/TargetInstrInfo.h"
  22. #include "llvm/Target/TargetMachine.h"
  23. #include "llvm/Assembly/Writer.h"
  24. #include "llvm/ADT/SmallString.h"
  25. #include "llvm/Support/Debug.h"
  26. #include "llvm/Support/LeakDetector.h"
  27. #include "llvm/Support/raw_ostream.h"
  28. #include <algorithm>
  29. using namespace llvm;
  30. MachineBasicBlock::MachineBasicBlock(MachineFunction &mf, const BasicBlock *bb)
  31. : BB(bb), Number(-1), xParent(&mf), Alignment(0), IsLandingPad(false),
  32. AddressTaken(false) {
  33. Insts.Parent = this;
  34. }
  35. MachineBasicBlock::~MachineBasicBlock() {
  36. LeakDetector::removeGarbageObject(this);
  37. }
  38. /// getSymbol - Return the MCSymbol for this basic block.
  39. ///
  40. MCSymbol *MachineBasicBlock::getSymbol(MCContext &Ctx) const {
  41. SmallString<60> Name;
  42. const MachineFunction *MF = getParent();
  43. raw_svector_ostream(Name)
  44. << MF->getTarget().getMCAsmInfo()->getPrivateGlobalPrefix() << "BB"
  45. << MF->getFunctionNumber() << '_' << getNumber();
  46. return Ctx.GetOrCreateSymbol(Name.str());
  47. }
  48. raw_ostream &llvm::operator<<(raw_ostream &OS, const MachineBasicBlock &MBB) {
  49. MBB.print(OS);
  50. return OS;
  51. }
  52. /// addNodeToList (MBB) - When an MBB is added to an MF, we need to update the
  53. /// parent pointer of the MBB, the MBB numbering, and any instructions in the
  54. /// MBB to be on the right operand list for registers.
  55. ///
  56. /// MBBs start out as #-1. When a MBB is added to a MachineFunction, it
  57. /// gets the next available unique MBB number. If it is removed from a
  58. /// MachineFunction, it goes back to being #-1.
  59. void ilist_traits<MachineBasicBlock>::addNodeToList(MachineBasicBlock *N) {
  60. MachineFunction &MF = *N->getParent();
  61. N->Number = MF.addToMBBNumbering(N);
  62. // Make sure the instructions have their operands in the reginfo lists.
  63. MachineRegisterInfo &RegInfo = MF.getRegInfo();
  64. for (MachineBasicBlock::iterator I = N->begin(), E = N->end(); I != E; ++I)
  65. I->AddRegOperandsToUseLists(RegInfo);
  66. LeakDetector::removeGarbageObject(N);
  67. }
  68. void ilist_traits<MachineBasicBlock>::removeNodeFromList(MachineBasicBlock *N) {
  69. N->getParent()->removeFromMBBNumbering(N->Number);
  70. N->Number = -1;
  71. LeakDetector::addGarbageObject(N);
  72. }
  73. /// addNodeToList (MI) - When we add an instruction to a basic block
  74. /// list, we update its parent pointer and add its operands from reg use/def
  75. /// lists if appropriate.
  76. void ilist_traits<MachineInstr>::addNodeToList(MachineInstr *N) {
  77. assert(N->getParent() == 0 && "machine instruction already in a basic block");
  78. N->setParent(Parent);
  79. // Add the instruction's register operands to their corresponding
  80. // use/def lists.
  81. MachineFunction *MF = Parent->getParent();
  82. N->AddRegOperandsToUseLists(MF->getRegInfo());
  83. LeakDetector::removeGarbageObject(N);
  84. }
  85. /// removeNodeFromList (MI) - When we remove an instruction from a basic block
  86. /// list, we update its parent pointer and remove its operands from reg use/def
  87. /// lists if appropriate.
  88. void ilist_traits<MachineInstr>::removeNodeFromList(MachineInstr *N) {
  89. assert(N->getParent() != 0 && "machine instruction not in a basic block");
  90. // Remove from the use/def lists.
  91. N->RemoveRegOperandsFromUseLists();
  92. N->setParent(0);
  93. LeakDetector::addGarbageObject(N);
  94. }
  95. /// transferNodesFromList (MI) - When moving a range of instructions from one
  96. /// MBB list to another, we need to update the parent pointers and the use/def
  97. /// lists.
  98. void ilist_traits<MachineInstr>::
  99. transferNodesFromList(ilist_traits<MachineInstr> &fromList,
  100. MachineBasicBlock::iterator first,
  101. MachineBasicBlock::iterator last) {
  102. assert(Parent->getParent() == fromList.Parent->getParent() &&
  103. "MachineInstr parent mismatch!");
  104. // Splice within the same MBB -> no change.
  105. if (Parent == fromList.Parent) return;
  106. // If splicing between two blocks within the same function, just update the
  107. // parent pointers.
  108. for (; first != last; ++first)
  109. first->setParent(Parent);
  110. }
  111. void ilist_traits<MachineInstr>::deleteNode(MachineInstr* MI) {
  112. assert(!MI->getParent() && "MI is still in a block!");
  113. Parent->getParent()->DeleteMachineInstr(MI);
  114. }
  115. MachineBasicBlock::iterator MachineBasicBlock::getFirstTerminator() {
  116. iterator I = end();
  117. while (I != begin() && (--I)->getDesc().isTerminator())
  118. ; /*noop */
  119. if (I != end() && !I->getDesc().isTerminator()) ++I;
  120. return I;
  121. }
  122. /// isOnlyReachableViaFallthough - Return true if this basic block has
  123. /// exactly one predecessor and the control transfer mechanism between
  124. /// the predecessor and this block is a fall-through.
  125. bool MachineBasicBlock::isOnlyReachableByFallthrough() const {
  126. // If this is a landing pad, it isn't a fall through. If it has no preds,
  127. // then nothing falls through to it.
  128. if (isLandingPad() || pred_empty())
  129. return false;
  130. // If there isn't exactly one predecessor, it can't be a fall through.
  131. const_pred_iterator PI = pred_begin(), PI2 = PI;
  132. ++PI2;
  133. if (PI2 != pred_end())
  134. return false;
  135. // The predecessor has to be immediately before this block.
  136. const MachineBasicBlock *Pred = *PI;
  137. if (!Pred->isLayoutSuccessor(this))
  138. return false;
  139. // If the block is completely empty, then it definitely does fall through.
  140. if (Pred->empty())
  141. return true;
  142. // Otherwise, check the last instruction.
  143. const MachineInstr &LastInst = Pred->back();
  144. return !LastInst.getDesc().isBarrier();
  145. }
  146. void MachineBasicBlock::dump() const {
  147. print(dbgs());
  148. }
  149. static inline void OutputReg(raw_ostream &os, unsigned RegNo,
  150. const TargetRegisterInfo *TRI = 0) {
  151. if (RegNo != 0 && TargetRegisterInfo::isPhysicalRegister(RegNo)) {
  152. if (TRI)
  153. os << " %" << TRI->get(RegNo).Name;
  154. else
  155. os << " %physreg" << RegNo;
  156. } else
  157. os << " %reg" << RegNo;
  158. }
  159. StringRef MachineBasicBlock::getName() const {
  160. if (const BasicBlock *LBB = getBasicBlock())
  161. return LBB->getName();
  162. else
  163. return "(null)";
  164. }
  165. void MachineBasicBlock::print(raw_ostream &OS) const {
  166. const MachineFunction *MF = getParent();
  167. if (!MF) {
  168. OS << "Can't print out MachineBasicBlock because parent MachineFunction"
  169. << " is null\n";
  170. return;
  171. }
  172. if (Alignment) { OS << "Alignment " << Alignment << "\n"; }
  173. OS << "BB#" << getNumber() << ": ";
  174. const char *Comma = "";
  175. if (const BasicBlock *LBB = getBasicBlock()) {
  176. OS << Comma << "derived from LLVM BB ";
  177. WriteAsOperand(OS, LBB, /*PrintType=*/false);
  178. Comma = ", ";
  179. }
  180. if (isLandingPad()) { OS << Comma << "EH LANDING PAD"; Comma = ", "; }
  181. if (hasAddressTaken()) { OS << Comma << "ADDRESS TAKEN"; Comma = ", "; }
  182. OS << '\n';
  183. const TargetRegisterInfo *TRI = MF->getTarget().getRegisterInfo();
  184. if (!livein_empty()) {
  185. OS << " Live Ins:";
  186. for (const_livein_iterator I = livein_begin(),E = livein_end(); I != E; ++I)
  187. OutputReg(OS, *I, TRI);
  188. OS << '\n';
  189. }
  190. // Print the preds of this block according to the CFG.
  191. if (!pred_empty()) {
  192. OS << " Predecessors according to CFG:";
  193. for (const_pred_iterator PI = pred_begin(), E = pred_end(); PI != E; ++PI)
  194. OS << " BB#" << (*PI)->getNumber();
  195. OS << '\n';
  196. }
  197. for (const_iterator I = begin(); I != end(); ++I) {
  198. OS << '\t';
  199. I->print(OS, &getParent()->getTarget());
  200. }
  201. // Print the successors of this block according to the CFG.
  202. if (!succ_empty()) {
  203. OS << " Successors according to CFG:";
  204. for (const_succ_iterator SI = succ_begin(), E = succ_end(); SI != E; ++SI)
  205. OS << " BB#" << (*SI)->getNumber();
  206. OS << '\n';
  207. }
  208. }
  209. void MachineBasicBlock::removeLiveIn(unsigned Reg) {
  210. livein_iterator I = std::find(livein_begin(), livein_end(), Reg);
  211. assert(I != livein_end() && "Not a live in!");
  212. LiveIns.erase(I);
  213. }
  214. bool MachineBasicBlock::isLiveIn(unsigned Reg) const {
  215. const_livein_iterator I = std::find(livein_begin(), livein_end(), Reg);
  216. return I != livein_end();
  217. }
  218. void MachineBasicBlock::moveBefore(MachineBasicBlock *NewAfter) {
  219. getParent()->splice(NewAfter, this);
  220. }
  221. void MachineBasicBlock::moveAfter(MachineBasicBlock *NewBefore) {
  222. MachineFunction::iterator BBI = NewBefore;
  223. getParent()->splice(++BBI, this);
  224. }
  225. void MachineBasicBlock::updateTerminator() {
  226. const TargetInstrInfo *TII = getParent()->getTarget().getInstrInfo();
  227. // A block with no successors has no concerns with fall-through edges.
  228. if (this->succ_empty()) return;
  229. MachineBasicBlock *TBB = 0, *FBB = 0;
  230. SmallVector<MachineOperand, 4> Cond;
  231. bool B = TII->AnalyzeBranch(*this, TBB, FBB, Cond);
  232. (void) B;
  233. assert(!B && "UpdateTerminators requires analyzable predecessors!");
  234. if (Cond.empty()) {
  235. if (TBB) {
  236. // The block has an unconditional branch. If its successor is now
  237. // its layout successor, delete the branch.
  238. if (isLayoutSuccessor(TBB))
  239. TII->RemoveBranch(*this);
  240. } else {
  241. // The block has an unconditional fallthrough. If its successor is not
  242. // its layout successor, insert a branch.
  243. TBB = *succ_begin();
  244. if (!isLayoutSuccessor(TBB))
  245. TII->InsertBranch(*this, TBB, 0, Cond);
  246. }
  247. } else {
  248. if (FBB) {
  249. // The block has a non-fallthrough conditional branch. If one of its
  250. // successors is its layout successor, rewrite it to a fallthrough
  251. // conditional branch.
  252. if (isLayoutSuccessor(TBB)) {
  253. if (TII->ReverseBranchCondition(Cond))
  254. return;
  255. TII->RemoveBranch(*this);
  256. TII->InsertBranch(*this, FBB, 0, Cond);
  257. } else if (isLayoutSuccessor(FBB)) {
  258. TII->RemoveBranch(*this);
  259. TII->InsertBranch(*this, TBB, 0, Cond);
  260. }
  261. } else {
  262. // The block has a fallthrough conditional branch.
  263. MachineBasicBlock *MBBA = *succ_begin();
  264. MachineBasicBlock *MBBB = *llvm::next(succ_begin());
  265. if (MBBA == TBB) std::swap(MBBB, MBBA);
  266. if (isLayoutSuccessor(TBB)) {
  267. if (TII->ReverseBranchCondition(Cond)) {
  268. // We can't reverse the condition, add an unconditional branch.
  269. Cond.clear();
  270. TII->InsertBranch(*this, MBBA, 0, Cond);
  271. return;
  272. }
  273. TII->RemoveBranch(*this);
  274. TII->InsertBranch(*this, MBBA, 0, Cond);
  275. } else if (!isLayoutSuccessor(MBBA)) {
  276. TII->RemoveBranch(*this);
  277. TII->InsertBranch(*this, TBB, MBBA, Cond);
  278. }
  279. }
  280. }
  281. }
  282. void MachineBasicBlock::addSuccessor(MachineBasicBlock *succ) {
  283. Successors.push_back(succ);
  284. succ->addPredecessor(this);
  285. }
  286. void MachineBasicBlock::removeSuccessor(MachineBasicBlock *succ) {
  287. succ->removePredecessor(this);
  288. succ_iterator I = std::find(Successors.begin(), Successors.end(), succ);
  289. assert(I != Successors.end() && "Not a current successor!");
  290. Successors.erase(I);
  291. }
  292. MachineBasicBlock::succ_iterator
  293. MachineBasicBlock::removeSuccessor(succ_iterator I) {
  294. assert(I != Successors.end() && "Not a current successor!");
  295. (*I)->removePredecessor(this);
  296. return Successors.erase(I);
  297. }
  298. void MachineBasicBlock::addPredecessor(MachineBasicBlock *pred) {
  299. Predecessors.push_back(pred);
  300. }
  301. void MachineBasicBlock::removePredecessor(MachineBasicBlock *pred) {
  302. std::vector<MachineBasicBlock *>::iterator I =
  303. std::find(Predecessors.begin(), Predecessors.end(), pred);
  304. assert(I != Predecessors.end() && "Pred is not a predecessor of this block!");
  305. Predecessors.erase(I);
  306. }
  307. void MachineBasicBlock::transferSuccessors(MachineBasicBlock *fromMBB) {
  308. if (this == fromMBB)
  309. return;
  310. for (MachineBasicBlock::succ_iterator I = fromMBB->succ_begin(),
  311. E = fromMBB->succ_end(); I != E; ++I)
  312. addSuccessor(*I);
  313. while (!fromMBB->succ_empty())
  314. fromMBB->removeSuccessor(fromMBB->succ_begin());
  315. }
  316. bool MachineBasicBlock::isSuccessor(const MachineBasicBlock *MBB) const {
  317. std::vector<MachineBasicBlock *>::const_iterator I =
  318. std::find(Successors.begin(), Successors.end(), MBB);
  319. return I != Successors.end();
  320. }
  321. bool MachineBasicBlock::isLayoutSuccessor(const MachineBasicBlock *MBB) const {
  322. MachineFunction::const_iterator I(this);
  323. return llvm::next(I) == MachineFunction::const_iterator(MBB);
  324. }
  325. bool MachineBasicBlock::canFallThrough() {
  326. MachineFunction::iterator Fallthrough = this;
  327. ++Fallthrough;
  328. // If FallthroughBlock is off the end of the function, it can't fall through.
  329. if (Fallthrough == getParent()->end())
  330. return false;
  331. // If FallthroughBlock isn't a successor, no fallthrough is possible.
  332. if (!isSuccessor(Fallthrough))
  333. return false;
  334. // Analyze the branches, if any, at the end of the block.
  335. MachineBasicBlock *TBB = 0, *FBB = 0;
  336. SmallVector<MachineOperand, 4> Cond;
  337. const TargetInstrInfo *TII = getParent()->getTarget().getInstrInfo();
  338. if (TII->AnalyzeBranch(*this, TBB, FBB, Cond)) {
  339. // If we couldn't analyze the branch, examine the last instruction.
  340. // If the block doesn't end in a known control barrier, assume fallthrough
  341. // is possible. The isPredicable check is needed because this code can be
  342. // called during IfConversion, where an instruction which is normally a
  343. // Barrier is predicated and thus no longer an actual control barrier. This
  344. // is over-conservative though, because if an instruction isn't actually
  345. // predicated we could still treat it like a barrier.
  346. return empty() || !back().getDesc().isBarrier() ||
  347. back().getDesc().isPredicable();
  348. }
  349. // If there is no branch, control always falls through.
  350. if (TBB == 0) return true;
  351. // If there is some explicit branch to the fallthrough block, it can obviously
  352. // reach, even though the branch should get folded to fall through implicitly.
  353. if (MachineFunction::iterator(TBB) == Fallthrough ||
  354. MachineFunction::iterator(FBB) == Fallthrough)
  355. return true;
  356. // If it's an unconditional branch to some block not the fall through, it
  357. // doesn't fall through.
  358. if (Cond.empty()) return false;
  359. // Otherwise, if it is conditional and has no explicit false block, it falls
  360. // through.
  361. return FBB == 0;
  362. }
  363. /// removeFromParent - This method unlinks 'this' from the containing function,
  364. /// and returns it, but does not delete it.
  365. MachineBasicBlock *MachineBasicBlock::removeFromParent() {
  366. assert(getParent() && "Not embedded in a function!");
  367. getParent()->remove(this);
  368. return this;
  369. }
  370. /// eraseFromParent - This method unlinks 'this' from the containing function,
  371. /// and deletes it.
  372. void MachineBasicBlock::eraseFromParent() {
  373. assert(getParent() && "Not embedded in a function!");
  374. getParent()->erase(this);
  375. }
  376. /// ReplaceUsesOfBlockWith - Given a machine basic block that branched to
  377. /// 'Old', change the code and CFG so that it branches to 'New' instead.
  378. void MachineBasicBlock::ReplaceUsesOfBlockWith(MachineBasicBlock *Old,
  379. MachineBasicBlock *New) {
  380. assert(Old != New && "Cannot replace self with self!");
  381. MachineBasicBlock::iterator I = end();
  382. while (I != begin()) {
  383. --I;
  384. if (!I->getDesc().isTerminator()) break;
  385. // Scan the operands of this machine instruction, replacing any uses of Old
  386. // with New.
  387. for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
  388. if (I->getOperand(i).isMBB() &&
  389. I->getOperand(i).getMBB() == Old)
  390. I->getOperand(i).setMBB(New);
  391. }
  392. // Update the successor information.
  393. removeSuccessor(Old);
  394. addSuccessor(New);
  395. }
  396. /// CorrectExtraCFGEdges - Various pieces of code can cause excess edges in the
  397. /// CFG to be inserted. If we have proven that MBB can only branch to DestA and
  398. /// DestB, remove any other MBB successors from the CFG. DestA and DestB can be
  399. /// null.
  400. ///
  401. /// Besides DestA and DestB, retain other edges leading to LandingPads
  402. /// (currently there can be only one; we don't check or require that here).
  403. /// Note it is possible that DestA and/or DestB are LandingPads.
  404. bool MachineBasicBlock::CorrectExtraCFGEdges(MachineBasicBlock *DestA,
  405. MachineBasicBlock *DestB,
  406. bool isCond) {
  407. // The values of DestA and DestB frequently come from a call to the
  408. // 'TargetInstrInfo::AnalyzeBranch' method. We take our meaning of the initial
  409. // values from there.
  410. //
  411. // 1. If both DestA and DestB are null, then the block ends with no branches
  412. // (it falls through to its successor).
  413. // 2. If DestA is set, DestB is null, and isCond is false, then the block ends
  414. // with only an unconditional branch.
  415. // 3. If DestA is set, DestB is null, and isCond is true, then the block ends
  416. // with a conditional branch that falls through to a successor (DestB).
  417. // 4. If DestA and DestB is set and isCond is true, then the block ends with a
  418. // conditional branch followed by an unconditional branch. DestA is the
  419. // 'true' destination and DestB is the 'false' destination.
  420. bool MadeChange = false;
  421. bool AddedFallThrough = false;
  422. MachineFunction::iterator FallThru =
  423. llvm::next(MachineFunction::iterator(this));
  424. if (isCond) {
  425. // If this block ends with a conditional branch that falls through to its
  426. // successor, set DestB as the successor.
  427. if (DestB == 0 && FallThru != getParent()->end()) {
  428. DestB = FallThru;
  429. AddedFallThrough = true;
  430. }
  431. } else {
  432. // If this is an unconditional branch with no explicit dest, it must just be
  433. // a fallthrough into DestA.
  434. if (DestA == 0 && FallThru != getParent()->end()) {
  435. DestA = FallThru;
  436. AddedFallThrough = true;
  437. }
  438. }
  439. MachineBasicBlock::succ_iterator SI = succ_begin();
  440. MachineBasicBlock *OrigDestA = DestA, *OrigDestB = DestB;
  441. while (SI != succ_end()) {
  442. const MachineBasicBlock *MBB = *SI;
  443. if (MBB == DestA) {
  444. DestA = 0;
  445. ++SI;
  446. } else if (MBB == DestB) {
  447. DestB = 0;
  448. ++SI;
  449. } else if (MBB->isLandingPad() &&
  450. MBB != OrigDestA && MBB != OrigDestB) {
  451. ++SI;
  452. } else {
  453. // Otherwise, this is a superfluous edge, remove it.
  454. SI = removeSuccessor(SI);
  455. MadeChange = true;
  456. }
  457. }
  458. if (!AddedFallThrough)
  459. assert(DestA == 0 && DestB == 0 && "MachineCFG is missing edges!");
  460. else if (isCond)
  461. assert(DestA == 0 && "MachineCFG is missing edges!");
  462. return MadeChange;
  463. }
  464. /// findDebugLoc - find the next valid DebugLoc starting at MBBI, skipping
  465. /// any DEBUG_VALUE instructions. Return UnknownLoc if there is none.
  466. DebugLoc
  467. MachineBasicBlock::findDebugLoc(MachineBasicBlock::iterator &MBBI) {
  468. DebugLoc DL;
  469. MachineBasicBlock::iterator E = end();
  470. if (MBBI != E) {
  471. // Skip debug declarations, we don't want a DebugLoc from them.
  472. MachineBasicBlock::iterator MBBI2 = MBBI;
  473. while (MBBI2 != E && MBBI2->isDebugValue())
  474. MBBI2++;
  475. if (MBBI2 != E)
  476. DL = MBBI2->getDebugLoc();
  477. }
  478. return DL;
  479. }
  480. void llvm::WriteAsOperand(raw_ostream &OS, const MachineBasicBlock *MBB,
  481. bool t) {
  482. OS << "BB#" << MBB->getNumber();
  483. }