3#define _SAGEGENERIC_H 1
14#include <Cxx_GrammarVisitorSupport.h>
22#define WITH_BINARY_NODES 0
23#define WITH_UNTYPED_NODES 0
30#define SG_UNEXPECTED_NODE(X) (sg::unexpected_node(X, __FILE__, __LINE__))
31#define SG_DEREF(X) (sg::deref(X, __FILE__, __LINE__))
32#define SG_ASSERT_TYPE(SAGENODE, N) (sg::assert_sage_type<SAGENODE>(N, __FILE__, __LINE__))
33#define SG_ERROR_IF(COND, MSG) (sg::report_error_if(COND, MSG, __FILE__, __LINE__))
46 void unused(
const T&) {}
49 template <
class T1,
class T2>
55 template <
class T1,
class T2>
58 typedef const T2 type;
65 template <
class T,
class E>
82 void report_error(std::string desc,
const char* file =
nullptr,
size_t ln = 0);
85 void unexpected_node(
const SgNode& n,
const char* file =
nullptr,
size_t ln = 0);
90 void report_error_if(
bool iserror,
const std::string& desc,
const char* file =
nullptr,
size_t ln = 0)
94 report_error(desc, file, ln);
99 T&
deref(T* ptr,
const char* file = 0,
size_t ln = 0)
101 report_error_if(!ptr,
"assertion failed: null dereference ", file, ln);
99 T&
deref(T* ptr,
const char* file = 0,
size_t ln = 0) {
…}
113 template <
class U,
class T>
128 SG_ERROR_IF(ptr ==
nullptr,
"failed null pointer check.");
139 template <class U, bool = EnableConversion<U*,T*>::value>
151 operator T*()
const {
return ptr; }
168 template <class T, class U, bool = EnableConversion<U*,T*>::value || EnableConversion<T*,U*>::value>
169 bool operator<(NotNull<T> lhs, NotNull<U> rhs)
171 return lhs.pointer() < rhs.pointer();
184 template <
class _ReturnType>
187 using ReturnType = _ReturnType;
202 : res(std::move(defaultval))
205 operator ReturnType() && {
return std::move(res); }
215 template <
class SageNode>
217 SageNode& assume_sage_type(
SgNode& n)
219 return static_cast<SageNode&
>(n);
224 template <
class SageNode>
226 const SageNode& assume_sage_type(
const SgNode& n)
228 return static_cast<const SageNode&
>(n);
231#define GEN_VISIT(X) \
232 void visit(X * n) { rv.handle(*n); }
234 template <
class RoseVisitor>
239 : rv(std::move(rosevisitor))
503 GEN_VISIT(SgJovialBitVal)
924 GEN_VISIT(SgAsmAarch64AtOperand)
925 GEN_VISIT(SgAsmAarch64BarrierOperand)
926 GEN_VISIT(SgAsmAarch64CImmediateOperand)
927 GEN_VISIT(SgAsmAarch64Instruction)
928 GEN_VISIT(SgAsmAarch64PrefetchOperand)
929 GEN_VISIT(SgAsmAarch64SysMoveOperand)
932 GEN_VISIT(SgAsmBinaryAddPostupdate)
933 GEN_VISIT(SgAsmBinaryAddPreupdate)
944 GEN_VISIT(SgAsmBinarySubtractPostupdate)
945 GEN_VISIT(SgAsmBinarySubtractPreupdate)
1248 auto nullptrHandlerTest(...) -> std::false_type;
1250 template <
class RoseVisitor>
1252 auto nullptrHandlerTest(RoseVisitor&&) ->
decltype(std::declval<RoseVisitor>().handle(
nullptr), std::true_type{});
1257 template <
class RoseVisitor>
1258 static RoseVisitor handle(RoseVisitor&& rv)
1266 struct NullHandler<std::false_type>
1268 template <
class RoseVisitor>
1270 RoseVisitor handle(RoseVisitor&& rv)
1272 ASSERT_not_null(
nullptr);
1278 template <
class RoseVisitor>
1280 typename std::remove_const<typename std::remove_reference<RoseVisitor>::type>::type
1281 _dispatch(RoseVisitor&& rv,
SgNode* n)
1283 using RoseVisitorNoref =
typename std::remove_reference<RoseVisitor>::type;
1284 using RoseHandler =
typename std::remove_const<RoseVisitorNoref>::type;
1291 VisitDispatcher<RoseHandler> vis( std::forward<RoseVisitor>(rv),
1292 std::is_lvalue_reference<RoseVisitor>()
1296 return std::move(vis).rv;
1368 template <
class RoseVisitor>
1370 typename std::remove_const<typename std::remove_reference<RoseVisitor>::type>::type
1374 return _dispatch(std::forward<RoseVisitor>(rv), n);
1377 template <
class RoseVisitor>
1379 typename std::remove_const<typename std::remove_reference<RoseVisitor>::type>::type
1383 return _dispatch(std::forward<RoseVisitor>(rv),
const_cast<SgNode*
>(n));
1395 template <
class SageNode>
1398 void handle(SageNode&) {}
1408 template <
class AncestorNode,
class QualSgNode>
1412 typedef std::pair<AncestorNode*, QualSgNode*> Pair;
1417 :
Base(), res(
nullptr,
nullptr)
1424 void handle(QualSgNode& n) { res.second = n.get_parent(); }
1425 void handle(AncestorNode& n) { res.first = &n; }
1427 operator Pair()
const {
return res; }
1432 template <
class AncestorNode,
class QualSgNode>
1437 typename AncestorFinder::Pair res(
nullptr, n.get_parent());
1439 while (res.second !=
nullptr)
1441 res = (
typename AncestorFinder::Pair)
sg::dispatch(AncestorFinder(), res.second);
1458 template <
class AncestorNode>
1461 if (n ==
nullptr)
return nullptr;
1463 return _ancestor<AncestorNode>(*n);
1467 template <
class AncestorNode>
1470 if (n ==
nullptr)
return nullptr;
1472 return _ancestor<const AncestorNode>(*n);
1476 template <
class AncestorNode>
1479 AncestorNode* res = _ancestor<AncestorNode>(n);
1486 template <
class AncestorNode>
1489 const AncestorNode* res = _ancestor<const AncestorNode>(n);
1499 template <
class SageNode>
1500 struct TypeRecoveryHandler
1502 using SageRootNode =
typename ConstLike<SageNode, SgNode>::type;
1504 TypeRecoveryHandler(
const char* f = 0,
size_t ln = 0)
1505 : res(nullptr), loc(f), loc_ln(ln)
1508 TypeRecoveryHandler(TypeRecoveryHandler&&) =
default;
1509 TypeRecoveryHandler& operator=(TypeRecoveryHandler&&) =
default;
1511 operator SageNode* () && {
return res; }
1513 void handle(SageRootNode& n) { unexpected_node(n, loc, loc_ln); }
1514 void handle(SageNode& n) { res = &n; }
1521 TypeRecoveryHandler() =
delete;
1522 TypeRecoveryHandler(
const TypeRecoveryHandler&) =
delete;
1523 TypeRecoveryHandler& operator=(
const TypeRecoveryHandler&) =
delete;
1536 template <
class SageNode>
1539 return sg::dispatch(TypeRecoveryHandler<SageNode>(f, ln), n);
1542 template <
class SageNode>
1545 return sg::dispatch(TypeRecoveryHandler<const SageNode>(f, ln), n);
1548 template <
class SageNode>
1551 return *
sg::dispatch(TypeRecoveryHandler<SageNode>(f, ln), &n);
1554 template <
class SageNode>
1557 return *
sg::dispatch(TypeRecoveryHandler<const SageNode>(f, ln), &n);
1561 template <
class SageNode>
1565 void handle(SageNode& n) { this->res = &n; }
1572 template <
class... SageNodes>
1573 struct SageGenericLastType
1575 using type =
typename std::tuple_element<
sizeof...(SageNodes)-1, std::tuple<SageNodes...>>::type;
1578 struct SageGenericEndTag {};
1579 struct SageGenericAnyTag {};
1581 template <
int>
struct SageGenericSequenceTag {
using type = SageGenericAnyTag; };
1582 template <>
struct SageGenericSequenceTag<0> {
using type = SageGenericEndTag; };
1584 template <
class SageNode>
1585 auto sageGenericConfirmPath(
const SgNode& n, SageGenericEndTag) -> SageNode*
1587 return dynamic_cast<SageNode*
>(n.
get_parent());
1591 template <
class SageNode,
class... SageNodes>
1592 auto sageGenericConfirmPath(
const SgNode& n, SageGenericAnyTag)
1593 ->
typename SageGenericLastType<SageNode, SageNodes...>::type*
1595 if (SageNode* parent = sageGenericConfirmPath<SageNode>(n, SageGenericEndTag{}))
1597 using SequenceTag =
typename SageGenericSequenceTag<
sizeof...(SageNodes)-1>::type;
1599 return sageGenericConfirmPath<SageNodes...>(*parent, SequenceTag{});
1609 template <
class SageNode,
class... SageNodes>
1611 ->
typename SageGenericLastType<SageNode, SageNodes...>::type*
1613 using SequenceTag =
typename SageGenericSequenceTag<
sizeof...(SageNodes)>::type;
1615 return sageGenericConfirmPath<SageNode, SageNodes...>(n, SequenceTag{});
1635 void swap_parent(
void*,
void*) {}
1644 template <
class SageNode,
class SageChild>
1645 void swap_child(SageNode& lhs, SageNode& rhs, SageChild* (SageNode::*getter) () const, void (SageNode::*setter) (SageChild*))
1647 SageChild* lhs_child = (lhs.*getter)();
1648 SageChild* rhs_child = (rhs.*getter)();
1649 ROSE_ASSERT(lhs_child && rhs_child);
1651 (lhs.*setter)(rhs_child);
1652 (rhs.*setter)(lhs_child);
1654 swap_parent(lhs_child, rhs_child);
1645 void swap_child(SageNode& lhs, SageNode& rhs, SageChild* (SageNode::*getter) () const, void (SageNode::*setter) (SageChild*)) {
…}
1659 template <
class GVisitor>
1664 : gvisitor(std::move(gv))
1667 void operator()(
SgNode* n)
1669 if (n !=
nullptr) gvisitor =
sg::dispatch(std::move(gvisitor), n);
1672 operator GVisitor() && {
return std::move(gvisitor); }
1678 template <
class GVisitor>
1681 dispatchHelper(GVisitor gv)
1689 struct DefaultTraversalSuccessors
1691 SgNodePtrList operator()(
const SgNode& n)
const
1701 template <
class GVisitor,
class SuccessorGenerator = DefaultTraversalSuccessors>
1703 GVisitor traverseChildren( GVisitor gv,
SgNode& n, SuccessorGenerator gen = {} )
1705 SgNodePtrList
const successors = gen(n);
1707 return std::for_each( successors.begin(), successors.end(),
1708 dispatchHelper(std::move(gv))
1712 template <
class GVisitor>
1714 GVisitor traverseChildren(GVisitor gv,
SgNode* n)
1716 return traverseChildren(std::move(gv),
sg::deref(n));
1723 template <
class SageParent,
class SageChild>
1724 void linkParentChild(SageParent& parent, SageChild& child,
void (SageParent::*setter)(SageChild*))
1726 (parent.*setter)(&child);
1727 child.set_parent(&parent);
1724 void linkParentChild(SageParent& parent, SageChild& child,
void (SageParent::*setter)(SageChild*)) {
…}
1733 template <
class SageNode>
1734 typename SageNode::base_node_type&
1737 template <
class SageNode>
1738 const typename SageNode::base_node_type&
1741 template <
class SageNode>
1742 typename SageNode::base_node_type*
1745 template <
class SageNode>
1746 const typename SageNode::base_node_type*
1758 template <
class SageNode>
1759 struct TraversalFunction
1761 typedef void (*TransformHandlerFn)(SageNode*);
1764 TraversalFunction(TransformHandlerFn fun)
1769 void handle(SageNode& n) { fn(&n); }
1771 TransformHandlerFn fn;
1776 template <
class SageNode>
1778 TraversalFunction<SageNode>
1779 createTraversalFunction(
void (* fn)(SageNode*))
1781 return TraversalFunction<SageNode>(fn);
1789 template <
class GVisitor>
1793 TraversalClass(GVisitor gv)
1804 GVisitor visitor() {
return gvisitor; }
1820 forAllNodes(F fn,
SgNode* root, AstSimpleProcessing::Order order = postorder)
1824 TraversalClass<F> tt(fn);
1827 tt.traverse(root, order);
1828 return tt.visitor();
1831 template <
class SageNode>
1834 forAllNodes(
void (*fn)(SageNode*),
SgNode* root, AstSimpleProcessing::Order order = postorder)
1836 forAllNodes(createTraversalFunction(fn), root, order);
1841 std::string nodeType(
const SgNode& n)
1843 return typeid(n).name();
1847 std::string nodeType(
const SgNode* n)
1849 if (n ==
nullptr)
return "<null>";
1851 return nodeType(*n);
1856 template <
class SageNode>
1857 auto ancestor_path(
const SgNode& n) -> SageNode*
1863 template <
class SageNode,
class... SageNodes>
1864 auto ancestor_path(
const SgNode& n) ->
decltype(ancestor_path<SageNodes...>(n))
1866 if (SageNode* parent = ancestor_path<SageNode>(n))
1867 return ancestor_path<SageNodes...>(*parent);
Class for traversing the AST.
virtual void visit(SgNode *astNode)=0
this method is called at every traversed node.
String associated with a binary file.
Expression that adds two operands.
Expression that performs an arithmetic, sign-bit preserving right shift.
Expression that divides the first operand by the second.
Base class for binary expressions.
Expression that performs a logical left shift operation.
Expression that performs a logical, sign-bit non-preserving right shift.
Expression that returns the remainder when dividing the first operand by the second.
Expression that performs a logical left shift operation filling low-order bits with one.
Expression that multiplies two operands.
Expression that performs a right rotate.
Expression that subtracts the second operand from the first.
CIL AssemblyOS node (II.22.3).
CIL AssemblyProcessor node (II.22.4).
CIL AssemblyRefOS node (II.22.6).
CIL AssemblyRefProcessor node (II.22.7).
CIL AssemblyRef node (II.22.5).
CIL Assembly node (II.22.2).
CIL ClassLayout node (II.22.8).
CIL Constant node (II.22.9).
CIL CustomAttribute node (II.22.10).
Base class for CIL branch of binary analysis IR nodes.
CIL DeclSecurity node (II.22.11).
CIL EventMap node (II.22.12).
CIL Event node (II.22.13).
CIL ExportedType node (II.22.14).
CIL FieldLayout node (II.22.16).
CIL FieldMarshal node (II.22.17).
CIL FieldRVA node (II.22.18).
CIL Field node (II.22.15).
CIL File node (II.22.19).
CIL GenericParamConstraint node (II.22.21).
CIL GenericParam node (II.22.20).
CIL ImplMap node (II.22.22).
CIL InterfaceImpl node (II.22.23).
CIL ManifestResource node (II.22.24).
CIL MemberRef node (II.22.25).
CIL MethodDef node (II.22.26).
CIL MethodImpl node (II.22.27).
CIL MethodSemantics node (II.22.28).
CIL MethodSpec node (II.22.29).
CIL ModuleRef node (II.22.31).
CIL Module node (II.22.30).
CIL NestedClass node (II.22.32).
Base class for CIL branch of binary analysis IR nodes.
CIL Param node (II.22.33).
CIL PropertyMap node (II.22.35).
CIL Property node (II.22.34).
CIL StandAloneSig node (II.22.36).
CIL TypeDef node (II.22.37).
CIL TypeRef node (II.22.38).
CIL TypeSpec node (II.22.39).
Base class for CIL branch of binary analysis IR nodes.
Base class for CIL branch of binary analysis IR nodes.
COFF symbol string table.
Base class for constants.
Expression representing a machine register.
List of dynamic linking section entries.
One entry from the dynamic linking table.
ELF section containing dynamic linking information.
List of ELF EH frame CI entries.
ELF error handling frame entry, common information entry.
List of ELF error handling frame descriptor entries.
ELF error handling frame entry frame description entry.
Represents an ELF EH frame section.
Node to hold list of ELF note entries.
One entry of an ELF notes table.
List of ELF relocation entries.
One entry of an ELF relocation table.
Represents an ELF relocation section.
Represents one entry in an ELF section table.
Represents an ELF section table.
Base class for ELF file sections.
Represents one entry of a segment table.
Represents an ELF segment table.
ELF string table section.
ELF file section containing symbols.
Represents a single ELF symbol.
List of symbol version aux entries.
Auxiliary data for an ELF Symbol Version.
List of entries for the ELF symbol version definition table.
One entry from an ELF symbol version definition table.
The GNU symbol version definitions.
List of entries from a symbol version table.
Entry in an ELF symbol version table.
Hods a list of symbol version aux entries.
Auxiliary info for needed symbol version.
List of symbol version needed entries.
One entry of the ELF symbol version needed table.
GNU symbol version requirements table.
The ELF symbol version table.
List of expression nodes.
Base class for expressions.
Represents a synthesized function.
List of pointers to other nodes.
Base class for dynamically linked library information.
List of AST file node pointers.
Base class for binary files.
List of pointers to file sections.
Contiguous region of a file.
Base class for strings related to binary specimens.
Base class for string tables.
Node to hold a list of symbol node pointers.
Registers accessed indirectly.
List of SgAsmInstruction nodes.
Base class for machine instructions.
Base class for integer values.
Represents an interpretation of a binary container.
JVM LocalVariableTable attribute.
JVM LocalVariableTypeEntry.
JVM LocalVariableTypeTable attribute.
JVM MethodParametersEntry.
JVM MethodParameters attribute.
JVM ModuleMainClass attribute.
Reference to memory locations.
Represents one MIPS machine instruction.
Base class for all binary analysis IR nodes.
List of operands for an instruction.
List of pointers to other AST nodes.
A list of PE Import Directories.
One import directory per library.
A list of imported items.
A single imported object.
Portable Executable Import Section.
List of SgAsmPERVASizePair AST nodes.
Base class for PE sections.
Represents one PowerPC machine instruction.
An ordered list of registers.
Base class for references to a machine register.
Static representation of instruction semantics.
Base class for scalar types.
Base class for statement-like subclasses.
Represents static data in an executable.
This class represents the concept of a C Assembler statement.
Strings stored in an ELF or PE container.
Strings stored in an ELF or PE container.
Declaration-like nodes that encapsulate multiple instructions.
Base class for synthesized declarations.
Base class for binary types.
Base class for unary expressions.
Expression represting negation.
Expression representing a (no-op) unary plus operation.
Expression representing sign extending.
Expression representing truncation.
Expression representing unsigned extending.
Instructions defined at runtime.
Base class for vector types.
A type that doesn't represent any data.
Represents one Intel x86 machine instruction.
This class represents the rhs of a variable declaration which includes an optional assignment (e....
This class represents the concept of a block (not a basic block from control flow analysis).
This class represents the notion of a binary operator. It is derived from a SgExpression because oper...
This class represents a boolean value (expression value).
This class represents the notion of a break statement (typically used in a switch statment).
This class represents the concept of a generic call expression.
This class represents the concept of a C and C++ case option (used within a switch statement).
This class represents a cast of one type to another.
This class represents the concept of a catch within a try-catch construct used in C++ exception handl...
This class represents the concept of a C++ sequence of catch statements.
This class represents the concept of a class declaration statement. It includes the concept of an ins...
This class represents the concept of a class definition in C++.
This class represents the concept of a C++ expression built from a class name.
This class represents the concept of a class name within the compiler.
This class represents the concept of a C style extern "C" declaration. But such information (linkage)...
This class represents the concept of a C trinary conditional expression (e.g. "test ?...
This class represents the call of a class constructor to initialize a variable. For example "Foo foo;...
This class represents the concept of a C or C++ continue statement.
This class represents the concept of a contructor initializer list (used in constructor (member funct...
This class represents modifiers for SgDeclaration (declaration statements).
This class represents the concept of a declaration statement.
This class represents the concept of a C or C++ default case within a switch statement.
This class represents the concept of a C++ call to the delete operator.
This class represents a directory within a projects file structure of files and directories.
This class represents the concept of a do-while statement.
This class represents the notion of an value (expression value).
This class represents the concept of an enum declaration.
This class represents the concept of the dynamic execution of a string, file, or code object....
This class represents the concept of a C and C++ expression list.
This class represents the concept of a C or C++ statement which contains a expression.
This class represents the notion of an expression. Expressions are derived from SgLocatedNodes,...
This class represents a source file for a project (which may contian many source files and or directo...
This class represents the notion of an value (expression value).
This class represents the variable declaration or variable initialization withn a for loop.
This class represents the concept of a for loop.
This class represents the concept of a C++ function call (which is an expression).
This class represents the concept of a function declaration statement.
This class represents the concept of a scope in C++ (e.g. global scope, fuction scope,...
This class represents the concept of a declaration list.
This class represents the function being called and must be assembled in the SgFunctionCall with the ...
This class represents the concept of a name and a type. It may be renamed in the future to SgTypeSymb...
This class represents the function type table (stores all function types so that they can be shared i...
This class represents a type for all functions.
This class represents the concept of a namespace definition.
This class represents the concept of a C or C++ goto statement.
This class represents the concept of an "if" construct.
This class represents the notion of a declared variable.
This class represents the notion of an initializer for a variable declaration or expression in a func...
This class represents the physical disequality (often called pointer disequality) operator for langua...
This class represents the physical equality (often called pointer equality) operator for languages th...
This class represents the concept of a C or C++ label statement.
This class represents a lambda expression.
This class represents a list display.
This class represents the notion of an expression or statement which has a position within the source...
This class represents the notion of an value (expression value).
This class represents the concept of a member function declaration statement.
This class represents the member function being called and must be assembled in the SgFunctionCall wi...
This class represents the numeric negation of a value. Not to be confused with SgSubtractOp.
This class is not used in ROSE, but is intended to represent a list of SgModifierTypes (similar to th...
This class represents the base class of a number of IR nodes define modifiers within the C++ grammar.
This class represents strings within the IR nodes.
This class represents the concept of a C++ namespace alias declaration statement.
This class represents the concept of a C++ namespace declaration.
This class represents the concept of a namespace definition.
This class represents the concept of a namespace name within the compiler.
This class represents the notion of an n-ary boolean operation. This node is intended for use with Py...
This class represents the notion of an n-ary comparison operation. This node is intended for use with...
This class represents the notion of an n-ary operator. This node is intended for use with Python.
This class represents the concept of a C++ call to the new operator.
This class represents the base class for all IR nodes within Sage III.
SgNode * get_parent() const
Access function for parent node.
virtual std::vector< SgNode * > get_traversalSuccessorContainer() const
container of pointers to AST successor nodes used in the traversal overridden in every class by gener...
void set_parent(SgNode *parent)
All nodes in the AST contain a reference to a parent node.
virtual void accept(ROSE_VisitorPattern &visitor)
support for the classic visitor pattern done in GoF
This class represents an object used to initialize the unparsing.
This class represents a Fortran pointer assignment. It is not some weird compound assignment operator...
This class represents the concept of a C Assembler statement (untested).
This class represents a source project, with a list of SgFile objects and global information about th...
This class represents the concept of a 'global' stmt in Python.
This class represents a OLD concept of the structure require for qualified names when they were in th...
This class represents a OLD concept of the structure require for qualified names when they were in th...
This class represents the "&" operator (applied to any lvalue).
This class represents the concept of a C Assembler statement (untested).
This class was part of CC++ support from a long time ago.
This class represents the concept of a scope in C++ (e.g. global scope, fuction scope,...
This class represents the "sizeof()" operator (applied to any type).
This class is part of the older CC++ concept. It is not a part of C or C++ (this IR node is not used ...
This class represents the GNU extension "statement expression" (thus is non-standard C and C++).
This class represents the notion of a statement.
This class is intended to be a wrapper around SgStatements, allowing them to exist in scopes that onl...
This class represents modifiers specific to storage.
This class represents the conversion of an arbitrary expression to a string. This node is intended fo...
This class represents the base class of a numbr of IR nodes that don't otherwise fit into the existin...
This class represents the concept of a switch.
This class represents the symbol tables used in both SgScopeStatement and the SgFunctionTypeSymbolTab...
This class represents the concept of a name within the compiler.
This class represents template argument within the use of a template to build an instantiation.
This class represents the concept of a template declaration.
This class represents the concept of an instantiated class template.
This class represents the concept of a class definition in C++.
This class represents the concept of a C++ template instantiation directive.
This class represents the concept of an instantiation of function template.
This class represents the concept of an instantiation of member function template or a member functio...
This class represents the "this" operator (can be applied to any member data).
This class represents the C++ throw expression (handled as a unary operator).
This class represents the concept of try statement within the try-catch support for exception handlin...
This class represents a tuple display.
This class represents a C99 complex type.
This class represents a default type used for some IR nodes (see below).
This class represents a C99 complex type.
This class represents a string type used for SgStringVal IR node.
This class represents the base class for all types.
This class represents the notion of a typedef declaration.
This class represents a list of associated typedefs for the SgType IR nodes which reference this list...
This class represents the notion of a unary operator. It is derived from a SgExpression because opera...
This class represents the concept of a C++ using declaration.
This class represents the concept of a C++ using directive.
This class represents the notion of an value (expression value).
This class represents the variable refernece in expressions.
This class represents the concept of a C or C++ variable declaration.
This class represents the definition (initialization) of a variable.
This class represents the concept of a variable name within the compiler (a shared container for the ...
This class represents the concept of a do-while statement.
This class represents the location of the code associated with the IR node in the original source cod...
This namespace contains template functions that operate on the ROSE AST.
AncestorNode * _ancestor(QualSgNode &n)
implements the ancestor search
void swap_child(SageNode &lhs, SageNode &rhs, SageChild *(SageNode::*getter)() const, void(SageNode::*setter)(SageChild *))
swaps children (of equal kind) between two ancestor nodes of the same type
std::remove_const< typenamestd::remove_reference< RoseVisitor >::type >::type dispatch(RoseVisitor &&rv, SgNode *n)
uncovers the type of SgNode and passes it to an function "handle" in RoseVisitor.
SageNode * assert_sage_type(SgNode *n, const char *f=0, size_t ln=0)
asserts that n has type SageNode
T & deref(T *ptr, const char *file=0, size_t ln=0)
dereferences an object (= checked dereference in debug mode)
AncestorNode * ancestor(SgNode *n)
finds an ancestor node with a given type
auto ancestorPath(const SgNode &n) -> typename SageGenericLastType< SageNode, SageNodes... >::type *
returns the last parent in an ancestor path
void linkParentChild(SageParent &parent, SageChild &child, void(SageParent::*setter)(SageChild *))
Links parent node parent to child node child using the setter method setter.
SageNode::base_node_type & asBaseType(SageNode &n)
returns the same node n upcasted to its base type
helper class for _ancestor
projects the constness of T1 on T2
prevents the dispatch handler being called on nullptr.
experimental class for returning non-null pointers
NotNull(NotNull< U > nn)
converting ctor for derived types and non-const versions of T
T * operator->() const
arrow operator returns pointer to object
T * pointer() const
explicit conversion operator
NotNull(T *p)
standard constructor testing that p is not nullptr
T & operator*() const
dereference operator returns reference to object