[llvm-dev] SmallString + raw_svector_ostream combination should be more efficient

Rafael EspĂ­ndola via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 13 06:53:23 PDT 2015

On 13 August 2015 at 04:17, Yaron Keren <yaron.keren at gmail.com> wrote:
> r244870 (with the change you requested), thanks!
> I initially placed the virtual function in header since they were
> one-liners.
> The coding standards say that an anchor() function should be supplied, which
> was indeed missing.  Other than required anchor function, why should the
> virtual functions go in the .cpp?

Just because there is no advantage for most virtual methods to be in the .h.

> Should I move the empty raw_svector_ostream destructor to the .cpp file too
> as well?

Maybe. Destructors are the one exception since base class destructors
call them non-virtually. If the class is final we can move them.


More information about the llvm-dev mailing list