summaryrefslogtreecommitdiff
path: root/dev-debug/hotspot/files/hotspot-odr.patch
blob: 75f11ad1b698018365e2123d9a324c35825d45a6 (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
--- a/src/models/disassemblymodel.cpp
+++ b/src/models/disassemblymodel.cpp
@@ -240,7 +240,7 @@ QModelIndex DisassemblyModel::indexForFileLine(const Data::FileLine& fileLine) c
     return index(bestMatch, 0);
 }
 
-void DisassemblyModel::find(const QString& search, Direction direction, int current)
+void DisassemblyModel::find(const QString& search, SearchDirection direction, int current)
 {
     auto searchFunc = [&search](const DisassemblyOutput::DisassemblyLine& line) {
         return line.disassembly.indexOf(search, 0, Qt::CaseInsensitive) != -1;
--- a/src/models/disassemblymodel.h
+++ b/src/models/disassemblymodel.h
@@ -20,7 +20,7 @@ class Definition;
 class Repository;
 }
 
-enum class Direction;
+enum class SearchDirection;
 
 class DisassemblyModel : public QAbstractTableModel
 {
@@ -76,7 +76,7 @@ signals:
 
 public slots:
     void updateHighlighting(int line);
-    void find(const QString& search, Direction direction, int offset);
+    void find(const QString& search, SearchDirection direction, int offset);
     void scrollToLine(const QString& lineNumber);
 
 private:
--- a/src/models/search.h
+++ b/src/models/search.h
@@ -10,7 +10,7 @@
 #include <algorithm>
 #include <iterator>
 
-enum class Direction
+enum class SearchDirection
 {
     Forward,
     Backward
@@ -45,7 +45,7 @@ int search_helper(const it begin, const it end, const it current, SearchFunc sea
 }
 
 template<typename it, typename SearchFunc, typename EndReached>
-int search(const it begin, const it end, int current, Direction direction, SearchFunc searchFunc, EndReached endReached)
+int search(const it begin, const it end, int current, SearchDirection direction, SearchFunc searchFunc, EndReached endReached)
 {
     if (begin == end)
         return -1;
@@ -54,7 +54,7 @@ int search(const it begin, const it end, int current, Direction direction, Searc
     current = std::clamp(current, 0, static_cast<int>(size) - 1);
     const auto currentIt = begin + current;
 
-    if (direction == Direction::Forward) {
+    if (direction == SearchDirection::Forward) {
         return search_helper(begin, end, std::next(currentIt), searchFunc, endReached);
     }
 
--- a/src/models/sourcecodemodel.cpp
+++ b/src/models/sourcecodemodel.cpp
@@ -258,7 +258,7 @@ void SourceCodeModel::setSysroot(const QString& sysroot)
     m_sysroot = sysroot;
 }
 
-void SourceCodeModel::find(const QString& search, Direction direction, int current)
+void SourceCodeModel::find(const QString& search, SearchDirection direction, int current)
 {
     auto searchFunc = [&search](const QString& line) { return line.indexOf(search, 0, Qt::CaseInsensitive) != -1; };
 
--- a/src/models/sourcecodemodel.h
+++ b/src/models/sourcecodemodel.h
@@ -20,7 +20,7 @@ class Repository;
 class Definition;
 }
 
-enum class Direction;
+enum class SearchDirection;
 
 Q_DECLARE_METATYPE(QTextLine)
 
@@ -73,7 +73,7 @@ public slots:
     void updateHighlighting(int line);
     void setSysroot(const QString& sysroot);
 
-    void find(const QString& search, Direction direction, int current);
+    void find(const QString& search, SearchDirection direction, int current);
     void scrollToLine(const QString& lineNumber);
 
 private:
--- a/src/resultsdisassemblypage.cpp
+++ b/src/resultsdisassemblypage.cpp
@@ -407,12 +407,12 @@ ResultsDisassemblyPage::ResultsDisassemblyPage(CostContextMenu* costContextMenu,
 
         auto searchNext = [model, edit, additionalRows, searchResultIndex] {
             const auto offset = searchResultIndex->isValid() ? searchResultIndex->row() - additionalRows : 0;
-            model->find(edit->text(), Direction::Forward, offset);
+            model->find(edit->text(), SearchDirection::Forward, offset);
         };
 
         auto searchPrev = [model, edit, additionalRows, searchResultIndex] {
             const auto offset = searchResultIndex->isValid() ? searchResultIndex->row() - additionalRows : 0;
-            model->find(edit->text(), Direction::Backward, offset);
+            model->find(edit->text(), SearchDirection::Backward, offset);
         };
 
         auto findNextAction = KStandardAction::findNext(this, searchNext, actions);
--- a/tests/modeltests/tst_models.cpp
+++ b/tests/modeltests/tst_models.cpp
@@ -514,7 +514,7 @@ private slots:
         // check if search works in general
         QSignalSpy searchSpy(&model, &SourceCodeModel::resultFound);
         for (int i = 0; i < 5; i++) {
-            model.find(QStringLiteral("Line 5"), Direction::Forward, i);
+            model.find(QStringLiteral("Line 5"), SearchDirection::Forward, i);
             auto result = searchSpy.takeFirst();
             QCOMPARE(result.at(0).value<QModelIndex>(), model.index(3, SourceCodeModel::SourceCodeColumn));
         }
@@ -522,21 +522,21 @@ private slots:
         // Check wrap around
         for (int i = 1; i < 4; i++) {
             QSignalSpy endReached(&model, &SourceCodeModel::searchEndReached);
-            model.find(QStringLiteral("Line 3"), Direction::Forward, i);
+            model.find(QStringLiteral("Line 3"), SearchDirection::Forward, i);
             QCOMPARE(endReached.size(), 1);
         }
 
         // check if no result found works
         searchSpy.clear();
         for (int i = 0; i < 5; i++) {
-            model.find(QStringLiteral("Line 8"), Direction::Forward, i);
+            model.find(QStringLiteral("Line 8"), SearchDirection::Forward, i);
             auto result = searchSpy.takeFirst();
             QCOMPARE(result.at(0).value<QModelIndex>().isValid(), false);
         }
 
         // test backward search
         for (int i = 4; i > 0; i--) {
-            model.find(QStringLiteral("Line 7"), Direction::Backward, i);
+            model.find(QStringLiteral("Line 7"), SearchDirection::Backward, i);
             auto result = searchSpy.takeFirst();
             QCOMPARE(result.at(0).value<QModelIndex>(), model.index(5, SourceCodeModel::SourceCodeColumn));
         }
@@ -544,14 +544,14 @@ private slots:
         // Check wrap around
         for (int i = 4; i > 0; i--) {
             QSignalSpy endReached(&model, &SourceCodeModel::searchEndReached);
-            model.find(QStringLiteral("Line 7"), Direction::Backward, i);
+            model.find(QStringLiteral("Line 7"), SearchDirection::Backward, i);
             QCOMPARE(endReached.size(), 1);
         }
 
         // check if no result found works
         searchSpy.clear();
         for (int i = 0; i < 5; i++) {
-            model.find(QStringLiteral("Line 8"), Direction::Backward, i);
+            model.find(QStringLiteral("Line 8"), SearchDirection::Backward, i);
             auto result = searchSpy.takeFirst();
             QCOMPARE(result.at(0).value<QModelIndex>().isValid(), false);
         }
--- a/tests/modeltests/tst_search.cpp
+++ b/tests/modeltests/tst_search.cpp
@@ -24,9 +24,9 @@ private slots:
         const std::array<int, 0> testArray = {};
 
         QCOMPARE(
-            search(testArray.cbegin(), testArray.cend(), 0, Direction::Forward, [](int) { return false; }, [] {}), -1);
+            search(testArray.cbegin(), testArray.cend(), 0, SearchDirection::Forward, [](int) { return false; }, [] {}), -1);
         QCOMPARE(
-            search(testArray.cbegin(), testArray.cend(), 0, Direction::Backward, [](int) { return false; }, [] {}), -1);
+            search(testArray.cbegin(), testArray.cend(), 0, SearchDirection::Backward, [](int) { return false; }, [] {}), -1);
     }
     void testSearch()
     {
@@ -35,11 +35,11 @@ private slots:
         int maxOffset = testArray.size() - 1;
         for (int offset = 0; offset < maxOffset; offset++) {
             QCOMPARE(search(
-                         testArray.cbegin(), testArray.cend(), offset, Direction::Forward,
+                         testArray.cbegin(), testArray.cend(), offset, SearchDirection::Forward,
                          [](int num) { return num == 2; }, [] {}),
                      1);
             QCOMPARE(search(
-                         testArray.cbegin(), testArray.cend(), offset, Direction::Backward,
+                         testArray.cbegin(), testArray.cend(), offset, SearchDirection::Backward,
                          [](int num) { return num == 2; }, [] {}),
                      1);
         }
@@ -51,7 +51,7 @@ private slots:
         {
             bool endReached = false;
             QCOMPARE(search(
-                         testArray.cbegin(), testArray.cend(), 1, Direction::Forward, [](int i) { return i == 1; },
+                         testArray.cbegin(), testArray.cend(), 1, SearchDirection::Forward, [](int i) { return i == 1; },
                          [&endReached] { endReached = true; }),
                      0);
             QCOMPARE(endReached, true);
@@ -60,7 +60,7 @@ private slots:
         {
             bool endReached = false;
             QCOMPARE(search(
-                         testArray.cbegin(), testArray.cend(), 1, Direction::Backward, [](int i) { return i == 4; },
+                         testArray.cbegin(), testArray.cend(), 1, SearchDirection::Backward, [](int i) { return i == 4; },
                          [&endReached] { endReached = true; }),
                      3);
             QCOMPARE(endReached, true);
@@ -73,7 +73,7 @@ private slots:
 
         for (int i = 0; i < 2; i++) {
             QCOMPARE(search(
-                         testArray.cbegin(), testArray.cend(), 0, Direction::Forward, [](int) { return true; }, [] {}),
+                         testArray.cbegin(), testArray.cend(), 0, SearchDirection::Forward, [](int) { return true; }, [] {}),
                      -1);
         }
     }
@@ -83,7 +83,7 @@ private slots:
         const std::array<int, 1> testArray = {0};
 
         QCOMPARE(search(
-                     testArray.cbegin(), testArray.cend(), 1, Direction::Forward, [](int i) { return i == 0; }, [] {}),
+                     testArray.cbegin(), testArray.cend(), 1, SearchDirection::Forward, [](int i) { return i == 0; }, [] {}),
                  0);
     }
 
@@ -93,7 +93,7 @@ private slots:
 
         for (std::size_t i = 0; i < testArray.size(); i++) {
             QCOMPARE(search(
-                         testArray.cbegin() + 1, testArray.cbegin() + 3, i, Direction::Forward,
+                         testArray.cbegin() + 1, testArray.cbegin() + 3, i, SearchDirection::Forward,
                          [](int i) { return i == 0; }, [] {}),
                      -1);
         }