Page MenuHomePhabricator

NFC: Reorganize the demangler a bit
ClosedPublic

Authored by erik.pilkington on Oct 22 2018, 4:44 PM.

Details

Summary

With this patch, the copies of the files ItaniumDemangle.h, StringView.h, and Utility.h are kept byte-for-byte in sync between libcxxabi and llvm. All differences (namespaces, fallthrough, and unreachable macros) are defined in each copies' DemanglerConfig.h. This patch also adds a script to copy changes from libcxxabi (cp-to-llvm.sh), and a README.txt explaining the situation.

Thanks for taking a look!

Diff Detail

Repository
rL LLVM

Event Timeline

This is awesome.

  1. Should we document in the README.txt that we want to split "demangle" out to a separate top-level directory some time after the monorepo move?
  2. I suggest adding a bot that runs the script and confirms that git status is clean.
  1. Should we document in the README.txt that we want to split "demangle" out to a separate top-level directory some time after the monorepo move?

Sure, new patch adds this.

  1. I suggest adding a bot that runs the script and confirms that git status is clean.

That's a good idea. I don't know how to go about doing that, but it seems like it should be pretty straightforward.

andrew.w.kaylor added inline comments.
llvm/include/llvm/Demangle/DemangleConfig.h
75 ↗(On Diff #170738)

Is DEMANGLE_ENABLE_DUMP ever going to be defined? LLVM_ENABLE_DUMP gets defined in llvm-config.h in response to a CMake variable. I don't see anything analogous here.

I like this change a lot. I was hoping something like this could be done, when I saw that we were copying patches around.

(Not clicking accept as I don't feel like an owner here.)

libcxxabi/src/demangle/README.txt
51 ↗(On Diff #170738)

Use an impersonal form here? "It is also highly recommended...", or at least change "I" to "we".

erik.pilkington marked 2 inline comments as done.

Use an impersonal tone in the README, remove DEMANGLE_ENABLE_DUMP.

libcxxabi/src/demangle/README.txt
51 ↗(On Diff #170738)

Sure, fixed in the update.

llvm/include/llvm/Demangle/DemangleConfig.h
75 ↗(On Diff #170738)

Ah, no it's not, sorry! Just went through this file too quickly I guess.

erik.pilkington accepted this revision.Jan 17 2019, 12:40 PM

I think I'll just land this, I have some dependent work that I want to do.

This revision is now accepted and ready to land.Jan 17 2019, 12:40 PM
This revision was automatically updated to reflect the committed changes.