LLVM: lib/SandboxIR/Use.cpp Source File (original) (raw)

Go to the documentation of this file.

1

2

3

4

5

6

7

8

12

15Value *Use::get() const { return Ctx->getValue(LLVMUse->get()); }

16

18 Ctx->getTracker().emplaceIfTracking<UseSet>(*this);

19 LLVMUse->set(V->Val);

20}

21

23

25 Ctx->getTracker().emplaceIfTracking<UseSwap>(*this, OtherUse);

26 LLVMUse->swap(*OtherUse.LLVMUse);

27}

28

29#ifndef NDEBUG

31 Value *Def = nullptr;

32 if (LLVMUse == nullptr)

33 OS << " LLVM Use! ";

34 else

35 Def = Ctx->getValue(LLVMUse->get());

36 OS << "Def: ";

37 if (Def == nullptr)

38 OS << "NULL";

40 OS << *Def;

41 OS << "\n";

42

43 OS << "User: ";

44 if (Usr == nullptr)

45 OS << "NULL";

46 else

47 OS << *Usr;

48 OS << "\n";

49

50 OS << "OperandNo: ";

51 if (Usr == nullptr)

52 OS << "N/A";

53 else

55 OS << "\n";

56}

57

59#endif

60

61}

This class implements an extremely fast bulk output stream that can only output to a stream.

Tracks the change of the source Value of a sandboxir::Use.

Tracks swapping a Use with another Use.

LLVM_ABI void set(Value *V)

Definition Use.cpp:17

LLVM_ABI unsigned getOperandNo() const

Definition Use.cpp:22

LLVM_ABI_FOR_TEST void dumpOS(raw_ostream &OS) const

Definition Use.cpp:30

LLVM_ABI void swap(Use &OtherUse)

Definition Use.cpp:24

void dump() const

Definition Use.cpp:58

LLVM_ABI Value * get() const

Definition Use.cpp:15

LLVM_ABI raw_ostream & dbgs()

dbgs() - This returns a reference to a raw_ostream for debugging messages.