Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 3358093

Browse files
committed
[IR] Rollback changes in r302744 which caused buildbots failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302745 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent dc6cb60 commit 3358093

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

include/llvm/IR/Value.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- llvm/Value.h - Definition of the Value class -------------*- C++ -*-===//
1+
//===-- llvm/Value.h - Definition of the Value class ------------*- C++ -*-===//
22
//
33
// The LLVM Compiler Infrastructure
44
//
@@ -44,12 +44,12 @@ class LLVMContext;
4444
class Module;
4545
class ModuleSlotTracker;
4646
class raw_ostream;
47-
template<typename ValueTy> class StringMapEntry;
4847
class StringRef;
4948
class Twine;
5049
class Type;
5150

52-
using ValueName = StringMapEntry<Value*>;
51+
template<typename ValueTy> class StringMapEntry;
52+
typedef StringMapEntry<Value*> ValueName;
5353

5454
//===----------------------------------------------------------------------===//
5555
// Value Class
@@ -120,14 +120,12 @@ class Value {
120120
template <typename UseT> // UseT == 'Use' or 'const Use'
121121
class use_iterator_impl
122122
: public std::iterator<std::forward_iterator_tag, UseT *> {
123-
friend class Value;
124-
125-
UseT *U = nullptr;
126-
123+
UseT *U;
127124
explicit use_iterator_impl(UseT *u) : U(u) {}
125+
friend class Value;
128126

129127
public:
130-
use_iterator_impl() = default;
128+
use_iterator_impl() : U() {}
131129

132130
bool operator==(const use_iterator_impl &x) const { return U == x.U; }
133131
bool operator!=(const use_iterator_impl &x) const { return !operator==(x); }
@@ -159,11 +157,9 @@ class Value {
159157
template <typename UserTy> // UserTy == 'User' or 'const User'
160158
class user_iterator_impl
161159
: public std::iterator<std::forward_iterator_tag, UserTy *> {
162-
friend class Value;
163-
164160
use_iterator_impl<Use> UI;
165-
166161
explicit user_iterator_impl(Use *U) : UI(U) {}
162+
friend class Value;
167163

168164
public:
169165
user_iterator_impl() = default;
@@ -313,8 +309,8 @@ class Value {
313309
return UseList == nullptr;
314310
}
315311

316-
using use_iterator = use_iterator_impl<Use>;
317-
using const_use_iterator = use_iterator_impl<const Use>;
312+
typedef use_iterator_impl<Use> use_iterator;
313+
typedef use_iterator_impl<const Use> const_use_iterator;
318314
use_iterator materialized_use_begin() { return use_iterator(UseList); }
319315
const_use_iterator materialized_use_begin() const {
320316
return const_use_iterator(UseList);
@@ -349,8 +345,8 @@ class Value {
349345
return UseList == nullptr;
350346
}
351347

352-
using user_iterator = user_iterator_impl<User>;
353-
using const_user_iterator = user_iterator_impl<const User>;
348+
typedef user_iterator_impl<User> user_iterator;
349+
typedef user_iterator_impl<const User> const_user_iterator;
354350
user_iterator materialized_user_begin() { return user_iterator(UseList); }
355351
const_user_iterator materialized_user_begin() const {
356352
return const_user_iterator(UseList);
@@ -564,6 +560,7 @@ class Value {
564560
/// block.
565561
const Value *DoPHITranslation(const BasicBlock *CurBB,
566562
const BasicBlock *PredBB) const;
563+
567564
Value *DoPHITranslation(const BasicBlock *CurBB, const BasicBlock *PredBB) {
568565
return const_cast<Value *>(
569566
static_cast<const Value *>(this)->DoPHITranslation(CurBB, PredBB));
@@ -609,7 +606,7 @@ class Value {
609606
Use *Merged;
610607
Use **Next = &Merged;
611608

612-
while (true) {
609+
for (;;) {
613610
if (!L) {
614611
*Next = R;
615612
break;

0 commit comments

Comments
 (0)