clang 8.0.0

Public Member Functions | Static Public Member Functions | List of all members
clang::ento::SymbolManager Class Reference

`#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"`

## Public Member Functions
| SymbolManager (ASTContext &ctx, BasicValueFactory &bv, llvm::BumpPtrAllocator &bpalloc)
| ~SymbolManager ()
const SymbolRegionValue * | getRegionValueSymbol (const TypedValueRegion *R)
| Make a unique symbol for MemRegion R according to its kind. More...
const SymbolConjured * | conjureSymbol (const Stmt *E, const LocationContext *LCtx, QualType T, unsigned VisitCount, const void *SymbolTag=nullptr)
const SymbolConjured * | conjureSymbol (const Expr *E, const LocationContext *LCtx, unsigned VisitCount, const void *SymbolTag=nullptr)
const SymbolDerived * | getDerivedSymbol (SymbolRef parentSymbol, const TypedValueRegion *R)
const SymbolExtent * | getExtentSymbol (const SubRegion *R)
const SymbolMetadata * | getMetadataSymbol (const MemRegion *R, const Stmt *S, QualType T, const LocationContext *LCtx, unsigned VisitCount, const void *SymbolTag=nullptr)
| Creates a metadata symbol associated with a specific region. More...
const SymbolCast * | getCastSymbol (const SymExpr *Operand, QualType From, QualType To)
const SymIntExpr * | getSymIntExpr (const SymExpr *lhs, BinaryOperator::Opcode op, const llvm::APSInt &rhs, QualType t)
const SymIntExpr * | getSymIntExpr (const SymExpr &lhs, BinaryOperator::Opcode op, const llvm::APSInt &rhs, QualType t)
const IntSymExpr * | getIntSymExpr (const llvm::APSInt &lhs, BinaryOperator::Opcode op, const SymExpr *rhs, QualType t)
const SymSymExpr * | getSymSymExpr (const SymExpr *lhs, BinaryOperator::Opcode op, const SymExpr *rhs, QualType t)
QualType | getType (const SymExpr *SE) const
void | addSymbolDependency (const SymbolRef Primary, const SymbolRef Dependent)
| Add artificial symbol dependency. More...
const SymbolRefSmallVectorTy * | getDependentSymbols (const SymbolRef Primary)
ASTContext & | getContext ()
BasicValueFactory & | getBasicVals ()

## Static Public Member Functions
static bool | canSymbolicate (QualType T)

## Detailed Description

Definition at line 461 of file SymbolManager.h.

## Constructor & Destructor Documentation

## ◆ SymbolManager()

clang::ento::SymbolManager::SymbolManager | ( | ASTContext & | ctx,
|  | BasicValueFactory & | bv,
|  | llvm::BumpPtrAllocator & | bpalloc
| ) |  |
| inline

Definition at line 477 of file SymbolManager.h.

## ◆ ~SymbolManager()

SymbolManager::~SymbolManager | ( |  | ) |

Definition at line 345 of file SymbolManager.cpp.

## Member Function Documentation

## ◆ addSymbolDependency()

void SymbolManager::addSymbolDependency | ( | const SymbolRef | Primary,
|  | const SymbolRef | Dependent
| ) |  |

Add artificial symbol dependency.

The dependent symbol should stay alive as long as the primary is alive.

Definition at line 364 of file SymbolManager.cpp.

## ◆ canSymbolicate()

bool SymbolManager::canSymbolicate | ( | QualType | T | ) |
| static

Definition at line 349 of file SymbolManager.cpp.

Referenced by clang::ento::SValBuilder::conjureSymbolVal(), clang::ento::SValBuilder::getConjuredHeapSymbolVal(), clang::ento::SValBuilder::getDerivedRegionValueSymbolVal(), clang::ento::SValBuilder::getMetadataSymbolVal(), clang::ento::SValBuilder::getRegionValueSymbolVal(), and isRecordEmpty().

## ◆ conjureSymbol() [1/2]

const SymbolConjured* clang::ento::SymbolManager::conjureSymbol | ( | const Stmt * | E,
|  | const LocationContext * | LCtx,
|  | QualType | T,
|  | unsigned | VisitCount,
|  | const void * | SymbolTag = `nullptr`
| ) |  |

Referenced by clang::ento::SValBuilder::conjureSymbol(), clang::ento::SValBuilder::conjureSymbolVal(), and clang::ento::SValBuilder::getConjuredHeapSymbolVal().

## ◆ conjureSymbol() [2/2]

const SymbolConjured* clang::ento::SymbolManager::conjureSymbol | ( | const Expr * | E,
|  | const LocationContext * | LCtx,
|  | unsigned | VisitCount,
|  | const void * | SymbolTag = `nullptr`
| ) |  |
| inline

