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 \arg 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 /// isOnlyAcceptedByClang - Is clang the only compiler that can handle this
64 bool isOnlyAcceptedByClang(ID Id);
66 /// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
69 /// isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
72 /// lookupTypeForExtension - Lookup the type to use for the file
73 /// extension \arg Ext.
74 ID lookupTypeForExtension(const char *Ext);
76 /// lookupTypeForTypSpecifier - Lookup the type to use for a user
77 /// specified type name.
78 ID lookupTypeForTypeSpecifier(const char *Name);
80 /// getNumCompilationPhases - Return the complete number of phases
81 /// to be done for this type.
82 unsigned getNumCompilationPhases(ID Id);
84 /// getCompilationPhase - Return the \args N th compilation phase to
85 /// be done for this type.
86 phases::ID getCompilationPhase(ID Id, unsigned N);
88 /// lookupCXXTypeForCType - Lookup CXX input type that corresponds to given
89 /// C type (used for clang++ emulation of g++ behaviour)
90 ID lookupCXXTypeForCType(ID Id);
92 } // end namespace types
93 } // end namespace driver
94 } // end namespace clang