Line 0
Link Here
|
|
|
1 |
--- libclamav/c++/llvm/lib/Target/SubtargetFeature.cpp.orig |
2 |
+++ libclamav/c++/llvm/lib/Target/SubtargetFeature.cpp |
3 |
@@ -18,6 +18,7 @@ |
4 |
#include <algorithm> |
5 |
#include <cassert> |
6 |
#include <cctype> |
7 |
+#include <cstdlib> |
8 |
using namespace llvm; |
9 |
|
10 |
//===----------------------------------------------------------------------===// |
11 |
--- libclamav/c++/llvm/include/llvm/Support/CFG.h.orig |
12 |
+++ libclamav/c++/llvm/include/llvm/Support/CFG.h |
13 |
@@ -27,8 +27,9 @@ |
14 |
|
15 |
template <class Ptr, class USE_iterator> // Predecessor Iterator |
16 |
class PredIterator : public std::iterator<std::forward_iterator_tag, |
17 |
- Ptr, ptrdiff_t> { |
18 |
- typedef std::iterator<std::forward_iterator_tag, Ptr, ptrdiff_t> super; |
19 |
+ Ptr, ptrdiff_t, Ptr*, Ptr*> { |
20 |
+ typedef std::iterator<std::forward_iterator_tag, Ptr, ptrdiff_t, Ptr*, |
21 |
+ Ptr*> super; |
22 |
typedef PredIterator<Ptr, USE_iterator> Self; |
23 |
USE_iterator It; |
24 |
|
25 |
@@ -40,6 +41,7 @@ |
26 |
|
27 |
public: |
28 |
typedef typename super::pointer pointer; |
29 |
+ typedef typename super::reference reference; |
30 |
|
31 |
PredIterator() {} |
32 |
explicit inline PredIterator(Ptr *bb) : It(bb->use_begin()) { |
33 |
@@ -50,7 +52,7 @@ |
34 |
inline bool operator==(const Self& x) const { return It == x.It; } |
35 |
inline bool operator!=(const Self& x) const { return !operator==(x); } |
36 |
|
37 |
- inline pointer operator*() const { |
38 |
+ inline reference operator*() const { |
39 |
assert(!It.atEnd() && "pred_iterator out of range!"); |
40 |
return cast<TerminatorInst>(*It)->getParent(); |
41 |
} |
42 |
@@ -100,10 +102,11 @@ |
43 |
|
44 |
template <class Term_, class BB_> // Successor Iterator |
45 |
class SuccIterator : public std::iterator<std::bidirectional_iterator_tag, |
46 |
- BB_, ptrdiff_t> { |
47 |
+ BB_, ptrdiff_t, BB_*, BB_*> { |
48 |
const Term_ Term; |
49 |
unsigned idx; |
50 |
- typedef std::iterator<std::bidirectional_iterator_tag, BB_, ptrdiff_t> super; |
51 |
+ typedef std::iterator<std::bidirectional_iterator_tag, BB_, ptrdiff_t, BB_*, |
52 |
+ BB_*> super; |
53 |
typedef SuccIterator<Term_, BB_> Self; |
54 |
|
55 |
inline bool index_is_valid(int idx) { |
56 |
@@ -112,6 +115,7 @@ |
57 |
|
58 |
public: |
59 |
typedef typename super::pointer pointer; |
60 |
+ typedef typename super::reference reference; |
61 |
// TODO: This can be random access iterator, only operator[] missing. |
62 |
|
63 |
explicit inline SuccIterator(Term_ T) : Term(T), idx(0) {// begin iterator |
64 |
@@ -142,7 +146,7 @@ |
65 |
inline bool operator==(const Self& x) const { return idx == x.idx; } |
66 |
inline bool operator!=(const Self& x) const { return !operator==(x); } |
67 |
|
68 |
- inline pointer operator*() const { return Term->getSuccessor(idx); } |
69 |
+ inline reference operator*() const { return Term->getSuccessor(idx); } |
70 |
inline pointer operator->() const { return operator*(); } |
71 |
|
72 |
inline Self& operator++() { ++idx; return *this; } // Preincrement |