1193326Sed//===--- Types.h - Input & Temporary Driver Types ---------------*- C++ -*-===// 2193326Sed// 3193326Sed// The LLVM Compiler Infrastructure 4193326Sed// 5193326Sed// This file is distributed under the University of Illinois Open Source 6193326Sed// License. See LICENSE.TXT for details. 7193326Sed// 8193326Sed//===----------------------------------------------------------------------===// 9193326Sed 10193326Sed#ifndef CLANG_DRIVER_TYPES_H_ 11193326Sed#define CLANG_DRIVER_TYPES_H_ 12193326Sed 13193326Sed#include "clang/Driver/Phases.h" 14249423Sdim#include "llvm/ADT/SmallVector.h" 15193326Sed 16193326Sednamespace clang { 17193326Sednamespace driver { 18193326Sednamespace types { 19193326Sed enum ID { 20193326Sed TY_INVALID, 21193326Sed#define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, FLAGS) TY_##ID, 22193326Sed#include "clang/Driver/Types.def" 23193326Sed#undef TYPE 24193326Sed TY_LAST 25193326Sed }; 26193326Sed 27239462Sdim /// getTypeName - Return the name of the type for \p Id. 28193326Sed const char *getTypeName(ID Id); 29193326Sed 30193326Sed /// getPreprocessedType - Get the ID of the type for this input when 31193326Sed /// it has been preprocessed, or INVALID if this input is not 32193326Sed /// preprocessed. 33193326Sed ID getPreprocessedType(ID Id); 34193326Sed 35193326Sed /// getTypeTempSuffix - Return the suffix to use when creating a 36193326Sed /// temp file of this type, or null if unspecified. 37193326Sed const char *getTypeTempSuffix(ID Id); 38193326Sed 39193326Sed /// onlyAssembleType - Should this type only be assembled. 40193326Sed bool onlyAssembleType(ID Id); 41193326Sed 42193326Sed /// onlyPrecompileType - Should this type only be precompiled. 43193326Sed bool onlyPrecompileType(ID Id); 44193326Sed 45193326Sed /// canTypeBeUserSpecified - Can this type be specified on the 46193326Sed /// command line (by the type name); this is used when forwarding 47193326Sed /// commands to gcc. 48193326Sed bool canTypeBeUserSpecified(ID Id); 49193326Sed 50193326Sed /// appendSuffixForType - When generating outputs of this type, 51193326Sed /// should the suffix be appended (instead of replacing the existing 52193326Sed /// suffix). 53193326Sed bool appendSuffixForType(ID Id); 54193326Sed 55193326Sed /// canLipoType - Is this type acceptable as the output of a 56193326Sed /// universal build (currently, just the Nothing, Image, and Object 57193326Sed /// types). 58193326Sed bool canLipoType(ID Id); 59193326Sed 60193326Sed /// isAcceptedByClang - Can clang handle this input type. 61193326Sed bool isAcceptedByClang(ID Id); 62193326Sed 63193326Sed /// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers). 64193326Sed bool isCXX(ID Id); 65193326Sed 66199482Srdivacky /// isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers). 67199482Srdivacky bool isObjC(ID Id); 68199482Srdivacky 69193326Sed /// lookupTypeForExtension - Lookup the type to use for the file 70239462Sdim /// extension \p Ext. 71193326Sed ID lookupTypeForExtension(const char *Ext); 72193326Sed 73193326Sed /// lookupTypeForTypSpecifier - Lookup the type to use for a user 74193326Sed /// specified type name. 75193326Sed ID lookupTypeForTypeSpecifier(const char *Name); 76193326Sed 77249423Sdim /// getCompilationPhases - Get the list of compilation phases ('Phases') to be 78249423Sdim /// done for type 'Id'. 79249423Sdim void getCompilationPhases( 80249423Sdim ID Id, 81249423Sdim llvm::SmallVector<phases::ID, phases::MaxNumberOfPhases> &Phases); 82193326Sed 83204643Srdivacky /// lookupCXXTypeForCType - Lookup CXX input type that corresponds to given 84204643Srdivacky /// C type (used for clang++ emulation of g++ behaviour) 85204643Srdivacky ID lookupCXXTypeForCType(ID Id); 86193326Sed 87193326Sed} // end namespace types 88193326Sed} // end namespace driver 89193326Sed} // end namespace clang 90193326Sed 91193326Sed#endif 92