types.def

Go to the documentation of this file.
00001 /* -*- Mode: c -*- */
00002 /*
00003  * Copyright (C) 2005, The EROS Group, LLC.
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or
00007  * without modification, are permitted provided that the following
00008  * conditions are met:
00009  *
00010  *   - Redistributions of source code must contain the above
00011  *     copyright notice, this list of conditions, and the following
00012  *     disclaimer.
00013  *
00014  *   - Redistributions in binary form must reproduce the above
00015  *     copyright notice, this list of conditions, and the following
00016  *     disclaimer in the documentation and/or other materials
00017  *     provided with the distribution.
00018  *
00019  *   - Neither the names of the copyright holders nor the names of any
00020  *     of any contributors may be used to endorse or promote products
00021  *     derived from this software without specific prior written
00022  *     permission.
00023  *
00024  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00025  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00026  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00027  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00028  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00029  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00030  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00031  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00032  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00033  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035  */
00036 
00037 //
00038 // PRIMARY: Whether this is a ground type in the BitC type system.
00039 //
00040 // CSIMPLE: Whether this is a non-composite type in the emitted C
00041 //          code. Includes all scalar primary types and (eventually)
00042 //          types that are represented as pointers
00043 //
00044 // ATOMIC   Primitive (non-composed values) SSA phase *was* using this
00045 // REF      True if the type is a reference type
00046 // PRIMINT   Primary integer type
00047 // PRIMFLOAT Primary floating point type
00048 //
00049 
00050 /*      NAME       PRIMARY CSIMPLE ATOMIC SCALAR REF    PRIMINT PRIMFLOAT*/
00051 DEFTYPE(unit,      true,   true,   true,  true,  false, false,  false)
00052 DEFTYPE(bool,      true,   true,   true,  true,  false, false,  false)
00053 DEFTYPE(char,      true,   true,   true,  true,  false, false,  false)
00054 DEFTYPE(word,      true,   true,   true,  true,  false, true,   false)
00055 DEFTYPE(int8,      true,   true,   true,  true,  false, true,   false)
00056 DEFTYPE(int16,     true,   true,   true,  true,  false, true,   false)
00057 DEFTYPE(int32,     true,   true,   true,  true,  false, true,   false)
00058 DEFTYPE(int64,     true,   true,   true,  true,  false, true,   false)
00059 DEFTYPE(uint8,     true,   true,   true,  true,  false, true,   false)
00060 DEFTYPE(uint16,    true,   true,   true,  true,  false, true,   false)
00061 DEFTYPE(uint32,    true,   true,   true,  true,  false, true,   false)
00062 DEFTYPE(uint64,    true,   true,   true,  true,  false, true,   false)
00063 DEFTYPE(float,     true,   true,   true,  true,  false, false,  true)
00064 DEFTYPE(double,    true,   true,   true,  true,  false, false,  true)
00065 DEFTYPE(quad,      true,   true,   true,  true,  false, false,  true)
00066 //Strings are considered scalars by special dispensation, because they
00067 //are immutable.
00068 DEFTYPE(string,    true,   true,   false, true,  true,  false,  false)
00069 
00070 //DEFTYPE(bitfield,  true,   false,  true,  false, false,  false)
00071 DEFTYPE(fn,        true,   false,  true,  true,  false, false,  false)
00072 DEFTYPE(method,    true,   false,  true,  true,  false, false,  false)
00073 DEFTYPE(tyfn,      true,   false,  true,  false, false, false,  false)
00074 DEFTYPE(uconv,     true,   false,  true,  false, false, false,  false)
00075 DEFTYPE(uconr,     true,   false,  false, false, true,  false,  false)
00076 
00077 DEFTYPE(tvar,      false,  false,  false, false, false, false,  false)
00078 DEFTYPE(fnarg,     false,  false,  false, false, false, false,  false)
00079 DEFTYPE(structv,   false,  false,  false, false, false, false,  false)
00080 DEFTYPE(structr,   false,  true,   false, false, true,  false,  false)
00081 DEFTYPE(objectv,   false,  false,  false, false, false, false,  false)
00082 DEFTYPE(objectr,   false,  true,   false, false, true,  false,  false)
00083 DEFTYPE(unionv,    false,  false,  false, false, false, false,  false)
00084 DEFTYPE(unionr,    false,  true,   false, false, true,  false,  false)
00085 DEFTYPE(uvalv,     false,  false,  false, false, false, false,  false)
00086 DEFTYPE(uvalr,     false,  true,   false, false, true,  false,  false)
00087 DEFTYPE(array,     false,  false,  false, false, false, false,  false)
00088 DEFTYPE(vector,    false,  false,  false, false, true,  false,  false)
00089 DEFTYPE(ref,       false,  true,   false, false, true,  false,  false)
00090 // by-ref is not actually used as a type. It is only present to qualify
00091 // at_byreftype since all ASTs must have a type. Since by-ref types
00092 // can only appear within argvecs, the by-ref-ness is marked on the
00093 // component-flags of ty_fnArgvec, and the ty_byref wrapper is
00094 // discarded henceforth.
00095 DEFTYPE(byref,     false,  true,   false, false, true,  false,  false)
00096 // array_ref is similar to by-ref, but for arrays.
00097 DEFTYPE(array_ref, false,  true,   false, false, true,  false,  false)
00098 DEFTYPE(mutable,   false,  false,  false, false, false, false,  false)
00099 DEFTYPE(const,     false,  false,  false, false, false, false,  false)
00100 DEFTYPE(mbTop,     false,  false,  false, false, false, false,  false)
00101 DEFTYPE(mbFull,    false,  false,  false, false, false, false,  false)
00102 DEFTYPE(exn,       false,  false,  false, false, true,  false,  false)
00103 DEFTYPE(dummy,     false,  false,  false, false, false, false,  false)
00104 DEFTYPE(field,     false,  false,  true,  false, false, false,  false)
00105 
00106 // The following, strictly speaking, are constraints, but are types at
00107 // the next level.
00108 DEFTYPE(typeclass, false,  false,  false, false, false, false,  false)
00109 // Meta polymorphic constraint (MPC)
00110 DEFTYPE(pcst, false,  false,  false, false, false, false,  false)
00111 // Kind variable for the MPC
00112 DEFTYPE(kvar, false,  false,  false, false, false, false,  false)
00113 // Fixed kinds for the MPC. The type-header has static types
00114 // to identify the two kinds (mono/poly) that can exist.
00115 DEFTYPE(kfix, false,  false,  false, false, false, false,  false)
00116 
00117 /* For internal use ONLY */
00118 //DEFTYPE(closure,   false,  false,  false, false, true,  false,  false)
00119 DEFTYPE(letGather, false,  false,  false, false, false, false,  false)
00120 
00121 #undef DEFTYPE
00122 
00123                                                                                 

Generated on Fri May 18 07:59:18 2012 for BitC Compiler by  doxygen 1.4.7