clang API Documentation

Types.h
Go to the documentation of this file.
00001 //===--- Types.h - Input & Temporary Driver Types ---------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #ifndef CLANG_DRIVER_TYPES_H_
00011 #define CLANG_DRIVER_TYPES_H_
00012 
00013 #include "clang/Driver/Phases.h"
00014 
00015 namespace clang {
00016 namespace driver {
00017 namespace types {
00018   enum ID {
00019     TY_INVALID,
00020 #define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, FLAGS) TY_##ID,
00021 #include "clang/Driver/Types.def"
00022 #undef TYPE
00023     TY_LAST
00024   };
00025 
00026   /// getTypeName - Return the name of the type for \arg Id.
00027   const char *getTypeName(ID Id);
00028 
00029   /// getPreprocessedType - Get the ID of the type for this input when
00030   /// it has been preprocessed, or INVALID if this input is not
00031   /// preprocessed.
00032   ID getPreprocessedType(ID Id);
00033 
00034   /// getTypeTempSuffix - Return the suffix to use when creating a
00035   /// temp file of this type, or null if unspecified.
00036   const char *getTypeTempSuffix(ID Id);
00037 
00038   /// onlyAssembleType - Should this type only be assembled.
00039   bool onlyAssembleType(ID Id);
00040 
00041   /// onlyPrecompileType - Should this type only be precompiled.
00042   bool onlyPrecompileType(ID Id);
00043 
00044   /// canTypeBeUserSpecified - Can this type be specified on the
00045   /// command line (by the type name); this is used when forwarding
00046   /// commands to gcc.
00047   bool canTypeBeUserSpecified(ID Id);
00048 
00049   /// appendSuffixForType - When generating outputs of this type,
00050   /// should the suffix be appended (instead of replacing the existing
00051   /// suffix).
00052   bool appendSuffixForType(ID Id);
00053 
00054   /// canLipoType - Is this type acceptable as the output of a
00055   /// universal build (currently, just the Nothing, Image, and Object
00056   /// types).
00057   bool canLipoType(ID Id);
00058 
00059   /// isAcceptedByClang - Can clang handle this input type.
00060   bool isAcceptedByClang(ID Id);
00061 
00062   /// isOnlyAcceptedByClang - Is clang the only compiler that can handle this
00063   /// input type.
00064   bool isOnlyAcceptedByClang(ID Id);
00065 
00066   /// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
00067   bool isCXX(ID Id);
00068 
00069   /// isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
00070   bool isObjC(ID Id);
00071 
00072   /// lookupTypeForExtension - Lookup the type to use for the file
00073   /// extension \arg Ext.
00074   ID lookupTypeForExtension(const char *Ext);
00075 
00076   /// lookupTypeForTypSpecifier - Lookup the type to use for a user
00077   /// specified type name.
00078   ID lookupTypeForTypeSpecifier(const char *Name);
00079 
00080   /// getNumCompilationPhases - Return the complete number of phases
00081   /// to be done for this type.
00082   unsigned getNumCompilationPhases(ID Id);
00083 
00084   /// getCompilationPhase - Return the \args N th compilation phase to
00085   /// be done for this type.
00086   phases::ID getCompilationPhase(ID Id, unsigned N);
00087   
00088   /// lookupCXXTypeForCType - Lookup CXX input type that corresponds to given
00089   /// C type (used for clang++ emulation of g++ behaviour)
00090   ID lookupCXXTypeForCType(ID Id);
00091 
00092 } // end namespace types
00093 } // end namespace driver
00094 } // end namespace clang
00095 
00096 #endif