From 34ac5801645f44829807b221fb196dac1946b359 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 29 Jan 2016 12:47:05 +0000 Subject: [PATCH] [IR] Move definitions of users of Use::set to Value.h Still ugly, but at least Use.h is self-contained again. llvm-svn: 259191 --- llvm/include/llvm/IR/Use.h | 10 ++-------- llvm/include/llvm/IR/Value.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/llvm/include/llvm/IR/Use.h b/llvm/include/llvm/IR/Use.h index a738677..dc65d2c 100644 --- a/llvm/include/llvm/IR/Use.h +++ b/llvm/include/llvm/IR/Use.h @@ -101,14 +101,8 @@ public: inline void set(Value *Val); - Value *operator=(Value *RHS) { - set(RHS); - return RHS; - } - const Use &operator=(const Use &RHS) { - set(RHS.Val); - return *this; - } + inline Value *operator=(Value *RHS); + inline const Use &operator=(const Use &RHS); Value *operator->() { return Val; } const Value *operator->() const { return Val; } diff --git a/llvm/include/llvm/IR/Value.h b/llvm/include/llvm/IR/Value.h index 1e08a4a..348ad97 100644 --- a/llvm/include/llvm/IR/Value.h +++ b/llvm/include/llvm/IR/Value.h @@ -602,6 +602,16 @@ void Use::set(Value *V) { if (V) V->addUse(*this); } +Value *Use::operator=(Value *RHS) { + set(RHS); + return RHS; +} + +const Use &Use::operator=(const Use &RHS) { + set(RHS.Val); + return *this; +} + template void Value::sortUseList(Compare Cmp) { if (!UseList || !UseList->Next) // No need to sort 0 or 1 uses. -- 2.7.4