summaryrefslogtreecommitdiffstats
path: root/include/llvm/User.h
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-02-20 12:57:14 +0000
committerdim <dim@FreeBSD.org>2011-02-20 12:57:14 +0000
commitcbb70ce070d220642b038ea101d9c0f9fbf860d6 (patch)
treed2b61ce94e654cb01a254d2195259db5f9cc3f3c /include/llvm/User.h
parent4ace901e87dac5bbbac78ed325e75462e48e386e (diff)
downloadFreeBSD-src-cbb70ce070d220642b038ea101d9c0f9fbf860d6.zip
FreeBSD-src-cbb70ce070d220642b038ea101d9c0f9fbf860d6.tar.gz
Vendor import of llvm trunk r126079:
http://llvm.org/svn/llvm-project/llvm/trunk@126079
Diffstat (limited to 'include/llvm/User.h')
-rw-r--r--include/llvm/User.h41
1 files changed, 6 insertions, 35 deletions
diff --git a/include/llvm/User.h b/include/llvm/User.h
index f827795..1363495 100644
--- a/include/llvm/User.h
+++ b/include/llvm/User.h
@@ -29,20 +29,6 @@ namespace llvm {
template <class>
struct OperandTraits;
-class User;
-
-/// OperandTraits<User> - specialization to User
-template <>
-struct OperandTraits<User> {
- static inline Use *op_begin(User*);
- static inline Use *op_end(User*);
- static inline unsigned operands(const User*);
- template <class U>
- struct Layout {
- typedef U overlay;
- };
-};
-
class User : public Value {
User(const User &); // Do not implement
void *operator new(size_t); // Do not implement
@@ -61,21 +47,18 @@ protected:
unsigned NumOperands;
void *operator new(size_t s, unsigned Us);
- void *operator new(size_t s, unsigned Us, bool Prefix);
User(const Type *ty, unsigned vty, Use *OpList, unsigned NumOps)
: Value(ty, vty), OperandList(OpList), NumOperands(NumOps) {}
Use *allocHungoffUses(unsigned) const;
- void dropHungoffUses(Use *U) {
- if (OperandList == U) {
- OperandList = 0;
- NumOperands = 0;
- }
- Use::zap(U, U->getImpliedUser(), true);
+ void dropHungoffUses() {
+ Use::zap(OperandList, OperandList + NumOperands, true);
+ OperandList = 0;
+ // Reset NumOperands so User::operator delete() does the right thing.
+ NumOperands = 0;
}
public:
~User() {
- if ((intptr_t(OperandList) & 1) == 0)
- Use::zap(OperandList, OperandList + NumOperands);
+ Use::zap(OperandList, OperandList + NumOperands);
}
/// operator delete - free memory allocated for User and Use objects
void operator delete(void *Usr);
@@ -158,18 +141,6 @@ public:
}
};
-inline Use *OperandTraits<User>::op_begin(User *U) {
- return U->op_begin();
-}
-
-inline Use *OperandTraits<User>::op_end(User *U) {
- return U->op_end();
-}
-
-inline unsigned OperandTraits<User>::operands(const User *U) {
- return U->getNumOperands();
-}
-
template<> struct simplify_type<User::op_iterator> {
typedef Value* SimpleType;
OpenPOWER on IntegriCloud