This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] add support for cppm files
ClosedPublic

Authored by MyDeveloperDay on Dec 13 2021, 3:55 AM.

Details

Summary

C++20 Modules current style is to assign a new file suffix .cppm.

https://github.com/llvm/llvm-project/issues/52658

Ensure git-clang-format can handle that as a default extension

Diff Detail

Event Timeline

MyDeveloperDay requested review of this revision.Dec 13 2021, 3:55 AM
MyDeveloperDay created this revision.
ChuanqiXu accepted this revision.Dec 13 2021, 3:58 AM

Thanks for the quick respond!

A note in the summary:

- C++20 Modules current style is to assign a new file suffix .cppm instead of .cpp and .h
+ C++20 Modules current style is to assign a new file suffix .cppm.

Since *.cpp and *.h is not deprecated.

This revision is now accepted and ready to land.Dec 13 2021, 3:58 AM
MyDeveloperDay edited the summary of this revision. (Show Details)Dec 13 2021, 4:36 AM
MyDeveloperDay added inline comments.
clang/tools/clang-format/git-clang-format
81–82

I missed a , here I think

Missed a comma

curdeius accepted this revision.Dec 13 2021, 4:57 AM

LGTM.

clang/tools/clang-format/clang-format-diff.py
50–51

Nit: I would put it close to other C++ extensions.

MyDeveloperDay edited the summary of this revision. (Show Details)Dec 13 2021, 5:05 AM

Move cppm to be with other cxx extensions

Add other support module file types for completeness

This revision was landed with ongoing or failed builds.Dec 14 2021, 6:56 AM
This revision was automatically updated to reflect the committed changes.