Class IfDirectiveContextFinder#
Defined in File IfDirectiveContextFinder.hh
Inheritance Relationships#
Base Type#
public CPreproc::IfDirectiveExtractor(Class IfDirectiveExtractor)
Class Documentation#
-
class IfDirectiveContextFinder : public CPreproc::IfDirectiveExtractor#
Find the ‘#if’ case surrounding a given node.
Given a target node, this traversal extracts the full program’s ‘#if’ directive structure and determines which ‘#if’ case surrounds the top and bottom portion of the target node.
For example, suppose a target SgBasicBlock is situated in the source code as follows:
// … #elif CONDITION_1 // … { // … #elif CONDITION_2 // … } // …
Then, this traversal permits the caller to determine that ‘#elif CONDITION_1’ guards the top of the block, and ‘#elif CONDITION_2’ guards the bottom of the block.
Get context.