Skip to content

Commit

Permalink
[IR] Rollback changes in r302744 which caused buildbots failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneZelenko committed May 10, 2017
1 parent 6c7b29e commit 00274f6
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions llvm/include/llvm/IR/Value.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===- llvm/Value.h - Definition of the Value class -------------*- C++ -*-===//
//===-- llvm/Value.h - Definition of the Value class ------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
Expand Down Expand Up @@ -44,12 +44,12 @@ class LLVMContext;
class Module;
class ModuleSlotTracker;
class raw_ostream;
template<typename ValueTy> class StringMapEntry;
class StringRef;
class Twine;
class Type;

using ValueName = StringMapEntry<Value*>;
template<typename ValueTy> class StringMapEntry;
typedef StringMapEntry<Value*> ValueName;

//===----------------------------------------------------------------------===//
// Value Class
Expand Down Expand Up @@ -120,14 +120,12 @@ class Value {
template <typename UseT> // UseT == 'Use' or 'const Use'
class use_iterator_impl
: public std::iterator<std::forward_iterator_tag, UseT *> {
friend class Value;

UseT *U = nullptr;

UseT *U;
explicit use_iterator_impl(UseT *u) : U(u) {}
friend class Value;

public:
use_iterator_impl() = default;
use_iterator_impl() : U() {}

bool operator==(const use_iterator_impl &x) const { return U == x.U; }
bool operator!=(const use_iterator_impl &x) const { return !operator==(x); }
Expand Down Expand Up @@ -159,11 +157,9 @@ class Value {
template <typename UserTy> // UserTy == 'User' or 'const User'
class user_iterator_impl
: public std::iterator<std::forward_iterator_tag, UserTy *> {
friend class Value;

use_iterator_impl<Use> UI;

explicit user_iterator_impl(Use *U) : UI(U) {}
friend class Value;

public:
user_iterator_impl() = default;
Expand Down Expand Up @@ -313,8 +309,8 @@ class Value {
return UseList == nullptr;
}

using use_iterator = use_iterator_impl<Use>;
using const_use_iterator = use_iterator_impl<const Use>;
typedef use_iterator_impl<Use> use_iterator;
typedef use_iterator_impl<const Use> const_use_iterator;
use_iterator materialized_use_begin() { return use_iterator(UseList); }
const_use_iterator materialized_use_begin() const {
return const_use_iterator(UseList);
Expand Down Expand Up @@ -349,8 +345,8 @@ class Value {
return UseList == nullptr;
}

using user_iterator = user_iterator_impl<User>;
using const_user_iterator = user_iterator_impl<const User>;
typedef user_iterator_impl<User> user_iterator;
typedef user_iterator_impl<const User> const_user_iterator;
user_iterator materialized_user_begin() { return user_iterator(UseList); }
const_user_iterator materialized_user_begin() const {
return const_user_iterator(UseList);
Expand Down Expand Up @@ -564,6 +560,7 @@ class Value {
/// block.
const Value *DoPHITranslation(const BasicBlock *CurBB,
const BasicBlock *PredBB) const;

Value *DoPHITranslation(const BasicBlock *CurBB, const BasicBlock *PredBB) {
return const_cast<Value *>(
static_cast<const Value *>(this)->DoPHITranslation(CurBB, PredBB));
Expand Down Expand Up @@ -609,7 +606,7 @@ class Value {
Use *Merged;
Use **Next = &Merged;

while (true) {
for (;;) {
if (!L) {
*Next = R;
break;
Expand Down

0 comments on commit 00274f6

Please sign in to comment.