1//===--- Types.h - Input & Temporary Driver Types ---------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef CLANG_DRIVER_TYPES_H_
11#define CLANG_DRIVER_TYPES_H_
12
13#include "clang/Driver/Phases.h"
14
15namespace clang {
16namespace driver {
17namespace types {
18  enum ID {
19    TY_INVALID,
20#define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, FLAGS) TY_##ID,
21#include "clang/Driver/Types.def"
22#undef TYPE
23    TY_LAST
24  };
25
26  /// getTypeName - Return the name of the type for \arg Id.
27  const char *getTypeName(ID Id);
28
29  /// getPreprocessedType - Get the ID of the type for this input when
30  /// it has been preprocessed, or INVALID if this input is not
31  /// preprocessed.
32  ID getPreprocessedType(ID Id);
33
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);
37
38  /// onlyAssembleType - Should this type only be assembled.
39  bool onlyAssembleType(ID Id);
40
41  /// onlyPrecompileType - Should this type only be precompiled.
42  bool onlyPrecompileType(ID Id);
43
44  /// canTypeBeUserSpecified - Can this type be specified on the
45  /// command line (by the type name); this is used when forwarding
46  /// commands to gcc.
47  bool canTypeBeUserSpecified(ID Id);
48
49  /// appendSuffixForType - When generating outputs of this type,
50  /// should the suffix be appended (instead of replacing the existing
51  /// suffix).
52  bool appendSuffixForType(ID Id);
53
54  /// canLipoType - Is this type acceptable as the output of a
55  /// universal build (currently, just the Nothing, Image, and Object
56  /// types).
57  bool canLipoType(ID Id);
58
59  /// isAcceptedByClang - Can clang handle this input type.
60  bool isAcceptedByClang(ID Id);
61
62  /// isOnlyAcceptedByClang - Is clang the only compiler that can handle this
63  /// input type.
64  bool isOnlyAcceptedByClang(ID Id);
65
66  /// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
67  bool isCXX(ID Id);
68
69  /// isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
70  bool isObjC(ID Id);
71
72  /// lookupTypeForExtension - Lookup the type to use for the file
73  /// extension \arg Ext.
74  ID lookupTypeForExtension(const char *Ext);
75
76  /// lookupTypeForTypSpecifier - Lookup the type to use for a user
77  /// specified type name.
78  ID lookupTypeForTypeSpecifier(const char *Name);
79
80  /// getNumCompilationPhases - Return the complete number of phases
81  /// to be done for this type.
82  unsigned getNumCompilationPhases(ID Id);
83
84  /// getCompilationPhase - Return the \args N th compilation phase to
85  /// be done for this type.
86  phases::ID getCompilationPhase(ID Id, unsigned N);
87
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);
91
92} // end namespace types
93} // end namespace driver
94} // end namespace clang
95
96#endif
97