[llvm-commits] [llvm] r74724 - /llvm/trunk/include/llvm/Pass.h

Devang Patel devang.patel at gmail.com
Thu Jul 16 21:26:42 PDT 2009


On Thu, Jul 16, 2009 at 8:52 PM, Daniel Dunbar<daniel at zuster.org> wrote:
> Hi Owen,
>
> In hindsight I am a little worried about this commit.
>
>> -  virtual bool doInitialization(Module &) { return false; }
>> +  virtual bool doInitialization(Module &M) {
>> +    Context = &M.getContext();
>> +    return false;
>> +  }
>
> This is dangerous; in LLVM we do not frequently implement virtual
> interfaces which require that the version in the base class be called.
> At the minimum the comment should make clear that subclasses must call
> this method if they override this, but I think it would be better to
> add an extra layer of indirection so that we can guarantee the context
> is always initialized.
>

I agree.
-
Devang




More information about the llvm-commits mailing list