]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Host/HostInfo.h
Merge clang 7.0.1 and several follow-up changes
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Host / HostInfo.h
1 //===-- HostInfoBase.h ------------------------------------------*- 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 #ifndef lldb_Host_HostInfo_h_
11 #define lldb_Host_HostInfo_h_
12
13 //----------------------------------------------------------------------
14 /// @class HostInfo HostInfo.h "lldb/Host/HostInfo.h"
15 /// A class that provides host computer information.
16 ///
17 /// HostInfo is a class that answers information about the host operating
18 /// system.  Note that HostInfo is NOT intended to be used to manipulate or
19 /// control the operating system.
20 ///
21 /// HostInfo is implemented in an OS-specific class (for example
22 /// HostInfoWindows) in a separate file, and then typedefed to HostInfo here.
23 /// Users of the class reference it as HostInfo::method().
24 ///
25 /// Not all hosts provide the same functionality.  It is important that
26 /// methods only be implemented at the lowest level at which they make sense.
27 /// It should be up to the clients of the class to ensure that they not
28 /// attempt to call a method which doesn't make sense for a particular
29 /// platform.  For example, when implementing a method that only makes sense
30 /// on a posix-compliant system, implement it on HostInfoPosix, and not on
31 /// HostInfoBase with a default implementation.  This way, users of HostInfo
32 /// are required to think about the implications of calling a particular
33 /// method and if used in a context where the method doesn't make sense, will
34 /// generate a compiler error.
35 ///
36 //----------------------------------------------------------------------
37
38 #if defined(_WIN32)
39 #include "lldb/Host/windows/HostInfoWindows.h"
40 #define HOST_INFO_TYPE HostInfoWindows
41 #elif defined(__linux__)
42 #if defined(__ANDROID__)
43 #include "lldb/Host/android/HostInfoAndroid.h"
44 #define HOST_INFO_TYPE HostInfoAndroid
45 #else
46 #include "lldb/Host/linux/HostInfoLinux.h"
47 #define HOST_INFO_TYPE HostInfoLinux
48 #endif
49 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
50 #include "lldb/Host/freebsd/HostInfoFreeBSD.h"
51 #define HOST_INFO_TYPE HostInfoFreeBSD
52 #elif defined(__NetBSD__)
53 #include "lldb/Host/netbsd/HostInfoNetBSD.h"
54 #define HOST_INFO_TYPE HostInfoNetBSD
55 #elif defined(__OpenBSD__)
56 #include "lldb/Host/openbsd/HostInfoOpenBSD.h"
57 #define HOST_INFO_TYPE HostInfoOpenBSD
58 #elif defined(__APPLE__)
59 #include "lldb/Host/macosx/HostInfoMacOSX.h"
60 #define HOST_INFO_TYPE HostInfoMacOSX
61 #else
62 #include "lldb/Host/posix/HostInfoPosix.h"
63 #define HOST_INFO_TYPE HostInfoPosix
64 #endif
65
66 namespace lldb_private {
67 typedef HOST_INFO_TYPE HostInfo;
68 }
69
70 #undef HOST_INFO_TYPE
71
72 #endif