/builds/2mk6rsew/0/parcoach/parcoach/src/include/parcoach/Warning.h
Line | Count | Source |
1 | | #pragma once |
2 | | |
3 | | #include "llvm/ADT/SmallVector.h" |
4 | | #include "llvm/IR/DebugLoc.h" |
5 | | |
6 | | #include <string> |
7 | | #include <vector> |
8 | | |
9 | | namespace llvm { |
10 | | class Function; |
11 | | class CallBase; |
12 | | } // namespace llvm |
13 | | |
14 | | namespace parcoach { |
15 | | |
16 | | struct Location { |
17 | | Location(llvm::DebugLoc DL); |
18 | | llvm::StringRef Filename{}; |
19 | | int Line{}; |
20 | 118 | inline bool operator<(Location const &Other) const { |
21 | 118 | return std::tie(Filename, Line) < std::tie(Other.Filename, Other.Line); |
22 | 118 | } |
23 | | }; |
24 | | |
25 | | struct Warning { |
26 | | using ConditionalsContainerTy = std::vector<Location>; |
27 | | Warning(llvm::Function const &, llvm::DebugLoc, ConditionalsContainerTy &&); |
28 | 7.24k | ~Warning() = default; |
29 | | llvm::Function const &MissedFunction; |
30 | | Location Where; |
31 | | ConditionalsContainerTy Conditionals{}; |
32 | | std::string toString() const; |
33 | | }; |
34 | | |
35 | | using WarningCollection = llvm::DenseMap<llvm::CallBase *, Warning>; |
36 | | |
37 | | } // namespace parcoach |