annotate tools/llvm-pdbutil/Diff.cpp @ 133:c60214abe0e8

fix intrin.h
author mir3636
date Fri, 16 Feb 2018 19:10:49 +0900
parents 803732b1fca8
children 3a76565eade5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 //===- Diff.cpp - PDB diff utility ------------------------------*- C++ -*-===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 // The LLVM Compiler Infrastructure
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 // This file is distributed under the University of Illinois Open Source
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 // License. See LICENSE.TXT for details.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 #include "Diff.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 #include "DiffPrinter.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 #include "FormatUtil.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 #include "StreamUtil.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 #include "llvm-pdbutil.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 #include "llvm/ADT/StringSet.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 #include "llvm/DebugInfo/PDB/Native/DbiStream.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 #include "llvm/DebugInfo/PDB/Native/Formatters.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 #include "llvm/DebugInfo/PDB/Native/InfoStream.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 #include "llvm/DebugInfo/PDB/Native/PDBStringTable.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 #include "llvm/Support/FileSystem.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 #include "llvm/Support/FormatAdapters.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 #include "llvm/Support/FormatProviders.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 #include "llvm/Support/FormatVariadic.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 #include "llvm/Support/Path.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 using namespace llvm;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 using namespace llvm::pdb;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 namespace {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 // Compare and format two stream numbers. Stream numbers are considered
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 // identical if they contain the same value, equivalent if they are both
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 // the invalid stream or neither is the invalid stream, and different if
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 // one is the invalid stream and another isn't.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 struct StreamNumberProvider {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 static DiffResult compare(uint16_t L, uint16_t R) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 if (L == R)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 return DiffResult::IDENTICAL;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 bool LP = L != kInvalidStreamIndex;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 bool RP = R != kInvalidStreamIndex;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 if (LP != RP)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 return DiffResult::DIFFERENT;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 return DiffResult::EQUIVALENT;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 static std::string format(uint16_t SN, bool Right) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 if (SN == kInvalidStreamIndex)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 return "(not present)";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 return formatv("{0}", SN).str();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 // Compares and formats two module indices. Modis are considered identical
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 // if they are identical, equivalent if they either both contain a value or
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 // both don't contain a value, and different if one contains a value and the
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 // other doesn't.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 struct ModiProvider {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 DiffResult compare(Optional<uint32_t> L, Optional<uint32_t> R) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 if (L == R)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 return DiffResult::IDENTICAL;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 if (L.hasValue() != R.hasValue())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 return DiffResult::DIFFERENT;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 return DiffResult::EQUIVALENT;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 std::string format(Optional<uint32_t> Modi, bool Right) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 if (!Modi.hasValue())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 return "(not present)";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 return formatv("{0}", *Modi).str();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 // Compares and formats two paths embedded in the PDB, ignoring the beginning
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 // of the path if the user specified it as a "root path" on the command line.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 struct BinaryPathProvider {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 explicit BinaryPathProvider(uint32_t MaxLen) : MaxLen(MaxLen) {}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83 DiffResult compare(StringRef L, StringRef R) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 if (L == R)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 return DiffResult::IDENTICAL;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 SmallString<64> LN = removeRoot(L, false);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 SmallString<64> RN = removeRoot(R, true);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90 return (LN.equals_lower(RN)) ? DiffResult::EQUIVALENT
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 : DiffResult::DIFFERENT;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94 std::string format(StringRef S, bool Right) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
95 if (S.empty())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
96 return "(empty)";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
97
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
98 SmallString<64> Native = removeRoot(S, Right);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
99 return truncateStringFront(Native.str(), MaxLen);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 SmallString<64> removeRoot(StringRef Path, bool IsRight) const {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103 SmallString<64> Native(Path);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
104 auto &RootOpt = IsRight ? opts::diff::RightRoot : opts::diff::LeftRoot;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
105 SmallString<64> Root(static_cast<std::string>(RootOpt));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
106 // pdb paths always use windows syntax, convert slashes to backslashes.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
107 sys::path::native(Root, sys::path::Style::windows);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
108 if (sys::path::has_stem(Root, sys::path::Style::windows))
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
109 sys::path::append(Root, sys::path::Style::windows,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
110 sys::path::get_separator(sys::path::Style::windows));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
111
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
112 sys::path::replace_path_prefix(Native, Root, "", sys::path::Style::windows);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
113 return Native;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
114 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
115 uint32_t MaxLen;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
116 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
117
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
118 // Compare and format two stream purposes. For general streams, this just
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
119 // compares the description. For module streams it uses the path comparison
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
120 // algorithm taking into consideration the binary root, described above.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
121 // Formatting stream purposes just prints the stream purpose, except for
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
122 // module streams and named streams, where it prefixes the name / module
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
123 // with an identifier. Example:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
124 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
125 // Named Stream "\names"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
126 // Module Stream "foo.obj"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
127 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
128 // If a named stream is too long to fit in a column, it is truncated at the
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
129 // end, and if a module is too long to fit in a column, it is truncated at the
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
130 // beginning. Example:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
131 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
132 // Named Stream "\Really Long Str..."
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
133 // Module Stream "...puts\foo.obj"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
134 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
135 struct StreamPurposeProvider {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
136 explicit StreamPurposeProvider(uint32_t MaxLen) : MaxLen(MaxLen) {}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
137
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
138 DiffResult compare(const StreamInfo &L, const StreamInfo &R) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
139 if (L.getPurpose() != R.getPurpose())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
140 return DiffResult::DIFFERENT;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
141 if (L.getPurpose() == StreamPurpose::ModuleStream) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
142 BinaryPathProvider PathProvider(MaxLen);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
143 return PathProvider.compare(L.getShortName(), R.getShortName());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
144 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
145 return (L.getShortName() == R.getShortName()) ? DiffResult::IDENTICAL
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
146 : DiffResult::DIFFERENT;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
147 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
148
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
149 std::string format(const StreamInfo &P, bool Right) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
150 if (P.getPurpose() == StreamPurpose::Other ||
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
151 P.getPurpose() == StreamPurpose::Symbols)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
152 return truncateStringBack(P.getShortName(), MaxLen);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
153 if (P.getPurpose() == StreamPurpose::NamedStream)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
154 return truncateQuotedNameBack("Named Stream", P.getShortName(), MaxLen);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
155
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
156 assert(P.getPurpose() == StreamPurpose::ModuleStream);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
157 uint32_t ExtraChars = strlen("Module \"\"");
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
158 BinaryPathProvider PathProvider(MaxLen - ExtraChars);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
159 std::string Result = PathProvider.format(P.getShortName(), Right);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
160 return formatv("Module \"{0}\"", Result);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
161 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
162
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
163 uint32_t MaxLen;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
164 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
165 } // namespace
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
166
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
167 namespace llvm {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
168 template <> struct format_provider<PdbRaw_FeatureSig> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
169 static void format(const PdbRaw_FeatureSig &Sig, raw_ostream &Stream,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
170 StringRef Style) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
171 switch (Sig) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
172 case PdbRaw_FeatureSig::MinimalDebugInfo:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
173 Stream << "MinimalDebugInfo";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
174 break;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
175 case PdbRaw_FeatureSig::NoTypeMerge:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
176 Stream << "NoTypeMerge";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
177 break;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
178 case PdbRaw_FeatureSig::VC110:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
179 Stream << "VC110";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
180 break;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
181 case PdbRaw_FeatureSig::VC140:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
182 Stream << "VC140";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
183 break;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
184 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
185 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
186 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
187 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
188
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
189 template <typename R> using ValueOfRange = llvm::detail::ValueOfRange<R>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
190
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
191 DiffStyle::DiffStyle(PDBFile &File1, PDBFile &File2)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
192 : File1(File1), File2(File2) {}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
193
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
194 Error DiffStyle::dump() {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
195 if (auto EC = diffSuperBlock())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
196 return EC;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
197
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
198 if (auto EC = diffFreePageMap())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
199 return EC;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
200
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
201 if (auto EC = diffStreamDirectory())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
202 return EC;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
203
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
204 if (auto EC = diffStringTable())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
205 return EC;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
206
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
207 if (auto EC = diffInfoStream())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
208 return EC;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
209
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
210 if (auto EC = diffDbiStream())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
211 return EC;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
212
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
213 if (auto EC = diffSectionContribs())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
214 return EC;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
215
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
216 if (auto EC = diffSectionMap())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
217 return EC;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
218
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
219 if (auto EC = diffFpoStream())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
220 return EC;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
221
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
222 if (auto EC = diffTpiStream(StreamTPI))
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
223 return EC;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
224
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
225 if (auto EC = diffTpiStream(StreamIPI))
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
226 return EC;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
227
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
228 if (auto EC = diffPublics())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
229 return EC;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
230
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
231 if (auto EC = diffGlobals())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
232 return EC;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
233
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
234 return Error::success();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
235 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
236
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
237 Error DiffStyle::diffSuperBlock() {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
238 DiffPrinter D(2, "MSF Super Block", 16, 20, opts::diff::PrintResultColumn,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
239 opts::diff::PrintValueColumns, outs());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
240 D.printExplicit("File", DiffResult::UNSPECIFIED,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
241 truncateStringFront(File1.getFilePath(), 18),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
242 truncateStringFront(File2.getFilePath(), 18));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
243 D.print("Block Size", File1.getBlockSize(), File2.getBlockSize());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
244 D.print("Block Count", File1.getBlockCount(), File2.getBlockCount());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
245 D.print("Unknown 1", File1.getUnknown1(), File2.getUnknown1());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
246 D.print("Directory Size", File1.getNumDirectoryBytes(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
247 File2.getNumDirectoryBytes());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
248 return Error::success();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
249 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
250
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
251 Error DiffStyle::diffStreamDirectory() {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
252 DiffPrinter D(2, "Stream Directory", 30, 20, opts::diff::PrintResultColumn,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
253 opts::diff::PrintValueColumns, outs());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
254 D.printExplicit("File", DiffResult::UNSPECIFIED,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
255 truncateStringFront(File1.getFilePath(), 18),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
256 truncateStringFront(File2.getFilePath(), 18));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
257
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
258 SmallVector<StreamInfo, 32> P;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
259 SmallVector<StreamInfo, 32> Q;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
260 discoverStreamPurposes(File1, P);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
261 discoverStreamPurposes(File2, Q);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
262 D.print("Stream Count", File1.getNumStreams(), File2.getNumStreams());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
263 auto PI = to_vector<32>(enumerate(P));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
264 auto QI = to_vector<32>(enumerate(Q));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
265
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
266 // Scan all streams in the left hand side, looking for ones that are also
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
267 // in the right. Each time we find one, remove it. When we're done, Q
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
268 // should contain all the streams that are in the right but not in the left.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
269 StreamPurposeProvider StreamProvider(28);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
270 for (const auto &P : PI) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
271 typedef decltype(PI) ContainerType;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
272 typedef typename ContainerType::value_type value_type;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
273
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
274 auto Iter = llvm::find_if(QI, [P, &StreamProvider](const value_type &V) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
275 DiffResult Result = StreamProvider.compare(P.value(), V.value());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
276 return Result == DiffResult::EQUIVALENT ||
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
277 Result == DiffResult::IDENTICAL;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
278 });
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
279
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
280 if (Iter == QI.end()) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
281 D.printExplicit(StreamProvider.format(P.value(), false),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
282 DiffResult::DIFFERENT, P.index(), "(not present)");
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
283 continue;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
284 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
285
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
286 D.print<EquivalentDiffProvider>(StreamProvider.format(P.value(), false),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
287 P.index(), Iter->index());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
288 QI.erase(Iter);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
289 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
290
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
291 for (const auto &Q : QI) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
292 D.printExplicit(StreamProvider.format(Q.value(), true),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
293 DiffResult::DIFFERENT, "(not present)", Q.index());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
294 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
295
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
296 return Error::success();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
297 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
298
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
299 Error DiffStyle::diffStringTable() {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
300 DiffPrinter D(2, "String Table", 30, 20, opts::diff::PrintResultColumn,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
301 opts::diff::PrintValueColumns, outs());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
302 D.printExplicit("File", DiffResult::UNSPECIFIED,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
303 truncateStringFront(File1.getFilePath(), 18),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
304 truncateStringFront(File2.getFilePath(), 18));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
305
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
306 auto ExpectedST1 = File1.getStringTable();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
307 auto ExpectedST2 = File2.getStringTable();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
308 bool Has1 = !!ExpectedST1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
309 bool Has2 = !!ExpectedST2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
310 std::string Count1 = Has1 ? llvm::utostr(ExpectedST1->getNameCount())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
311 : "(string table not present)";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
312 std::string Count2 = Has2 ? llvm::utostr(ExpectedST2->getNameCount())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
313 : "(string table not present)";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
314 D.print("Number of Strings", Count1, Count2);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
315
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
316 if (!Has1 || !Has2) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
317 consumeError(ExpectedST1.takeError());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
318 consumeError(ExpectedST2.takeError());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
319 return Error::success();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
320 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
321
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
322 auto &ST1 = *ExpectedST1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
323 auto &ST2 = *ExpectedST2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
324
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
325 D.print("Hash Version", ST1.getHashVersion(), ST2.getHashVersion());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
326 D.print("Byte Size", ST1.getByteSize(), ST2.getByteSize());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
327 D.print("Signature", ST1.getSignature(), ST2.getSignature());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
328
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
329 // Both have a valid string table, dive in and compare individual strings.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
330
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
331 auto IdList1 = ST1.name_ids();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
332 auto IdList2 = ST2.name_ids();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
333 StringSet<> LS;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
334 StringSet<> RS;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
335 uint32_t Empty1 = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
336 uint32_t Empty2 = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
337 for (auto ID : IdList1) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
338 auto S = ST1.getStringForID(ID);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
339 if (!S)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
340 return S.takeError();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
341 if (S->empty())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
342 ++Empty1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
343 else
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
344 LS.insert(*S);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
345 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
346 for (auto ID : IdList2) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
347 auto S = ST2.getStringForID(ID);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
348 if (!S)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
349 return S.takeError();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
350 if (S->empty())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
351 ++Empty2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
352 else
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
353 RS.insert(*S);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
354 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
355 D.print("Empty Strings", Empty1, Empty2);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
356
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
357 for (const auto &S : LS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
358 auto R = RS.find(S.getKey());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
359 std::string Truncated = truncateStringMiddle(S.getKey(), 28);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
360 uint32_t I = cantFail(ST1.getIDForString(S.getKey()));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
361 if (R == RS.end()) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
362 D.printExplicit(Truncated, DiffResult::DIFFERENT, I, "(not present)");
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
363 continue;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
364 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
365
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
366 uint32_t J = cantFail(ST2.getIDForString(R->getKey()));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
367 D.print<EquivalentDiffProvider>(Truncated, I, J);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
368 RS.erase(R);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
369 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
370
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
371 for (const auto &S : RS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
372 auto L = LS.find(S.getKey());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
373 std::string Truncated = truncateStringMiddle(S.getKey(), 28);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
374 uint32_t J = cantFail(ST2.getIDForString(S.getKey()));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
375 if (L == LS.end()) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
376 D.printExplicit(Truncated, DiffResult::DIFFERENT, "(not present)", J);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
377 continue;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
378 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
379
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
380 uint32_t I = cantFail(ST1.getIDForString(L->getKey()));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
381 D.print<EquivalentDiffProvider>(Truncated, I, J);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
382 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
383 return Error::success();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
384 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
385
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
386 Error DiffStyle::diffFreePageMap() { return Error::success(); }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
387
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
388 Error DiffStyle::diffInfoStream() {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
389 DiffPrinter D(2, "PDB Stream", 22, 40, opts::diff::PrintResultColumn,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
390 opts::diff::PrintValueColumns, outs());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
391 D.printExplicit("File", DiffResult::UNSPECIFIED,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
392 truncateStringFront(File1.getFilePath(), 38),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
393 truncateStringFront(File2.getFilePath(), 38));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
394
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
395 auto ExpectedInfo1 = File1.getPDBInfoStream();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
396 auto ExpectedInfo2 = File2.getPDBInfoStream();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
397
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
398 bool Has1 = !!ExpectedInfo1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
399 bool Has2 = !!ExpectedInfo2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
400 if (!(Has1 && Has2)) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
401 std::string L = Has1 ? "(present)" : "(not present)";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
402 std::string R = Has2 ? "(present)" : "(not present)";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
403 D.print("Stream", L, R);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
404
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
405 consumeError(ExpectedInfo1.takeError());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
406 consumeError(ExpectedInfo2.takeError());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
407 return Error::success();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
408 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
409
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
410 auto &IS1 = *ExpectedInfo1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
411 auto &IS2 = *ExpectedInfo2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
412 D.print("Stream Size", IS1.getStreamSize(), IS2.getStreamSize());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
413 D.print("Age", IS1.getAge(), IS2.getAge());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
414 D.print("Guid", IS1.getGuid(), IS2.getGuid());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
415 D.print("Signature", IS1.getSignature(), IS2.getSignature());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
416 D.print("Version", IS1.getVersion(), IS2.getVersion());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
417 D.diffUnorderedArray("Feature", IS1.getFeatureSignatures(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
418 IS2.getFeatureSignatures());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
419 D.print("Named Stream Size", IS1.getNamedStreamMapByteSize(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
420 IS2.getNamedStreamMapByteSize());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
421 StringMap<uint32_t> NSL = IS1.getNamedStreams().getStringMap();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
422 StringMap<uint32_t> NSR = IS2.getNamedStreams().getStringMap();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
423 D.diffUnorderedMap<EquivalentDiffProvider>("Named Stream", NSL, NSR);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
424 return Error::success();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
425 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
426
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
427 typedef std::pair<uint32_t, DbiModuleDescriptor> IndexedModuleDescriptor;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
428 typedef std::vector<IndexedModuleDescriptor> IndexedModuleDescriptorList;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
429
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
430 static IndexedModuleDescriptorList
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
431 getModuleDescriptors(const DbiModuleList &ML) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
432 IndexedModuleDescriptorList List;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
433 List.reserve(ML.getModuleCount());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
434 for (uint32_t I = 0; I < ML.getModuleCount(); ++I)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
435 List.emplace_back(I, ML.getModuleDescriptor(I));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
436 return List;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
437 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
438
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
439 static IndexedModuleDescriptorList::iterator
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
440 findOverrideEquivalentModule(uint32_t Modi,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
441 IndexedModuleDescriptorList &OtherList) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
442 auto &EqMap = opts::diff::Equivalences;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
443
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
444 auto Iter = EqMap.find(Modi);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
445 if (Iter == EqMap.end())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
446 return OtherList.end();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
447
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
448 uint32_t EqValue = Iter->second;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
449
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
450 return llvm::find_if(OtherList,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
451 [EqValue](const IndexedModuleDescriptor &Desc) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
452 return Desc.first == EqValue;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
453 });
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
454 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
455
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
456 static IndexedModuleDescriptorList::iterator
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
457 findEquivalentModule(const IndexedModuleDescriptor &Item,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
458 IndexedModuleDescriptorList &OtherList, bool ItemIsRight) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
459
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
460 if (!ItemIsRight) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
461 uint32_t Modi = Item.first;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
462 auto OverrideIter = findOverrideEquivalentModule(Modi, OtherList);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
463 if (OverrideIter != OtherList.end())
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
464 return OverrideIter;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
465 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
466
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
467 BinaryPathProvider PathProvider(28);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
468
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
469 auto Iter = OtherList.begin();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
470 auto End = OtherList.end();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
471 for (; Iter != End; ++Iter) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
472 const IndexedModuleDescriptor *Left = &Item;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
473 const IndexedModuleDescriptor *Right = &*Iter;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
474 if (ItemIsRight)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
475 std::swap(Left, Right);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
476 DiffResult Result = PathProvider.compare(Left->second.getModuleName(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
477 Right->second.getModuleName());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
478 if (Result == DiffResult::EQUIVALENT || Result == DiffResult::IDENTICAL)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
479 return Iter;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
480 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
481 return OtherList.end();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
482 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
483
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
484 static void diffOneModule(DiffPrinter &D, const IndexedModuleDescriptor &Item,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
485 IndexedModuleDescriptorList &Other,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
486 bool ItemIsRight) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
487 StreamPurposeProvider HeaderProvider(70);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
488 StreamInfo Info = StreamInfo::createModuleStream(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
489 Item.second.getModuleName(), Item.second.getModuleStreamIndex(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
490 Item.first);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
491 D.printFullRow(HeaderProvider.format(Info, ItemIsRight));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
492
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
493 const auto *L = &Item;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
494
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
495 auto Iter = findEquivalentModule(Item, Other, ItemIsRight);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
496 if (Iter == Other.end()) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
497 // We didn't find this module at all on the other side. Just print one row
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
498 // and continue.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
499 if (ItemIsRight)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
500 D.print<ModiProvider>("- Modi", None, Item.first);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
501 else
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
502 D.print<ModiProvider>("- Modi", Item.first, None);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
503 return;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
504 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
505
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
506 // We did find this module. Go through and compare each field.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
507 const auto *R = &*Iter;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
508 if (ItemIsRight)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
509 std::swap(L, R);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
510
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
511 BinaryPathProvider PathProvider(28);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
512 D.print<ModiProvider>("- Modi", L->first, R->first);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
513 D.print<BinaryPathProvider>("- Obj File Name", L->second.getObjFileName(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
514 R->second.getObjFileName(), PathProvider);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
515 D.print<StreamNumberProvider>("- Debug Stream",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
516 L->second.getModuleStreamIndex(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
517 R->second.getModuleStreamIndex());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
518 D.print("- C11 Byte Size", L->second.getC11LineInfoByteSize(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
519 R->second.getC11LineInfoByteSize());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
520 D.print("- C13 Byte Size", L->second.getC13LineInfoByteSize(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
521 R->second.getC13LineInfoByteSize());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
522 D.print("- # of files", L->second.getNumberOfFiles(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
523 R->second.getNumberOfFiles());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
524 D.print("- Pdb File Path Index", L->second.getPdbFilePathNameIndex(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
525 R->second.getPdbFilePathNameIndex());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
526 D.print("- Source File Name Index", L->second.getSourceFileNameIndex(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
527 R->second.getSourceFileNameIndex());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
528 D.print("- Symbol Byte Size", L->second.getSymbolDebugInfoByteSize(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
529 R->second.getSymbolDebugInfoByteSize());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
530 Other.erase(Iter);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
531 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
532
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
533 Error DiffStyle::diffDbiStream() {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
534 DiffPrinter D(2, "DBI Stream", 40, 30, opts::diff::PrintResultColumn,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
535 opts::diff::PrintValueColumns, outs());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
536 D.printExplicit("File", DiffResult::UNSPECIFIED,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
537 truncateStringFront(File1.getFilePath(), 28),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
538 truncateStringFront(File2.getFilePath(), 28));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
539
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
540 auto ExpectedDbi1 = File1.getPDBDbiStream();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
541 auto ExpectedDbi2 = File2.getPDBDbiStream();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
542
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
543 bool Has1 = !!ExpectedDbi1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
544 bool Has2 = !!ExpectedDbi2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
545 if (!(Has1 && Has2)) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
546 std::string L = Has1 ? "(present)" : "(not present)";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
547 std::string R = Has2 ? "(present)" : "(not present)";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
548 D.print("Stream", L, R);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
549
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
550 consumeError(ExpectedDbi1.takeError());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
551 consumeError(ExpectedDbi2.takeError());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
552 return Error::success();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
553 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
554
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
555 auto &DL = *ExpectedDbi1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
556 auto &DR = *ExpectedDbi2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
557
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
558 D.print("Dbi Version", (uint32_t)DL.getDbiVersion(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
559 (uint32_t)DR.getDbiVersion());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
560 D.print("Age", DL.getAge(), DR.getAge());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
561 D.print("Machine", (uint16_t)DL.getMachineType(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
562 (uint16_t)DR.getMachineType());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
563 D.print("Flags", DL.getFlags(), DR.getFlags());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
564 D.print("Build Major", DL.getBuildMajorVersion(), DR.getBuildMajorVersion());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
565 D.print("Build Minor", DL.getBuildMinorVersion(), DR.getBuildMinorVersion());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
566 D.print("Build Number", DL.getBuildNumber(), DR.getBuildNumber());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
567 D.print("PDB DLL Version", DL.getPdbDllVersion(), DR.getPdbDllVersion());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
568 D.print("PDB DLL RBLD", DL.getPdbDllRbld(), DR.getPdbDllRbld());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
569 D.print<StreamNumberProvider>("DBG (FPO)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
570 DL.getDebugStreamIndex(DbgHeaderType::FPO),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
571 DR.getDebugStreamIndex(DbgHeaderType::FPO));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
572 D.print<StreamNumberProvider>(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
573 "DBG (Exception)", DL.getDebugStreamIndex(DbgHeaderType::Exception),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
574 DR.getDebugStreamIndex(DbgHeaderType::Exception));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
575 D.print<StreamNumberProvider>("DBG (Fixup)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
576 DL.getDebugStreamIndex(DbgHeaderType::Fixup),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
577 DR.getDebugStreamIndex(DbgHeaderType::Fixup));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
578 D.print<StreamNumberProvider>(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
579 "DBG (OmapToSrc)", DL.getDebugStreamIndex(DbgHeaderType::OmapToSrc),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
580 DR.getDebugStreamIndex(DbgHeaderType::OmapToSrc));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
581 D.print<StreamNumberProvider>(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
582 "DBG (OmapFromSrc)", DL.getDebugStreamIndex(DbgHeaderType::OmapFromSrc),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
583 DR.getDebugStreamIndex(DbgHeaderType::OmapFromSrc));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
584 D.print<StreamNumberProvider>(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
585 "DBG (SectionHdr)", DL.getDebugStreamIndex(DbgHeaderType::SectionHdr),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
586 DR.getDebugStreamIndex(DbgHeaderType::SectionHdr));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
587 D.print<StreamNumberProvider>(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
588 "DBG (TokenRidMap)", DL.getDebugStreamIndex(DbgHeaderType::TokenRidMap),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
589 DR.getDebugStreamIndex(DbgHeaderType::TokenRidMap));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
590 D.print<StreamNumberProvider>("DBG (Xdata)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
591 DL.getDebugStreamIndex(DbgHeaderType::Xdata),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
592 DR.getDebugStreamIndex(DbgHeaderType::Xdata));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
593 D.print<StreamNumberProvider>("DBG (Pdata)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
594 DL.getDebugStreamIndex(DbgHeaderType::Pdata),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
595 DR.getDebugStreamIndex(DbgHeaderType::Pdata));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
596 D.print<StreamNumberProvider>("DBG (NewFPO)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
597 DL.getDebugStreamIndex(DbgHeaderType::NewFPO),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
598 DR.getDebugStreamIndex(DbgHeaderType::NewFPO));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
599 D.print<StreamNumberProvider>(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
600 "DBG (SectionHdrOrig)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
601 DL.getDebugStreamIndex(DbgHeaderType::SectionHdrOrig),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
602 DR.getDebugStreamIndex(DbgHeaderType::SectionHdrOrig));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
603 D.print<StreamNumberProvider>("Globals Stream",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
604 DL.getGlobalSymbolStreamIndex(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
605 DR.getGlobalSymbolStreamIndex());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
606 D.print<StreamNumberProvider>("Publics Stream",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
607 DL.getPublicSymbolStreamIndex(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
608 DR.getPublicSymbolStreamIndex());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
609 D.print<StreamNumberProvider>("Symbol Records", DL.getSymRecordStreamIndex(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
610 DR.getSymRecordStreamIndex());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
611 D.print("Has CTypes", DL.hasCTypes(), DR.hasCTypes());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
612 D.print("Is Incrementally Linked", DL.isIncrementallyLinked(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
613 DR.isIncrementallyLinked());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
614 D.print("Is Stripped", DL.isStripped(), DR.isStripped());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
615 const DbiModuleList &ML = DL.modules();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
616 const DbiModuleList &MR = DR.modules();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
617 D.print("Module Count", ML.getModuleCount(), MR.getModuleCount());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
618 D.print("Source File Count", ML.getSourceFileCount(),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
619 MR.getSourceFileCount());
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
620 auto MDL = getModuleDescriptors(ML);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
621 auto MDR = getModuleDescriptors(MR);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
622 // Scan all module descriptors from the left, and look for corresponding
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
623 // module descriptors on the right.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
624 for (const auto &L : MDL)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
625 diffOneModule(D, L, MDR, false);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
626
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
627 for (const auto &R : MDR)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
628 diffOneModule(D, R, MDL, true);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
629
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
630 return Error::success();
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
631 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
632
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
633 Error DiffStyle::diffSectionContribs() { return Error::success(); }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
634
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
635 Error DiffStyle::diffSectionMap() { return Error::success(); }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
636
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
637 Error DiffStyle::diffFpoStream() { return Error::success(); }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
638
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
639 Error DiffStyle::diffTpiStream(int Index) { return Error::success(); }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
640
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
641 Error DiffStyle::diffModuleInfoStream(int Index) { return Error::success(); }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
642
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
643 Error DiffStyle::diffPublics() { return Error::success(); }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
644
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
645 Error DiffStyle::diffGlobals() { return Error::success(); }