14
14
#include " clang/Basic/PlistSupport.h"
15
15
#include " clang/Basic/SourceManager.h"
16
16
#include " clang/Basic/Version.h"
17
+ #include " clang/CrossTU/CrossTranslationUnit.h"
17
18
#include " clang/Lex/Preprocessor.h"
18
19
#include " clang/Lex/TokenConcatenation.h"
19
20
#include " clang/Rewrite/Core/HTMLRewrite.h"
20
21
#include " clang/StaticAnalyzer/Core/AnalyzerOptions.h"
21
22
#include " clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h"
22
23
#include " clang/StaticAnalyzer/Core/IssueHash.h"
23
24
#include " clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h"
24
- #include " llvm/ADT/Statistic.h"
25
25
#include " llvm/ADT/SmallPtrSet.h"
26
26
#include " llvm/ADT/SmallVector.h"
27
+ #include " llvm/ADT/Statistic.h"
27
28
#include " llvm/Support/Casting.h"
28
29
29
30
using namespace clang ;
@@ -39,12 +40,13 @@ namespace {
39
40
class PlistDiagnostics : public PathDiagnosticConsumer {
40
41
const std::string OutputFile;
41
42
const Preprocessor &PP;
43
+ const cross_tu::CrossTranslationUnitContext &CTU;
42
44
AnalyzerOptions &AnOpts;
43
45
const bool SupportsCrossFileDiagnostics;
44
46
public:
45
- PlistDiagnostics (AnalyzerOptions &AnalyzerOpts,
46
- const std::string& prefix,
47
+ PlistDiagnostics (AnalyzerOptions &AnalyzerOpts, const std::string &prefix,
47
48
const Preprocessor &PP,
49
+ const cross_tu::CrossTranslationUnitContext &CTU,
48
50
bool supportsMultipleFiles);
49
51
50
52
~PlistDiagnostics () override {}
@@ -518,26 +520,29 @@ static void printBugPath(llvm::raw_ostream &o, const FIDMap& FM,
518
520
// Methods of PlistDiagnostics.
519
521
// ===----------------------------------------------------------------------===//
520
522
521
- PlistDiagnostics::PlistDiagnostics (AnalyzerOptions &AnalyzerOpts,
522
- const std::string& output,
523
- const Preprocessor &PP,
524
- bool supportsMultipleFiles)
525
- : OutputFile(output), PP(PP), AnOpts(AnalyzerOpts),
526
- SupportsCrossFileDiagnostics(supportsMultipleFiles) {}
527
-
528
- void ento::createPlistDiagnosticConsumer (AnalyzerOptions &AnalyzerOpts,
529
- PathDiagnosticConsumers &C,
530
- const std::string& s,
531
- const Preprocessor &PP) {
532
- C.push_back (new PlistDiagnostics (AnalyzerOpts, s, PP,
523
+ PlistDiagnostics::PlistDiagnostics (
524
+ AnalyzerOptions &AnalyzerOpts, const std::string &output,
525
+ const Preprocessor &PP, const cross_tu::CrossTranslationUnitContext &CTU,
526
+ bool supportsMultipleFiles)
527
+ : OutputFile(output), PP(PP), CTU(CTU), AnOpts(AnalyzerOpts),
528
+ SupportsCrossFileDiagnostics(supportsMultipleFiles) {
529
+ // FIXME: Will be used by a later planned change.
530
+ (void )CTU;
531
+ }
532
+
533
+ void ento::createPlistDiagnosticConsumer (
534
+ AnalyzerOptions &AnalyzerOpts, PathDiagnosticConsumers &C,
535
+ const std::string &s, const Preprocessor &PP,
536
+ const cross_tu::CrossTranslationUnitContext &CTU) {
537
+ C.push_back (new PlistDiagnostics (AnalyzerOpts, s, PP, CTU,
533
538
/* supportsMultipleFiles*/ false ));
534
539
}
535
540
536
- void ento::createPlistMultiFileDiagnosticConsumer (AnalyzerOptions &AnalyzerOpts,
537
- PathDiagnosticConsumers &C,
538
- const std::string &s,
539
- const Preprocessor &PP ) {
540
- C.push_back (new PlistDiagnostics (AnalyzerOpts, s, PP,
541
+ void ento::createPlistMultiFileDiagnosticConsumer (
542
+ AnalyzerOptions &AnalyzerOpts, PathDiagnosticConsumers &C,
543
+ const std::string &s, const Preprocessor &PP ,
544
+ const cross_tu::CrossTranslationUnitContext &CTU ) {
545
+ C.push_back (new PlistDiagnostics (AnalyzerOpts, s, PP, CTU,
541
546
/* supportsMultipleFiles*/ true ));
542
547
}
543
548
void PlistDiagnostics::FlushDiagnosticsImpl (
0 commit comments