clang 23.0.0git
DependencyScanningTool.cpp File Reference
#include "clang/Tooling/DependencyScanningTool.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticFrontend.h"
#include "clang/DependencyScanning/DependencyScannerImpl.h"
#include "clang/Driver/Tool.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Frontend/Utils.h"
#include "clang/Lex/Preprocessor.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallVectorExtras.h"
#include "llvm/ADT/iterator.h"
#include "llvm/TargetParser/Host.h"
#include <optional>

Go to the source code of this file.

Functions

static std::pair< std::unique_ptr< driver::Driver >, std::unique_ptr< driver::Compilation > > buildCompilation (ArrayRef< std::string > ArgStrs, DiagnosticsEngine &Diags, IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS, llvm::BumpPtrAllocator &Alloc)
static SmallVector< std::string, 0 > buildCC1CommandLine (const driver::Command &Cmd)
 Constructs the full frontend command line, including executable, for the given driver Cmd.
static bool computeDependenciesForDriverCommandLine (DependencyScanningWorker &Worker, StringRef WorkingDirectory, ArrayRef< std::string > CommandLine, DependencyConsumer &Consumer, DependencyActionController &Controller, DiagnosticConsumer &DiagConsumer, IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > OverlayFS)
static llvm::Error makeErrorFromDiagnosticsOS (TextDiagnosticsPrinterWithOutput &DiagPrinterWithOS)
static std::pair< IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem >, std::vector< std::string > > initVFSForTUBufferScanning (IntrusiveRefCntPtr< llvm::vfs::FileSystem > BaseFS, ArrayRef< std::string > CommandLine, StringRef WorkingDirectory, llvm::MemoryBufferRef TUBuffer)
static std::pair< IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem >, std::vector< std::string > > initVFSForByNameScanning (IntrusiveRefCntPtr< llvm::vfs::FileSystem > BaseFS, ArrayRef< std::string > CommandLine, StringRef WorkingDirectory)
static std::optional< SmallVector< std::string, 0 > > getFirstCC1CommandLine (ArrayRef< std::string > CommandLine, DiagnosticsEngine &Diags, llvm::IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > OverlayFS)

Function Documentation

◆ buildCC1CommandLine()

SmallVector< std::string, 0 > buildCC1CommandLine ( const driver::Command & Cmd)
static

Constructs the full frontend command line, including executable, for the given driver Cmd.

Definition at line 124 of file DependencyScanningTool.cpp.

References clang::driver::Command::getArguments(), and clang::driver::Command::getExecutable().

Referenced by computeDependenciesForDriverCommandLine(), and getFirstCC1CommandLine().

◆ buildCompilation()

std::pair< std::unique_ptr< driver::Driver >, std::unique_ptr< driver::Compilation > > buildCompilation ( ArrayRef< std::string > ArgStrs,
DiagnosticsEngine & Diags,
IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS,
llvm::BumpPtrAllocator & Alloc )
static

◆ computeDependenciesForDriverCommandLine()

bool computeDependenciesForDriverCommandLine ( DependencyScanningWorker & Worker,
StringRef WorkingDirectory,
ArrayRef< std::string > CommandLine,
DependencyConsumer & Consumer,
DependencyActionController & Controller,
DiagnosticConsumer & DiagConsumer,
IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > OverlayFS )
static

◆ getFirstCC1CommandLine()

std::optional< SmallVector< std::string, 0 > > getFirstCC1CommandLine ( ArrayRef< std::string > CommandLine,
DiagnosticsEngine & Diags,
llvm::IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > OverlayFS )
static

◆ initVFSForByNameScanning()

std::pair< IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem >, std::vector< std::string > > initVFSForByNameScanning ( IntrusiveRefCntPtr< llvm::vfs::FileSystem > BaseFS,
ArrayRef< std::string > CommandLine,
StringRef WorkingDirectory )
static

◆ initVFSForTUBufferScanning()

std::pair< IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem >, std::vector< std::string > > initVFSForTUBufferScanning ( IntrusiveRefCntPtr< llvm::vfs::FileSystem > BaseFS,
ArrayRef< std::string > CommandLine,
StringRef WorkingDirectory,
llvm::MemoryBufferRef TUBuffer )
static

◆ makeErrorFromDiagnosticsOS()