[llvm-commits] [llvm] r57587 - /llvm/trunk/include/llvm/Use.h
Chris Lattner
sabre at nondot.org
Wed Oct 15 09:56:14 PDT 2008
Author: lattner
Date: Wed Oct 15 11:56:14 2008
New Revision: 57587
URL: http://llvm.org/viewvc/llvm-project?rev=57587&view=rev
Log:
Fix PR2115 by doxygenating Use more, and make some more methods private.
Modified:
llvm/trunk/include/llvm/Use.h
Modified: llvm/trunk/include/llvm/Use.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Use.h?rev=57587&r1=57586&r2=57587&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Use.h (original)
+++ llvm/trunk/include/llvm/Use.h Wed Oct 15 11:56:14 2008
@@ -63,8 +63,8 @@
// Use Class
//===----------------------------------------------------------------------===//
-// Use is here to make keeping the "use" list of a Value up-to-date really easy.
-//
+/// Use is here to make keeping the "use" list of a Value up-to-date really
+/// easy.
class Use {
public:
/// swap - provide a fast substitute to std::swap<Use>
@@ -80,9 +80,8 @@
if (Val) removeFromList();
}
- /// Default ctor - This leaves the Use completely uninitialized. The only thing
- /// that is valid to do with this use is to call the "init" method.
-
+ /// Default ctor - This leaves the Use completely uninitialized. The only
+ /// thing that is valid to do with this use is to call the "init" method.
inline Use() {}
enum PrevPtrTag { zeroDigitTag = noTag
, oneDigitTag = tagOne
@@ -90,12 +89,16 @@
, fullStopTag = tagThree };
public:
+ /// Normally Use will just implicitly convert to a Value* that it holds.
operator Value*() const { return Val; }
+
+ /// If implicit conversion to Value* doesn't work, the get() method returns
+ /// the Value*.
Value *get() const { return Val; }
+
+ /// getUser - This returns the User that contains this Use. For an
+ /// instruction operand, for example, this will return the instruction.
User *getUser() const;
- const Use* getImpliedUser() const;
- static Use *initTags(Use *Start, Use *Stop, ptrdiff_t Done = 0);
- static void zap(Use *Start, const Use *Stop, bool del = false);
inline void set(Value *Val);
@@ -112,7 +115,16 @@
const Value *operator->() const { return Val; }
Use *getNext() const { return Next; }
+
+
+ /// zap - This is used to destroy Use operands when the number of operands of
+ /// a User changes.
+ static void zap(Use *Start, const Use *Stop, bool del = false);
+
private:
+ const Use* getImpliedUser() const;
+ static Use *initTags(Use *Start, Use *Stop, ptrdiff_t Done = 0);
+
Value *Val;
Use *Next, **Prev;
@@ -132,6 +144,7 @@
}
friend class Value;
+ friend class User;
};
// simplify_type - Allow clients to treat uses just like values when using
More information about the llvm-commits
mailing list