This is an archive of the discontinued LLVM Phabricator instance.

Move some utility classes to header files
ClosedPublic

Authored by zturner on Jul 16 2018, 1:48 PM.

Details

Summary

There were a bunch of useful utility classes and compiler test macros stashed away inside of ItaniumDemangle.cpp. A long time ago, in D34667, there was an attempt to add a Microsoft demangler. It got stalled but I'm intending to pick this up and finish it off. It had done a lot of the same stuff as was already being done in the helper classes in ItaniumDemangle.cpp such as testing for various compiler features, copying StringView from LLVM, etc. So all of the stuff that would be useful to a different demangler, I'm moving out into header files which can be included by the Microsoft demangler. In a followup patch, I'll rebase Rui's work on top of the new changes, finish it up, and then upload a new version of the MS demangler.

Diff Detail

Repository
rL LLVM

Event Timeline

zturner created this revision.Jul 16 2018, 1:48 PM
dblaikie accepted this revision.Jul 16 2018, 2:16 PM

Might be worth some unit tests now that these are reusable components.

This revision is now accepted and ready to land.Jul 16 2018, 2:16 PM

Might be worth some unit tests now that these are reusable components.

They're not suuuper re-usable. They're still considered private implementation details (i.e. they're in the source directory, not the include directory). a unittest wouldn't be able to #include the header file. If you think it's worth doing so, I can make them public, but I don't think we want anyone outside of LLVMDemangle including these, so it's iffy. I'll submit this for now, if you think I should move the files to the include directory and add unit tests, we can do that in a followup.

Ah, yeah, fair point that they're still implementation details/can't be
included from tests - fine fine (:

This revision was automatically updated to reflect the committed changes.