Author: tberghammer Date: Wed Oct 14 05:29:17 2015 New Revision: 250286 URL: http://llvm.org/viewvc/llvm-project?rev=250286&view=rev Log: Make use of lldv::Triple::isAndroid
It is a new function added to the llvm::Triple class to simplify the checking if we are targeting android to clean up the confusion between android being an OS or an environment. Modified: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp Modified: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp?rev=250286&r1=250285&r2=250286&view=diff ============================================================================== --- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp (original) +++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp Wed Oct 14 05:29:17 2015 @@ -291,19 +291,13 @@ DYLDRendezvous::SOEntryIsMainExecutable( // FreeBSD and on Android it is the full path to the executable. auto triple = m_process->GetTarget().GetArchitecture().GetTriple(); - auto os_type = triple.getOS(); - auto env_type = triple.getEnvironment(); - - switch (os_type) { + switch (triple.getOS()) { case llvm::Triple::FreeBSD: return entry.file_spec == m_exe_file_spec; case llvm::Triple::Linux: - switch (env_type) { - case llvm::Triple::Android: - return entry.file_spec == m_exe_file_spec; - default: - return !entry.file_spec; - } + if (triple.isAndroid()) + return entry.file_spec == m_exe_file_spec; + return !entry.file_spec; default: return false; } @@ -381,7 +375,7 @@ isLoadBiasIncorrect(Target& target, cons // On Android L (API 21, 22) the load address of the "/system/bin/linker" isn't filled in // correctly. uint32_t os_major = 0, os_minor = 0, os_update = 0; - if (target.GetArchitecture().GetTriple().getEnvironment() == llvm::Triple::Android && + if (target.GetArchitecture().GetTriple().isAndroid() && target.GetPlatform()->GetOSVersion(os_major, os_minor, os_update) && (os_major == 21 || os_major == 22) && (file_path == "/system/bin/linker" || file_path == "/system/bin/linker64")) Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=250286&r1=250285&r2=250286&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Wed Oct 14 05:29:17 2015 @@ -290,7 +290,7 @@ EmulateInstructionARM::GetRegisterInfo ( uint32_t EmulateInstructionARM::GetFramePointerRegisterNumber () const { - if (m_arch.GetTriple().getEnvironment() == llvm::Triple::Android) + if (m_arch.GetTriple().isAndroid()) return LLDB_INVALID_REGNUM; // Don't use frame pointer on android bool is_apple = false; Modified: lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp?rev=250286&r1=250285&r2=250286&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp Wed Oct 14 05:29:17 2015 @@ -405,7 +405,7 @@ EmulateInstructionARM64::CreateFunctionE uint32_t EmulateInstructionARM64::GetFramePointerRegisterNumber () const { - if (m_arch.GetTriple().getEnvironment() == llvm::Triple::Android) + if (m_arch.GetTriple().isAndroid()) return LLDB_INVALID_REGNUM; // Don't use frame pointer on android return arm64_dwarf::sp; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits