[llvm] [NFC] Eliminate needs of Emacs tag and file name in file headers (PR #118553)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 14:07:49 PST 2024


https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/118553

- Simplify file header to not require file name and C++ Emacs tag.

See https://discourse.llvm.org/t/is-c-in-header-files-still-relevant/83124/1

>From c75482c0cdfd853b251c278efd5635adea37b896 Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Tue, 3 Dec 2024 14:04:32 -0800
Subject: [PATCH] [NFC] Eliminate needs of Emacs tag and file name in file
 headers

- Simplify file header to not require file name and C++ Emacs tag.

See https://discourse.llvm.org/t/is-c-in-header-files-still-relevant/83124/1
---
 llvm/docs/CodingStandards.rst | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/llvm/docs/CodingStandards.rst b/llvm/docs/CodingStandards.rst
index 6e90efe0f11197..d6d6ecf759cf38 100644
--- a/llvm/docs/CodingStandards.rst
+++ b/llvm/docs/CodingStandards.rst
@@ -177,7 +177,7 @@ the file. The standard header looks like this:
 
 .. code-block:: c++
 
-  //===-- llvm/Instruction.h - Instruction class definition -------*- C++ -*-===//
+  //===----------------------------------------------------------------------===//
   //
   // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
   // See https://llvm.org/LICENSE.txt for license information.
@@ -191,17 +191,7 @@ the file. The standard header looks like this:
   ///
   //===----------------------------------------------------------------------===//
 
-A few things to note about this particular format: The "``-*- C++ -*-``" string
-on the first line is there to tell Emacs that the source file is a C++ file, not
-a C file (Emacs assumes ``.h`` files are C files by default).
-
-.. note::
-
-    This tag is not necessary in ``.cpp`` files.  The name of the file is also
-    on the first line, along with a very short description of the purpose of the
-    file.
-
-The next section in the file is a concise note that defines the license that the
+The first section in the file is a concise note that defines the license that the
 file is released under.  This makes it perfectly clear what terms the source
 code can be distributed under and should not be modified in any way.
 



More information about the llvm-commits mailing list