clang 20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::driver::MultilibSet Class Reference

See also MultilibSetBuilder for combining multilibs into a set. More...

#include "clang/Driver/Multilib.h"

Classes

struct  FlagMatcher
 Uses regular expressions to simplify flags used for multilib selection. More...
 

Public Types

using multilib_list = std::vector< Multilib >
 
using const_iterator = multilib_list::const_iterator
 
using IncludeDirsFunc = std::function< std::vector< std::string >(const Multilib &M)>
 
using FilterCallback = llvm::function_ref< bool(const Multilib &)>
 

Public Member Functions

 MultilibSet ()=default
 
 MultilibSet (multilib_list &&Multilibs, std::vector< FlagMatcher > &&FlagMatchers={})
 
const multilib_listgetMultilibs ()
 
MultilibSetFilterOut (FilterCallback F)
 Filter out some subset of the Multilibs using a user defined callback.
 
void push_back (const Multilib &M)
 Add a completed Multilib to the set.
 
const_iterator begin () const
 
const_iterator end () const
 
bool select (const Multilib::flags_list &Flags, llvm::SmallVectorImpl< Multilib > &) const
 Select compatible variants,.
 
unsigned size () const
 
llvm::StringSet expandFlags (const Multilib::flags_list &) const
 Get the given flags plus flags found by matching them against the FlagMatchers and choosing the Flags of each accordingly.
 
LLVM_DUMP_METHOD void dump () const
 
void print (raw_ostream &OS) const
 
MultilibSetsetIncludeDirsCallback (IncludeDirsFunc F)
 
const IncludeDirsFuncincludeDirsCallback () const
 
MultilibSetsetFilePathsCallback (IncludeDirsFunc F)
 
const IncludeDirsFuncfilePathsCallback () const
 

Static Public Member Functions

static llvm::ErrorOr< MultilibSetparseYaml (llvm::MemoryBufferRef, llvm::SourceMgr::DiagHandlerTy=nullptr, void *DiagHandlerCtxt=nullptr)
 

Detailed Description

See also MultilibSetBuilder for combining multilibs into a set.

Definition at line 92 of file Multilib.h.

Member Typedef Documentation

◆ const_iterator

using clang::driver::MultilibSet::const_iterator = multilib_list::const_iterator

Definition at line 95 of file Multilib.h.

◆ FilterCallback

using clang::driver::MultilibSet::FilterCallback = llvm::function_ref<bool(const Multilib &)>

Definition at line 98 of file Multilib.h.

◆ IncludeDirsFunc

using clang::driver::MultilibSet::IncludeDirsFunc = std::function<std::vector<std::string>(const Multilib &M)>

Definition at line 96 of file Multilib.h.

◆ multilib_list

Definition at line 94 of file Multilib.h.

Constructor & Destructor Documentation

◆ MultilibSet() [1/2]

clang::driver::MultilibSet::MultilibSet ( )
default

Referenced by parseYaml().

◆ MultilibSet() [2/2]

clang::driver::MultilibSet::MultilibSet ( multilib_list &&  Multilibs,
std::vector< FlagMatcher > &&  FlagMatchers = {} 
)
inline

Definition at line 116 of file Multilib.h.

Member Function Documentation

◆ begin()

const_iterator clang::driver::MultilibSet::begin ( ) const
inline

Definition at line 128 of file Multilib.h.

◆ dump()

LLVM_DUMP_METHOD void MultilibSet::dump ( ) const

Definition at line 311 of file Multilib.cpp.

References print().

◆ end()

const_iterator clang::driver::MultilibSet::end ( ) const
inline

Definition at line 129 of file Multilib.h.

◆ expandFlags()

llvm::StringSet MultilibSet::expandFlags ( const Multilib::flags_list InFlags) const

Get the given flags plus flags found by matching them against the FlagMatchers and choosing the Flags of each accordingly.

The select method calls this method so in most cases it's not necessary to call it directly.

Definition at line 136 of file Multilib.cpp.

References clang::Result.

Referenced by clang::driver::Driver::HandleImmediateArgs(), and select().

◆ filePathsCallback()

const IncludeDirsFunc & clang::driver::MultilibSet::filePathsCallback ( ) const
inline

◆ FilterOut()

MultilibSet & MultilibSet::FilterOut ( FilterCallback  F)

◆ getMultilibs()

const multilib_list & clang::driver::MultilibSet::getMultilibs ( )
inline

Definition at line 120 of file Multilib.h.

◆ includeDirsCallback()

const IncludeDirsFunc & clang::driver::MultilibSet::includeDirsCallback ( ) const
inline

◆ parseYaml()

llvm::ErrorOr< MultilibSet > MultilibSet::parseYaml ( llvm::MemoryBufferRef  Input,
llvm::SourceMgr::DiagHandlerTy  DiagHandler = nullptr,
void *  DiagHandlerCtxt = nullptr 
)
static

Definition at line 286 of file Multilib.cpp.

References MultilibSet().

Referenced by findMultilibsFromYAML().

◆ print()

void MultilibSet::print ( raw_ostream &  OS) const

Definition at line 315 of file Multilib.cpp.

Referenced by dump(), and clang::driver::operator<<().

◆ push_back()

void MultilibSet::push_back ( const Multilib M)

Add a completed Multilib to the set.

Definition at line 95 of file Multilib.cpp.

Referenced by findOHOSMuslMultilibs(), and clang::driver::toolchains::Fuchsia::Fuchsia().

◆ select()

bool MultilibSet::select ( const Multilib::flags_list Flags,
llvm::SmallVectorImpl< Multilib > &  Selected 
) const

◆ setFilePathsCallback()

MultilibSet & clang::driver::MultilibSet::setFilePathsCallback ( IncludeDirsFunc  F)
inline

◆ setIncludeDirsCallback()

MultilibSet & clang::driver::MultilibSet::setIncludeDirsCallback ( IncludeDirsFunc  F)
inline

◆ size()

unsigned clang::driver::MultilibSet::size ( ) const
inline

Definition at line 135 of file Multilib.h.

Referenced by findMipsCsMultilibs().


The documentation for this class was generated from the following files: