[libcxx-commits] [libcxx] [libc++][modules] Adds std.compat module. (PR #71438)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 21 09:57:52 PST 2023


================
@@ -18,15 +18,47 @@ namespace libcpp {
 class header_exportable_declarations : public clang::tidy::ClangTidyCheck {
 public:
   explicit header_exportable_declarations(llvm::StringRef, clang::tidy::ClangTidyContext*);
+  ~header_exportable_declarations();
   void registerMatchers(clang::ast_matchers::MatchFinder*) override;
   void check(const clang::ast_matchers::MatchFinder::MatchResult&) override;
 
-  enum class FileType { Header, ModulePartition, Module, Unknown };
+  enum class FileType {
+    // std module specific
+    Header,
+    CompatModulePartition,
+    Module,
+    // std.compat module specific
+    CHeader,
+    ModulePartition,
+    CompatModule,
+    // invalid value
+    Unknown
+  };
 
 private:
   llvm::StringRef filename_;
   FileType file_type_;
   llvm::StringRef extra_header_;
   std::set<std::string> decls_;
+
+  // The named declarations in .h C headers are "tricky". On POSIX systems
+  // these headers contain POSIX specific functions that do not use a reserved
+  // name. For example, fmemopen is provided by stdio.h.
+  // The way to filter the names that should be provided by the headers is the
+  // following:
----------------
ldionne wrote:

```suggestion
  // We filter the names that should be provided by the headers as follows:
```

https://github.com/llvm/llvm-project/pull/71438


More information about the libcxx-commits mailing list