PTAL
http://codereview.appspot.com/164084/diff/6/8
File include/llvm/Type.h (right):
http://codereview.appspot.com/164084/diff/6/8#newcode127
include/llvm/Type.h:127: virtual void destroy() const; // const is a
lie, this does "delete this"!
On 2009/12/04 02:55:01, Jeffrey Yasskin wrote:
> Note that virtual destroy() can still be private as long as subclasses
are only
> intended to override it and not call it.
Done.
http://codereview.appspot.com/164084/diff/6/8#newcode441
include/llvm/Type.h:441: protected:
On 2009/12/04 02:55:01, Jeffrey Yasskin wrote:
> Same here. These don't need to be protected unless subclasses need to
call them.
Done.
http://codereview.appspot.com/164084/diff/6/11
File lib/VMCore/LLVMContextImpl.h (right):
http://codereview.appspot.com/164084/diff/6/11#newcode214
lib/VMCore/LLVMContextImpl.h:214: static_cast<Type
*>(*I)->AbstractTypeUsers.clear();
On 2009/12/04 02:55:01, Jeffrey Yasskin wrote:
> Didn't it work to use "I->AbstractTypeUsers.clear()"? Subclasses
automatically
> have their base classes' fields.
Done.
http://codereview.appspot.com/164084/diff/6/10
File lib/VMCore/Type.cpp (right):
http://codereview.appspot.com/164084/diff/6/10#newcode1194
lib/VMCore/Type.cpp:1194: // concrete - this could potentially change us
from an abstract type to a
On 2009/12/04 02:55:01, Jeffrey Yasskin wrote:
> Since this is an opaque type, it couldn't change us from abstract to
concrete.
Done.
http://codereview.appspot.com/164084/diff/6/10#newcode1201
lib/VMCore/Type.cpp:1201: DerivedType::refineAbstractType(OldType,
NewType);
On 2009/12/04 02:55:01, Jeffrey Yasskin wrote:
> You're sure this is called? DerivedType doesn't define
refineAbstractType, and
> Type::refineAbstractType calls llvm_unreachable().
> Same for typeBecameConcrete.
Done.
http://codereview.appspot.com/164084/diff/6/10#newcode1210
lib/VMCore/Type.cpp:1210: void OpaqueType::destroy() const {
On 2009/12/04 02:55:01, Jeffrey Yasskin wrote:
> Can you put this inside Type::destroy()? As un-C++ish as that is, it
seems like
> that's the way LLVM has chosen to do this.
Done.
http://codereview.appspot.com/164084