10 #ifndef LLVM_CLANG_DRIVER_MULTILIB_H 11 #define LLVM_CLANG_DRIVER_MULTILIB_H 14 #include "llvm/ADT/STLExtras.h" 15 #include "llvm/Option/Option.h" 30 std::string GCCSuffix;
32 std::string IncludeSuffix;
36 Multilib(StringRef GCCSuffix =
"", StringRef OSSuffix =
"",
37 StringRef IncludeSuffix =
"");
42 assert(GCCSuffix.empty() ||
43 (StringRef(GCCSuffix).front() ==
'/' && GCCSuffix.size() > 1));
52 assert(OSSuffix.empty() ||
53 (StringRef(OSSuffix).front() ==
'/' && OSSuffix.size() > 1));
62 assert(IncludeSuffix.empty() ||
63 (StringRef(IncludeSuffix).front() ==
'/' && IncludeSuffix.size() > 1));
71 const flags_list &
flags()
const {
return Flags; }
72 flags_list &
flags() {
return Flags; }
82 assert(F.front() ==
'+' || F.front() ==
'-');
87 LLVM_DUMP_METHOD
void dump()
const;
89 void print(raw_ostream &OS)
const;
96 {
return GCCSuffix.empty() && OSSuffix.empty() && IncludeSuffix.empty(); }
109 typedef std::function<std::vector<std::string>(
const Multilib &M)>
115 multilib_list Multilibs;
150 iterator
begin() {
return Multilibs.begin(); }
151 const_iterator
begin()
const {
return Multilibs.begin(); }
153 iterator
end() {
return Multilibs.end(); }
154 const_iterator
end()
const {
return Multilibs.end(); }
159 unsigned size()
const {
return Multilibs.size(); }
161 LLVM_DUMP_METHOD
void dump()
const;
162 void print(raw_ostream &OS)
const;
165 IncludeCallback = std::move(F);
171 FilePathsCallback = std::move(F);
178 static multilib_list filterCopy(FilterCallback F,
const multilib_list &Ms);
181 static void filterInPlace(FilterCallback F, multilib_list &Ms);
bool operator==(const Multilib &Other) const
std::function< std::vector< std::string >const Multilib &M)> IncludeDirsFunc
bool isDefault() const
Check whether the default is selected.
const IncludeDirsFunc & includeDirsCallback() const
const IncludeDirsFunc & filePathsCallback() const
multilib_list::iterator iterator
llvm::function_ref< bool(const Multilib &)> FilterCallback
Multilib & flag(StringRef F)
Add a flag to the flags list Flag must be a flag accepted by the driver with its leading '-' removed...
const std::string & includeSuffix() const
Get the include directory suffix.
raw_ostream & operator<<(raw_ostream &OS, const Multilib &M)
const std::string & gccSuffix() const
Get the detected GCC installation path suffix for the multi-arch target variant.
void clear()
Remove all of thie multilibs from the set.
std::vector< Multilib > multilib_list
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
const std::string & osSuffix() const
Get the detected os path suffix for the multi-arch target variant.
MultilibSet & setIncludeDirsCallback(IncludeDirsFunc F)
const_iterator end() const
const flags_list & flags() const
Get the flags that indicate or contraindicate this multilib's use All elements begin with either '+' ...
This corresponds to a single GCC Multilib, or a segment of one controlled by a command line flag...
multilib_list::const_iterator const_iterator
bool isValid() const
Check whether any of the 'against' flags contradict the 'for' flags.
Multilib(StringRef GCCSuffix="", StringRef OSSuffix="", StringRef IncludeSuffix="")
const_iterator begin() const
char __ovld __cnfn select(char a, char b, char c)
For each component of a vector type, result[i] = if MSB of c[i] is set ? b[i] : a[i].
void print(raw_ostream &OS) const
print summary of the Multilib
MultilibSet & setFilePathsCallback(IncludeDirsFunc F)
Dataflow Directional Tag Classes.
LLVM_DUMP_METHOD void dump() const
std::vector< std::string > flags_list