1 //===-- Use.cpp - Implement the Use class ---------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "llvm/IR/Use.h"
10 #include "llvm/IR/User.h"
14 void Use::swap(Use
&RHS
) {
18 std::swap(Val
, RHS
.Val
);
19 std::swap(Next
, RHS
.Next
);
20 std::swap(Prev
, RHS
.Prev
);
28 RHS
.Next
->Prev
= &RHS
.Next
;
31 unsigned Use::getOperandNo() const {
32 return this - getUser()->op_begin();
35 void Use::zap(Use
*Start
, const Use
*Stop
, bool del
) {
39 ::operator delete(Start
);