clang 22.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/Utils.h"
#include "llvm/ADT/SmallVectorExtras.h"
#include "llvm/ADT/iterator.h"
#include "llvm/Support/VirtualFileSystem.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::optional< SmallVector< std::string, 0 > > getFirstCC1CommandLine (ArrayRef< std::string > CommandLine, DiagnosticsEngine &Diags, llvm::IntrusiveRefCntPtr< llvm::vfs::OverlayFileSystem > ScanFS)

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 127 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 > ScanFS )
static

◆ makeErrorFromDiagnosticsOS()