Page MenuHomeFreeBSD

Add clang-format under WITH_CLANG_EXTRAS.
ClosedPublic

Authored by bdrewery on Jun 16 2016, 12:52 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 8, 5:25 PM
Unknown Object (File)
Fri, Mar 8, 2:46 PM
Unknown Object (File)
Fri, Mar 8, 11:44 AM
Unknown Object (File)
Thu, Mar 7, 8:27 AM
Unknown Object (File)
Feb 17 2024, 6:34 PM
Unknown Object (File)
Feb 14 2024, 4:30 PM
Unknown Object (File)
Feb 14 2024, 4:30 PM
Unknown Object (File)
Feb 14 2024, 4:30 PM
Subscribers

Details

Summary

Several of the required llvm files were either missing or seemingly
out-of-sync from the 3.8.0 release at revision r262564. They've been
imported from that revision.

Sponsored by: EMC / Isilon Storage Division

Test Plan

I ran clang-format -h and clang-format --version. Nothing beyond that yet.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bdrewery retitled this revision from to Add clang-format under WITH_CLANG_EXTRAS..
bdrewery updated this object.
bdrewery edited the test plan for this revision. (Show Details)

I assume there's actually a vendor branch for these files that needs to be updated first and then imported back from. The import to the vendor/contrib trees seems a bit chaotic since it is tending to miss updates. I think it would be simpler to just sync the entire llvm checkout in there?

I assume there's actually a vendor branch for these files that needs to be updated first and then imported back from. The import to the vendor/contrib trees seems a bit chaotic since it is tending to miss updates. I think it would be simpler to just sync the entire llvm checkout in there?

I'm not sure what you mean, can you explain this further? I always import to ^/base/vendor/llvm and ^/base/vendor/clang, then merge from there to ^/base/head/contrib/llvm, like it was done for ages. The versions in the vendor area correspond exactly with whatever is in ^/base/head/contrib/llvm, minus some build cruft like CMake files and things we don't need in base.

And some small patches are imported on top of the base versions, for example for specific crash reports from users or port maintainers. But that's really it.

I don't really see where all the differences you mention come from,

contrib/llvm/tools/clang/include/clang/Format/Format.h
40 ↗(On Diff #17615)

It looks like you imported from https://llvm.org/svn/llvm-project/cfe/trunk at r262564, not from https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_380/final. This explains the gratuitous differences you have been seeing.

contrib/llvm/tools/clang/lib/Tooling/Core/CMakeLists.txt
1 ↗(On Diff #17615)

We don't want to import CMake files.

contrib/llvm/tools/clang/lib/Tooling/Core/QualTypeNames.cpp
1 ↗(On Diff #17615)

Instead of patching, these files should be copied from the vendor area. But this cannot be expressed in Phabricator, I guess.

contrib/llvm/tools/clang/tools/clang-format/clang-format-bbedit.applescript
1 ↗(On Diff #17615)

No sense in importing this file, since we're not MacOS?

contrib/llvm/tools/clang/tools/clang-format/clang-format-diff.py
1 ↗(On Diff #17615)

Not sure if it makes sense importing this, since Python is not in the base system?

contrib/llvm/tools/clang/tools/clang-format/clang-format.el
1 ↗(On Diff #17615)

Doesn't really make sense to import this.

contrib/llvm/tools/clang/tools/clang-format/fuzzer/CMakeLists.txt
1 ↗(On Diff #17615)

The fuzzer libs are only for upstream development purposes, we don't need them.

usr.bin/clang/Makefile
9 ↗(On Diff #17615)

Incorrect sort order

bdrewery edited edge metadata.
  • Import files from 380 release tag
  • Cleanup whitespace
  • Fix sort order

After fixing where I imported from, the only file missing was ClangFormat.cpp. I would copy that from the vendor branch before committing this.

dim edited edge metadata.

For the rest, LGTM. It builds for me, and the resulting clang-format executable is able to reformat a bunch of .c files in the source tree.

targets/pseudo/clang/Makefile.depend
23 ↗(On Diff #17647)

Sort, please, or regenerate :)

This revision is now accepted and ready to land.Jun 17 2016, 11:00 AM
targets/pseudo/clang/Makefile.depend
23 ↗(On Diff #17647)

Hah, I forgot the alphabet that day. The files in targets/ are not generated.

This revision was automatically updated to reflect the committed changes.