[llvm-commits] [llvm] r49454 - /llvm/branches/ggreif/use-diet/include/llvm/User.h
Gabor Greif
ggreif at gmail.com
Wed Apr 9 14:56:35 PDT 2008
Author: ggreif
Date: Wed Apr 9 16:56:35 2008
New Revision: 49454
URL: http://llvm.org/viewvc/llvm-project?rev=49454&view=rev
Log:
implement allocHangoffUses
Modified:
llvm/branches/ggreif/use-diet/include/llvm/User.h
Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/User.h?rev=49454&r1=49453&r2=49454&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/User.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/User.h Wed Apr 9 16:56:35 2008
@@ -251,7 +251,7 @@
template <unsigned Idx> const Use &Op() const {
return OperandTraits<User>::op_begin(const_cast<User*>(this))[Idx];
}
- Use *allocHangoffUses(unsigned) const;
+ inline Use *allocHangoffUses(unsigned) const;
Value *getOperand(unsigned i) const {
assert(i < NumOperands && "getOperand() out of range!");
@@ -320,6 +320,12 @@
};
*/
+Use *User::allocHangoffUses(unsigned N) const {
+ Use *Begin = static_cast<Use*>(::operator new(sizeof(Use) * N));
+ Use::initTags(Begin, Begin + N);
+ return Begin;
+}
+
template<> struct simplify_type<User::op_iterator> {
typedef Value* SimpleType;
More information about the llvm-commits
mailing list