Go to the documentation of this file.
9 #ifndef LLVM_CLANG_DRIVER_MULTILIB_H
10 #define LLVM_CLANG_DRIVER_MULTILIB_H
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/STLExtras.h"
15 #include "llvm/ADT/StringRef.h"
16 #include "llvm/Support/Compiler.h"
40 Multilib(StringRef GCCSuffix = {}, StringRef OSSuffix = {},
41 StringRef IncludeSuffix = {},
int Priority = 0);
46 assert(GCCSuffix.empty() ||
47 (StringRef(GCCSuffix).front() ==
'/' && GCCSuffix.size() > 1));
57 assert(OSSuffix.empty() ||
58 (StringRef(OSSuffix).front() ==
'/' && OSSuffix.size() > 1));
68 assert(IncludeSuffix.empty() ||
69 (StringRef(IncludeSuffix).front() ==
'/' && IncludeSuffix.size() > 1));
93 assert(F.front() ==
'+' || F.front() ==
'-');
98 LLVM_DUMP_METHOD
void dump()
const;
100 void print(raw_ostream &OS)
const;
107 {
return GCCSuffix.empty() && OSSuffix.empty() && IncludeSuffix.empty(); }
112 raw_ostream &
operator<<(raw_ostream &OS,
const Multilib &M);
120 std::function<std::vector<std::string>(
const Multilib &M)>;
169 unsigned size()
const {
return Multilibs.size(); }
171 LLVM_DUMP_METHOD
void dump()
const;
172 void print(raw_ostream &OS)
const;
175 IncludeCallback = std::move(F);
182 FilePathsCallback = std::move(F);
196 raw_ostream &
operator<<(raw_ostream &OS,
const MultilibSet &MS);
201 #endif // LLVM_CLANG_DRIVER_MULTILIB_H
void print(raw_ostream &OS) const
std::vector< std::string > flags_list
bool isDefault() const
Check whether the default is selected.
MultilibSet & Either(const Multilib &M1, const Multilib &M2)
Add a set of mutually incompatible Multilib segments.
void clear()
Remove all of the multilibs from the set.
MultilibSet & FilterOut(FilterCallback F)
Filter out some subset of the Multilibs using a user defined callback.
std::function< std::vector< std::string >(const Multilib &M)> IncludeDirsFunc
MultilibSet & setFilePathsCallback(IncludeDirsFunc F)
void print(raw_ostream &OS) const
print summary of the Multilib
LLVM_DUMP_METHOD void dump() const
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.
raw_ostream & operator<<(raw_ostream &OS, const Multilib &M)
const_iterator begin() const
const IncludeDirsFunc & includeDirsCallback() const
void push_back(const Multilib &M)
Add a completed Multilib to the set.
Multilib(StringRef GCCSuffix={}, StringRef OSSuffix={}, StringRef IncludeSuffix={}, int Priority=0)
This corresponds to a single GCC Multilib, or a segment of one controlled by a command line flag.
LLVM_DUMP_METHOD void dump() const
const IncludeDirsFunc & filePathsCallback() const
const_iterator end() const
int priority() const
Returns the multilib priority.
bool operator==(const Multilib &Other) const
std::vector< Multilib > multilib_list
bool isValid() const
Check whether any of the 'against' flags contradict the 'for' flags.
Multilib & flag(StringRef F)
Add a flag to the flags list Flag must be a flag accepted by the driver with its leading '-' removed,...
multilib_list::iterator iterator
llvm::function_ref< bool(const Multilib &)> FilterCallback
void combineWith(const MultilibSet &MS)
Union this set of multilibs with another.
const std::string & includeSuffix() const
Get the include directory suffix.
multilib_list::const_iterator const_iterator
MultilibSet & Maybe(const Multilib &M)
Add an optional Multilib segment.
const flags_list & flags() const
Get the flags that indicate or contraindicate this multilib's use All elements begin with either '+' ...
bool select(const Multilib::flags_list &Flags, Multilib &M) const
Pick the best multilib in the set,.
MultilibSet & setIncludeDirsCallback(IncludeDirsFunc F)