This is an archive of the discontinued LLVM Phabricator instance.

[demangler] write-protect non-canonical source
ClosedPublic

Authored by urnathan on Jan 23 2022, 2:17 PM.

Details

Summary

To try and void undesired changes to the non-canonical demangler sources, change the cp-to-llvm script to (a) write-protect the target files and (b) prepend 'do not edit' comments that are significant to emacs[*], and hopefully humans.

  • bite me :)

Diff Detail

Event Timeline

urnathan requested review of this revision.Jan 23 2022, 2:17 PM
urnathan created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2022, 2:17 PM
urnathan updated this revision to Diff 402374.Jan 23 2022, 2:36 PM

use a single cat with - to concatenate

ChuanqiXu added inline comments.Jan 23 2022, 6:16 PM
libcxxabi/src/demangle/cp-to-llvm.sh
28–33

Is the indentation proper?

May I suggest an alternate approach: it could be cmake's job to do the copying. That way the LLVM headers would never live in git, and there would be only one source for each of them (?)

May I suggest an alternate approach: it could be cmake's job to do the copying. That way the LLVM headers would never live in git, and there would be only one source for each of them (?)

But that would mean a cross-project rule, which is probably not a good thing. Forget about it.

urnathan marked an inline comment as done.Jan 24 2022, 3:54 AM
urnathan added inline comments.
libcxxabi/src/demangle/cp-to-llvm.sh
28–33

yes, that's a HERE document, so needs the indentation you want the output to have. Upsets the script's indentation as you noticed

urnathan marked an inline comment as done.Jan 24 2022, 3:55 AM

May I suggest an alternate approach: it could be cmake's job to do the copying. That way the LLVM headers would never live in git, and there would be only one source for each of them (?)

But that would mean a cross-project rule, which is probably not a good thing. Forget about it.

Either that or remove the duplication entirely. Either requires more effort than I have the time for :)

ChuanqiXu accepted this revision.Jan 24 2022, 4:04 AM

This should be good.

This revision is now accepted and ready to land.Jan 24 2022, 4:04 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJan 24 2022, 5:29 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript