clang
9.0.0
|
#include "clang/StaticAnalyzer/Core/BugReporter/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/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 "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.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 <utility>
#include <vector>
Go to the source code of this file.
Functions | |
static StringRef | StripTrailingDots (StringRef s) |
static PathDiagnosticCallPiece * | getFirstStackedCallToHeaderFile (PathDiagnosticCallPiece *CP, const SourceManager &SMgr) |
static Optional< bool > | comparePath (const PathPieces &X, const PathPieces &Y) |
static Optional< bool > | compareControlFlow (const PathDiagnosticControlFlowPiece &X, const PathDiagnosticControlFlowPiece &Y) |
static Optional< bool > | compareMacro (const PathDiagnosticMacroPiece &X, const PathDiagnosticMacroPiece &Y) |
static Optional< bool > | compareCall (const PathDiagnosticCallPiece &X, const PathDiagnosticCallPiece &Y) |
static 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 SourceLocation | getValidSourceLocation (const Stmt *S, LocationOrAnalysisDeclContext LAC, bool UseEnd=false) |
static PathDiagnosticLocation | getLocationForCaller (const StackFrameContext *SFC, const LocationContext *CallerCtx, const SourceManager &SM) |
static const LocationContext * | findTopAutosynthesizedParentContext (const LocationContext *LC) |
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 423 of file PathDiagnostic.cpp.
References b, compareCrossTUSourceLocs(), comparePath(), clang::Decl::getLocation(), clang::FullSourceLoc::getManager(), and SM.
Referenced by clang::ento::PathDiagnosticConsumer::FlushDiagnostics(), isKnownToHaveUnsignedValue(), clang::APFixedPoint::operator!=(), clang::APFixedPoint::operator<(), clang::APFixedPoint::operator<=(), clang::APFixedPoint::operator==(), clang::APFixedPoint::operator>(), and clang::APFixedPoint::operator>=().
|
static |
Definition at line 326 of file PathDiagnostic.cpp.
References comparePath(), and clang::FullSourceLoc::isBeforeInTranslationUnitThan().
Referenced by comparePiece().
|
static |
Definition at line 308 of file PathDiagnostic.cpp.
References clang::FullSourceLoc::isBeforeInTranslationUnitThan().
Referenced by comparePiece().
|
static |
Definition at line 405 of file PathDiagnostic.cpp.
References clang::FullSourceLoc::getDecomposedLoc(), clang::SourceManager::getFileEntryForID(), clang::FullSourceLoc::getFileID(), clang::FullSourceLoc::getManager(), clang::FileEntry::getName(), clang::FullSourceLoc::getSpellingLoc(), clang::FullSourceLoc::isBeforeInTranslationUnitThan(), clang::SourceManager::isInTheSameTranslationUnit(), and SM.
Referenced by compare().
|
static |
Definition at line 321 of file PathDiagnostic.cpp.
References comparePath().
Referenced by comparePiece().
Definition at line 389 of file PathDiagnostic.cpp.
References b, and comparePiece().
Referenced by compare(), compareCall(), compareMacro(), and clang::ento::PathDiagnosticConsumer::HandlePathDiagnostic().
|
static |
Definition at line 343 of file PathDiagnostic.cpp.
References clang::ento::PathDiagnosticPiece::Call, compareCall(), compareControlFlow(), compareMacro(), clang::ento::PathDiagnosticPiece::ControlFlow, clang::ento::PathDiagnosticPiece::Event, clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::FullSourceLoc::getManager(), i, clang::SourceManager::isBeforeInTranslationUnit(), clang::FullSourceLoc::isBeforeInTranslationUnitThan(), clang::ento::PathDiagnosticPiece::Macro, clang::ento::PathDiagnosticPiece::Note, clang::ento::PathDiagnosticPiece::PopUp, and SM.
Referenced by comparePath().
|
static |
Definition at line 1232 of file PathDiagnostic.cpp.
References clang::ento::PathDiagnosticPiece::PathDiagnosticPiece().
Referenced by clang::ento::PathDiagnostic::full_size().
|
static |
Definition at line 1088 of file PathDiagnostic.cpp.
References describeTemplateParameters(), and clang::NamedDecl::getIdentifier().
Referenced by describeCodeDecl().
|
static |
Definition at line 1100 of file PathDiagnostic.cpp.
References describeClass(), and describeTemplateParameters().
Referenced by clang::ento::PathDiagnosticCallPiece::getCallEnterEvent(), clang::ento::PathDiagnosticCallPiece::getCallEnterWithinCallerEvent(), and clang::ento::PathDiagnosticCallPiece::getCallExitEvent().
|
static |
Definition at line 1061 of file PathDiagnostic.cpp.
References describeTemplateParameters(), clang::TemplateArgument::getKind(), clang::TemplateArgument::getPackAsArray(), and clang::TemplateArgument::print().
Referenced by describeTemplateParameters().
|
static |
Definition at line 1072 of file PathDiagnostic.cpp.
References describeTemplateParameter(), and clang::Last.
Referenced by describeClass(), describeCodeDecl(), describeTemplateParameter(), and clang::ento::PathDiagnosticCallPiece::setCallee().
|
static |
Definition at line 794 of file PathDiagnostic.cpp.
References clang::LocationContext::getAnalysisDeclContext(), clang::LocationContext::getParent(), and clang::AnalysisDeclContext::isBodyAutosynthesized().
Referenced by clang::ento::PathDiagnosticLocation::getStmt().
|
static |
Definition at line 147 of file PathDiagnostic.cpp.
References clang::ento::AnalysisManager::isInCodeFile(), and clang::SourceLocation::isMacroID().
Referenced by clang::ento::PathDiagnostic::resetDiagnosticLocationToMainFile().
|
static |
Definition at line 584 of file PathDiagnostic.cpp.
References clang::CFGElement::AutomaticObjectDtor, clang::CFGElement::BaseDtor, clang::CFGElement::castAs(), clang::CFGElement::Constructor, clang::ento::PathDiagnosticLocation::create(), clang::ento::PathDiagnosticLocation::createEnd(), clang::CFGElement::CXXRecordTypedCall, clang::CFGElement::DeleteDtor, clang::CFGNewAllocator::getAllocatorExpr(), clang::LocationContext::getAnalysisDeclContext(), clang::AnalysisDeclContext::getBody(), clang::StackFrameContext::getCallSiteBlock(), clang::AnalysisDeclContext::getDecl(), clang::CFGDeleteDtor::getDeleteExpr(), clang::StackFrameContext::getIndex(), clang::CXXCtorInitializer::getInit(), clang::CFGInitializer::getInitializer(), clang::CFGElement::getKind(), clang::CFGStmt::getStmt(), clang::CFGAutomaticObjDtor::getTriggerStmt(), 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 539 of file PathDiagnostic.cpp.
Referenced by clang::ento::PathDiagnosticLocation::createEnd(), clang::ento::PathDiagnosticLocation::createEndOfPath(), and clang::ento::PathDiagnosticLocation::createSingleLocation().
|
static |
Definition at line 67 of file PathDiagnostic.cpp.
References i, clang::ento::PathDiagnosticPiece::PathDiagnosticPiece(), clang::ento::PathDiagnosticCallPiece::~PathDiagnosticCallPiece(), clang::ento::PathDiagnosticControlFlowPiece::~PathDiagnosticControlFlowPiece(), clang::ento::PathDiagnosticEventPiece::~PathDiagnosticEventPiece(), clang::ento::PathDiagnosticMacroPiece::~PathDiagnosticMacroPiece(), clang::ento::PathDiagnosticNotePiece::~PathDiagnosticNotePiece(), clang::ento::PathDiagnosticPiece::~PathDiagnosticPiece(), and clang::ento::PathDiagnosticPopUpPiece::~PathDiagnosticPopUpPiece().