clang  14.0.0git
Public Types | Public Member Functions | List of all members
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={}, int Priority=0)
 
const std::stringgccSuffix () const
 Get the detected GCC installation path suffix for the multi-arch target variant. More...
 
MultilibgccSuffix (StringRef S)
 Set the GCC installation path suffix. More...
 
const std::stringosSuffix () const
 Get the detected os path suffix for the multi-arch target variant. More...
 
MultilibosSuffix (StringRef S)
 Set the os path suffix. More...
 
const std::stringincludeSuffix () const
 Get the include directory suffix. More...
 
MultilibincludeSuffix (StringRef S)
 Set the include directory suffix. More...
 
const flags_listflags () const
 Get the flags that indicate or contraindicate this multilib's use All elements begin with either '+' or '-'. More...
 
flags_listflags ()
 
int priority () const
 Returns the multilib priority. More...
 
Multilibflag (StringRef F)
 Add a flag to the flags list Flag must be a flag accepted by the driver with its leading '-' removed, and replaced with either: '-' which contraindicates using this multilib with that flag or: '+' which promotes using this multilib in the presence of that flag otherwise '-print-multi-lib' will not emit them correctly. More...
 
LLVM_DUMP_METHOD void dump () const
 
void print (raw_ostream &OS) const
 print summary of the Multilib More...
 
bool isValid () const
 Check whether any of the 'against' flags contradict the 'for' flags. More...
 
bool isDefault () const
 Check whether the default is selected. More...
 
bool operator== (const Multilib &Other) const
 

Detailed Description

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

Definition at line 28 of file Multilib.h.

Member Typedef Documentation

◆ flags_list

Definition at line 30 of file Multilib.h.

Constructor & Destructor Documentation

◆ Multilib()

Multilib::Multilib ( StringRef  GCCSuffix = {},
StringRef  OSSuffix = {},
StringRef  IncludeSuffix = {},
int  Priority = 0 
)

Definition at line 53 of file Multilib.cpp.

References normalizePathSegment().

Member Function Documentation

◆ dump()

LLVM_DUMP_METHOD void Multilib::dump ( ) const

Definition at line 80 of file Multilib.cpp.

References print().

◆ flag()

Multilib& clang::driver::Multilib::flag ( StringRef  F)
inline

Add a flag to the flags list Flag must be a flag accepted by the driver with its leading '-' removed, and replaced with either: '-' which contraindicates using this multilib with that flag or: '+' which promotes using this multilib in the presence of that flag otherwise '-print-multi-lib' will not emit them correctly.

Definition at line 92 of file Multilib.h.

References string().

Referenced by findAndroidArmMultilibs(), findMipsCsMultilibs(), findMipsImgMultilibs(), findMipsMtiMultilibs(), findMipsMuslMultilibs(), findMSP430Multilibs(), findRISCVBareMetalMultilibs(), and findRISCVMultilibs().

◆ flags() [1/2]

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

Definition at line 79 of file Multilib.h.

◆ flags() [2/2]

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 78 of file Multilib.h.

Referenced by compose(), clang::driver::MultilibSet::Maybe(), and clang::driver::MultilibSet::select().

◆ gccSuffix() [1/2]

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

◆ gccSuffix() [2/2]

Multilib & Multilib::gccSuffix ( StringRef  S)

Set the GCC installation path suffix.

Definition at line 62 of file Multilib.cpp.

◆ includeSuffix() [1/2]

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

◆ includeSuffix() [2/2]

Multilib & Multilib::includeSuffix ( StringRef  S)

Set the include directory suffix.

Definition at line 74 of file Multilib.cpp.

◆ isDefault()

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

Check whether the default is selected.

Definition at line 106 of file Multilib.h.

Referenced by clang::driver::toolchains::Fuchsia::Fuchsia(), and clang::driver::toolchains::Generic_GCC::GCCInstallationDetector::print().

◆ isValid()

bool Multilib::isValid ( ) const

Check whether any of the 'against' flags contradict the 'for' flags.

Definition at line 98 of file Multilib.cpp.

Referenced by clang::driver::MultilibSet::Either().

◆ operator==()

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

Definition at line 114 of file Multilib.cpp.

References gccSuffix(), includeSuffix(), and osSuffix().

◆ osSuffix() [1/2]

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

◆ osSuffix() [2/2]

Multilib & Multilib::osSuffix ( StringRef  S)

Set the os path suffix.

Definition at line 68 of file Multilib.cpp.

◆ print()

void Multilib::print ( raw_ostream &  OS) const

print summary of the Multilib

Definition at line 84 of file Multilib.cpp.

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

◆ priority()

int clang::driver::Multilib::priority ( ) const
inline

Returns the multilib priority.

When more than one multilib matches flags, the one with the highest priority is selected, with 0 being the default.

Definition at line 83 of file Multilib.h.

References Priority.


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