[IR] Add LLVM_READONLY to BasicBlock::getTerminator.

I noticed that this function got called twice in compiled code to create succ_begin and succ_end iterators. Adding this directive helps the compiler share the call.

Ideally we'd just make this method available for inlining since its quite simple, but the current header file arrangements don't allow that.

llvm-svn: 292754
This commit is contained in:
Craig Topper 2017-01-22 06:53:07 +00:00
parent 6f8e989b21
commit eb3067ee85
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ public:
/// \brief Returns the terminator instruction if the block is well formed or
/// null if the block is not well formed.
TerminatorInst *getTerminator();
TerminatorInst *getTerminator() LLVM_READONLY;
const TerminatorInst *getTerminator() const {
return const_cast<BasicBlock *>(this)->getTerminator();
}