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"
24 #define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, FLAGS) TY_##ID,
25 #include "clang/Driver/Types.def"
30 /// getTypeName - Return the name of the type for \p Id.
31 const char *getTypeName(ID Id);
33 /// getPreprocessedType - Get the ID of the type for this input when
34 /// it has been preprocessed, or INVALID if this input is not
36 ID getPreprocessedType(ID Id);
38 /// getPrecompiledType - Get the ID of the type for this input when
39 /// it has been precompiled, or INVALID if this input is not
41 ID getPrecompiledType(ID Id);
43 /// getTypeTempSuffix - Return the suffix to use when creating a
44 /// temp file of this type, or null if unspecified.
45 const char *getTypeTempSuffix(ID Id, bool CLMode = false);
47 /// onlyAssembleType - Should this type only be assembled.
48 bool onlyAssembleType(ID Id);
50 /// onlyPrecompileType - Should this type only be precompiled.
51 bool onlyPrecompileType(ID Id);
53 /// canTypeBeUserSpecified - Can this type be specified on the
54 /// command line (by the type name); this is used when forwarding
56 bool canTypeBeUserSpecified(ID Id);
58 /// appendSuffixForType - When generating outputs of this type,
59 /// should the suffix be appended (instead of replacing the existing
61 bool appendSuffixForType(ID Id);
63 /// canLipoType - Is this type acceptable as the output of a
64 /// universal build (currently, just the Nothing, Image, and Object
66 bool canLipoType(ID Id);
68 /// isAcceptedByClang - Can clang handle this input type.
69 bool isAcceptedByClang(ID Id);
71 /// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
77 /// isCuda - Is this a CUDA input.
80 /// isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
83 /// isSrcFile - Is this a source file, i.e. something that still has to be
84 /// preprocessed. The logic behind this is the same that decides if the first
85 /// compilation phase is a preprocessing one.
86 bool isSrcFile(ID Id);
88 /// lookupTypeForExtension - Lookup the type to use for the file
90 ID lookupTypeForExtension(llvm::StringRef Ext);
92 /// lookupTypeForTypSpecifier - Lookup the type to use for a user
93 /// specified type name.
94 ID lookupTypeForTypeSpecifier(const char *Name);
96 /// getCompilationPhases - Get the list of compilation phases ('Phases') to be
97 /// done for type 'Id'.
98 void getCompilationPhases(
100 llvm::SmallVectorImpl<phases::ID> &Phases);
102 /// lookupCXXTypeForCType - Lookup CXX input type that corresponds to given
103 /// C type (used for clang++ emulation of g++ behaviour)
104 ID lookupCXXTypeForCType(ID Id);
106 /// Lookup header file input type that corresponds to given
107 /// source file type (used for clang-cl emulation of \Yc).
108 ID lookupHeaderTypeForSourceType(ID Id);
110 } // end namespace types
111 } // end namespace driver
112 } // end namespace clang