This is an archive of the discontinued LLVM Phabricator instance.

Introduce LIT_SITE_CFG_IN_HEADER
ClosedPublic

Authored by AlexDenisov on Apr 15 2016, 4:24 AM.

Details

Summary

At the moment almost every lit.site.cfg.in contains two lines comment:

## Autogenerated by LLVM/Clang configuration.
# Do not edit!

It took me several days and a few attempts to realise that these are not for this file itself, but for files that are generated from this template.

The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from configure_lit_site_cfg with the note and some useful information.

Assigning to Chandler Carruth as CODE_OWNERS.txt states.

If everybody happy with the patch, then I will apply the change to other projects as well (clang/ compiler-rt, lld, and so on).

P.S. Credits for idea go to Mehdi Amini:

[08:05:19] AlexDenisov:	does anybody know how lit.site.cfg.in's are generated?
[08:06:27] joker-eph:	AlexDenisov: the .in file is in the repo the .cfg is generated, is that what you're asking about ?
[08:06:59] AlexDenisov:	@joker-eph I see there "## Autogenerated by LLVM/Clang configuration."
[08:07:21] AlexDenisov:	which probably a part of the template
[08:07:53] joker-eph:	AlexDenisov: I don't know, I modified this file by hand I think
[08:08:06] AlexDenisov:	yepp, that's a bit confusing
[08:08:29] joker-eph:	AlexDenisov: I think it is so that the comment is in the .cfg file in the end
[08:08:33] AlexDenisov:	I think this note intended to be in the output file
[08:08:34] joker-eph:	not nice though.
[08:08:41] joker-eph:	agree
[08:09:51] AlexDenisov:	ok, at least it's a bit clearer now
[08:10:06] AlexDenisov:	need to be documented or noted somehow somewhere
[08:10:47] joker-eph:	I'd rather have the configure_lit_site_cfg() function prepending the comment
[08:11:05] joker-eph:	 But I did my share of cleanup this week, I have real work to do :)
[08:20:41] AlexDenisov:	joker-eph I will try to send patch soon, thank you very much for help :)

Diff Detail

Event Timeline

AlexDenisov retitled this revision from to Introduce LIT_SITE_CFG_IN_HEADER.
AlexDenisov updated this object.
AlexDenisov added a reviewer: chandlerc.
AlexDenisov added subscribers: llvm-commits, mehdi_amini.
mehdi_amini accepted this revision.Apr 15 2016, 8:57 AM
mehdi_amini added a reviewer: mehdi_amini.

Nice!
Can you do the same thing in clang/test?

This revision is now accepted and ready to land.Apr 15 2016, 8:57 AM
In D19155#402556, @joker.eph wrote:

Nice!
Can you do the same thing in clang/test?

Yes, as well as for compiler-rt, lld, clang-tools-extra and probably dragonegg and lldb.

AlexDenisov closed this revision.Apr 16 2016, 12:31 AM