* | ``Function::iterator`` - Typedef for basic block list iterator
| ``Function::const_iterator`` - Typedef for const_iterator.
- | ``begin()``, ``end()``, ``size()``, ``empty()``
+ | ``begin()``, ``end()``, ``size()``, ``empty()``, ``insert()``,
+ ``splice()``, ``erase()``
These are forwarding methods that make it easy to access the contents of a
``Function`` object's BasicBlock_ list.
-* ``Function::BasicBlockListType &getBasicBlockList()``
-
- Returns the list of BasicBlock_\ s. This is necessary to use when you need to
- update the list or perform a complex action that doesn't have a forwarding
- method.
-
* | ``Function::arg_iterator`` - Typedef for the argument list iterator
| ``Function::const_arg_iterator`` - Typedef for const_iterator.
| ``arg_begin()``, ``arg_end()``, ``arg_size()``, ``arg_empty()``
.. code-block:: c++
// Emit else block.
- TheFunction->getBasicBlockList().push_back(ElseBB);
+ TheFunction->insert(TheFunction->end(), ElseBB);
Builder.SetInsertPoint(ElseBB);
Value *ElseV = Else->codegen();
.. code-block:: c++
// Emit merge block.
- TheFunction->getBasicBlockList().push_back(MergeBB);
+ TheFunction->insert(TheFunction->end(), MergeBB);
Builder.SetInsertPoint(MergeBB);
PHINode *PN =
Builder.CreatePHI(Type::getDoubleTy(TheContext), 2, "iftmp");