clang API Documentation
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 LLVM_CLANG_DRIVER_TYPES_H 00011 #define LLVM_CLANG_DRIVER_TYPES_H 00012 00013 #include "clang/Driver/Phases.h" 00014 #include "llvm/ADT/SmallVector.h" 00015 00016 namespace clang { 00017 namespace driver { 00018 namespace types { 00019 enum ID { 00020 TY_INVALID, 00021 #define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, FLAGS) TY_##ID, 00022 #include "clang/Driver/Types.def" 00023 #undef TYPE 00024 TY_LAST 00025 }; 00026 00027 /// getTypeName - Return the name of the type for \p Id. 00028 const char *getTypeName(ID Id); 00029 00030 /// getPreprocessedType - Get the ID of the type for this input when 00031 /// it has been preprocessed, or INVALID if this input is not 00032 /// preprocessed. 00033 ID getPreprocessedType(ID Id); 00034 00035 /// getTypeTempSuffix - Return the suffix to use when creating a 00036 /// temp file of this type, or null if unspecified. 00037 const char *getTypeTempSuffix(ID Id, bool CLMode = false); 00038 00039 /// onlyAssembleType - Should this type only be assembled. 00040 bool onlyAssembleType(ID Id); 00041 00042 /// onlyPrecompileType - Should this type only be precompiled. 00043 bool onlyPrecompileType(ID Id); 00044 00045 /// canTypeBeUserSpecified - Can this type be specified on the 00046 /// command line (by the type name); this is used when forwarding 00047 /// commands to gcc. 00048 bool canTypeBeUserSpecified(ID Id); 00049 00050 /// appendSuffixForType - When generating outputs of this type, 00051 /// should the suffix be appended (instead of replacing the existing 00052 /// suffix). 00053 bool appendSuffixForType(ID Id); 00054 00055 /// canLipoType - Is this type acceptable as the output of a 00056 /// universal build (currently, just the Nothing, Image, and Object 00057 /// types). 00058 bool canLipoType(ID Id); 00059 00060 /// isAcceptedByClang - Can clang handle this input type. 00061 bool isAcceptedByClang(ID Id); 00062 00063 /// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers). 00064 bool isCXX(ID Id); 00065 00066 /// isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers). 00067 bool isObjC(ID Id); 00068 00069 /// lookupTypeForExtension - Lookup the type to use for the file 00070 /// extension \p Ext. 00071 ID lookupTypeForExtension(const char *Ext); 00072 00073 /// lookupTypeForTypSpecifier - Lookup the type to use for a user 00074 /// specified type name. 00075 ID lookupTypeForTypeSpecifier(const char *Name); 00076 00077 /// getCompilationPhases - Get the list of compilation phases ('Phases') to be 00078 /// done for type 'Id'. 00079 void getCompilationPhases( 00080 ID Id, 00081 llvm::SmallVectorImpl<phases::ID> &Phases); 00082 00083 /// lookupCXXTypeForCType - Lookup CXX input type that corresponds to given 00084 /// C type (used for clang++ emulation of g++ behaviour) 00085 ID lookupCXXTypeForCType(ID Id); 00086 00087 } // end namespace types 00088 } // end namespace driver 00089 } // end namespace clang 00090 00091 #endif