clang 20.0.0git
|
#include "clang/Analysis/PathDiagnostic.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/OperationKinds.h"
#include "clang/AST/ParentMap.h"
#include "clang/AST/PrettyPrinter.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/Type.h"
#include "clang/Analysis/AnalysisDeclContext.h"
#include "clang/Analysis/CFG.h"
#include "clang/Analysis/ProgramPoint.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstring>
#include <memory>
#include <optional>
#include <utility>
#include <vector>
Go to the source code of this file.
Functions | |
static StringRef | StripTrailingDots (StringRef s) |
static std::optional< bool > | comparePath (const PathPieces &X, const PathPieces &Y) |
static std::optional< bool > | compareControlFlow (const PathDiagnosticControlFlowPiece &X, const PathDiagnosticControlFlowPiece &Y) |
static std::optional< bool > | compareMacro (const PathDiagnosticMacroPiece &X, const PathDiagnosticMacroPiece &Y) |
static std::optional< bool > | compareCall (const PathDiagnosticCallPiece &X, const PathDiagnosticCallPiece &Y) |
static std::optional< bool > | comparePiece (const PathDiagnosticPiece &X, const PathDiagnosticPiece &Y) |
static bool | compareCrossTUSourceLocs (FullSourceLoc XL, FullSourceLoc YL) |
static bool | compare (const PathDiagnostic &X, const PathDiagnostic &Y) |
static PathDiagnosticLocation | getLocationForCaller (const StackFrameContext *SFC, const LocationContext *CallerCtx, const SourceManager &SM) |
static void | describeTemplateParameters (raw_ostream &Out, const ArrayRef< TemplateArgument > TAList, const LangOptions &LO, StringRef Prefix=StringRef(), StringRef Postfix=StringRef()) |
static void | describeTemplateParameter (raw_ostream &Out, const TemplateArgument &TArg, const LangOptions &LO) |
static void | describeClass (raw_ostream &Out, const CXXRecordDecl *D, StringRef Prefix=StringRef()) |
static bool | describeCodeDecl (raw_ostream &Out, const Decl *D, bool ExtendedDescription, StringRef Prefix=StringRef()) |
static void | compute_path_size (const PathPieces &pieces, unsigned &size) |
|
static |
Definition at line 350 of file PathDiagnostic.cpp.
References clang::ento::PathDiagnosticLocation::asLocation(), compareCrossTUSourceLocs(), comparePath(), clang::ento::PathDiagnostic::getBugType(), clang::ento::PathDiagnostic::getCategory(), clang::ento::PathDiagnostic::getDeclWithIssue(), clang::ento::PathDiagnostic::getLocation(), clang::Decl::getLocation(), clang::FullSourceLoc::getManager(), clang::ento::PathDiagnostic::getShortDescription(), clang::ento::PathDiagnostic::getUniqueingDecl(), clang::ento::PathDiagnostic::getUniqueingLoc(), clang::ento::PathDiagnostic::getVerboseDescription(), clang::SourceLocation::isValid(), clang::ento::PathDiagnostic::meta_begin(), clang::ento::PathDiagnostic::meta_end(), clang::ento::PathDiagnostic::path, clang::Result, SM, and X.
Referenced by clang::ento::PathDiagnosticConsumer::FlushDiagnostics(), and clang::ASTContext::ObjCQualifiedIdTypesAreCompatible().
|
static |
Definition at line 248 of file PathDiagnostic.cpp.
References clang::ento::PathDiagnosticLocation::asLocation(), clang::ento::PathDiagnosticCallPiece::callEnter, clang::ento::PathDiagnosticCallPiece::callEnterWithin, clang::ento::PathDiagnosticCallPiece::callReturn, comparePath(), clang::FullSourceLoc::isBeforeInTranslationUnitThan(), clang::ento::PathDiagnosticCallPiece::path, and X.
Referenced by comparePiece().
|
static |
Definition at line 230 of file PathDiagnostic.cpp.
References clang::ento::PathDiagnosticLocation::asLocation(), clang::ento::PathDiagnosticControlFlowPiece::getEndLocation(), clang::ento::PathDiagnosticControlFlowPiece::getStartLocation(), clang::FullSourceLoc::isBeforeInTranslationUnitThan(), and X.
Referenced by comparePiece().
|
static |
Definition at line 326 of file PathDiagnostic.cpp.
References clang::FullSourceLoc::getDecomposedLoc(), clang::FullSourceLoc::getFileID(), clang::FullSourceLoc::getManager(), clang::FileEntryRef::getName(), clang::FullSourceLoc::getSpellingLoc(), clang::FullSourceLoc::isBeforeInTranslationUnitThan(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isValid(), and SM.
Referenced by compare().
|
static |
Definition at line 243 of file PathDiagnostic.cpp.
References comparePath(), clang::ento::PathDiagnosticMacroPiece::subPieces, and X.
Referenced by comparePiece().
|
static |
Definition at line 311 of file PathDiagnostic.cpp.
References b, comparePiece(), and X.
Referenced by compare(), compareCall(), and compareMacro().
|
static |
Definition at line 265 of file PathDiagnostic.cpp.
References clang::ento::PathDiagnosticLocation::asLocation(), clang::ento::PathDiagnosticPiece::Call, compareCall(), compareControlFlow(), compareMacro(), clang::ento::PathDiagnosticPiece::ControlFlow, clang::ento::PathDiagnosticPiece::Event, clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::ento::PathDiagnosticPiece::getKind(), clang::ento::PathDiagnosticPiece::getLocation(), clang::FullSourceLoc::getManager(), clang::ento::PathDiagnosticPiece::getRanges(), clang::ento::PathDiagnosticPiece::getString(), clang::FullSourceLoc::isBeforeInTranslationUnitThan(), clang::ento::PathDiagnosticPiece::Macro, clang::ento::PathDiagnosticPiece::Note, clang::ento::PathDiagnosticPiece::PopUp, SM, and X.
Referenced by comparePath().
|
static |
Definition at line 1067 of file PathDiagnostic.cpp.
References compute_path_size().
Referenced by compute_path_size(), and clang::ento::PathDiagnostic::full_size().
|
static |
Definition at line 923 of file PathDiagnostic.cpp.
References D, describeTemplateParameters(), clang::Decl::getLangOpts(), and clang::T.
Referenced by describeCodeDecl().
|
static |
Definition at line 935 of file PathDiagnostic.cpp.
References D, describeClass(), and describeTemplateParameters().
Referenced by clang::ento::PathDiagnosticCallPiece::getCallEnterEvent(), clang::ento::PathDiagnosticCallPiece::getCallEnterWithinCallerEvent(), and clang::ento::PathDiagnosticCallPiece::getCallExitEvent().
|
static |
Definition at line 896 of file PathDiagnostic.cpp.
References describeTemplateParameters(), clang::TemplateArgument::getKind(), clang::TemplateArgument::getPackAsArray(), clang::TemplateArgument::Pack, and clang::TemplateArgument::print().
Referenced by describeTemplateParameters().
|
static |
Definition at line 907 of file PathDiagnostic.cpp.
References describeTemplateParameter(), and clang::Last.
Referenced by describeClass(), describeCodeDecl(), and describeTemplateParameter().
|
static |
Definition at line 521 of file PathDiagnostic.cpp.
References clang::CFGElement::AutomaticObjectDtor, clang::CFGElement::BaseDtor, clang::Block, clang::CFGElement::castAs(), clang::CFGElement::CleanupFunction, clang::CFGElement::Constructor, clang::ento::PathDiagnosticLocation::create(), clang::ento::PathDiagnosticLocation::createEnd(), clang::CFGElement::CXXRecordTypedCall, clang::CFGElement::DeleteDtor, clang::LocationContext::getAnalysisDeclContext(), clang::AnalysisDeclContext::getBody(), clang::StackFrameContext::getCallSiteBlock(), clang::AnalysisDeclContext::getDecl(), clang::CFGDeleteDtor::getDeleteExpr(), clang::StackFrameContext::getIndex(), clang::CFGElement::getKind(), clang::CFGStmt::getStmt(), clang::CFGAutomaticObjDtor::getTriggerStmt(), clang::Init, clang::CFGElement::Initializer, clang::CFGElement::LifetimeEnds, clang::CFGElement::LoopExit, clang::CFGElement::MemberDtor, clang::CFGElement::NewAllocator, clang::CFGElement::ScopeBegin, clang::CFGElement::ScopeEnd, SM, clang::CFGElement::Statement, and clang::CFGElement::TemporaryDtor.
Referenced by clang::ento::PathDiagnosticCallPiece::construct(), clang::ento::PathDiagnosticLocation::create(), and clang::ento::PathDiagnosticCallPiece::setCallee().
|
static |
Definition at line 53 of file PathDiagnostic.cpp.
References s.