xref: /llvm-project/clang-tools-extra/modularize/Modularize.h (revision 282dc72c8b84759dda4fe12420228158962351e8)
15ab4f111SJohn Thompson //===--- Modularize.h - Common definitions for Modularize -*- C++ -*-----===//
25ab4f111SJohn Thompson //
32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65ab4f111SJohn Thompson //
75ab4f111SJohn Thompson //===--------------------------------------------------------------------===//
85ab4f111SJohn Thompson ///
95ab4f111SJohn Thompson /// \file
10*282dc72cSDmitri Gribenko /// Common definitions for Modularize.
115ab4f111SJohn Thompson ///
125ab4f111SJohn Thompson //===--------------------------------------------------------------------===//
135ab4f111SJohn Thompson 
145ab4f111SJohn Thompson #ifndef MODULARIZE_H
155ab4f111SJohn Thompson #define MODULARIZE_H
165ab4f111SJohn Thompson 
175ab4f111SJohn Thompson #include "llvm/ADT/ArrayRef.h"
185ab4f111SJohn Thompson #include "llvm/ADT/SmallString.h"
195ab4f111SJohn Thompson #include "llvm/ADT/SmallVector.h"
205ab4f111SJohn Thompson #include "llvm/ADT/StringMap.h"
215ab4f111SJohn Thompson #include "llvm/ADT/StringRef.h"
225ab4f111SJohn Thompson #include <string>
235ab4f111SJohn Thompson #include <vector>
245ab4f111SJohn Thompson 
255ab4f111SJohn Thompson // Save the program name for error messages.
265ab4f111SJohn Thompson extern const char *Argv0;
275ab4f111SJohn Thompson // Save the command line for comments.
285ab4f111SJohn Thompson extern std::string CommandLine;
295ab4f111SJohn Thompson 
305ab4f111SJohn Thompson // Dependency types.
315ab4f111SJohn Thompson typedef llvm::SmallVector<std::string, 4> DependentsVector;
325ab4f111SJohn Thompson typedef llvm::StringMap<DependentsVector> DependencyMap;
335ab4f111SJohn Thompson 
345ab4f111SJohn Thompson // Global function declarations.
355ab4f111SJohn Thompson 
365ab4f111SJohn Thompson /// Create the module map file.
375ab4f111SJohn Thompson /// \param ModuleMapPath The path to the module map file to be generated.
385ab4f111SJohn Thompson /// \param HeaderFileNames The list of header files, absolute native paths.
394018c624SJohn Thompson /// \param ProblemFileNames The list of problem header files.
405ab4f111SJohn Thompson /// \param Dependencies Map of headers that depend on other headers.
415ab4f111SJohn Thompson /// \param HeaderPrefix Tells the code where the headers are, if they
425ab4f111SJohn Thompson ///   aren's in the current directory, allowing the generator to strip
435ab4f111SJohn Thompson ///   the leading, non-relative beginning of the header paths.
44*282dc72cSDmitri Gribenko /// RootModuleName If not empty, specifies that a root module
455ab4f111SJohn Thompson ///   should be created with this name.
465ab4f111SJohn Thompson /// \returns True if successful.
475ab4f111SJohn Thompson bool createModuleMap(llvm::StringRef ModuleMapPath,
485ab4f111SJohn Thompson                      llvm::ArrayRef<std::string> HeaderFileNames,
494018c624SJohn Thompson                      llvm::ArrayRef<std::string> ProblemFileNames,
505ab4f111SJohn Thompson                      DependencyMap &Dependencies, llvm::StringRef HeaderPrefix,
515ab4f111SJohn Thompson                      llvm::StringRef RootModuleName);
525ab4f111SJohn Thompson 
535ab4f111SJohn Thompson #endif // MODULARIZE_H
54