3#ifndef ROSE_Common_Analysis_AnalysisTypes_H
4#define ROSE_Common_Analysis_AnalysisTypes_H 1
15#include <boost/variant.hpp>
18namespace Rose::Common::Analysis
22enum struct FunctionTypeRelation :
int
40 using type = std::uintptr_t;
56 return lhs.key == rhs.key;
67operator!=(KeyType<tag> lhs, KeyType<tag> rhs)
noexcept
69 return lhs.key != rhs.key;
80operator<(KeyType<tag> lhs, KeyType<tag> rhs)
noexcept
82 return lhs.key < rhs.key;
93operator<=(KeyType<tag> lhs, KeyType<tag> rhs)
noexcept
95 return lhs.key <= rhs.key;
106operator>(KeyType<tag> lhs, KeyType<tag> rhs)
noexcept
108 return lhs.key > rhs.key;
119operator>=(KeyType<tag> lhs, KeyType<tag> rhs)
noexcept
121 return lhs.key >= rhs.key;
154isValidKey(KeyType<tag> k) {
return IsValidKey{}(k); }
157enum KeyTags { tgNone, tgRoot, tgClass, tgFunc, tgVar, tgFuncType, tgOtherType, tgCast, tgOtherExpr };
160using ASTRootType = KeyType<tgRoot>;
163using FunctionKeyType = KeyType<tgFunc>;
166using ClassKeyType = KeyType<tgClass>;
169using VariableKeyType = KeyType<tgVar>;
172using FunctionTypeKeyType = KeyType<tgFuncType>;
175using TypeKeyType = KeyType<tgOtherType>;
178using CastKeyType = KeyType<tgCast>;
181using ExpressionKeyType = KeyType<tgOtherExpr>;
184using AnyKeyType = boost::variant< ASTRootType, FunctionKeyType, ClassKeyType, VariableKeyType
185 , TypeKeyType, FunctionTypeKeyType
186 , ExpressionKeyType, CastKeyType
191using DataMemberTypeBase = std::tuple<ClassKeyType, bool, bool, bool, bool>;
198 using base = DataMemberTypeBase;
208 bool isConst()
const {
return std::get<1>(*
this); }
216 bool hasArray()
const {
return std::get<3>(*
this); }
228using ClassNameFn = std::function<std::string(ClassKeyType)>;
233using FuncNameFn = std::function<std::string(FunctionKeyType)>;
238using VarNameFn = std::function<std::string(VariableKeyType)>;
243using FunctionPredicate = std::function<bool(FunctionKeyType)>;
260 std::size_t
operator()(const ::Rose::Common::Analysis::KeyType<tag>& k)
const noexcept
262 return std::hash<typename ::Rose::Common::Analysis::KeyType<tag>::type>{}(k.key);
Describes the class-valued type and selected qualifiers of a data member.
DataMemberTypeBase base
Base tuple type used for storage.
ClassKeyType classType() const
Returns the class type of this data member, if represented by the frontend.
bool isConst() const
Returns true when the data member type is const-qualified.
bool hasReference() const
Returns true when the data member type contains a reference.
bool hasArray() const
Returns true when the data member type contains an array.
bool hasInitializer() const
Returns true when the data member has an initializer.
Predicate object that tests whether an abstract key is nonzero.
bool operator()(KeyType< tag > k) const
Returns true when k is a nonzero key.
Strongly typed wrapper around an abstract pointer-sized analysis key.
type key
Raw integer key value; zero represents an invalid key.
std::uintptr_t type
Integer storage type used for abstract keys.
std::size_t operator()(const ::Rose::Common::Analysis::KeyType< tag > &k) const noexcept
Returns the hash of the wrapped raw key value.