1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

[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 06d7099dce
commit eb278db84d

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();
}