diff --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h --- a/llvm/include/llvm/IR/Function.h +++ b/llvm/include/llvm/IR/Function.h @@ -719,6 +719,15 @@ /// \Returns \p ToIt. Function::iterator erase(Function::iterator FromIt, Function::iterator ToIt); +private: + // These need access to the underlying BB list. + friend void BasicBlock::removeFromParent(); + friend iplist::iterator BasicBlock::eraseFromParent(); + template + friend class InstIterator; + friend class llvm::SymbolTableListTraits; + friend class llvm::ilist_node_with_parent; + /// Get the underlying elements of the Function... the basic block list is /// empty for external functions. /// @@ -732,6 +741,7 @@ return &Function::BasicBlocks; } +public: const BasicBlock &getEntryBlock() const { return front(); } BasicBlock &getEntryBlock() { return front(); }