1 //===-- CommandOptionValidators.cpp -----------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "lldb/Interpreter/CommandOptionValidators.h" 11 12 #include "lldb/Interpreter/CommandInterpreter.h" 13 #include "lldb/Target/Platform.h" 14 15 using namespace lldb; 16 using namespace lldb_private; 17 18 bool PosixPlatformCommandOptionValidator::IsValid( 19 Platform &platform, const ExecutionContext &target) const { 20 llvm::Triple::OSType os = 21 platform.GetSystemArchitecture().GetTriple().getOS(); 22 switch (os) { 23 // Are there any other platforms that are not POSIX-compatible? 24 case llvm::Triple::Win32: 25 return false; 26 default: 27 return true; 28 } 29 } 30 31 const char *PosixPlatformCommandOptionValidator::ShortConditionString() const { 32 return "POSIX"; 33 } 34 35 const char *PosixPlatformCommandOptionValidator::LongConditionString() const { 36 return "Option only valid for POSIX-compliant hosts."; 37 } 38