Skip to content

CPreproc::If

Stores a preprocessor '#if' directive and nested directives.

Synopsis

Declared in <src/midend/programTransformation/astOutlining/If.hh>

class If;

Description

If represents one instance of a preprocessor '#if' directive, including all its cases. That is, a If object corresponding to the following '#if' directive,


#if C_1 ... #elif C_2 ... #elif C_k ... #endif // k+1

stores a sequence of k cases plus the final '#endif'. One may view a If object as a container of cases (If::Cases).

In addition, If represents the complete tree of nested '#if' directives. See the case object, If::Case, for more information.

Types

Name Description
Case Stores one case of a preprocessor '#if' directive.

Type Aliases

Name Description
Cases_t Stores the cases composing an '#if' directive.
const_iterator
const_reverse_iterator
iterator
reverse_iterator

Member Functions

Name Description
If
If(); [constructor]
Default constructor.
~If
~If(); [destructor]
Destructor---frees memory associated with cases.
appendCase
Case* appendCase( PreprocessingInfo*, SgLocatedNode*);
Appends a new case.
begin
iterator begin();
end
iterator end();
firstCase
Case* firstCase();
getParent
Case* getParent();
isValid
bool isValid() const;
Returns 'true' if this appears to be a complete '#if' directive.
lastCase
Case* lastCase();
rbegin
reverse_iterator rbegin();
rend
reverse_iterator rend();
setParent
void setParent(If::Case*);
Sets the parent directive.

Private Data Members

Name Description
cases_ Stores the cases composing this directive.
parent_ Parent directive (may be NULL).

Created with MrDocs