This is an archive of the discontinued LLVM Phabricator instance.

Merge demangler changes over to libcxxabi
ClosedPublic

Authored by zturner on Jul 19 2018, 4:31 PM.

Details

Summary

I actually tried to compile this on Windows, but was unsuccessful. I guess the only way to test it would be with a linux environment. Sorry for the trouble, but hopefully this at least saves you some of the gruntwork.

Diff Detail

Repository
rL LLVM

Event Timeline

zturner created this revision.Jul 19 2018, 4:31 PM
erik.pilkington accepted this revision.Jul 19 2018, 4:48 PM

$ diff llvm-project/libcxxabi/src/demangle/StringView.h llvm-project/llvm/lib/Demangle/StringView.h gives a bunch of junk, I used to be able to just use a script that basically called patch to copy the bulk of the changes over. Did you call clang-format or something?

I think this is fine though, so after deformatting and adding that include feel free to commit!

libcxxabi/src/demangle/Compiler.h
23 ↗(On Diff #156384)

This depends on __cxxabi_config.h to make sure that __has_attribute is defined on compilers that don't support it. Please add the include.

This revision is now accepted and ready to land.Jul 19 2018, 4:48 PM
thakis added a subscriber: thakis.Jul 20 2018, 5:20 AM
thakis added inline comments.
libcxxabi/src/demangle/Compiler.h
23 ↗(On Diff #156384)

Is there any harm to just #ifndef #def here instead of pulling in that whole header?

Or just doing nothing. It’s a private header and is only included in 1 TU.
In that fine, cxxabi-config is already included first

Or just doing nothing. It’s a private header and is only included in 1 TU.
In that fine, cxxabi-config is already included first

I guess we're starting to split hairs here, but I think its better to make headers self-contained rather then implicitly relying on #include ordering, even for a one-off header like this.

libcxxabi/src/demangle/Compiler.h
23 ↗(On Diff #156384)

No, that would be fine too.

Yea, it's fine either way. I was just looking at it from the perspective
of minimizing differences from the master copy in LLVM. Definitely having
headers be self-contained is worthy, but it comes at the (very small)
expense of adding an extra difference from the master copy. That said, I
don't feel strongly, so if you want me to add it, that's fine.

This revision was automatically updated to reflect the committed changes.