Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/ScanningProjectModules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ModuleDependencyScanner {
: CDB(CDB), TFS(TFS),
Service(tooling::dependencies::ScanningMode::CanonicalPreprocessing,
tooling::dependencies::ScanningOutputFormat::P1689,
CASOptions(), nullptr, nullptr, nullptr) {}
CASOptions(), nullptr, nullptr) {}

/// The scanned modules dependency information for a specific source file.
struct ModuleDependencyInfo {
Expand Down
5 changes: 3 additions & 2 deletions clang/include/clang/Basic/DiagnosticCASKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ let Component = "CAS" in {
def err_cas_cannot_be_initialized : Error<
"CAS cannot be initialized from the specified '-fcas-*' options: %0">,
DefaultFatal;
def err_cas_cannot_parse_root_id : Error<
"CAS cannot parse root-id '%0' specified by -fcas-fs">, DefaultFatal;
def err_cas_cannot_parse_root_id
: Error<"CAS cannot parse root-id '%0' specified by '-fcas-*' options">,
DefaultFatal;
def err_cas_filesystem_cannot_be_initialized : Error<
"CAS filesystem cannot be initialized from root-id '%0': %1">, DefaultFatal;
def err_cas_filesystem_cannot_set_working_directory : Error<
Expand Down
8 changes: 0 additions & 8 deletions clang/include/clang/Basic/FileSystemOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ class FileSystemOptions {
/// If set, paths are resolved as if the working directory was
/// set to the value of WorkingDir.
std::string WorkingDir;

/// If set, uses this root ID with \a CASFileSystem.
std::string CASFileSystemRootID;

/// If set, used as the working directory for -fcas-fs.
///
/// FIXME: Merge with WorkingDir?
std::string CASFileSystemWorkingDirectory;
};

} // end namespace clang
Expand Down
1 change: 0 additions & 1 deletion clang/include/clang/Frontend/CompileJobCacheKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class DiagnosticsEngine;

enum class CachingInputKind {
IncludeTree,
FileSystemRoot,
CachedCompilation,
Object,
};
Expand Down
11 changes: 0 additions & 11 deletions clang/include/clang/Lex/Preprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -2513,23 +2513,12 @@ class Preprocessor {
/// See \c FrontendOptions::CASIncludeTreeID.
std::optional<std::string> CASIncludeTreeID;

/// The cas-fs tree that is being built, if any.
/// See \c FileSystemOptions::CASFileSystemRootID.
std::optional<std::string> CASFileSystemRootID;

public:
std::optional<std::string> getCASIncludeTreeID() const {
return CASIncludeTreeID;
}
void setCASIncludeTreeID(std::string ID) { CASIncludeTreeID = std::move(ID); }

std::optional<std::string> getCASFileSystemRootID() const {
return CASFileSystemRootID;
}
void setCASFileSystemRootID(std::string ID) {
CASFileSystemRootID = std::move(ID);
}

/// Allocate a new MacroInfo object with the provided SourceLocation.
MacroInfo *AllocateMacroInfo(SourceLocation L);

Expand Down
52 changes: 0 additions & 52 deletions clang/include/clang/Options/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -9065,40 +9065,6 @@ def fsycl_is_host : Flag<["-"], "fsycl-is-host">,
// CAS Options
//===----------------------------------------------------------------------===//

// Example command-lines we expect:
//
// For building against some pre-ingested, CAS-based filesystem in the builtin
// on-disk CAS:
// ```
// % clang -fcas-path=auto -fcas-fs=llvmcas://1af12fa2afa1af2a1fa
// % clang -fcas-path=path/to/cas -fcas-fs=llvmcas://1af12fa2afa1af2a1fa
// ```
//
// For building against some pre-ingested, CAS-based filesystem using a plugin:
// ```
// % clang -fcas-plugin=path/to/some/cas-plugind \
// -fcas-plugin-args=-X,-Y,-Z \
// -fcas-fs=llvmcas://1af12fa2afa1af2a1fa
// ```
//
// For automatically ingesting from the live filesystem into a CAS,
// canonicalizing the paths, and running the `-cc1` against the CAS tree:
// ```
// % clang -fdepscan \
// -fdepscan-prefix-map=/my/sources=/^src \
// -fdepscan-prefix-map=/my/build/dir=/^build
// ```
//
// For pruning and canonicalizing even when starting from a pre-ingested,
// CAS-based filesystem:
// ```
// % clang -fcas-path=path/to/the/cas \
// -fcas-fs=llvmcas://1af12fa2afa1af2a1fa \
// -fdepscan \
// -fdepscan-prefix-map=/my/sources=/^src \
// -fdepscan-prefix-map=/my/build/dir=/^build
// ```

// Driver CAS options.
def fdepscan_EQ : Joined<["-"], "fdepscan=">,
Group<f_Group>,
Expand Down Expand Up @@ -9155,10 +9121,6 @@ def fdepscan_daemon_EQ : Joined<["-"], "fdepscan-daemon=">, Group<f_Group>,
" daemon specified, rather than try to spawn its own based on"
" parent processes.">;

def fdepscan_include_tree : Flag<["-"], "fdepscan-include-tree">,
Visibility<[ClangOption, CLOption]>,
Group<f_Group>, HelpText<"Set dep-scanner to produce the include tree">;

// CAS prefix map options.
//
// FIXME: Add DepscanOption flag.
Expand Down Expand Up @@ -9219,20 +9181,6 @@ def fcas_plugin_option : Separate<["-"], "fcas-plugin-option">,
HelpText<"Option to pass to the CAS plugin.">,
MarshallingInfoStringPairVector<CASOpts<"PluginOptions">>;

// FIXME: Add to driver once it's supported by -fdepscan.
def fcas_fs : Separate<["-"], "fcas-fs">,
Group<f_Group>, MetaVarName<"<tree>">,
HelpText<"Configure the filesystem to read from the provided CAS tree."
" See also -fcas-builtin-path for loading a tree.">,
MarshallingInfoString<FileSystemOpts<"CASFileSystemRootID">>;

// FIXME: Remove / merge with -fworking-directory?
def fcas_fs_working_directory : Separate<["-"], "fcas-fs-working-directory">,
Group<f_Group>, MetaVarName<"<dir>">,
HelpText<"Working directory for -fcas-fs (if not the root).">,
ShouldParseIf<!strconcat("!", fcas_fs.KeyPath, ".empty()")>,
MarshallingInfoString<FileSystemOpts<"CASFileSystemWorkingDirectory">>;

def fcas_include_tree : Separate<["-"], "fcas-include-tree">,
Group<f_Group>, MetaVarName<"<tree>">,
HelpText<"Configure the frontend to use a CAS include tree.">,
Expand Down
4 changes: 0 additions & 4 deletions clang/include/clang/Serialization/ASTBitCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,6 @@ enum ControlRecordTypes {
/// Record code for the (optional) \c ActionCache key for this module.
MODULE_CACHE_KEY,

/// Record code for the (optional) CAS filesystem root ID for implicit modules
/// built with the dependency scanner.
CASFS_ROOT_ID,

/// Record code for the (optional) include-tree ID for implicit modules
/// built with the dependency scanner.
CAS_INCLUDE_TREE_ID,
Expand Down
4 changes: 0 additions & 4 deletions clang/include/clang/Serialization/ModuleFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,6 @@ class ModuleFile {
/// The \c CASID for the module, or empty.
std::string CASID;

/// The CAS filesystem root ID for implicit modules built with the dependency
/// scanner, or empty.
std::string CASFileSystemRootID;

/// The include-tree root ID for implicit modules built with the dependency
/// scanner, or empty.
std::string IncludeTreeID;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
#define LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_DEPENDENCYSCANNINGSERVICE_H

#include "clang/CAS/CASOptions.h"
#include "clang/Tooling/DependencyScanning/DependencyScanningCASFilesystem.h"
#include "clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h"
#include "clang/Tooling/DependencyScanning/InProcessModuleCache.h"
#include "llvm/ADT/BitmaskEnum.h"
#include "llvm/CAS/ActionCache.h"
#include "llvm/CAS/CachingOnDiskFileSystem.h"
#include "llvm/Support/Chrono.h"

namespace clang {
Expand Down Expand Up @@ -46,13 +44,6 @@ enum class ScanningOutputFormat {
/// explicitly building modules.
Full,

/// This emits the CAS ID of the scanned files.
Tree,

/// This emits the full dependency graph but with CAS tree embedded as file
/// dependency.
FullTree,

/// This emits the CAS ID of the include tree.
IncludeTree,

Expand Down Expand Up @@ -111,7 +102,6 @@ class DependencyScanningService {
ScanningMode Mode, ScanningOutputFormat Format, CASOptions CASOpts,
std::shared_ptr<llvm::cas::ObjectStore> CAS,
std::shared_ptr<llvm::cas::ActionCache> Cache,
IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> SharedFS,
ScanningOptimizations OptimizeArgs = ScanningOptimizations::Default,
bool EagerLoadModules = false, bool TraceVFS = false,
std::time_t BuildSessionTimestamp =
Expand All @@ -131,20 +121,14 @@ class DependencyScanningService {
bool shouldCacheNegativeStats() const { return CacheNegativeStats; }

DependencyScanningFilesystemSharedCache &getSharedCache() {
assert(!SharedFS && "Expected not to have a CASFS");
assert(SharedCache && "Expected a shared cache");
return *SharedCache;
return SharedCache;
}

const CASOptions &getCASOpts() const { return CASOpts; }

std::shared_ptr<llvm::cas::ObjectStore> getCAS() const { return CAS; }
std::shared_ptr<llvm::cas::ActionCache> getCache() const { return Cache; }

llvm::cas::CachingOnDiskFileSystem &getSharedFS() { return *SharedFS; }

bool useCASFS() const { return (bool)SharedFS; }

ModuleCacheEntries &getModuleCacheEntries() { return ModCacheEntries; }

std::time_t getBuildSessionTimestamp() const { return BuildSessionTimestamp; }
Expand All @@ -162,11 +146,8 @@ class DependencyScanningService {
/// Whether to trace VFS accesses.
const bool TraceVFS;
const bool CacheNegativeStats;
/// Shared CachingOnDiskFileSystem. Set to nullptr to not use CAS dependency
/// scanning.
IntrusiveRefCntPtr<llvm::cas::CachingOnDiskFileSystem> SharedFS;
/// The global file system cache.
std::optional<DependencyScanningFilesystemSharedCache> SharedCache;
DependencyScanningFilesystemSharedCache SharedCache;
/// The global module cache entries.
ModuleCacheEntries ModCacheEntries;
/// The build session timestamp.
Expand Down
Loading