@@ -223,7 +223,8 @@ class Triple {
223223 WASI, // Experimental WebAssembly OS
224224 Emscripten,
225225 ShaderModel, // DirectX ShaderModel
226- LastOSType = ShaderModel
226+ LiteOS,
227+ LastOSType = LiteOS
227228 };
228229 enum EnvironmentType {
229230 UnknownEnvironment,
@@ -273,8 +274,8 @@ class Triple {
273274 Callable,
274275 Mesh,
275276 Amplification,
276-
277- LastEnvironmentType = Amplification
277+ OpenHOS,
278+ LastEnvironmentType = OpenHOS
278279 };
279280 enum ObjectFormatType {
280281 UnknownObjectFormat,
@@ -740,9 +741,18 @@ class Triple {
740741 return getEnvironment () == Triple::Musl ||
741742 getEnvironment () == Triple::MuslEABI ||
742743 getEnvironment () == Triple::MuslEABIHF ||
743- getEnvironment () == Triple::MuslX32;
744+ getEnvironment () == Triple::MuslX32 ||
745+ getEnvironment () == Triple::OpenHOS || isOSLiteOS ();
744746 }
745747
748+ // / Tests whether the target is OHOS
749+ // / LiteOS default enviroment is also OHOS, but omited on triple.
750+ bool isOHOSFamily () const { return isOpenHOS () || isOSLiteOS (); }
751+
752+ bool isOpenHOS () const { return getEnvironment () == Triple::OpenHOS; }
753+
754+ bool isOSLiteOS () const { return getOS () == Triple::LiteOS; }
755+
746756 // / Tests whether the target is DXIL.
747757 bool isDXIL () const {
748758 return getArch () == Triple::dxil;
@@ -789,6 +799,7 @@ class Triple {
789799 getEnvironment () == Triple::MuslEABI ||
790800 getEnvironment () == Triple::EABIHF ||
791801 getEnvironment () == Triple::GNUEABIHF ||
802+ getEnvironment () == Triple::OpenHOS ||
792803 getEnvironment () == Triple::MuslEABIHF || isAndroid ()) &&
793804 isOSBinFormatELF ();
794805 }
0 commit comments