#include #include #include #include #include ">

clang: lib/Analysis/PathDiagnostic.cpp File Reference (original) (raw)

#include "[clang/Analysis/PathDiagnostic.h](PathDiagnostic%5F8h%5Fsource.html)"
#include "[clang/AST/Decl.h](Decl%5F8h%5Fsource.html)"
#include "[clang/AST/DeclBase.h](DeclBase%5F8h%5Fsource.html)"
#include "[clang/AST/DeclCXX.h](DeclCXX%5F8h%5Fsource.html)"
#include "[clang/AST/DeclObjC.h](DeclObjC%5F8h%5Fsource.html)"
#include "[clang/AST/DeclTemplate.h](DeclTemplate%5F8h%5Fsource.html)"
#include "[clang/AST/Expr.h](Expr%5F8h%5Fsource.html)"
#include "[clang/AST/ExprCXX.h](ExprCXX%5F8h%5Fsource.html)"
#include "[clang/AST/OperationKinds.h](OperationKinds%5F8h%5Fsource.html)"
#include "[clang/AST/ParentMap.h](ParentMap%5F8h%5Fsource.html)"
#include "[clang/AST/PrettyPrinter.h](PrettyPrinter%5F8h%5Fsource.html)"
#include "[clang/AST/Stmt.h](Stmt%5F8h%5Fsource.html)"
#include "[clang/AST/Type.h](Type%5F8h%5Fsource.html)"
#include "[clang/Analysis/AnalysisDeclContext.h](AnalysisDeclContext%5F8h%5Fsource.html)"
#include "[clang/Analysis/CFG.h](CFG%5F8h%5Fsource.html)"
#include "[clang/Analysis/ProgramPoint.h](ProgramPoint%5F8h%5Fsource.html)"
#include "[clang/Basic/FileManager.h](FileManager%5F8h%5Fsource.html)"
#include "[clang/Basic/LLVM.h](LLVM%5F8h%5Fsource.html)"
#include "[clang/Basic/SourceLocation.h](SourceLocation%5F8h%5Fsource.html)"
#include "[clang/Basic/SourceManager.h](SourceManager%5F8h%5Fsource.html)"
#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)

compare()

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().

compareCall()

compareControlFlow()

compareCrossTUSourceLocs()

compareMacro()

comparePath()

comparePiece()

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().

compute_path_size()

describeClass()

static void describeClass ( raw_ostream & Out, const CXXRecordDecl * D, StringRef Prefix = StringRef() ) static

describeCodeDecl()

static bool describeCodeDecl ( raw_ostream & Out, const Decl * D, bool ExtendedDescription, StringRef Prefix = StringRef() ) static

describeTemplateParameter()

describeTemplateParameters()

static void describeTemplateParameters ( raw_ostream & Out, const ArrayRef< TemplateArgument > TAList, const LangOptions & LO, StringRef Prefix = StringRef(), StringRef Postfix = StringRef() ) static

getLocationForCaller()

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().

StripTrailingDots()

static StringRef StripTrailingDots ( StringRef s) static