clang 22.0.0git
ModuleDepCollector.cpp File Reference
#include "clang/Tooling/DependencyScanning/ModuleDepCollector.h"
#include "clang/Basic/MakeSupport.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Tooling/DependencyScanning/DependencyScanningWorker.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/BLAKE3.h"
#include <optional>

Go to the source code of this file.

Macros

#define IF_RELATIVE_RETURN_FALSE(PATH)
#define IF_ANY_RELATIVE_RETURN_FALSE(PATHS)

Functions

static void optimizeHeaderSearchOpts (HeaderSearchOptions &Opts, ASTReader &Reader, const serialization::ModuleFile &MF, const PrebuiltModulesAttrsMap &PrebuiltModulesASTMap, ScanningOptimizations OptimizeArgs)
static void optimizeDiagnosticOpts (DiagnosticOptions &Opts, bool IsSystemModule)
static void optimizeCWD (CowCompilerInvocation &BuildInvocation, StringRef CWD)
static std::vector< std::string > splitString (std::string S, char Separator)
static CowCompilerInvocation makeCommonInvocationForModuleBuild (CompilerInvocation CI)
static bool needsModules (FrontendInputFile FIF)
static bool isSafeToIgnoreCWD (const CowCompilerInvocation &CI)
static std::string getModuleContextHash (const ModuleDeps &MD, const CowCompilerInvocation &CI, bool EagerLoadModules, bool IgnoreCWD, llvm::vfs::FileSystem &VFS)
static void forEachSubmoduleSorted (const Module *M, llvm::function_ref< void(const Module *)> F)
static StringRef makeAbsoluteAndPreferred (CompilerInstance &CI, StringRef Path, SmallVectorImpl< char > &Storage)

Macro Definition Documentation

◆ IF_ANY_RELATIVE_RETURN_FALSE

#define IF_ANY_RELATIVE_RETURN_FALSE ( PATHS)
Value:
do { \
if (llvm::any_of(PATHS, [](const auto &P) { \
return !P.empty() && !llvm::sys::path::is_absolute(P); \
})) \
return false; \
} while (0)

Referenced by isSafeToIgnoreCWD().

◆ IF_RELATIVE_RETURN_FALSE

#define IF_RELATIVE_RETURN_FALSE ( PATH)
Value:
do { \
if (!PATH.empty() && !llvm::sys::path::is_absolute(PATH)) \
return false; \
} while (0)

Referenced by isSafeToIgnoreCWD().

Function Documentation

◆ forEachSubmoduleSorted()

void forEachSubmoduleSorted ( const Module * M,
llvm::function_ref< void(const Module *)> F )
static

Definition at line 854 of file ModuleDepCollector.cpp.

References clang::Module::Name, and clang::Module::submodules().

◆ getModuleContextHash()

◆ isSafeToIgnoreCWD()

◆ makeAbsoluteAndPreferred()

StringRef makeAbsoluteAndPreferred ( CompilerInstance & CI,
StringRef Path,
SmallVectorImpl< char > & Storage )
static

◆ makeCommonInvocationForModuleBuild()

◆ needsModules()

◆ optimizeCWD()

◆ optimizeDiagnosticOpts()

void optimizeDiagnosticOpts ( DiagnosticOptions & Opts,
bool IsSystemModule )
static

◆ optimizeHeaderSearchOpts()

◆ splitString()

std::vector< std::string > splitString ( std::string S,
char Separator )
static

Definition at line 151 of file ModuleDepCollector.cpp.