diff options
Diffstat (limited to 'include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h index b4ab1ea78545..941d524079b0 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h @@ -70,11 +70,15 @@ public: void Profile(llvm::FoldingSetNodeID &ID) { ID = NodeID; } }; - struct FilesMade : public llvm::FoldingSet<PDFileEntry> { + class FilesMade { llvm::BumpPtrAllocator Alloc; + llvm::FoldingSet<PDFileEntry> Set; + public: ~FilesMade(); + bool empty() const { return Set.empty(); } + void addDiagnostic(const PathDiagnostic &PD, StringRef ConsumerName, StringRef fileName); @@ -352,9 +356,9 @@ private: std::vector<SourceRange> ranges; - PathDiagnosticPiece() LLVM_DELETED_FUNCTION; - PathDiagnosticPiece(const PathDiagnosticPiece &P) LLVM_DELETED_FUNCTION; - void operator=(const PathDiagnosticPiece &P) LLVM_DELETED_FUNCTION; + PathDiagnosticPiece() = delete; + PathDiagnosticPiece(const PathDiagnosticPiece &P) = delete; + void operator=(const PathDiagnosticPiece &P) = delete; protected: PathDiagnosticPiece(StringRef s, Kind k, DisplayHint hint = Below); @@ -362,7 +366,7 @@ protected: PathDiagnosticPiece(Kind k, DisplayHint hint = Below); public: - virtual ~PathDiagnosticPiece(); + ~PathDiagnosticPiece() override; StringRef getString() const { return str; } @@ -478,7 +482,7 @@ private: public: StackHintGeneratorForSymbol(SymbolRef S, StringRef M) : Sym(S), Msg(M) {} - virtual ~StackHintGeneratorForSymbol() {} + ~StackHintGeneratorForSymbol() override {} /// \brief Search the call expression for the symbol Sym and dispatch the /// 'getMessageForX()' methods to construct a specific message. @@ -511,7 +515,7 @@ public: : PathDiagnosticSpotPiece(pos, s, Event, addPosRange), CallStackHint(stackHint) {} - ~PathDiagnosticEventPiece(); + ~PathDiagnosticEventPiece() override; /// Mark the diagnostic piece as being potentially prunable. This /// flag may have been previously set, at which point it will not @@ -570,9 +574,9 @@ public: PathDiagnosticLocation callEnterWithin; PathDiagnosticLocation callReturn; PathPieces path; - - virtual ~PathDiagnosticCallPiece(); - + + ~PathDiagnosticCallPiece() override; + const Decl *getCaller() const { return Caller; } const Decl *getCallee() const { return Callee; } @@ -631,7 +635,7 @@ public: LPairs.push_back(PathDiagnosticLocationPair(startPos, endPos)); } - ~PathDiagnosticControlFlowPiece(); + ~PathDiagnosticControlFlowPiece() override; PathDiagnosticLocation getStartLocation() const { assert(!LPairs.empty() && @@ -686,7 +690,7 @@ public: PathDiagnosticMacroPiece(const PathDiagnosticLocation &pos) : PathDiagnosticSpotPiece(pos, "", Macro) {} - ~PathDiagnosticMacroPiece(); + ~PathDiagnosticMacroPiece() override; PathPieces subPieces; @@ -730,7 +734,7 @@ class PathDiagnostic : public llvm::FoldingSetNode { PathDiagnosticLocation UniqueingLoc; const Decl *UniqueingDecl; - PathDiagnostic() LLVM_DELETED_FUNCTION; + PathDiagnostic() = delete; public: PathDiagnostic(StringRef CheckName, const Decl *DeclWithIssue, StringRef bugtype, StringRef verboseDesc, StringRef shortDesc, |