Visibility.h revision 218893
11553Srgrimes//===--- Visibility.h - Visibility enumeration and utilities ----*- C++ -*-===//
21553Srgrimes//
31553Srgrimes//                     The LLVM Compiler Infrastructure
41553Srgrimes//
51553Srgrimes// This file is distributed under the University of Illinois Open Source
61553Srgrimes// License. See LICENSE.TXT for details.
71553Srgrimes//
81553Srgrimes//===----------------------------------------------------------------------===//
91553Srgrimes//
101553Srgrimes// This file defines the Visibility enumeration and various utility
111553Srgrimes// functions.
121553Srgrimes//
131553Srgrimes//===----------------------------------------------------------------------===//
141553Srgrimes#ifndef LLVM_CLANG_BASIC_VISIBILITY_H
151553Srgrimes#define LLVM_CLANG_BASIC_VISIBILITY_H
161553Srgrimes
171553Srgrimesnamespace clang {
181553Srgrimes
191553Srgrimes/// \link Describes the different kinds of visibility that a
201553Srgrimes/// declaration may have.  Visibility determines how a declaration
211553Srgrimes/// interacts with the dynamic linker.  It may also affect whether the
221553Srgrimes/// symbol can be found by runtime symbol lookup APIs.
231553Srgrimes///
241553Srgrimes/// Visibility is not described in any language standard and
251553Srgrimes/// (nonetheless) sometimes has odd behavior.  Not all platforms
261553Srgrimes/// support all visibility kinds.
271553Srgrimesenum Visibility {
281553Srgrimes  /// Objects with "hidden" visibility are not seen by the dynamic
291553Srgrimes  /// linker.
301553Srgrimes  HiddenVisibility,
3130642Scharnier
321553Srgrimes  /// Objects with "protected" visibility are seen by the dynamic
3330642Scharnier  /// linker but always dynamically resolve to an object within this
3430642Scharnier  /// shared object.
3550479Speter  ProtectedVisibility,
361553Srgrimes
371553Srgrimes  /// Objects with "default" visibility are seen by the dynamic linker
381553Srgrimes  /// and act like normal objects.
391553Srgrimes  DefaultVisibility
401553Srgrimes};
411553Srgrimes
421553Srgrimesinline Visibility minVisibility(Visibility L, Visibility R) {
431553Srgrimes  return L < R ? L : R;
441553Srgrimes}
45246209Scharnier
461553Srgrimes}
471553Srgrimes
481553Srgrimes#endif // LLVM_CLANG_BASIC_VISIBILITY_H
491553Srgrimes