Another option is to simply move it into support and say that going forward merges to libcxxabi might get more difficult.  Perhaps this isn’t so bad though.  Isn’t the itanium demangler mostly complete?  If the potential for future changes to it is low, maybe this is an acceptable tradeoff.  Then we could just move it to support, use it and evolve it any way we want with no restrictions, and when new functionality gets added to the itanium mangler that needs to be port to libcxxabi, it’s a little more effort than a simple copy paste because you have to think about it some.<br><br>Thoughts?<br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 16, 2018 at 4:16 PM Chandler Carruth via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">chandlerc added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D50828#1203431" rel="noreferrer" target="_blank">https://reviews.llvm.org/D50828#1203431</a>, @zturner wrote:<br>
<br>
> If we're not going to allow code from Support to be used in the demangler, then I don't think we should move it to support, because it will be too easy for people to mess up and use code they shouldn't.<br>
<br>
<br>
We could easily add a unittest (or something similar) that builds and uses the file in the standalone mode without the Support library to ensure that when it gets copied into libc++abi it still works. This should be possible to implement both with a single file in the Support library and for a separate library. And regardless of which design, seem like a more reliable way of preserving the invariant that we want here?<br>
<br>
> Perhaps what we need are some hooks into the demangler (e.g. an interface defined in LLVMDemangle that exposes some virtual methods with default implementations), and then LLVM / Clang could override them to inject custom functionality.<br>
<br>
No strong feelings here, happy to let you and Richard discuss this aspect of the design.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D50828" rel="noreferrer" target="_blank">https://reviews.llvm.org/D50828</a><br>
<br>
<br>
<br>
</blockquote></div>