clang 22.0.0git
clang::driver::Multilib Class Reference

This corresponds to a single GCC Multilib, or a segment of one controlled by a command line flag. More...

#include "clang/Driver/Multilib.h"

Public Types

using flags_list = std::vector<std::string>

Public Member Functions

 Multilib (StringRef GCCSuffix={}, StringRef OSSuffix={}, StringRef IncludeSuffix={}, const flags_list &Flags=flags_list(), StringRef ExclusiveGroup={}, std::optional< StringRef > Error=std::nullopt)
 GCCSuffix, OSSuffix & IncludeSuffix will be appended directly to the sysroot string so they must either be empty or begin with a '/' character.
const std::string & gccSuffix () const
 Get the detected GCC installation path suffix for the multi-arch target variant.
const std::string & osSuffix () const
 Get the detected os path suffix for the multi-arch target variant.
const std::string & includeSuffix () const
 Get the include directory suffix.
const flags_listflags () const
 Get the flags that indicate or contraindicate this multilib's use All elements begin with either '-' or '!
const std::string & exclusiveGroup () const
 Get the exclusive group label.
LLVM_DUMP_METHOD void dump () const
void print (raw_ostream &OS) const
 print summary of the Multilib
bool isDefault () const
 Check whether the default is selected.
bool operator== (const Multilib &Other) const
bool isError () const
const std::string & getErrorMessage () const

Detailed Description

This corresponds to a single GCC Multilib, or a segment of one controlled by a command line flag.

See also MultilibBuilder for building a multilib by mutating it incrementally.

Definition at line 35 of file Multilib.h.

Member Typedef Documentation

◆ flags_list

using clang::driver::Multilib::flags_list = std::vector<std::string>

Definition at line 37 of file Multilib.h.

Constructor & Destructor Documentation

◆ Multilib()

Multilib::Multilib ( StringRef GCCSuffix = {},
StringRef OSSuffix = {},
StringRef IncludeSuffix = {},
const flags_list & Flags = flags_list(),
StringRef ExclusiveGroup = {},
std::optional< StringRef > Error = std::nullopt )

GCCSuffix, OSSuffix & IncludeSuffix will be appended directly to the sysroot string so they must either be empty or begin with a '/' character.

This is enforced with an assert in the constructor.

Definition at line 30 of file Multilib.cpp.

Referenced by operator==().

Member Function Documentation

◆ dump()

LLVM_DUMP_METHOD void Multilib::dump ( ) const

Definition at line 43 of file Multilib.cpp.

References print().

◆ exclusiveGroup()

const std::string & clang::driver::Multilib::exclusiveGroup ( ) const
inline

Get the exclusive group label.

Definition at line 85 of file Multilib.h.

◆ flags()

const flags_list & clang::driver::Multilib::flags ( ) const
inline

Get the flags that indicate or contraindicate this multilib's use All elements begin with either '-' or '!

'

Definition at line 82 of file Multilib.h.

Referenced by findMultilibsFromYAML().

◆ gccSuffix()

const std::string & clang::driver::Multilib::gccSuffix ( ) const
inline

Get the detected GCC installation path suffix for the multi-arch target variant.

Always starts with a '/', unless empty

Definition at line 70 of file Multilib.h.

Referenced by clang::driver::toolchains::Fuchsia::AddClangCXXStdlibIncludeArgs(), findMipsImgMultilibs(), findMipsMtiMultilibs(), findRISCVBareMetalMultilibs(), clang::driver::Driver::HandleImmediateArgs(), and operator==().

◆ getErrorMessage()

const std::string & clang::driver::Multilib::getErrorMessage ( ) const
inline

Definition at line 99 of file Multilib.h.

Referenced by findMultilibsFromYAML().

◆ includeSuffix()

◆ isDefault()

bool clang::driver::Multilib::isDefault ( ) const
inline

Check whether the default is selected.

Definition at line 92 of file Multilib.h.

◆ isError()

bool clang::driver::Multilib::isError ( ) const
inline

Definition at line 97 of file Multilib.h.

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

◆ operator==()

bool Multilib::operator== ( const Multilib & Other) const

Definition at line 60 of file Multilib.cpp.

References gccSuffix(), includeSuffix(), Multilib(), osSuffix(), and clang::Other.

◆ osSuffix()

const std::string & clang::driver::Multilib::osSuffix ( ) const
inline

Get the detected os path suffix for the multi-arch target variant.

Always starts with a '/', unless empty

Definition at line 74 of file Multilib.h.

Referenced by clang::driver::toolchains::Generic_GCC::AddMultiarchPaths(), clang::driver::toolchains::Linux::computeSysRoot(), findMipsMuslMultilibs(), and operator==().

◆ print()

void Multilib::print ( raw_ostream & OS) const

print summary of the Multilib

Definition at line 47 of file Multilib.cpp.

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


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