clang-tools  8.0.0svn
Classes | Typedefs | Functions | Variables
Modularize.cpp File Reference
#include "Modularize.h"
#include "ModularizeUtilities.h"
#include "PreprocessorTracker.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Driver/Options.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/OptTable.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include <algorithm>
#include <fstream>
#include <iterator>
#include <string>
#include <vector>
Include dependency graph for Modularize.cpp:

Go to the source code of this file.

Classes

struct  Location
 
struct  Entry
 
struct  HeaderEntry
 
class  EntityMap
 
class  CollectEntitiesVisitor
 
class  CollectEntitiesConsumer
 
class  CollectEntitiesAction
 
class  ModularizeFrontendActionFactory
 
class  CompileCheckVisitor
 
class  CompileCheckConsumer
 
class  CompileCheckAction
 
class  CompileCheckFrontendActionFactory
 

Typedefs

typedef std::vector< HeaderEntryHeaderContents
 

Functions

static cl::list< std::string > ListFileNames (cl::Positional, cl::value_desc("list"), cl::desc("<list of one or more header list files>"), cl::CommaSeparated)
 
static cl::list< std::string > CC1Arguments (cl::ConsumeAfter, cl::desc("<arguments to be passed to front end>..."))
 
static cl::opt< std::string > HeaderPrefix ("prefix", cl::init(""), cl::desc("Prepend header file paths with this prefix." " If not specified," " the files are considered to be relative to the header list file."))
 
static cl::opt< std::string > ModuleMapPath ("module-map-path", cl::init(""), cl::desc("Turn on module map output and specify output path or file name." " If no path is specified and if prefix option is specified," " use prefix for file path."))
 
static cl::opt< std::string > ProblemFilesList ("problem-files-list", cl::init(""), cl::desc("List of files with compilation or modularization problems for" " assistant mode. This will be excluded."))
 
static cl::opt< std::string > RootModule ("root-module", cl::init(""), cl::desc("Specify the name of the root module."))
 
static cl::opt< bool > BlockCheckHeaderListOnly ("block-check-header-list-only", cl::init(false), cl::desc("Only warn if #include directives are inside extern or namespace" " blocks if the included header is in the header list."))
 
static cl::list< std::string > IncludePaths ("I", cl::desc("Include path for coverage check."), cl::ZeroOrMore, cl::value_desc("path"))
 
static cl::opt< bool > NoCoverageCheck ("no-coverage-check", cl::init(false), cl::desc("Don't do the coverage check."))
 
static cl::opt< bool > CoverageCheckOnly ("coverage-check-only", cl::init(false), cl::desc("Only do the coverage check."))
 
static cl::opt< bool > DisplayFileLists ("display-file-lists", cl::init(false), cl::desc("Display lists of good files (no compile errors), problem files," " and a combined list with problem files preceded by a '#'."))
 
static std::string findInputFile (const CommandLineArguments &CLArgs)
 
static ArgumentsAdjuster getModularizeArgumentsAdjuster (DependencyMap &Dependencies)
 
int main (int Argc, const char **Argv)
 

Variables

const char * Argv0
 
std::string CommandLine
 

Typedef Documentation

◆ HeaderContents

typedef std::vector<HeaderEntry> HeaderContents

Definition at line 484 of file Modularize.cpp.

Function Documentation

◆ BlockCheckHeaderListOnly()

static cl::opt<bool> BlockCheckHeaderListOnly ( "block-check-header-list-only"  ,
cl::init(false)  ,
cl::desc("Only warn if #include directives are inside extern or namespace" " blocks if the included header is in the header list.")   
)
static

◆ CC1Arguments()

static cl::list<std::string> CC1Arguments ( cl::ConsumeAfter  ,
cl::desc("<arguments to be passed to front end>...")   
)
static

Referenced by main().

◆ CoverageCheckOnly()

static cl::opt<bool> CoverageCheckOnly ( "coverage-check-only"  ,
cl::init(false)  ,
cl::desc("Only do the coverage check.")   
)
static

Referenced by main().

◆ DisplayFileLists()

static cl::opt<bool> DisplayFileLists ( "display-file-lists"  ,
cl::init(false)  ,
cl::desc("Display lists of good files (no compile errors), problem files," " and a combined list with problem files preceded by a '#'.")   
)
static

◆ findInputFile()

static std::string findInputFile ( const CommandLineArguments &  CLArgs)
static

Definition at line 339 of file Modularize.cpp.

◆ getModularizeArgumentsAdjuster()

static ArgumentsAdjuster getModularizeArgumentsAdjuster ( DependencyMap Dependencies)
static

Definition at line 356 of file Modularize.cpp.

◆ HeaderPrefix()

static cl::opt<std::string> HeaderPrefix ( "prefix"  ,
cl::init("")  ,
cl::desc("Prepend header file paths with this prefix." " If not specified," " the files are considered to be relative to the header list file.")   
)
static

Referenced by main().

◆ IncludePaths()

static cl::list<std::string> IncludePaths ( "I"  ,
cl::desc("Include path for coverage check.")  ,
cl::ZeroOrMore  ,
cl::value_desc("path")   
)
static

Referenced by main().

◆ ListFileNames()

static cl::list<std::string> ListFileNames ( cl::Positional  ,
cl::value_desc("list")  ,
cl::desc("<list of one or more header list files>")  ,
cl::CommaSeparated   
)
static

Referenced by main().

◆ main()

int main ( int  Argc,
const char **  Argv 
)

◆ ModuleMapPath()

static cl::opt<std::string> ModuleMapPath ( "module-map-path"  ,
cl::init("")  ,
cl::desc("Turn on module map output and specify output path or file name." " If no path is specified and if prefix option is specified," " use prefix for file path.")   
)
static

Referenced by main(), and writeModuleMap().

◆ NoCoverageCheck()

static cl::opt<bool> NoCoverageCheck ( "no-coverage-check"  ,
cl::init(false)  ,
cl::desc("Don't do the coverage check.")   
)
static

Referenced by main().

◆ ProblemFilesList()

static cl::opt<std::string> ProblemFilesList ( "problem-files-list"  ,
cl::init("")  ,
cl::desc("List of files with compilation or modularization problems for" " assistant mode. This will be excluded.")   
)
static

Referenced by main().

◆ RootModule()

static cl::opt<std::string> RootModule ( "root-module"  ,
cl::init("")  ,
cl::desc("Specify the name of the root module.")   
)
static

Variable Documentation

◆ Argv0

const char* Argv0

Definition at line 334 of file Modularize.cpp.

◆ CommandLine

std::string CommandLine

Definition at line 336 of file Modularize.cpp.