1 //===--- Types.h - Input & Temporary Driver Types ---------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_DRIVER_TYPES_H
11 #define LLVM_CLANG_DRIVER_TYPES_H
13 #include "clang/Driver/Phases.h"
14 #include "llvm/ADT/SmallVector.h"
21 #define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, FLAGS) TY_##ID,
22 #include "clang/Driver/Types.def"
27 /// getTypeName - Return the name of the type for \p Id.
28 const char *getTypeName(ID Id);
30 /// getPreprocessedType - Get the ID of the type for this input when
31 /// it has been preprocessed, or INVALID if this input is not
33 ID getPreprocessedType(ID Id);
35 /// getTypeTempSuffix - Return the suffix to use when creating a
36 /// temp file of this type, or null if unspecified.
37 const char *getTypeTempSuffix(ID Id, bool CLMode = false);
39 /// onlyAssembleType - Should this type only be assembled.
40 bool onlyAssembleType(ID Id);
42 /// onlyPrecompileType - Should this type only be precompiled.
43 bool onlyPrecompileType(ID Id);
45 /// canTypeBeUserSpecified - Can this type be specified on the
46 /// command line (by the type name); this is used when forwarding
48 bool canTypeBeUserSpecified(ID Id);
50 /// appendSuffixForType - When generating outputs of this type,
51 /// should the suffix be appended (instead of replacing the existing
53 bool appendSuffixForType(ID Id);
55 /// canLipoType - Is this type acceptable as the output of a
56 /// universal build (currently, just the Nothing, Image, and Object
58 bool canLipoType(ID Id);
60 /// isAcceptedByClang - Can clang handle this input type.
61 bool isAcceptedByClang(ID Id);
63 /// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
69 /// isCuda - Is this a CUDA input.
72 /// isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
75 /// lookupTypeForExtension - Lookup the type to use for the file
77 ID lookupTypeForExtension(const char *Ext);
79 /// lookupTypeForTypSpecifier - Lookup the type to use for a user
80 /// specified type name.
81 ID lookupTypeForTypeSpecifier(const char *Name);
83 /// getCompilationPhases - Get the list of compilation phases ('Phases') to be
84 /// done for type 'Id'.
85 void getCompilationPhases(
87 llvm::SmallVectorImpl<phases::ID> &Phases);
89 /// lookupCXXTypeForCType - Lookup CXX input type that corresponds to given
90 /// C type (used for clang++ emulation of g++ behaviour)
91 ID lookupCXXTypeForCType(ID Id);
93 } // end namespace types
94 } // end namespace driver
95 } // end namespace clang