clang  3.7.0
Types.h
Go to the documentation of this file.
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 LLVM_CLANG_DRIVER_TYPES_H
11 #define LLVM_CLANG_DRIVER_TYPES_H
12 
13 #include "clang/Driver/Phases.h"
14 #include "llvm/ADT/SmallVector.h"
15 
16 namespace clang {
17 namespace driver {
18 namespace types {
19  enum ID {
21 #define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, FLAGS) TY_##ID,
22 #include "clang/Driver/Types.def"
23 #undef TYPE
25  };
26 
27  /// getTypeName - Return the name of the type for \p Id.
28  const char *getTypeName(ID Id);
29 
30  /// getPreprocessedType - Get the ID of the type for this input when
31  /// it has been preprocessed, or INVALID if this input is not
32  /// preprocessed.
34 
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);
38 
39  /// onlyAssembleType - Should this type only be assembled.
40  bool onlyAssembleType(ID Id);
41 
42  /// onlyPrecompileType - Should this type only be precompiled.
43  bool onlyPrecompileType(ID Id);
44 
45  /// canTypeBeUserSpecified - Can this type be specified on the
46  /// command line (by the type name); this is used when forwarding
47  /// commands to gcc.
48  bool canTypeBeUserSpecified(ID Id);
49 
50  /// appendSuffixForType - When generating outputs of this type,
51  /// should the suffix be appended (instead of replacing the existing
52  /// suffix).
53  bool appendSuffixForType(ID Id);
54 
55  /// canLipoType - Is this type acceptable as the output of a
56  /// universal build (currently, just the Nothing, Image, and Object
57  /// types).
58  bool canLipoType(ID Id);
59 
60  /// isAcceptedByClang - Can clang handle this input type.
61  bool isAcceptedByClang(ID Id);
62 
63  /// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
64  bool isCXX(ID Id);
65 
66  /// isCuda - Is this a CUDA input.
67  bool isCuda(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 \p 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  /// getCompilationPhases - Get the list of compilation phases ('Phases') to be
81  /// done for type 'Id'.
83  ID Id,
85 
86  /// lookupCXXTypeForCType - Lookup CXX input type that corresponds to given
87  /// C type (used for clang++ emulation of g++ behaviour)
89 
90 } // end namespace types
91 } // end namespace driver
92 } // end namespace clang
93 
94 #endif
ID lookupTypeForExtension(const char *Ext)
Definition: Types.cpp:143
bool canLipoType(ID Id)
Definition: Types.cpp:73
const char * getTypeTempSuffix(ID Id, bool CLMode=false)
Definition: Types.cpp:47
bool onlyAssembleType(ID Id)
onlyAssembleType - Should this type only be assembled.
Definition: Types.cpp:57
bool canTypeBeUserSpecified(ID Id)
Definition: Types.cpp:65
ID lookupCXXTypeForCType(ID Id)
Definition: Types.cpp:235
ID getPreprocessedType(ID Id)
Definition: Types.cpp:43
const char * getTypeName(ID Id)
getTypeName - Return the name of the type for Id.
Definition: Types.cpp:39
void getCompilationPhases(ID Id, llvm::SmallVectorImpl< phases::ID > &Phases)
Definition: Types.cpp:209
bool isCuda(ID Id)
isCuda - Is this a CUDA input.
Definition: Types.cpp:131
bool isAcceptedByClang(ID Id)
isAcceptedByClang - Can clang handle this input type.
Definition: Types.cpp:80
bool isCXX(ID Id)
isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
Definition: Types.cpp:117
bool onlyPrecompileType(ID Id)
onlyPrecompileType - Should this type only be precompiled.
Definition: Types.cpp:61
bool appendSuffixForType(ID Id)
Definition: Types.cpp:69
ID lookupTypeForTypeSpecifier(const char *Name)
Definition: Types.cpp:197
bool isObjC(ID Id)
isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
Definition: Types.cpp:104