[PATCH] D84989: [doc] Describe the header guard style

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


mtrofin created this revision.
mtrofin added reviewers: dblaikie, mehdi_amini.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
mtrofin requested review of this revision.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84989

Files:
  llvm/docs/CodingStandards.rst


Index: llvm/docs/CodingStandards.rst
===================================================================
--- llvm/docs/CodingStandards.rst
+++ llvm/docs/CodingStandards.rst
@@ -174,6 +174,16 @@
 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
 """""""""""""""
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84989.282071.patch
Type: text/x-patch
Size: 722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200730/d43632d7/attachment.bin>


More information about the llvm-commits mailing list