clang 22.0.0git
clang::ssaf Namespace Reference

Classes

class  BuildNamespace
 Represents a single namespace in the build process. More...
class  EntityName
 Uniquely identifies an entity in a program. More...
class  NestedBuildNamespace
 Represents a hierarchical sequence of build namespaces. More...

Enumerations

enum class  BuildNamespaceKind : unsigned short { CompilationUnit , LinkUnit }

Functions

std::optional< EntityNamegetEntityName (const Decl *D)
 Maps a declaration to an EntityName.
std::optional< EntityNamegetEntityNameForReturn (const FunctionDecl *FD)
 Maps return entity of a function to an EntityName.
llvm::StringRef toString (BuildNamespaceKind BNK)
std::optional< BuildNamespaceKindparseBuildNamespaceKind (llvm::StringRef Str)

Enumeration Type Documentation

◆ BuildNamespaceKind

enum class clang::ssaf::BuildNamespaceKind : unsigned short
strong
Enumerator
CompilationUnit 
LinkUnit 

Definition at line 29 of file BuildNamespace.h.

Function Documentation

◆ getEntityName()

std::optional< EntityName > clang::ssaf::getEntityName ( const Decl * D)

Maps a declaration to an EntityName.

Supported declaration types for entity mapping:

  • Functions and methods
  • Global Variables
  • Function parameters
  • Struct/class/union type definitions
  • Struct/class/union fields

Implicit declarations and compiler builtins are not mapped.

Parameters
DThe declaration to map. Must not be null.
Returns
An EntityName if the declaration can be mapped, std::nullopt otherwise.

Definition at line 21 of file ASTEntityMapping.cpp.

References clang::cast(), clang::index::generateUSRForDecl(), clang::isa(), and clang::Decl::isImplicit().

◆ getEntityNameForReturn()

std::optional< EntityName > clang::ssaf::getEntityNameForReturn ( const FunctionDecl * FD)

Maps return entity of a function to an EntityName.

The returned name uniquely identifies the return value of function

Parameters
FD.
FDThe function declaration. Must not be null.
Returns
An EntityName for the function's return entity.

Definition at line 62 of file ASTEntityMapping.cpp.

References clang::index::generateUSRForDecl(), clang::FunctionDecl::getBuiltinID(), and clang::Decl::isImplicit().

◆ parseBuildNamespaceKind()

std::optional< BuildNamespaceKind > clang::ssaf::parseBuildNamespaceKind ( llvm::StringRef Str)

Definition at line 25 of file BuildNamespace.cpp.

References CompilationUnit, and LinkUnit.

◆ toString()

llvm::StringRef clang::ssaf::toString ( BuildNamespaceKind BNK)

Definition at line 15 of file BuildNamespace.cpp.

References CompilationUnit, and LinkUnit.