clang 23.0.0git
DependencyDirectivesScanner.h File Reference

This is the interface for scanning header and source files to get the minimum necessary preprocessor directives for evaluating includes. More...

#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/ArrayRef.h"

Go to the source code of this file.

Classes

struct  clang::dependency_directives_scan::Token
 Token lexed as part of dependency directive scanning. More...
struct  clang::dependency_directives_scan::Directive
 Represents a directive that's lexed as part of the dependency directives scanning. More...
class  clang::DependencyDirectivesGetter
 Functor that returns the dependency directives for a given file. More...

Namespaces

namespace  clang
 The JSON file list parser is used to communicate input to InstallAPI.
namespace  clang::tok
namespace  clang::dependency_directives_scan

Enumerations

enum  clang::dependency_directives_scan::DirectiveKind : uint8_t {
  clang::dependency_directives_scan::pp_none , clang::dependency_directives_scan::pp_include , clang::dependency_directives_scan::pp___include_macros , clang::dependency_directives_scan::pp_define ,
  clang::dependency_directives_scan::pp_undef , clang::dependency_directives_scan::pp_import , clang::dependency_directives_scan::pp_pragma_import , clang::dependency_directives_scan::pp_pragma_once ,
  clang::dependency_directives_scan::pp_pragma_push_macro , clang::dependency_directives_scan::pp_pragma_pop_macro , clang::dependency_directives_scan::pp_pragma_include_alias , clang::dependency_directives_scan::pp_pragma_system_header ,
  clang::dependency_directives_scan::pp_include_next , clang::dependency_directives_scan::pp_if , clang::dependency_directives_scan::pp_ifdef , clang::dependency_directives_scan::pp_ifndef ,
  clang::dependency_directives_scan::pp_elif , clang::dependency_directives_scan::pp_elifdef , clang::dependency_directives_scan::pp_elifndef , clang::dependency_directives_scan::pp_else ,
  clang::dependency_directives_scan::pp_endif , clang::dependency_directives_scan::decl_at_import , clang::dependency_directives_scan::cxx_module_decl , clang::dependency_directives_scan::cxx_import_decl ,
  clang::dependency_directives_scan::cxx_export_module_decl , clang::dependency_directives_scan::cxx_export_import_decl , clang::dependency_directives_scan::tokens_present_before_eof , clang::dependency_directives_scan::pp_eof
}
 Represents the kind of preprocessor directive or a module declaration that is tracked by the scanner in its token output. More...

Functions

bool clang::scanSourceForDependencyDirectives (StringRef Input, SmallVectorImpl< dependency_directives_scan::Token > &Tokens, SmallVectorImpl< dependency_directives_scan::Directive > &Directives, DiagnosticsEngine *Diags=nullptr, SourceLocation InputSourceLoc=SourceLocation())
 Scan the input for the preprocessor directives that might have an effect on the dependencies for a compilation unit.
void clang::printDependencyDirectivesAsSource (StringRef Source, ArrayRef< dependency_directives_scan::Directive > Directives, llvm::raw_ostream &OS)
 Print the previously scanned dependency directives as minimized source text.
bool clang::scanInputForCXX20ModulesUsage (StringRef Source)
 Scan an input source buffer for C++20 named module usage.
bool clang::isPreprocessedModuleFile (StringRef Source)
 Scan an input source buffer, and check whether the input source is a preprocessed output.

Detailed Description

This is the interface for scanning header and source files to get the minimum necessary preprocessor directives for evaluating includes.

It reduces the source down to #define, #include, #import, @import, and any conditional preprocessor logic that contains one of those.

Definition in file DependencyDirectivesScanner.h.