;
60: kind(k), Hint(hint) {}
77 boolShouldFlattenMacros)
const{
78 for(
auto&Piece : *
this) {
79 switch(Piece->getKind()) {
81 auto&
Call= cast<PathDiagnosticCallPiece>(*Piece);
83Current.push_back(std::move(
CallEnter));
84 Call.path.flattenTo(Primary, Primary, ShouldFlattenMacros);
85 if(
autocallExit =
Call.getCallExitEvent())
86Current.push_back(std::move(callExit));
90 auto&Macro = cast<PathDiagnosticMacroPiece>(*Piece);
91 if(ShouldFlattenMacros) {
92Macro.subPieces.flattenTo(Primary, Primary, ShouldFlattenMacros);
94Current.push_back(Piece);
96Macro.subPieces.flattenTo(Primary, NewPath, ShouldFlattenMacros);
98Macro.subPieces = NewPath;
106Current.push_back(Piece);
115StringRef CheckerName,
const Decl*declWithIssue, StringRef bugtype,
116StringRef verboseDesc, StringRef shortDesc, StringRef category,
118 const Decl*AnalysisEntryPoint,
119std::unique_ptr<FilesToLineNumsMap> ExecutedLines)
120: CheckerName(CheckerName), DeclWithIssue(declWithIssue),
125UniqueingDecl(DeclToUnique), AnalysisEntryPoint(AnalysisEntryPoint),
126ExecutedLines(
std::move(ExecutedLines)), path(pathImpl) {
127assert(AnalysisEntryPoint);
130voidPathDiagnosticConsumer::anchor() {}
139std::unique_ptr<PathDiagnostic>
D) {
140 if(!
D||
D->path.empty())
146 D->flattenLocations();
157llvm::raw_svector_ostream warning(buf);
158warning <<
"warning: Path diagnostic report is not generated. Current " 159<<
"output format does not support diagnostics that cross file " 160<<
"boundaries. Refer to --analyzer-output for valid output " 166 for(
const auto&I : path) {
173llvm::errs() << warning.str();
179 for(
const auto&I : Ranges) {
182llvm::errs() << warning.str();
187llvm::errs() << warning.str();
192 if(
const auto*call = dyn_cast<PathDiagnosticCallPiece>(piece))
194 else if(
const auto*macro = dyn_cast<PathDiagnosticMacroPiece>(piece))
195 WorkList.push_back(¯o->subPieces);
204llvm::FoldingSetNodeID profile;
205 D->Profile(profile);
206 void*InsertPos =
nullptr;
213 const unsignedorig_size = orig->full_size();
214 const unsignednew_size =
D->full_size();
215 if(orig_size <= new_size)
218assert(orig !=
D.get());
219 Diags.RemoveNode(orig);
223 Diags.InsertNode(
D.release());
229staticstd::optional<bool>
256 if(X_CEWL != Y_CEWL)
268 return X.getKind() < Y.
getKind();
278 if(
X.getRanges().size() != Y.
getRanges().size())
279 return X.getRanges().size() < Y.
getRanges().size();
283 for(
unsignedi = 0, n =
X.getRanges().size(); i < n; ++i) {
289 return SM.isBeforeInTranslationUnit(XR.
getEnd(), YR.
getEnd());
293 switch(
X.getKind()) {
296cast<PathDiagnosticControlFlowPiece>(Y));
299cast<PathDiagnosticMacroPiece>(Y));
302cast<PathDiagnosticCallPiece>(Y));
308llvm_unreachable(
"all cases handled");
313 if(
X.size() != Y.size())
314 return X.size() < Y.size();
316PathPieces::const_iterator X_I =
X.begin(), X_end =
X.end();
317PathPieces::const_iterator Y_I = Y.begin(), Y_end = Y.end();
319 for(; X_I != X_end && Y_I != Y_end; ++X_I, ++Y_I)
334std::pair<bool, bool> InSameTU =
SM.isInTheSameTranslationUnit(XOffs, YOffs);
367 autoCompareDecls = [&XL](
const Decl*D1,
368 const Decl*D2) -> std::optional<bool> {
392 if(XE - XI != YE - YI)
393 return(XE - XI) < (YE - YI);
394 for( ; XI != XE ; ++XI, ++YI) {
396 return(*XI) < (*YI);
408std::vector<const PathDiagnostic *> BatchDiags;
409 for(
const auto&
D:
Diags)
410BatchDiags.push_back(&
D);
416assert(*
X!= *Y &&
"PathDiagnostics not uniqued!");
419assert(
compare(**Y, **
X) &&
"Not a total order!");
422array_pod_sort(BatchDiags.begin(), BatchDiags.end(), Comp);
427 for(
const auto D: BatchDiags)
435 for(
autoIt = Set.begin(); It != Set.end();)
440StringRef ConsumerName,
442llvm::FoldingSetNodeID NodeID;
449 Set.InsertNode(Entry, InsertPos);
453 char*FileName_cstr = (
char*) Alloc.Allocate(
FileName.size(), 1);
456Entry->
files.push_back(std::make_pair(ConsumerName,
457StringRef(FileName_cstr,
463llvm::FoldingSetNodeID NodeID;
469 return&Entry->
files;
478 SourceLocationL = UseEndOfStatement ? S->getEndLoc() : S->getBeginLoc();
479assert(!LAC.isNull() &&
480 "A valid LocationContext or AnalysisDeclContext should be passed to " 481 "PathDiagnosticLocation upon creation.");
487 if(
auto*LC = dyn_cast<const LocationContext *>(LAC))
488ADC = LC->getAnalysisDeclContext();
490ADC = cast<AnalysisDeclContext *>(LAC);
511L = UseEndOfStatement ?
Parent->getEndLoc() :
Parent->getBeginLoc();
550 if(
const Stmt*CallerBody = CallerInfo->
getBody())
569llvm_unreachable(
"not yet implemented!");
572llvm_unreachable(
"CFGElement kind should not be on callsite!");
575llvm_unreachable(
"Unknown CFGElement kind");
588assert(S &&
"Statement cannot be null");
597 if(
const auto*CS = dyn_cast<CompoundStmt>(S))
598 returncreateEndBrace(CS,
SM);
648 if(
const auto*CS = dyn_cast_or_null<CompoundStmt>(LC->
getDecl()->
getBody()))
649 if(!CS->body_empty()) {
667 const Stmt* S =
nullptr;
668 if(std::optional<BlockEdge> BE =
P.getAs<
BlockEdge>()) {
669 const CFGBlock*BSrc = BE->getSrc();
674 P.getLocationContext()->getDecl(), SMng);
683 "TerminatorCondition and is not the enrty block of the CFG");
685 P.getLocationContext()->getDecl(), SMng);
688}
else if(std::optional<StmtPoint> SP =
P.getAs<
StmtPoint>()) {
692}
else if(std::optional<PostInitializer> PIP =
P.getAs<
PostInitializer>()) {
695}
else if(std::optional<PreImplicitCall> PIC =
P.getAs<
PreImplicitCall>()) {
697}
else if(std::optional<PostImplicitCall> PIE =
700}
else if(std::optional<CallEnter> CE =
P.getAs<
CallEnter>()) {
702CE->getLocationContext(),
704}
else if(std::optional<CallExitEnd> CEE =
P.getAs<
CallExitEnd>()) {
706CEE->getLocationContext(),
709 if(
const ReturnStmt*RS = CEB->getReturnStmt())
711CEB->getLocationContext());
713CEB->getLocationContext()->getDecl()->getSourceRange().getEnd(), SMng);
714}
else if(std::optional<BlockEntrance> BE =
P.getAs<
BlockEntrance>()) {
715 if(std::optional<CFGElement> BlockFront = BE->getFirstElement()) {
716 if(
autoStmtElt = BlockFront->getAs<
CFGStmt>()) {
718}
else if(
autoNewAllocElt = BlockFront->getAs<
CFGNewAllocator>()) {
720NewAllocElt->getAllocatorExpr()->getBeginLoc(), SMng);
722llvm_unreachable(
"Unexpected CFG element at front of block");
726BE->getBlock()->getTerminatorStmt()->getBeginLoc(), SMng);
727}
else if(std::optional<FunctionExitPoint> FE =
730FE->getLocationContext());
732llvm_unreachable(
"Unexpected ProgramPoint");
781 const Stmt*S = asStmt();
782 switch(S->getStmtClass()) {
785 caseStmt::DeclStmtClass: {
786 const auto*DS = cast<DeclStmt>(S);
787 if(DS->isSingleDecl()) {
790DS->getSingleDecl()->getLocation());
796 caseStmt::IfStmtClass:
797 caseStmt::WhileStmtClass:
798 caseStmt::DoStmtClass:
799 caseStmt::ForStmtClass:
800 caseStmt::ChooseExprClass:
801 caseStmt::IndirectGotoStmtClass:
802 caseStmt::SwitchStmtClass:
803 caseStmt::BinaryConditionalOperatorClass:
804 caseStmt::ConditionalOperatorClass:
805 caseStmt::ObjCForCollectionStmtClass: {
816 if(
const auto*MD = dyn_cast<ObjCMethodDecl>(
D))
817 returnMD->getSourceRange();
818 if(
const auto*FD = dyn_cast<FunctionDecl>(
D)) {
819 if(
Stmt*Body = FD->getBody())
820 returnBody->getSourceRange();
837 else if(K == DeclK) {
848std::shared_ptr<PathDiagnosticCallPiece>
855 returnstd::shared_ptr<PathDiagnosticCallPiece>(
861 const Decl*caller) {
862std::shared_ptr<PathDiagnosticCallPiece>
C(
866path.push_front(std::move(
C));
873Callee = CalleeCtx->
getDecl();
884 if(
const auto*MD = dyn_cast<ObjCMethodDecl>(Callee))
885IsCalleeAnAutosynthesizedPropertyAccessor = (
886MD->isPropertyAccessor() &&
893StringRef Prefix = StringRef(),
894StringRef Postfix = StringRef());
910StringRef Prefix, StringRef Postfix) {
915 for(
intI = 0,
Last= TAList.size() - 1; I !=
Last; ++I) {
924StringRef Prefix = StringRef()) {
925 if(!
D->getIdentifier())
927Out << Prefix <<
'\''<< *
D;
928 if(
const auto T= dyn_cast<ClassTemplateSpecializationDecl>(
D))
936 boolExtendedDescription,
937StringRef Prefix = StringRef()) {
941 if(isa<BlockDecl>(
D)) {
942 if(ExtendedDescription)
943Out << Prefix <<
"anonymous block";
944 returnExtendedDescription;
947 if(
const auto*MD = dyn_cast<CXXMethodDecl>(
D)) {
949 if(ExtendedDescription && !MD->isUserProvided()) {
950 if(MD->isExplicitlyDefaulted())
951Out <<
"defaulted ";
956 if(
const auto*CD = dyn_cast<CXXConstructorDecl>(MD)) {
957 if(CD->isDefaultConstructor())
959 else if(CD->isCopyConstructor())
961 else if(CD->isMoveConstructor())
964Out <<
"constructor";
966}
else if(isa<CXXDestructorDecl>(MD)) {
967 if(!MD->isUserProvided()) {
968Out <<
"destructor";
972Out <<
"'"<< *MD <<
"'";
974}
else if(MD->isCopyAssignmentOperator()) {
975Out <<
"copy assignment operator";
977}
else if(MD->isMoveAssignmentOperator()) {
978Out <<
"move assignment operator";
981 if(MD->getParent()->getIdentifier())
982Out <<
"'"<< *MD->getParent() <<
"::"<< *MD <<
"'";
984Out <<
"'"<< *MD <<
"'";
990Out << Prefix << '\'' << cast<NamedDecl>(*
D);
993 if(
const autoFD = dyn_cast<FunctionDecl>(
D))
995FD->getTemplateSpecializationArgs())
1003std::shared_ptr<PathDiagnosticEventPiece>
1009 if(!Callee || IsCalleeAnAutosynthesizedPropertyAccessor)
1013llvm::raw_svector_ostream Out(buf);
1018assert(callEnter.asLocation().isValid());
1019 returnstd::make_shared<PathDiagnosticEventPiece>(callEnter, Out.str());
1022std::shared_ptr<PathDiagnosticEventPiece>
1024 if(!callEnterWithin.asLocation().isValid())
1026 if(Callee->isImplicit() || !Callee->hasBody())
1028 if(
const auto*MD = dyn_cast<CXXMethodDecl>(Callee))
1029 if(MD->isDefaulted())
1033llvm::raw_svector_ostream Out(buf);
1035Out <<
"Entered call";
1038 returnstd::make_shared<PathDiagnosticEventPiece>(callEnterWithin, Out.str());
1041std::shared_ptr<PathDiagnosticEventPiece>
1047 if(NoExit || IsCalleeAnAutosynthesizedPropertyAccessor)
1051llvm::raw_svector_ostream Out(buf);
1053 if(!CallStackMessage.empty()) {
1054Out << CallStackMessage;
1058 "Returning from ");
1060Out <<
"Returning to caller";
1063assert(callReturn.asLocation().isValid());
1064 returnstd::make_shared<PathDiagnosticEventPiece>(callReturn, Out.str());
1068 for(
const auto&I : pieces) {
1070 if(
const auto*cp = dyn_cast<PathDiagnosticCallPiece>(piece))
1088ID.Add(
Range.getBegin());
1089ID.Add(
Range.getEnd());
1094ID.AddInteger((
unsigned)
getKind());
1097ID.AddInteger((
unsigned) getDisplayHint());
1099 for(
const auto&I : Ranges) {
1100ID.Add(I.getBegin());
1107 for(
const auto&I : path)
1118 for(
const auto&I : *
this)
1124 for(
const auto&I : subPieces)
1137ID.Add(getLocation());
1138ID.Add(getUniqueingLoc());
1140ID.AddString(VerboseDesc);
1146 for(
const auto&I : path)
1154 for(PathPieces::const_iterator I = begin(),
E= end(); I !=
E; ++I) {
1155llvm::errs() <<
"["<< index++ <<
"] ";
1157llvm::errs() <<
"\n";
1162llvm::errs() <<
"CALL\n--------------\n";
1164 if(
const Stmt*SLoc = getLocation().getStmtOrNull())
1166 else if(
const auto*ND = dyn_cast_or_null<NamedDecl>(getCallee()))
1167llvm::errs() << *ND <<
"\n";
1169getLocation().dump();
1173llvm::errs() <<
"EVENT\n--------------\n";
1174llvm::errs() << getString() <<
"\n";
1175llvm::errs() <<
" ---- at ----\n";
1176getLocation().dump();
1180llvm::errs() <<
"CONTROL\n--------------\n";
1181getStartLocation().dump();
1182llvm::errs() <<
" ---- to ----\n";
1183getEndLocation().dump();
1187llvm::errs() <<
"MACRO\n--------------\n";
1192llvm::errs() <<
"NOTE\n--------------\n";
1193llvm::errs() << getString() <<
"\n";
1194llvm::errs() <<
" ---- at ----\n";
1195getLocation().dump();
1199llvm::errs() <<
"POP-UP\n--------------\n";
1200llvm::errs() << getString() <<
"\n";
1201llvm::errs() <<
" ---- at ----\n";
1202getLocation().dump();
1207llvm::errs() <<
"<INVALID>\n";
1214llvm::errs() <<
"<range>\n";
1217asLocation().dump();
1218llvm::errs() <<
"\n";
1224llvm::errs() <<
"<NULL STMT>\n";
1227 if(
const auto*ND = dyn_cast_or_null<NamedDecl>(
D))
1228llvm::errs() << *ND <<
"\n";
1229 else if(isa<BlockDecl>(
D))
1231llvm::errs() <<
"<block>\n";
1233llvm::errs() <<
"<unknown decl>\n";
1235llvm::errs() <<
"<NULL DECL>\n";
This file defines AnalysisDeclContext, a class that manages the analysis context data for context sen...
static Decl::Kind getKind(const Decl *D)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
Defines the clang::Expr interface and subclasses for C++ expressions.
Defines the clang::FileManager interface and associated types.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
static std::optional< bool > comparePath(const PathPieces &X, const PathPieces &Y)
static PathDiagnosticLocation getLocationForCaller(const StackFrameContext *SFC, const LocationContext *CallerCtx, const SourceManager &SM)
static void describeClass(raw_ostream &Out, const CXXRecordDecl *D, StringRef Prefix=StringRef())
static bool compare(const PathDiagnostic &X, const PathDiagnostic &Y)
static bool describeCodeDecl(raw_ostream &Out, const Decl *D, bool ExtendedDescription, StringRef Prefix=StringRef())
static std::optional< bool > compareCall(const PathDiagnosticCallPiece &X, const PathDiagnosticCallPiece &Y)
static std::optional< bool > comparePiece(const PathDiagnosticPiece &X, const PathDiagnosticPiece &Y)
static void describeTemplateParameter(raw_ostream &Out, const TemplateArgument &TArg, const LangOptions &LO)
static void compute_path_size(const PathPieces &pieces, unsigned &size)
static std::optional< bool > compareMacro(const PathDiagnosticMacroPiece &X, const PathDiagnosticMacroPiece &Y)
static std::optional< bool > compareControlFlow(const PathDiagnosticControlFlowPiece &X, const PathDiagnosticControlFlowPiece &Y)
static StringRef StripTrailingDots(StringRef s)
static void describeTemplateParameters(raw_ostream &Out, const ArrayRef< TemplateArgument > TAList, const LangOptions &LO, StringRef Prefix=StringRef(), StringRef Postfix=StringRef())
static bool compareCrossTUSourceLocs(FullSourceLoc XL, FullSourceLoc YL)
Defines the clang::SourceLocation class and associated facilities.
Defines the SourceManager interface.
C Language Family Type Representation.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
__device__ __2f16 float __ockl_bool s
SourceLocation getColonLoc() const
AnalysisDeclContext contains the context data for the function, method or block under analysis.
ParentMap & getParentMap()
const Decl * getDecl() const
bool isBodyAutosynthesized() const
A builtin binary operation expression such as "x + y" or "x <= y".
SourceLocation getOperatorLoc() const
Represents C++ object destructor implicitly generated for automatic object or temporary bound to cons...
const Stmt * getTriggerStmt() const
Represents a single basic block in a source-level CFG.
CFGTerminator getTerminator() const
Stmt * getTerminatorCondition(bool StripParens=true)
Represents C++ object destructor generated from a call to delete.
const CXXDeleteExpr * getDeleteExpr() const
Represents a top-level expression in a basic block.
T castAs() const
Convert to the specified CFGElement type, asserting that this CFGElement is of the desired type.
Represents C++ base or member initializer from constructor's initialization list.
Represents C++ allocator call.
const Stmt * getStmt() const
Represents C++ object destructor implicitly generated at the end of full expression for temporary obj...
bool isVirtualBaseBranch() const
Represents a C++ struct/union/class.
Represents a point when we begin processing an inlined call.
const StackFrameContext * getCalleeContext() const
Represents a point when we start the call exit sequence (for inlined call).
Represents a point when we finish the call exit sequence (for inlined call).
const StackFrameContext * getCalleeContext() const
CompoundStmt - This represents a group of statements like { stmt stmt }.
SourceLocation getLBracLoc() const
SourceLocation getRBracLoc() const
ConditionalOperator - The ?: ternary operator.
Decl - This represents one declaration (or definition), e.g.
SourceLocation getEndLoc() const LLVM_READONLY
virtual Stmt * getBody() const
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
SourceLocation getBodyRBrace() const
getBodyRBrace - Gets the right brace of the body, if a body exists.
SourceLocation getLocation() const
SourceLocation getBeginLoc() const LLVM_READONLY
const LangOptions & getLangOpts() const LLVM_READONLY
Helper to get the language options from the ASTContext.
StringRef getName() const
The name of this FileEntry.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
A SourceLocation and its associated SourceManager.
FullSourceLoc getExpansionLoc() const
FullSourceLoc getSpellingLoc() const
std::pair< FileID, unsigned > getDecomposedLoc() const
Decompose the specified location into a raw FileID + Offset pair.
const SourceManager & getManager() const
bool isBeforeInTranslationUnitThan(SourceLocation Loc) const
Determines the order of 2 source locations in the translation unit.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext ...
const Decl * getDecl() const
LLVM_ATTRIBUTE_RETURNS_NONNULL AnalysisDeclContext * getAnalysisDeclContext() const
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
SourceLocation getMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'.
SourceLocation getBeginLoc() const LLVM_READONLY
Stmt * getParent(Stmt *) const
Represents a program point just after an implicit call event.
Represents a point after we ran remove dead bindings AFTER processing the given statement.
Represents a program point just before an implicit call event.
const LocationContext * getLocationContext() const
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
This class handles loading and caching of source files into memory.
FileID getFileID(SourceLocation SpellingLoc) const
Return the FileID for a SourceLocation.
SourceLocation getExpansionLoc(SourceLocation Loc) const
Given a SourceLocation object Loc, return the expansion location referenced by the ID.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
It represents a stack frame of the call stack (based on CallEvent).
unsigned getIndex() const
const CFGBlock * getCallSiteBlock() const
Stmt - This represents one statement.
SourceLocation getBeginLoc() const LLVM_READONLY
A template argument list.
Represents a template argument.
ArrayRef< TemplateArgument > getPackAsArray() const
Return the array of arguments in this template argument pack.
void print(const PrintingPolicy &Policy, raw_ostream &Out, bool IncludeType) const
Print this template argument to the given output stream.
@ Pack
The template argument is actually a parameter pack.
ArgKind getKind() const
Return the kind of stored template argument.
~PathDiagnosticCallPiece() override
void setCallee(const CallEnter &CE, const SourceManager &SM)
PathDiagnosticLocation callEnter
void dump() const override
std::shared_ptr< PathDiagnosticEventPiece > getCallExitEvent() const
static std::shared_ptr< PathDiagnosticCallPiece > construct(const CallExitEnd &CE, const SourceManager &SM)
PathDiagnosticLocation callReturn
std::shared_ptr< PathDiagnosticEventPiece > getCallEnterWithinCallerEvent() const
void Profile(llvm::FoldingSetNodeID &ID) const override
std::shared_ptr< PathDiagnosticEventPiece > getCallEnterEvent() const
PathDiagnosticLocation callEnterWithin
PDFileEntry::ConsumerFiles * getFiles(const PathDiagnostic &PD)
void addDiagnostic(const PathDiagnostic &PD, StringRef ConsumerName, StringRef fileName)
std::vector< std::pair< StringRef, StringRef > > ConsumerFiles
ConsumerFiles files
A vector of <consumer,file> pairs.
virtual void FlushDiagnosticsImpl(std::vector< const PathDiagnostic * > &Diags, FilesMade *filesMade)=0
virtual bool supportsCrossFileDiagnostics() const
Return true if the PathDiagnosticConsumer supports individual PathDiagnostics that span multiple file...
void HandlePathDiagnostic(std::unique_ptr< PathDiagnostic > D)
llvm::FoldingSet< PathDiagnostic > Diags
virtual ~PathDiagnosticConsumer()
void FlushDiagnostics(FilesMade *FilesMade)
PathDiagnosticLocation getStartLocation() const
void dump() const override
~PathDiagnosticControlFlowPiece() override
PathDiagnosticLocation getEndLocation() const
void Profile(llvm::FoldingSetNodeID &ID) const override
~PathDiagnosticEventPiece() override
void dump() const override
static PathDiagnosticLocation createMemberLoc(const MemberExpr *ME, const SourceManager &SM)
For member expressions, return the location of the '.
static PathDiagnosticLocation createDeclBegin(const LocationContext *LC, const SourceManager &SM)
Create a location for the beginning of the enclosing declaration body.
void Profile(llvm::FoldingSetNodeID &ID) const
static PathDiagnosticLocation createOperatorLoc(const BinaryOperator *BO, const SourceManager &SM)
Create the location for the operator of the binary expression.
static PathDiagnosticLocation createEndBrace(const CompoundStmt *CS, const SourceManager &SM)
Create a location for the end of the compound statement.
static PathDiagnosticLocation createBeginBrace(const CompoundStmt *CS, const SourceManager &SM)
Create a location for the beginning of the compound statement.
static SourceLocation getValidSourceLocation(const Stmt *S, LocationOrAnalysisDeclContext LAC, bool UseEndOfStatement=false)
Construct a source location that corresponds to either the beginning or the end of the given statemen...
static PathDiagnosticLocation createEnd(const Stmt *S, const SourceManager &SM, const LocationOrAnalysisDeclContext LAC)
Create a location for the end of the statement.
static PathDiagnosticLocation createBegin(const Decl *D, const SourceManager &SM)
Create a location for the beginning of the declaration.
FullSourceLoc asLocation() const
static PathDiagnosticLocation create(const Decl *D, const SourceManager &SM)
Create a location corresponding to the given declaration.
static PathDiagnosticLocation createConditionalColonLoc(const ConditionalOperator *CO, const SourceManager &SM)
static PathDiagnosticLocation createDeclEnd(const LocationContext *LC, const SourceManager &SM)
Constructs a location for the end of the enclosing declaration body.
static PathDiagnosticLocation createSingleLocation(const PathDiagnosticLocation &PDL)
Convert the given location into a single kind location.
void dump() const override
void Profile(llvm::FoldingSetNodeID &ID) const override
~PathDiagnosticMacroPiece() override
void Profile(llvm::FoldingSetNodeID &ID) const override
void dump() const override
~PathDiagnosticNotePiece() override
ArrayRef< SourceRange > getRanges() const
Return the SourceRanges associated with this PathDiagnosticPiece.
virtual PathDiagnosticLocation getLocation() const =0
virtual void Profile(llvm::FoldingSetNodeID &ID) const
virtual ~PathDiagnosticPiece()
PathDiagnosticPiece()=delete
StringRef getString() const
void Profile(llvm::FoldingSetNodeID &ID) const override
PathDiagnostic - PathDiagnostic objects represent a single path-sensitive diagnostic.
meta_iterator meta_end() const
void FullProfile(llvm::FoldingSetNodeID &ID) const
Profiles the diagnostic, including its path.
PathDiagnosticLocation getUniqueingLoc() const
Get the location on which the report should be uniqued.
std::deque< std::string >::const_iterator meta_iterator
StringRef getVerboseDescription() const
const Decl * getDeclWithIssue() const
Return the semantic context where an issue occurred.
void Profile(llvm::FoldingSetNodeID &ID) const
Profiles the diagnostic, independent of the path it references.
unsigned full_size()
Return the unrolled size of the path.
StringRef getBugType() const
const Decl * getUniqueingDecl() const
Get the declaration containing the uniqueing location.
StringRef getCategory() const
StringRef getShortDescription() const
meta_iterator meta_begin() const
PathDiagnosticLocation getLocation() const
A Range represents the closed range [from, to].
llvm::PointerUnion< const LocationContext *, AnalysisDeclContext * > LocationOrAnalysisDeclContext
The JSON file list parser is used to communicate input to InstallAPI.
@ Result
The result type of a method or function.
const FunctionProtoType * T
Describes how types, statements, expressions, and declarations should be printed.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4