LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
llvm::RegionNode Class Reference

A RegionNode represents a subregion or a BasicBlock that is part of a Region. More...

#include <RegionInfo.h>

Inheritance diagram for llvm::RegionNode:
Inheritance graph
[legend]
Collaboration diagram for llvm::RegionNode:
Collaboration graph
[legend]

Public Member Functions

 RegionNode (Region *Parent, BasicBlock *Entry, bool isSubRegion=0)
 Create a RegionNode. More...
 
RegiongetParent () const
 Get the parent Region of this RegionNode. More...
 
BasicBlockgetEntry () const
 Get the entry BasicBlock of this RegionNode. More...
 
template<class T >
TgetNodeAs () const
 Get the content of this RegionNode. More...
 
bool isSubRegion () const
 Is this RegionNode a subregion? More...
 
template<>
BasicBlockgetNodeAs () const
 
template<>
RegiongetNodeAs () const
 

Protected Attributes

PointerIntPair< BasicBlock
*, 1, bool
entry
 
Regionparent
 The parent Region of this RegionNode. More...
 

Detailed Description

A RegionNode represents a subregion or a BasicBlock that is part of a Region.

Definition at line 56 of file RegionInfo.h.

Constructor & Destructor Documentation

llvm::RegionNode::RegionNode ( Region Parent,
BasicBlock Entry,
bool  isSubRegion = 0 
)
inline

Create a RegionNode.

Parameters
ParentThe parent of this RegionNode.
EntryThe entry BasicBlock of the RegionNode. If this RegionNode represents a BasicBlock, this is the BasicBlock itself. If it represents a subregion, this is the entry BasicBlock of the subregion.
isSubRegionIf this RegionNode represents a SubRegion.

Definition at line 86 of file RegionInfo.h.

Member Function Documentation

BasicBlock* llvm::RegionNode::getEntry ( ) const
inline

Get the entry BasicBlock of this RegionNode.

If this RegionNode represents a BasicBlock this is just the BasicBlock itself, otherwise we return the entry BasicBlock of the Subregion

Returns
The entry BasicBlock of this RegionNode.

Definition at line 105 of file RegionInfo.h.

References entry, and llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits >::getPointer().

Referenced by llvm::Region::getEntry().

template<class T >
T* llvm::RegionNode::getNodeAs ( ) const
inline

Get the content of this RegionNode.

This can be either a BasicBlock or a subregion. Before calling getNodeAs() check the type of the content with the isSubRegion() function call.

Returns
The content of this RegionNode.

Referenced by buildExtractionBlockSet(), llvm::DOTGraphTraits< RegionInfo * >::getEdgeAttributes(), llvm::DOTGraphTraits< RegionNode * >::getNodeLabel(), and llvm::operator<<().

template<>
BasicBlock* llvm::RegionNode::getNodeAs ( ) const
inline

Definition at line 129 of file RegionInfo.h.

template<>
Region* llvm::RegionNode::getNodeAs ( ) const
inline

Definition at line 135 of file RegionInfo.h.

Region* llvm::RegionNode::getParent ( ) const
inline

Get the parent Region of this RegionNode.

The parent Region is the Region this RegionNode belongs to. If for example a BasicBlock is element of two Regions, there exist two RegionNodes for this BasicBlock. Each with the getParent() function pointing to the Region this RegionNode belongs to.

Returns
Get the parent Region of this RegionNode.

Definition at line 97 of file RegionInfo.h.

References parent.

Referenced by llvm::Region::getParent().

bool llvm::RegionNode::isSubRegion ( ) const
inline

Member Data Documentation

PointerIntPair<BasicBlock*, 1, bool> llvm::RegionNode::entry
protected

This is the entry basic block that starts this region node. If this is a BasicBlock RegionNode, then entry is just the basic block, that this RegionNode represents. Otherwise it is the entry of this (Sub)RegionNode.

In the BBtoRegionNode map of the parent of this node, BB will always map to this node no matter which kind of node this one is.

The node can hold either a Region or a BasicBlock. Use one bit to save, if this RegionNode is a subregion or BasicBlock RegionNode.

Definition at line 71 of file RegionInfo.h.

Referenced by llvm::Region::contains(), llvm::Region::getEnteringBlock(), getEntry(), isSubRegion(), and llvm::Region::replaceEntry().

Region* llvm::RegionNode::parent
protected

The documentation for this class was generated from the following file: