forked from include-what-you-use/include-what-you-use
-
Notifications
You must be signed in to change notification settings - Fork 4
/
iwyu_verrs.cc
44 lines (35 loc) · 1.01 KB
/
iwyu_verrs.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//===--- iwyu_verrs.cc - debug output for include-what-you-use ------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "iwyu_verrs.h"
#include "iwyu_globals.h"
#include "iwyu_location_util.h"
#include "iwyu_path_util.h"
namespace include_what_you_use {
using clang::FileEntry;
namespace {
int verbose_level = 1;
} // namespace
void SetVerboseLevel(int level) {
verbose_level = level;
}
int GetVerboseLevel() {
return verbose_level;
}
bool ShouldPrintSymbolFromFile(const FileEntry* file) {
if (GetVerboseLevel() < 5) {
return false;
} else if (GetVerboseLevel() < 10) {
return ShouldReportIWYUViolationsFor(file);
} else if (GetVerboseLevel() < 11) {
return !IsSystemIncludeFile(GetFilePath(file));
} else {
return true;
}
}
} // namespace include_what_you_use