llvm.org GIT mirror llvm / e1fe09f
ADT/Triple: Add isOSDarwin() and isOSWindows() helper functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129815 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 9 years ago
2 changed file(s) with 14 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
248248 return getOSMajorVersion();
249249 }
250250
251 /// isOSVersionLT - Helper function for doing comparisons against version
252 /// numbers included in the target triple.
251253 bool isOSVersionLT(unsigned Major, unsigned Minor = 0,
252254 unsigned Micro = 0) const {
253255 unsigned LHS[3];
267269 /// "darwin" and "osx" as OS X triples.
268270 bool isOSX() const {
269271 return getOS() == Triple::Darwin || getOS() == Triple::OSX;
272 }
273
274 /// isOSDarwin - Is this a "Darwin" OS (OS X or iOS).
275 bool isOSDarwin() const {
276 return isOSX() ||getOS() == Triple::IOS;
277 }
278
279 /// isOSWindows - Is this a "Windows" OS.
280 bool isOSWindows() const {
281 return getOS() == Triple::Win32 || getOS() == Triple::Cygwin ||
282 getOS() == Triple::MinGW32;
270283 }
271284
272285 /// isOSXVersionLT - Comparison function for checking OS X version
212212
213213 // Returns architecture name that is understood by the target assembler.
214214 const char *Triple::getArchNameForAssembler() {
215 if (getOS() != Triple::Darwin && getOS() != Triple::OSX &&
216 getOS() != Triple::IOS && getVendor() != Triple::Apple)
215 if (!isOSDarwin() && getVendor() != Triple::Apple)
217216 return NULL;
218217
219218 StringRef Str = getArchName();