File indexing completed on 2026-05-10 08:43:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVCOMPARE_H
0015 #define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVCOMPARE_H
0016
0017 #include "llvm/DebugInfo/LogicalView/Core/LVObject.h"
0018
0019 namespace llvm {
0020 namespace logicalview {
0021
0022 class LVReader;
0023
0024
0025 using LVPassEntry = std::tuple<LVReader *, LVElement *, LVComparePass>;
0026 using LVPassTable = std::vector<LVPassEntry>;
0027
0028 class LVCompare final {
0029 raw_ostream &OS;
0030 LVScopes ScopeStack;
0031
0032
0033
0034
0035
0036
0037 LVPassTable PassTable;
0038
0039
0040
0041
0042 LVReader *Reader = nullptr;
0043
0044 bool FirstMissing = true;
0045 bool PrintLines = false;
0046 bool PrintScopes = false;
0047 bool PrintSymbols = false;
0048 bool PrintTypes = false;
0049
0050 static void setInstance(LVCompare *Compare);
0051
0052 void printCurrentStack();
0053 void printSummary() const;
0054
0055 public:
0056 LVCompare() = delete;
0057 LVCompare(raw_ostream &OS);
0058 LVCompare(const LVCompare &) = delete;
0059 LVCompare &operator=(const LVCompare &) = delete;
0060 ~LVCompare() = default;
0061
0062 static LVCompare &getInstance();
0063
0064
0065 void push(LVScope *Scope) { ScopeStack.push_back(Scope); }
0066 void pop() { ScopeStack.pop_back(); }
0067
0068
0069 Error execute(LVReader *ReferenceReader, LVReader *TargetReader);
0070
0071 void addPassEntry(LVReader *Reader, LVElement *Element, LVComparePass Pass) {
0072 PassTable.emplace_back(Reader, Element, Pass);
0073 }
0074 const LVPassTable &getPassTable() const & { return PassTable; }
0075
0076 void printItem(LVElement *Element, LVComparePass Pass);
0077 void print(raw_ostream &OS) const;
0078
0079 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
0080 void dump() const { print(dbgs()); }
0081 #endif
0082 };
0083
0084 inline LVCompare &getComparator() { return LVCompare::getInstance(); }
0085
0086 }
0087 }
0088
0089 #endif