Changeset View
Changeset View
Standalone View
Standalone View
include/llvm/Target/TargetInstrInfo.h
Show First 20 Lines • Show All 446 Lines • ▼ Show 20 Line(s) | 144 | public: | |||
---|---|---|---|---|---|
447 | /// methods to create new branches. | 447 | /// methods to create new branches. | ||
448 | /// | 448 | /// | ||
449 | /// Note that RemoveBranch and InsertBranch must be implemented to support | 449 | /// Note that RemoveBranch and InsertBranch must be implemented to support | ||
450 | /// cases where this method returns success. | 450 | /// cases where this method returns success. | ||
451 | /// | 451 | /// | ||
452 | /// If AllowModify is true, then this routine is allowed to modify the basic | 452 | /// If AllowModify is true, then this routine is allowed to modify the basic | ||
453 | /// block (e.g. delete instructions after the unconditional branch). | 453 | /// block (e.g. delete instructions after the unconditional branch). | ||
454 | /// | 454 | /// | ||
455 | /// The CFG information must be valid before calling this function. | ||||
DavidKreitzer: Both here and at 526, I would recommend saying explicitly, "The CFG information in MBB. | |||||
conghAuthorUnsubmitted Not Done ReplyDone. congh: Done. | |||||
455 | virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, | 456 | virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, | ||
456 | MachineBasicBlock *&FBB, | 457 | MachineBasicBlock *&FBB, | ||
457 | SmallVectorImpl<MachineOperand> &Cond, | 458 | SmallVectorImpl<MachineOperand> &Cond, | ||
458 | bool AllowModify = false) const { | 459 | bool AllowModify = false) const { | ||
459 | return true; | 460 | return true; | ||
460 | } | 461 | } | ||
461 | 462 | | |||
462 | /// Represents a predicate at the MachineFunction level. The control flow a | 463 | /// Represents a predicate at the MachineFunction level. The control flow a | ||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | |||||
516 | /// returned by AnalyzeBranch. This is only invoked in cases where | 517 | /// returned by AnalyzeBranch. This is only invoked in cases where | ||
517 | /// AnalyzeBranch returns success. It returns the number of instructions | 518 | /// AnalyzeBranch returns success. It returns the number of instructions | ||
518 | /// inserted. | 519 | /// inserted. | ||
519 | /// | 520 | /// | ||
520 | /// It is also invoked by tail merging to add unconditional branches in | 521 | /// It is also invoked by tail merging to add unconditional branches in | ||
521 | /// cases where AnalyzeBranch doesn't apply because there was no original | 522 | /// cases where AnalyzeBranch doesn't apply because there was no original | ||
522 | /// branch to analyze. At least this much must be implemented, else tail | 523 | /// branch to analyze. At least this much must be implemented, else tail | ||
523 | /// merging needs to be disabled. | 524 | /// merging needs to be disabled. | ||
525 | /// | ||||
526 | /// The CFG information must be valid before calling this function. | ||||
524 | virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, | 527 | virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, | ||
525 | MachineBasicBlock *FBB, | 528 | MachineBasicBlock *FBB, | ||
526 | ArrayRef<MachineOperand> Cond, | 529 | ArrayRef<MachineOperand> Cond, | ||
527 | DebugLoc DL) const { | 530 | DebugLoc DL) const { | ||
528 | llvm_unreachable("Target didn't implement TargetInstrInfo::InsertBranch!"); | 531 | llvm_unreachable("Target didn't implement TargetInstrInfo::InsertBranch!"); | ||
529 | } | 532 | } | ||
530 | 533 | | |||
531 | /// Delete the instruction OldInst and everything after it, replacing it with | 534 | /// Delete the instruction OldInst and everything after it, replacing it with | ||
▲ Show 20 Lines • Show All 905 Lines • Show Last 20 Lines |
Both here and at 526, I would recommend saying explicitly, "The CFG information in MBB.Predecessors and MBB.Successors must be valid before calling this function."