Home | History | Annotate | Download | only in Basic
      1 //===--- AddressSpaces.h - Language-specific address spaces -----*- 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 Provides definitions for the various language-specific address
     12 /// spaces.
     13 ///
     14 //===----------------------------------------------------------------------===//
     15 
     16 #ifndef LLVM_CLANG_BASIC_ADDRESSSPACES_H
     17 #define LLVM_CLANG_BASIC_ADDRESSSPACES_H
     18 
     19 namespace clang {
     20 
     21 namespace LangAS {
     22 
     23 /// \brief Defines the address space values used by the address space qualifier
     24 /// of QualType.
     25 ///
     26 enum ID {
     27   // The default value 0 is the value used in QualType for the the situation
     28   // where there is no address space qualifier. For most languages, this also
     29   // corresponds to the situation where there is no address space qualifier in
     30   // the source code, except for OpenCL, where the address space value 0 in
     31   // QualType represents private address space in OpenCL source code.
     32   Default = 0,
     33 
     34   // OpenCL specific address spaces.
     35   opencl_global,
     36   opencl_local,
     37   opencl_constant,
     38   opencl_generic,
     39 
     40   // CUDA specific address spaces.
     41   cuda_device,
     42   cuda_constant,
     43   cuda_shared,
     44 
     45   // This denotes the count of language-specific address spaces and also
     46   // the offset added to the target-specific address spaces, which are usually
     47   // specified by address space attributes __attribute__(address_space(n))).
     48   FirstTargetAddressSpace
     49 };
     50 
     51 /// The type of a lookup table which maps from language-specific address spaces
     52 /// to target-specific ones.
     53 typedef unsigned Map[FirstTargetAddressSpace];
     54 }
     55 
     56 }
     57 
     58 #endif
     59