[llvm] abb8128 - [doc] Describe the header guard style

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 16:08:16 PDT 2020


Author: Mircea Trofin
Date: 2020-07-30T16:08:07-07:00
New Revision: abb812823701cbbb615fea0d6fe731725eb4162f

URL: https://github.com/llvm/llvm-project/commit/abb812823701cbbb615fea0d6fe731725eb4162f
DIFF: https://github.com/llvm/llvm-project/commit/abb812823701cbbb615fea0d6fe731725eb4162f.diff

LOG: [doc] Describe the header guard style

clang-tidy's llvm-header-guard rule references the LLVM style - where it's
missing.

Differential Revision: https://reviews.llvm.org/D84989

Added: 
    

Modified: 
    llvm/docs/CodingStandards.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/CodingStandards.rst b/llvm/docs/CodingStandards.rst
index a9884cd9f3b5..9c95e3ebf28a 100644
--- a/llvm/docs/CodingStandards.rst
+++ b/llvm/docs/CodingStandards.rst
@@ -174,6 +174,16 @@ used as an abstract.  Any additional information should be separated by a blank
 line.  If an algorithm is based on a paper or is described in another source,
 provide a reference.
 
+Header Guard
+""""""""""""
+
+The header file's guard should be the all-caps path that a user of this header
+would #include, using '_' instead of path separator and extension marker. 
+For example, the header file
+``llvm/include/llvm/Analysis/Utils/Local.h`` would be ``#include``-ed as 
+``#include "llvm/Analysis/Utils/Local.h"``, so its guard is 
+``LLVM_ANALYSIS_UTILS_LOCAL_H``.
+
 Class overviews
 """""""""""""""
 


        


More information about the llvm-commits mailing list