[libcxx-commits] [PATCH] D117438: [libc++] [test] Check for another kind of modulemap typo in lint_modulemap.sh.py.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 17 07:21:08 PST 2022


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe93f98f09c86: [libc++] [test] Check for another kind of modulemap typo in lint_modulemap.sh. (authored by arthur.j.odwyer).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117438/new/

https://reviews.llvm.org/D117438

Files:
  libcxx/include/module.modulemap
  libcxx/test/libcxx/lint/lint_modulemap.sh.py


Index: libcxx/test/libcxx/lint/lint_modulemap.sh.py
===================================================================
--- libcxx/test/libcxx/lint/lint_modulemap.sh.py
+++ libcxx/test/libcxx/lint/lint_modulemap.sh.py
@@ -18,6 +18,19 @@
     with open(modulemap_name, 'r') as f:
         for line in f.readlines():
             if re.match(r'^\s*module.*[{]\s*private', line):
+                # Check that these lines are all of the expected format.
+                # This incidentally checks for typos in the module name.
+                if re.match(r'^\s*module (\w+)\s+[{] private header "\1(.h)?"\s+export [*] [}]', line):
+                    # It's a top-level private header, such as <__bit_reference>.
+                    pass
+                elif re.match(r'^\s*module (\w+)\s+[{] private header "__\w+/\1[.]h" [}]', line):
+                    # It's a private submodule, such as <__utility/swap.h>.
+                    pass
+                else:
+                    okay = False
+                    print("LINE DOESN'T MATCH REGEX in libcxx/include/module.modulemap!")
+                    print(line)
+                # Check that these lines are alphabetized.
                 if (prevline is not None) and (line < prevline):
                     okay = False
                     print('LINES OUT OF ORDER in libcxx/include/module.modulemap!')
Index: libcxx/include/module.modulemap
===================================================================
--- libcxx/include/module.modulemap
+++ libcxx/include/module.modulemap
@@ -989,7 +989,7 @@
   module __function_like     { private header "__function_like.h"   export * }
   module __hash_table        {         header "__hash_table"        export * }
   module __locale            { private header "__locale"            export * }
-  module __mbstate           { private header "__mbstate_t.h"       export * }
+  module __mbstate_t         { private header "__mbstate_t.h"       export * }
   module __mutex_base        { private header "__mutex_base"        export * }
   module __node_handle       { private header "__node_handle"       export * }
   module __nullptr           {         header "__nullptr"           export * }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117438.400545.patch
Type: text/x-patch
Size: 2206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220117/9c2aaf80/attachment.bin>


More information about the libcxx-commits mailing list