1//===--- Visibility.h - Visibility enumeration and utilities ----*- 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/// \file
11/// \brief Defines the clang::Visibility enumeration and various utility
12/// functions.
13///
14//===----------------------------------------------------------------------===//
15#ifndef LLVM_CLANG_BASIC_VISIBILITY_H
16#define LLVM_CLANG_BASIC_VISIBILITY_H
17
18namespace clang {
19
20/// \brief Describes the different kinds of visibility that a declaration
21/// may have.
22///
23/// Visibility determines how a declaration interacts with the dynamic
24/// linker.  It may also affect whether the symbol can be found by runtime
25/// symbol lookup APIs.
26///
27/// Visibility is not described in any language standard and
28/// (nonetheless) sometimes has odd behavior.  Not all platforms
29/// support all visibility kinds.
30enum Visibility {
31  /// Objects with "hidden" visibility are not seen by the dynamic
32  /// linker.
33  HiddenVisibility,
34
35  /// Objects with "protected" visibility are seen by the dynamic
36  /// linker but always dynamically resolve to an object within this
37  /// shared object.
38  ProtectedVisibility,
39
40  /// Objects with "default" visibility are seen by the dynamic linker
41  /// and act like normal objects.
42  DefaultVisibility
43};
44
45inline Visibility minVisibility(Visibility L, Visibility R) {
46  return L < R ? L : R;
47}
48
49}
50
51#endif // LLVM_CLANG_BASIC_VISIBILITY_H
52