|
clang 22.0.0git
|
Namespaces | |
| namespace | internal |
Classes | |
| class | LifetimeSafetyReporter |
| struct | LifetimeSafetyStats |
| A structure to hold the statistics related to LifetimeAnalysis. More... | |
Enumerations | |
| enum class | Confidence : uint8_t { None , Maybe , Definite } |
| Enum to track the confidence level of a potential error. More... | |
| enum class | SuggestionScope { CrossTU , IntraTU } |
| Enum to track functions visible across or within TU. More... | |
Functions | |
| void | runLifetimeSafetyAnalysis (AnalysisDeclContext &AC, LifetimeSafetyReporter *Reporter, LifetimeSafetyStats &Stats, bool CollectStats) |
| The main entry point for the analysis. | |
| void | printStats (const LifetimeSafetyStats &Stats) |
| Utility function to print missing origin stats. | |
| const FunctionDecl * | getDeclWithMergedLifetimeBoundAttrs (const FunctionDecl *FD) |
| const CXXMethodDecl * | getDeclWithMergedLifetimeBoundAttrs (const CXXMethodDecl *CMD) |
| bool | isNormalAssignmentOperator (const FunctionDecl *FD) |
| bool | isAssignmentOperatorLifetimeBound (const CXXMethodDecl *CMD) |
| bool | implicitObjectParamIsLifetimeBound (const FunctionDecl *FD) |
| template<typename T> | |
| static bool | isRecordWithAttr (QualType Type) |
| bool | isGslPointerType (QualType QT) |
| bool | isGslOwnerType (QualType QT) |
|
strong |
Enum to track the confidence level of a potential error.
| Enumerator | |
|---|---|
| None | |
| Maybe | |
| Definite | |
Definition at line 33 of file LifetimeSafety.h.
|
strong |
Enum to track functions visible across or within TU.
| Enumerator | |
|---|---|
| CrossTU | |
| IntraTU | |
Definition at line 40 of file LifetimeSafety.h.
| const CXXMethodDecl * clang::lifetimes::getDeclWithMergedLifetimeBoundAttrs | ( | const CXXMethodDecl * | CMD | ) |
Definition at line 25 of file LifetimeAnnotations.cpp.
References getDeclWithMergedLifetimeBoundAttrs().
| const FunctionDecl * clang::lifetimes::getDeclWithMergedLifetimeBoundAttrs | ( | const FunctionDecl * | FD | ) |
Definition at line 20 of file LifetimeAnnotations.cpp.
References clang::FunctionDecl::getMostRecentDecl().
Referenced by getDeclWithMergedLifetimeBoundAttrs(), implicitObjectParamIsLifetimeBound(), isAssignmentOperatorLifetimeBound(), and clang::sema::visitFunctionCallArguments().
| bool clang::lifetimes::implicitObjectParamIsLifetimeBound | ( | const FunctionDecl * | FD | ) |
Definition at line 55 of file LifetimeAnnotations.cpp.
References clang::TypeLoc::getAsAdjusted(), clang::AttributedTypeLoc::getAttrAs(), getDeclWithMergedLifetimeBoundAttrs(), clang::AttributedTypeLoc::getModifiedLoc(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), and isNormalAssignmentOperator().
Referenced by ProcessAPINotes(), and clang::sema::visitFunctionCallArguments().
| bool clang::lifetimes::isAssignmentOperatorLifetimeBound | ( | const CXXMethodDecl * | CMD | ) |
Definition at line 49 of file LifetimeAnnotations.cpp.
References getDeclWithMergedLifetimeBoundAttrs(), clang::FunctionDecl::getParamDecl(), clang::Decl::hasAttr(), isNormalAssignmentOperator(), and clang::FunctionDecl::param_size().
Referenced by clang::sema::checkExprLifetimeImpl(), and clang::sema::shouldRunGSLAssignmentAnalysis().
Definition at line 102 of file LifetimeAnnotations.cpp.
References isRecordWithAttr().
Referenced by clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr().
Definition at line 101 of file LifetimeAnnotations.cpp.
References isRecordWithAttr().
Referenced by clang::lifetimes::internal::hasOrigins(), clang::Sema::inferLifetimeCaptureByAttribute(), clang::lifetimes::internal::FactsGenerator::VisitCXXConstructExpr(), clang::lifetimes::internal::FactsGenerator::VisitCXXFunctionalCastExpr(), and clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr().
| bool clang::lifetimes::isNormalAssignmentOperator | ( | const FunctionDecl * | FD | ) |
Definition at line 31 of file LifetimeAnnotations.cpp.
References clang::Decl::getASTContext(), clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), clang::ASTContext::getLValueReferenceType(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getReturnType(), clang::ValueDecl::getType(), clang::ASTContext::hasSameType(), clang::isCompoundAssignmentOperator(), and clang::Type::isLValueReferenceType().
Referenced by implicitObjectParamIsLifetimeBound(), and isAssignmentOperatorLifetimeBound().
Definition at line 74 of file LifetimeAnnotations.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::Result, and clang::T.
Referenced by isGslOwnerType(), and isGslPointerType().
| void clang::lifetimes::printStats | ( | const LifetimeSafetyStats & | Stats | ) |
Utility function to print missing origin stats.
Definition at line 19 of file LifetimeStats.cpp.
References clang::lifetimes::LifetimeSafetyStats::ExprStmtClassToMissingOriginCount, clang::lifetimes::LifetimeSafetyStats::ExprTypeToMissingOriginCount, and clang::QualType::getAsString().
Referenced by clang::sema::AnalysisBasedWarnings::PrintStats().
| void clang::lifetimes::runLifetimeSafetyAnalysis | ( | AnalysisDeclContext & | AC, |
| LifetimeSafetyReporter * | Reporter, | ||
| LifetimeSafetyStats & | Stats, | ||
| bool | CollectStats ) |
The main entry point for the analysis.
Definition at line 105 of file LifetimeSafety.cpp.
References clang::lifetimes::internal::LifetimeSafetyAnalysis::getFactManager(), clang::lifetimes::internal::FactManager::getOriginMgr(), and clang::lifetimes::internal::LifetimeSafetyAnalysis::run().
Referenced by clang::sema::AnalysisBasedWarnings::IssueWarnings().