1#ifndef ROSE_Source_Analysis_CppHierarchyAnalysis_H
2#define ROSE_Source_Analysis_CppHierarchyAnalysis_H 1
10#include <unordered_map>
14#include <Rose/Common/Analysis/ClassHierarchyAnalysis.h>
15#include <Rose/Source/Analysis/CppCompatibility.h>
16#include <Rose/Source/Analysis/CppSpecialMemberAnalysis.h>
39 std::unordered_map<Rose::Common::Analysis::ClassKeyType, SpecialMemberFunctionContainer>;
145 SpecialMemberFunctionContainer&
151 const SpecialMemberFunctionContainer&
163 static constexpr std::uint32_t
Cxx98 = 199711L;
166 static constexpr std::uint32_t
Cxx11 = 201103L;
169 static constexpr std::uint32_t
Cxx14 = 201402L;
172 static constexpr std::uint32_t
Cxx17 = 201703L;
175 static constexpr std::uint32_t
Cxx20 = 202002L;
178 static constexpr std::uint32_t
Cxx23 = 202302L;
181 static constexpr std::uint32_t
Cxx26 = 202600L;
188 std::uint32_t langVersion =
Cxx98;
207 SpecialMemberFunctionPredicate pred);
215bool hasSpecialFunction(const Rose::Common::Analysis::ClassAnalysis& all,
216 Rose::Common::Analysis::ClassKeyType clazz,
217 SpecialMemberFunctionPredicate pred);
234 bool normalizedSignature =
false);
holds data about all classes in a program
ClassAnalysisBase base
Base map type used for storage.
stores the results of virtual function analysis by Id
Implements the Common compatibility interface for C++ ROSE AST nodes.
Binds Rose::Common::Analysis::ClassAnalysis to C++ ROSE AST nodes and stores C++-specific metadata.
static constexpr std::uint32_t Cxx26
Draft C++26 language standard identifier.
std::unordered_map< Rose::Common::Analysis::ClassKeyType, SpecialMemberFunctionContainer > SpecialMemberFunctionMap
Map from class keys to their detected special member functions.
static constexpr std::uint32_t Cxx14
C++14 language standard identifier.
const SpecialMemberFunctionContainer & specialMemberFunctions(Rose::Common::Analysis::ClassKeyType clazz) const
Returns special member function metadata for clazz.
static constexpr std::uint32_t Cxx23
C++23 language standard identifier.
const CppCompatibility & compatibilityBridge() const override
Returns the C++ compatibility bridge.
SgProject * root(Rose::Common::Analysis::ASTRootType key) const
Converts an abstract analysis key back to a ROSE project root pointer.
Rose::Common::Analysis::FunctionTypeKeyType functionTypeId(const SgFunctionType *ty) const
Converts a ROSE function type pointer to an abstract function type key.
std::string nameOf(const SgClassDefinition *cls) const
Returns a printable source name for a ROSE class definition.
Rose::Common::Analysis::VariableKeyType variableId(SgInitializedName *var) const
Converts a ROSE initialized-name pointer to an abstract variable key.
static constexpr std::uint32_t Cxx20
C++20 language standard identifier.
static constexpr std::uint32_t Cxx17
C++17 language standard identifier.
SgInitializedName * variableDeclaration(Rose::Common::Analysis::VariableKeyType key) const
Converts an abstract variable key back to a ROSE initialized-name pointer.
std::string nameOf(const SgFunctionDeclaration *fun) const
Returns a printable source name for a ROSE function declaration.
SgFunctionType * functionType(Rose::Common::Analysis::FunctionTypeKeyType key) const
Converts an abstract function type key back to a ROSE function type pointer.
SgFunctionDeclaration * functionDeclaration(Rose::Common::Analysis::FunctionKeyType key) const
Converts an abstract function key back to a ROSE function declaration pointer.
SpecialMemberFunctionContainer & specialMemberFunctions(Rose::Common::Analysis::ClassKeyType clazz)
Returns mutable special member function metadata for clazz.
static constexpr std::uint32_t Cxx98
C++98 language standard identifier.
void languageStandard(std::uint32_t v)
Sets the version identifier of the language standard.
SgClassDefinition * classDefinition(Rose::Common::Analysis::ClassKeyType key) const
Converts an abstract class key back to a ROSE class definition pointer.
Rose::Common::Analysis::ClassKeyType classId(const SgClassDefinition *cls) const
Converts a ROSE class definition pointer to an abstract analysis key.
Rose::Common::Analysis::FunctionKeyType functionId(const SgFunctionDeclaration *fun) const
Converts a ROSE function declaration pointer to an abstract analysis key.
Rose::Common::Analysis::VariableKeyType variableId(SgVariableDeclaration *var) const
Converts a ROSE variable declaration pointer to an abstract variable key.
SgType * type(Rose::Common::Analysis::TypeKeyType key) const
Converts an abstract type key back to a ROSE type pointer.
std::uint32_t languageStandard() const
returns the version identifier of the language standard.
std::string nameOf(const SgInitializedName *var) const
Returns a printable source name for a ROSE initialized name (field).
static constexpr std::uint32_t Cxx11
C++11 language standard identifier.
Rose::Common::Analysis::TypeKeyType typeId(const SgType *ty) const
Converts a ROSE type pointer to an abstract type key.
Rose::Common::Analysis::ASTRootType rootId(const SgProject *root) const
Converts a ROSE project root pointer to an abstract analysis key.
This class represents the concept of a class definition in C++.
This class represents the concept of a function declaration statement.
This class represents a type for all functions.
This class represents the notion of a declared variable.
This class represents a source project, with a list of SgFile objects and global information about th...
This class represents the base class for all types.
This class represents the concept of a C or C++ variable declaration.
Capabilities related to the analysis of source-code.
void analyzeSpecialMemberFunctions(CppHierarchyAnalysis &all)
Detects and records C++ special member functions for all classes in all.
CppHierarchyAnalysis analyzeCppClasses(const SgProject *)
Builds a C++ class hierarchy analysis by traversing the AST rooted at root.
bool hasSpecialFunction(const CppHierarchyAnalysis &all, Rose::Common::Analysis::ClassKeyType clazz, SpecialMemberFunctionPredicate pred)
Returns true when class clazz in all has a special member matching pred.
CppHierarchyAnalysis analyzeCppClassesFromMemoryPool()
Builds a C++ class hierarchy analysis from the ROSE memory pool.
Rose::Common::Analysis::VirtualFunctionAnalysis analyzeCppVirtualFunctions(const Rose::Common::Analysis::ClassAnalysis &classes, bool normalizedSignature=false)
Computes virtual function override relationships for C++ classes.
Strongly typed wrapper around an abstract pointer-sized analysis key.