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 CLANG_DRIVER_TYPES_H_
11 #define CLANG_DRIVER_TYPES_H_
13 #include "clang/Driver/Phases.h"
20 #define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, FLAGS) TY_##ID,
21 #include "clang/Driver/Types.def"
26 /// getTypeName - Return the name of the type for \p Id.
27 const char *getTypeName(ID Id);
29 /// getPreprocessedType - Get the ID of the type for this input when
30 /// it has been preprocessed, or INVALID if this input is not
32 ID getPreprocessedType(ID Id);
34 /// getTypeTempSuffix - Return the suffix to use when creating a
35 /// temp file of this type, or null if unspecified.
36 const char *getTypeTempSuffix(ID Id);
38 /// onlyAssembleType - Should this type only be assembled.
39 bool onlyAssembleType(ID Id);
41 /// onlyPrecompileType - Should this type only be precompiled.
42 bool onlyPrecompileType(ID Id);
44 /// canTypeBeUserSpecified - Can this type be specified on the
45 /// command line (by the type name); this is used when forwarding
47 bool canTypeBeUserSpecified(ID Id);
49 /// appendSuffixForType - When generating outputs of this type,
50 /// should the suffix be appended (instead of replacing the existing
52 bool appendSuffixForType(ID Id);
54 /// canLipoType - Is this type acceptable as the output of a
55 /// universal build (currently, just the Nothing, Image, and Object
57 bool canLipoType(ID Id);
59 /// isAcceptedByClang - Can clang handle this input type.
60 bool isAcceptedByClang(ID Id);
62 /// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
65 /// isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
68 /// lookupTypeForExtension - Lookup the type to use for the file
70 ID lookupTypeForExtension(const char *Ext);
72 /// lookupTypeForTypSpecifier - Lookup the type to use for a user
73 /// specified type name.
74 ID lookupTypeForTypeSpecifier(const char *Name);
76 /// getNumCompilationPhases - Return the complete number of phases
77 /// to be done for this type.
78 unsigned getNumCompilationPhases(ID Id);
80 /// getCompilationPhase - Return the \p N th compilation phase to
81 /// be done for this type.
82 phases::ID getCompilationPhase(ID Id, unsigned N);
84 /// lookupCXXTypeForCType - Lookup CXX input type that corresponds to given
85 /// C type (used for clang++ emulation of g++ behaviour)
86 ID lookupCXXTypeForCType(ID Id);
88 } // end namespace types
89 } // end namespace driver
90 } // end namespace clang