This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Update header files to inclue language tags like -*- C++ -*-
AbandonedPublic

Authored by abrachet on Jul 11 2019, 7:56 AM.

Details

Summary

The style guide suggests to include tags like -*- C++ -*- in header files where the programming language is ambiguous to Emacs.

Directories excluded: libclc, libcxx, libunwind, openmp and parallel-libs.

This patch was generated by a program but then looked over by hand. Files which still exist but did not have space for these tags and could not be resolved by hand are these:

compiler-rt/lib/builtins/fp_lib.h
compiler-rt/lib/builtins/unwind-ehabi-helpers.h
clang-tools-extra/clang-move/HelperDeclRefGraph.h
clang-tools-extra/test/modularize/Inputs/Anonymous.h
clang/tools/libclang/CXTranslationUnit.h
clang/tools/diagtool/DiagnosticNames.h

Diff Detail

Event Timeline

abrachet created this revision.Jul 11 2019, 7:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2019, 7:56 AM
abrachet marked an inline comment as done.Jul 11 2019, 7:59 AM
abrachet added inline comments.
compiler-rt/include/sanitizer/allocator_interface.h
1

I'm not sure what to do about compiler-rt/include/sanitizer/*.h files. They are C files but have #ifdef __cpluslus extern "C" { blocks. I'm not sure if it makes more sense to label these as C++ or C files.

abrachet edited the summary of this revision. (Show Details)Jul 11 2019, 8:01 AM

The beginning of the first line, even in this diff, is inconsistent, too.

The beginning of the first line, even in this diff, is inconsistent, too.

Which files are you referring to? I'm not sure what you mean.

lebedev.ri added inline comments.Jul 11 2019, 8:08 AM
clang-tools-extra/clang-move/Move.h
1

//===--

clang-tools-extra/clang-tidy/ClangTidyForceLinker.h
1

//===-

clang-tools-extra/clang-tidy/android/CloexecOpenCheck.h
1

//===---

clang-tools-extra/clang-tidy/utils/NamespaceAliaser.h
1

//===----------

clang/tools/clang-fuzzer/handle-llvm/handle_llvm.h
1

//==--

clang/tools/libclang/CXComment.h
1

//===-

Oh right I see. This wouldn't be too hard to write a little program to move things around I think. I could do this in another patch if we think its worth it.

I'm worried of how large that change will be. Hopefully it isn't too bad in the other files, my guess is that these are particularly bad because they are already not conforming with respect to declaring the language.

Doesn't touch any files I usually work with but I personally like it.

abrachet updated this revision to Diff 209436.Jul 12 2019, 2:27 AM

Found StringSwitch.h was wrong too.

abrachet abandoned this revision.Apr 18 2022, 8:47 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript