projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a note about a potential PIC optimization.
[oota-llvm.git]
/
include
/
llvm
/
Use.h
diff --git
a/include/llvm/Use.h
b/include/llvm/Use.h
index b4d4bda620e8e6de7c4e3bcabc0ad62121f8aa64..0a971d18ce3a31b1478a1bf41e09382a316b82b2 100644
(file)
--- a/
include/llvm/Use.h
+++ b/
include/llvm/Use.h
@@
-17,7
+17,7
@@
#define LLVM_USE_H
#include "llvm/Support/Casting.h"
#define LLVM_USE_H
#include "llvm/Support/Casting.h"
-#include "llvm/ADT/iterator"
+#include "llvm/ADT/iterator
.h
"
namespace llvm {
namespace llvm {
@@
-66,19
+66,22
@@
inline T *transferTag(const T *From, const T *To) {
// Use is here to make keeping the "use" list of a Value up-to-date really easy.
//
class Use {
// Use is here to make keeping the "use" list of a Value up-to-date really easy.
//
class Use {
-public:
+private:
+ /// init - specify Value and User
+ /// @deprecated in 2.4, will be removed soon
inline void init(Value *V, User *U);
inline void init(Value *V, User *U);
+public:
+ /// swap - provide a fast substitute to std::swap<Use>
+ /// that also works with less standard-compliant compilers
+ void swap(Use &RHS);
private:
private:
- ///
Allow std::swap some intimacy
-
template <typename U> friend void std::swap(U&, U&
);
+ ///
Copy ctor - do not implement
+
Use(const Use &U
);
- /// Copy ctor - Only for std::swap
- Use(const Use &U) { init(U.get(), 0); }
-
- /// Destructor - Only for zap() and std::swap
+ /// Destructor - Only for zap()
inline ~Use() {
inline ~Use() {
- if (
get()
) removeFromList();
+ if (
Val
) removeFromList();
}
/// Default ctor - This leaves the Use completely uninitialized. The only thing
}
/// Default ctor - This leaves the Use completely uninitialized. The only thing
@@
-91,8
+94,6
@@
private:
, fullStopTag = tagThree };
public:
, fullStopTag = tagThree };
public:
-
-
operator Value*() const { return Val; }
Value *get() const { return Val; }
User *getUser() const;
operator Value*() const { return Val; }
Value *get() const { return Val; }
User *getUser() const;
@@
-107,7
+108,7
@@
public:
return RHS;
}
const Use &operator=(const Use &RHS) {
return RHS;
}
const Use &operator=(const Use &RHS) {
- set(RHS.
get()
);
+ set(RHS.
Val
);
return *this;
}
return *this;
}