Definition at line 493 of file SymbolManager.h.

References clang::Expr::getType().

## ◆ getBasicVals()

BasicValueFactory& clang::ento::SymbolManager::getBasicVals | ( |  | ) |
| inline

Definition at line 545 of file SymbolManager.h.

## ◆ getCastSymbol()

const SymbolCast * SymbolManager::getCastSymbol | ( | const SymExpr * | Operand,
|  | QualType | From,
|  | QualType | To
| ) |  |

Definition at line 255 of file SymbolManager.cpp.

Referenced by clang::ento::SValBuilder::makeNonLoc().

## ◆ getContext()

ASTContext& clang::ento::SymbolManager::getContext | ( |  | ) |
| inline

Definition at line 544 of file SymbolManager.h.

Referenced by clang::ento::RangedConstraintManager::assumeSym().

## ◆ getDependentSymbols()

const SymbolRefSmallVectorTy * SymbolManager::getDependentSymbols | ( | const SymbolRef | Primary | ) |

Definition at line 377 of file SymbolManager.cpp.

## ◆ getDerivedSymbol()

const SymbolDerived * SymbolManager::getDerivedSymbol | ( | SymbolRef | parentSymbol,
|  | const TypedValueRegion * | R
| ) |  |

Definition at line 204 of file SymbolManager.cpp.

Referenced by clang::ento::SValBuilder::getDerivedRegionValueSymbolVal().

## ◆ getExtentSymbol()

const SymbolExtent * SymbolManager::getExtentSymbol | ( | const SubRegion * | R | ) |

Definition at line 221 of file SymbolManager.cpp.

Referenced by clang::ento::AllocaRegion::getExtent(), clang::ento::TypedValueRegion::getExtent(), and clang::ento::SymbolicRegion::getExtent().

## ◆ getIntSymExpr()

const IntSymExpr * SymbolManager::getIntSymExpr | ( | const llvm::APSInt & | lhs,
|  | BinaryOperator::Opcode | op,
|  | const SymExpr * | rhs,
|  | QualType | t
| ) |  |

Definition at line 288 of file SymbolManager.cpp.

Referenced by clang::ento::SValBuilder::makeNonLoc().

## ◆ getMetadataSymbol()

const SymbolMetadata * SymbolManager::getMetadataSymbol | ( | const MemRegion * | R,
|  | const Stmt * | S,
|  | QualType | T,
|  | const LocationContext * | LCtx,
|  | unsigned | VisitCount,
|  | const void * | SymbolTag = `nullptr`
| ) |  |

Creates a metadata symbol associated with a specific region.

VisitCount can be used to differentiate regions corresponding to different loop iterations, thus, making the symbol path-dependent.

Definition at line 237 of file SymbolManager.cpp.

Referenced by clang::ento::SValBuilder::getMetadataSymbolVal().

## ◆ getRegionValueSymbol()

const SymbolRegionValue * SymbolManager::getRegionValueSymbol | ( | const TypedValueRegion * | R | ) |

Make a unique symbol for MemRegion R according to its kind.

Definition at line 169 of file SymbolManager.cpp.

Referenced by clang::ento::SValBuilder::getRegionValueSymbolVal().

## ◆ getSymIntExpr() [1/2]

const SymIntExpr* clang::ento::SymbolManager::getSymIntExpr | ( | const SymExpr * | lhs,
|  | BinaryOperator::Opcode | op,
|  | const llvm::APSInt & | rhs,
|  | QualType | t
| ) |  |

Referenced by clang::ento::SValBuilder::makeNonLoc().

## ◆ getSymIntExpr() [2/2]

const SymIntExpr* clang::ento::SymbolManager::getSymIntExpr | ( | const SymExpr & | lhs,
|  | BinaryOperator::Opcode | op,
|  | const llvm::APSInt & | rhs,
|  | QualType | t
| ) |  |
| inline

Definition at line 521 of file SymbolManager.h.

## ◆ getSymSymExpr()

const SymSymExpr * SymbolManager::getSymSymExpr | ( | const SymExpr * | lhs,
|  | BinaryOperator::Opcode | op,
|  | const SymExpr * | rhs,
|  | QualType | t
| ) |  |

Definition at line 306 of file SymbolManager.cpp.

Referenced by clang::ento::RangedConstraintManager::assumeSym(), and clang::ento::SValBuilder::makeNonLoc().

## ◆ getType()

QualType clang::ento::SymbolManager::getType | ( | const SymExpr * | SE | ) | const
| inline

Definition at line 533 of file SymbolManager.h.

References clang::ento::SymExpr::getType().

The documentation for this class was generated from the following files:

- include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
- lib/StaticAnalyzer/Core/SymbolManager.cpp