Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:53

0001 //===--- Types.h - Input & Temporary Driver Types ---------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_CLANG_DRIVER_TYPES_H
0010 #define LLVM_CLANG_DRIVER_TYPES_H
0011 
0012 #include "clang/Driver/Phases.h"
0013 #include "llvm/ADT/SmallVector.h"
0014 #include "llvm/Option/ArgList.h"
0015 
0016 namespace llvm {
0017 class StringRef;
0018 }
0019 namespace clang {
0020 namespace driver {
0021 class Driver;
0022 namespace types {
0023   enum ID {
0024     TY_INVALID,
0025 #define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, ...) TY_##ID,
0026 #include "clang/Driver/Types.def"
0027 #undef TYPE
0028     TY_LAST
0029   };
0030 
0031   /// getTypeName - Return the name of the type for \p Id.
0032   const char *getTypeName(ID Id);
0033 
0034   /// getPreprocessedType - Get the ID of the type for this input when
0035   /// it has been preprocessed, or INVALID if this input is not
0036   /// preprocessed.
0037   ID getPreprocessedType(ID Id);
0038 
0039   /// getPrecompiledType - Get the ID of the type for this input when
0040   /// it has been precompiled, or INVALID if this input is not
0041   /// precompiled.
0042   ID getPrecompiledType(ID Id);
0043 
0044   /// getTypeTempSuffix - Return the suffix to use when creating a
0045   /// temp file of this type, or null if unspecified.
0046   const char *getTypeTempSuffix(ID Id, bool CLStyle = false);
0047 
0048   /// onlyPrecompileType - Should this type only be precompiled.
0049   bool onlyPrecompileType(ID Id);
0050 
0051   /// canTypeBeUserSpecified - Can this type be specified on the
0052   /// command line (by the type name); this is used when forwarding
0053   /// commands to gcc.
0054   bool canTypeBeUserSpecified(ID Id);
0055 
0056   /// appendSuffixForType - When generating outputs of this type,
0057   /// should the suffix be appended (instead of replacing the existing
0058   /// suffix).
0059   bool appendSuffixForType(ID Id);
0060 
0061   /// canLipoType - Is this type acceptable as the output of a
0062   /// universal build (currently, just the Nothing, Image, and Object
0063   /// types).
0064   bool canLipoType(ID Id);
0065 
0066   /// isAcceptedByClang - Can clang handle this input type.
0067   bool isAcceptedByClang(ID Id);
0068 
0069   /// isAcceptedByFlang - Can flang handle this input type.
0070   bool isAcceptedByFlang(ID Id);
0071 
0072   /// isDerivedFromC - Is the input derived from C.
0073   ///
0074   /// That is, does the lexer follow the rules of
0075   /// TokenConcatenation::AvoidConcat. If this is the case, the preprocessor may
0076   /// add and remove whitespace between tokens. Used to determine whether the
0077   /// input can be processed by -fminimize-whitespace.
0078   bool isDerivedFromC(ID Id);
0079 
0080   /// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
0081   bool isCXX(ID Id);
0082 
0083   /// Is this LLVM IR.
0084   bool isLLVMIR(ID Id);
0085 
0086   /// isCuda - Is this a CUDA input.
0087   bool isCuda(ID Id);
0088 
0089   /// isHIP - Is this a HIP input.
0090   bool isHIP(ID Id);
0091 
0092   /// isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
0093   bool isObjC(ID Id);
0094 
0095   /// isOpenCL - Is this an "OpenCL" input.
0096   bool isOpenCL(ID Id);
0097 
0098   /// isHLSL - Is this an HLSL input.
0099   bool isHLSL(ID Id);
0100 
0101   /// isSrcFile - Is this a source file, i.e. something that still has to be
0102   /// preprocessed. The logic behind this is the same that decides if the first
0103   /// compilation phase is a preprocessing one.
0104   bool isSrcFile(ID Id);
0105 
0106   /// lookupTypeForExtension - Lookup the type to use for the file
0107   /// extension \p Ext.
0108   ID lookupTypeForExtension(llvm::StringRef Ext);
0109 
0110   /// lookupTypeForTypSpecifier - Lookup the type to use for a user
0111   /// specified type name.
0112   ID lookupTypeForTypeSpecifier(const char *Name);
0113 
0114   /// getCompilationPhases - Get the list of compilation phases ('Phases') to be
0115   /// done for type 'Id' up until including LastPhase.
0116   llvm::SmallVector<phases::ID, phases::MaxNumberOfPhases>
0117   getCompilationPhases(ID Id, phases::ID LastPhase = phases::IfsMerge);
0118   llvm::SmallVector<phases::ID, phases::MaxNumberOfPhases>
0119   getCompilationPhases(const clang::driver::Driver &Driver,
0120                        llvm::opt::DerivedArgList &DAL, ID Id);
0121 
0122   /// lookupCXXTypeForCType - Lookup CXX input type that corresponds to given
0123   /// C type (used for clang++ emulation of g++ behaviour)
0124   ID lookupCXXTypeForCType(ID Id);
0125 
0126   /// Lookup header file input type that corresponds to given
0127   /// source file type (used for clang-cl emulation of \Yc).
0128   ID lookupHeaderTypeForSourceType(ID Id);
0129 
0130 } // end namespace types
0131 } // end namespace driver
0132 } // end namespace clang
0133 
0134 #endif