aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/ADT/Triple.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ADT/Triple.h')
-rw-r--r--include/llvm/ADT/Triple.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h
index d4130e1e85ae..e271075b7e2a 100644
--- a/include/llvm/ADT/Triple.h
+++ b/include/llvm/ADT/Triple.h
@@ -110,6 +110,7 @@ public:
ARMSubArch_v7m,
ARMSubArch_v7s,
ARMSubArch_v7k,
+ ARMSubArch_v7ve,
ARMSubArch_v6,
ARMSubArch_v6m,
ARMSubArch_v6k,
@@ -206,6 +207,7 @@ public:
COFF,
ELF,
MachO,
+ Wasm,
};
private:
@@ -558,7 +560,8 @@ public:
/// Tests whether the OS uses glibc.
bool isOSGlibc() const {
- return getOS() == Triple::Linux || getOS() == Triple::KFreeBSD;
+ return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD) &&
+ !isAndroid();
}
/// Tests whether the OS uses the ELF binary format.
@@ -576,6 +579,11 @@ public:
return getObjectFormat() == Triple::MachO;
}
+ /// Tests whether the OS uses the Wasm binary format.
+ bool isOSBinFormatWasm() const {
+ return getObjectFormat() == Triple::Wasm;
+ }
+
/// Tests whether the target is the PS4 CPU
bool isPS4CPU() const {
return getArch() == Triple::x86_64 &&
@@ -592,6 +600,19 @@ public:
/// Tests whether the target is Android
bool isAndroid() const { return getEnvironment() == Triple::Android; }
+ bool isAndroidVersionLT(unsigned Major) const {
+ assert(isAndroid() && "Not an Android triple!");
+
+ unsigned Env[3];
+ getEnvironmentVersion(Env[0], Env[1], Env[2]);
+
+ // 64-bit targets did not exist before API level 21 (Lollipop).
+ if (isArch64Bit() && Env[0] < 21)
+ Env[0] = 21;
+
+ return Env[0] < Major;
+ }
+
/// Tests whether the environment is musl-libc
bool isMusl() const {
return getEnvironment() == Triple::Musl ||