Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 1 | //===--- CodeGenTypes.h - Type translation for LLVM CodeGen -----*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 0bc735f | 2007-12-29 19:59:25 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 10 | // This is the code that handles AST -> LLVM type lowering. |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Chris Lattner | ef52a2f | 2008-02-29 17:10:38 +0000 | [diff] [blame] | 14 | #ifndef CLANG_CODEGEN_CODEGENTYPES_H |
| 15 | #define CLANG_CODEGEN_CODEGENTYPES_H |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 16 | |
Chris Lattner | 800588f | 2010-07-29 06:26:06 +0000 | [diff] [blame] | 17 | #include "CGCall.h" |
| 18 | #include "GlobalDecl.h" |
Owen Anderson | 47a434f | 2009-08-05 23:18:46 +0000 | [diff] [blame] | 19 | #include "llvm/Module.h" |
Anders Carlsson | c9e2091 | 2007-08-21 00:21:21 +0000 | [diff] [blame] | 20 | #include "llvm/ADT/DenseMap.h" |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 21 | #include <vector> |
| 22 | |
| 23 | namespace llvm { |
Daniel Dunbar | 45c25ba | 2008-09-10 04:01:49 +0000 | [diff] [blame] | 24 | class FunctionType; |
Anders Carlsson | 4e53328 | 2007-08-17 22:00:32 +0000 | [diff] [blame] | 25 | class Module; |
Chris Lattner | fce71b8 | 2008-04-03 05:50:42 +0000 | [diff] [blame] | 26 | class OpaqueType; |
Devang Patel | 30ec997 | 2007-10-25 18:32:36 +0000 | [diff] [blame] | 27 | class PATypeHolder; |
Devang Patel | 7a4718e | 2007-10-31 20:01:01 +0000 | [diff] [blame] | 28 | class TargetData; |
Daniel Dunbar | 45c25ba | 2008-09-10 04:01:49 +0000 | [diff] [blame] | 29 | class Type; |
Benjamin Kramer | f21efe9 | 2009-08-11 17:46:57 +0000 | [diff] [blame] | 30 | class LLVMContext; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | namespace clang { |
Daniel Dunbar | 6b1da0e | 2008-10-13 17:02:26 +0000 | [diff] [blame] | 34 | class ABIInfo; |
Chris Lattner | d2d2a11 | 2007-07-14 01:29:45 +0000 | [diff] [blame] | 35 | class ASTContext; |
John McCall | ead608a | 2010-02-26 00:48:12 +0000 | [diff] [blame] | 36 | template <typename> class CanQual; |
Anders Carlsson | f6c56e2 | 2009-11-25 03:15:49 +0000 | [diff] [blame] | 37 | class CXXConstructorDecl; |
| 38 | class CXXDestructorDecl; |
Anders Carlsson | f6f8ae5 | 2009-04-03 22:48:58 +0000 | [diff] [blame] | 39 | class CXXMethodDecl; |
Devang Patel | b1e3989 | 2007-10-23 23:26:46 +0000 | [diff] [blame] | 40 | class FieldDecl; |
Douglas Gregor | 72564e7 | 2009-02-26 23:50:07 +0000 | [diff] [blame] | 41 | class FunctionProtoType; |
Chris Lattner | 391d77a | 2008-03-30 23:03:07 +0000 | [diff] [blame] | 42 | class ObjCInterfaceDecl; |
| 43 | class ObjCIvarDecl; |
Daniel Dunbar | 45c25ba | 2008-09-10 04:01:49 +0000 | [diff] [blame] | 44 | class PointerType; |
| 45 | class QualType; |
| 46 | class RecordDecl; |
| 47 | class TagDecl; |
| 48 | class TargetInfo; |
| 49 | class Type; |
John McCall | ead608a | 2010-02-26 00:48:12 +0000 | [diff] [blame] | 50 | typedef CanQual<Type> CanQualType; |
Devang Patel | b84a06e | 2007-10-23 02:10:49 +0000 | [diff] [blame] | 51 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 52 | namespace CodeGen { |
John McCall | f16aa10 | 2010-08-22 21:01:12 +0000 | [diff] [blame] | 53 | class CGCXXABI; |
Daniel Dunbar | 2924ade | 2010-03-30 22:26:10 +0000 | [diff] [blame] | 54 | class CGRecordLayout; |
Devang Patel | b84a06e | 2007-10-23 02:10:49 +0000 | [diff] [blame] | 55 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 56 | /// CodeGenTypes - This class organizes the cross-module state that is used |
| 57 | /// while lowering AST types to LLVM types. |
| 58 | class CodeGenTypes { |
Chris Lattner | d2d2a11 | 2007-07-14 01:29:45 +0000 | [diff] [blame] | 59 | ASTContext &Context; |
Daniel Dunbar | 444be73 | 2009-11-13 05:51:54 +0000 | [diff] [blame] | 60 | const TargetInfo &Target; |
Anders Carlsson | 4e53328 | 2007-08-17 22:00:32 +0000 | [diff] [blame] | 61 | llvm::Module& TheModule; |
Devang Patel | 7a4718e | 2007-10-31 20:01:01 +0000 | [diff] [blame] | 62 | const llvm::TargetData& TheTargetData; |
Anton Korobeynikov | 82d0a41 | 2010-01-10 12:58:08 +0000 | [diff] [blame] | 63 | const ABIInfo& TheABIInfo; |
John McCall | f16aa10 | 2010-08-22 21:01:12 +0000 | [diff] [blame] | 64 | CGCXXABI &TheCXXABI; |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 65 | |
Daniel Dunbar | 6aeae7f | 2009-02-26 19:48:14 +0000 | [diff] [blame] | 66 | llvm::SmallVector<std::pair<QualType, |
Chris Lattner | fce71b8 | 2008-04-03 05:50:42 +0000 | [diff] [blame] | 67 | llvm::OpaqueType *>, 8> PointersToResolve; |
| 68 | |
Daniel Dunbar | efb6d0d | 2008-09-06 02:26:43 +0000 | [diff] [blame] | 69 | llvm::DenseMap<const Type*, llvm::PATypeHolder> TagDeclTypes; |
Devang Patel | b84a06e | 2007-10-23 02:10:49 +0000 | [diff] [blame] | 70 | |
Eli Friedman | b3b6b9b | 2009-03-05 03:16:41 +0000 | [diff] [blame] | 71 | llvm::DenseMap<const Type*, llvm::PATypeHolder> FunctionTypes; |
| 72 | |
Daniel Dunbar | 412f59b | 2009-04-22 10:28:39 +0000 | [diff] [blame] | 73 | /// The opaque type map for Objective-C interfaces. All direct |
| 74 | /// manipulation is done by the runtime interfaces, which are |
| 75 | /// responsible for coercing to the appropriate type; these opaque |
| 76 | /// types are never refined. |
| 77 | llvm::DenseMap<const ObjCInterfaceType*, const llvm::Type *> InterfaceTypes; |
| 78 | |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 79 | /// CGRecordLayouts - This maps llvm struct type with corresponding |
| 80 | /// record layout info. |
Daniel Dunbar | efb6d0d | 2008-09-06 02:26:43 +0000 | [diff] [blame] | 81 | llvm::DenseMap<const Type*, CGRecordLayout *> CGRecordLayouts; |
Devang Patel | b84a06e | 2007-10-23 02:10:49 +0000 | [diff] [blame] | 82 | |
Daniel Dunbar | 40a6be6 | 2009-02-03 00:07:12 +0000 | [diff] [blame] | 83 | /// FunctionInfos - Hold memoized CGFunctionInfo results. |
| 84 | llvm::FoldingSet<CGFunctionInfo> FunctionInfos; |
| 85 | |
Lauro Ramos Venancio | 3b8c22d | 2008-01-22 20:17:04 +0000 | [diff] [blame] | 86 | private: |
Chris Lattner | 4581fff | 2008-02-06 05:21:55 +0000 | [diff] [blame] | 87 | /// TypeCache - This map keeps cache of llvm::Types (through PATypeHolder) |
Devang Patel | 30ec997 | 2007-10-25 18:32:36 +0000 | [diff] [blame] | 88 | /// and maps llvm::Types to corresponding clang::Type. llvm::PATypeHolder is |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 89 | /// used instead of llvm::Type because it allows us to bypass potential |
Devang Patel | 30ec997 | 2007-10-25 18:32:36 +0000 | [diff] [blame] | 90 | /// dangling type pointers due to type refinement on llvm side. |
John McCall | f4c7371 | 2011-01-19 06:33:43 +0000 | [diff] [blame] | 91 | llvm::DenseMap<const Type *, llvm::PATypeHolder> TypeCache; |
Devang Patel | 5825ac2 | 2007-10-25 21:40:12 +0000 | [diff] [blame] | 92 | |
| 93 | /// ConvertNewType - Convert type T into a llvm::Type. Do not use this |
| 94 | /// method directly because it does not do any type caching. This method |
| 95 | /// is available only for ConvertType(). CovertType() is preferred |
| 96 | /// interface to convert type T into a llvm::Type. |
| 97 | const llvm::Type *ConvertNewType(QualType T); |
Michael J. Spencer | 9cac494 | 2010-10-19 06:39:39 +0000 | [diff] [blame] | 98 | |
Chris Lattner | a9fa858 | 2010-07-01 06:20:47 +0000 | [diff] [blame] | 99 | /// HandleLateResolvedPointers - For top-level ConvertType calls, this handles |
| 100 | /// pointers that are referenced but have not been converted yet. This is |
| 101 | /// used to handle cyclic structures properly. |
| 102 | void HandleLateResolvedPointers(); |
| 103 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 104 | public: |
Anton Korobeynikov | 82d0a41 | 2010-01-10 12:58:08 +0000 | [diff] [blame] | 105 | CodeGenTypes(ASTContext &Ctx, llvm::Module &M, const llvm::TargetData &TD, |
John McCall | f16aa10 | 2010-08-22 21:01:12 +0000 | [diff] [blame] | 106 | const ABIInfo &Info, CGCXXABI &CXXABI); |
Devang Patel | b84a06e | 2007-10-23 02:10:49 +0000 | [diff] [blame] | 107 | ~CodeGenTypes(); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 108 | |
Devang Patel | d9e9ede | 2007-10-31 20:08:22 +0000 | [diff] [blame] | 109 | const llvm::TargetData &getTargetData() const { return TheTargetData; } |
Daniel Dunbar | 444be73 | 2009-11-13 05:51:54 +0000 | [diff] [blame] | 110 | const TargetInfo &getTarget() const { return Target; } |
Devang Patel | 86522b9 | 2007-10-29 20:50:19 +0000 | [diff] [blame] | 111 | ASTContext &getContext() const { return Context; } |
Anton Korobeynikov | 82d0a41 | 2010-01-10 12:58:08 +0000 | [diff] [blame] | 112 | const ABIInfo &getABIInfo() const { return TheABIInfo; } |
John McCall | f16aa10 | 2010-08-22 21:01:12 +0000 | [diff] [blame] | 113 | CGCXXABI &getCXXABI() const { return TheCXXABI; } |
Owen Anderson | 47a434f | 2009-08-05 23:18:46 +0000 | [diff] [blame] | 114 | llvm::LLVMContext &getLLVMContext() { return TheModule.getContext(); } |
Devang Patel | 5825ac2 | 2007-10-25 21:40:12 +0000 | [diff] [blame] | 115 | |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 116 | /// ConvertType - Convert type T into a llvm::Type. |
Chris Lattner | bcaedae | 2010-06-30 19:14:05 +0000 | [diff] [blame] | 117 | const llvm::Type *ConvertType(QualType T, bool IsRecursive = false); |
Chris Lattner | fce71b8 | 2008-04-03 05:50:42 +0000 | [diff] [blame] | 118 | const llvm::Type *ConvertTypeRecursive(QualType T); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 119 | |
Chris Lattner | 4581fff | 2008-02-06 05:21:55 +0000 | [diff] [blame] | 120 | /// ConvertTypeForMem - Convert type T into a llvm::Type. This differs from |
| 121 | /// ConvertType in that it is used to convert to the memory representation for |
| 122 | /// a type. For example, the scalar representation for _Bool is i1, but the |
| 123 | /// memory representation is usually i8 or i32, depending on the target. |
Chris Lattner | bcaedae | 2010-06-30 19:14:05 +0000 | [diff] [blame] | 124 | const llvm::Type *ConvertTypeForMem(QualType T, bool IsRecursive = false); |
| 125 | const llvm::Type *ConvertTypeForMemRecursive(QualType T) { |
| 126 | return ConvertTypeForMem(T, true); |
| 127 | } |
Daniel Dunbar | 45c25ba | 2008-09-10 04:01:49 +0000 | [diff] [blame] | 128 | |
Daniel Dunbar | 36b5f5e | 2009-01-31 03:05:44 +0000 | [diff] [blame] | 129 | /// GetFunctionType - Get the LLVM function type for \arg Info. |
Daniel Dunbar | bb36d33 | 2009-02-02 21:43:58 +0000 | [diff] [blame] | 130 | const llvm::FunctionType *GetFunctionType(const CGFunctionInfo &Info, |
Chris Lattner | bcaedae | 2010-06-30 19:14:05 +0000 | [diff] [blame] | 131 | bool IsVariadic, |
| 132 | bool IsRecursive = false); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 133 | |
John McCall | c0bf462 | 2010-02-23 00:48:20 +0000 | [diff] [blame] | 134 | const llvm::FunctionType *GetFunctionType(GlobalDecl GD); |
| 135 | |
Eli Friedman | c00129a | 2010-05-30 06:03:20 +0000 | [diff] [blame] | 136 | /// VerifyFuncTypeComplete - Utility to check whether a function type can |
| 137 | /// be converted to an LLVM type (i.e. doesn't depend on an incomplete tag |
| 138 | /// type). |
| 139 | static const TagType *VerifyFuncTypeComplete(const Type* T); |
Anders Carlsson | ecf282b | 2009-11-24 05:08:52 +0000 | [diff] [blame] | 140 | |
Anders Carlsson | 046c294 | 2010-04-17 20:15:18 +0000 | [diff] [blame] | 141 | /// GetFunctionTypeForVTable - Get the LLVM function type for use in a vtable, |
Michael J. Spencer | 9cac494 | 2010-10-19 06:39:39 +0000 | [diff] [blame] | 142 | /// given a CXXMethodDecl. If the method to has an incomplete return type, |
Anders Carlsson | ecf282b | 2009-11-24 05:08:52 +0000 | [diff] [blame] | 143 | /// and/or incomplete argument types, this will return the opaque type. |
John McCall | 4c40d98 | 2010-08-31 07:33:07 +0000 | [diff] [blame] | 144 | const llvm::Type *GetFunctionTypeForVTable(GlobalDecl GD); |
Michael J. Spencer | 9cac494 | 2010-10-19 06:39:39 +0000 | [diff] [blame] | 145 | |
Anders Carlsson | c8f01eb | 2010-11-24 19:51:04 +0000 | [diff] [blame] | 146 | const CGRecordLayout &getCGRecordLayout(const RecordDecl*); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 147 | |
Chris Lattner | c5b8806 | 2008-02-06 05:08:19 +0000 | [diff] [blame] | 148 | /// UpdateCompletedType - When we find the full definition for a TagDecl, |
| 149 | /// replace the 'opaque' type we previously made for it if applicable. |
| 150 | void UpdateCompletedType(const TagDecl *TD); |
Daniel Dunbar | 541b63b | 2009-02-02 23:23:47 +0000 | [diff] [blame] | 151 | |
Daniel Dunbar | bac7c25 | 2009-09-11 22:24:53 +0000 | [diff] [blame] | 152 | /// getFunctionInfo - Get the function info for the specified function decl. |
Anders Carlsson | b2bcf1c | 2010-02-06 02:44:09 +0000 | [diff] [blame] | 153 | const CGFunctionInfo &getFunctionInfo(GlobalDecl GD); |
Michael J. Spencer | 9cac494 | 2010-10-19 06:39:39 +0000 | [diff] [blame] | 154 | |
Daniel Dunbar | 541b63b | 2009-02-02 23:23:47 +0000 | [diff] [blame] | 155 | const CGFunctionInfo &getFunctionInfo(const FunctionDecl *FD); |
Anders Carlsson | f6f8ae5 | 2009-04-03 22:48:58 +0000 | [diff] [blame] | 156 | const CGFunctionInfo &getFunctionInfo(const CXXMethodDecl *MD); |
Daniel Dunbar | 541b63b | 2009-02-02 23:23:47 +0000 | [diff] [blame] | 157 | const CGFunctionInfo &getFunctionInfo(const ObjCMethodDecl *MD); |
Anders Carlsson | f6c56e2 | 2009-11-25 03:15:49 +0000 | [diff] [blame] | 158 | const CGFunctionInfo &getFunctionInfo(const CXXConstructorDecl *D, |
| 159 | CXXCtorType Type); |
| 160 | const CGFunctionInfo &getFunctionInfo(const CXXDestructorDecl *D, |
| 161 | CXXDtorType Type); |
| 162 | |
John McCall | 04a67a6 | 2010-02-05 21:31:56 +0000 | [diff] [blame] | 163 | const CGFunctionInfo &getFunctionInfo(const CallArgList &Args, |
Tilmann Scheller | 9c6082f | 2011-03-02 21:36:49 +0000 | [diff] [blame] | 164 | const FunctionType *Ty) { |
| 165 | return getFunctionInfo(Ty->getResultType(), Args, |
| 166 | Ty->getExtInfo()); |
John McCall | 04a67a6 | 2010-02-05 21:31:56 +0000 | [diff] [blame] | 167 | } |
Chris Lattner | bcaedae | 2010-06-30 19:14:05 +0000 | [diff] [blame] | 168 | |
| 169 | const CGFunctionInfo &getFunctionInfo(CanQual<FunctionProtoType> Ty, |
| 170 | bool IsRecursive = false); |
| 171 | const CGFunctionInfo &getFunctionInfo(CanQual<FunctionNoProtoType> Ty, |
| 172 | bool IsRecursive = false); |
John McCall | 04a67a6 | 2010-02-05 21:31:56 +0000 | [diff] [blame] | 173 | |
John McCall | 4c40d98 | 2010-08-31 07:33:07 +0000 | [diff] [blame] | 174 | /// getFunctionInfo - Get the function info for a member function of |
| 175 | /// the given type. This is used for calls through member function |
| 176 | /// pointers. |
Anders Carlsson | 375c31c | 2009-10-03 19:43:08 +0000 | [diff] [blame] | 177 | const CGFunctionInfo &getFunctionInfo(const CXXRecordDecl *RD, |
| 178 | const FunctionProtoType *FTP); |
Michael J. Spencer | 9cac494 | 2010-10-19 06:39:39 +0000 | [diff] [blame] | 179 | |
Daniel Dunbar | bac7c25 | 2009-09-11 22:24:53 +0000 | [diff] [blame] | 180 | /// getFunctionInfo - Get the function info for a function described by a |
| 181 | /// return type and argument types. If the calling convention is not |
| 182 | /// specified, the "C" calling convention will be used. |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 183 | const CGFunctionInfo &getFunctionInfo(QualType ResTy, |
Daniel Dunbar | bac7c25 | 2009-09-11 22:24:53 +0000 | [diff] [blame] | 184 | const CallArgList &Args, |
Rafael Espindola | 264ba48 | 2010-03-30 20:24:48 +0000 | [diff] [blame] | 185 | const FunctionType::ExtInfo &Info); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 186 | const CGFunctionInfo &getFunctionInfo(QualType ResTy, |
Daniel Dunbar | bac7c25 | 2009-09-11 22:24:53 +0000 | [diff] [blame] | 187 | const FunctionArgList &Args, |
Rafael Espindola | 264ba48 | 2010-03-30 20:24:48 +0000 | [diff] [blame] | 188 | const FunctionType::ExtInfo &Info); |
John McCall | ead608a | 2010-02-26 00:48:12 +0000 | [diff] [blame] | 189 | |
| 190 | /// Retrieves the ABI information for the given function signature. |
Michael J. Spencer | 9cac494 | 2010-10-19 06:39:39 +0000 | [diff] [blame] | 191 | /// |
John McCall | ead608a | 2010-02-26 00:48:12 +0000 | [diff] [blame] | 192 | /// \param ArgTys - must all actually be canonical as params |
| 193 | const CGFunctionInfo &getFunctionInfo(CanQualType RetTy, |
| 194 | const llvm::SmallVectorImpl<CanQualType> &ArgTys, |
Chris Lattner | bcaedae | 2010-06-30 19:14:05 +0000 | [diff] [blame] | 195 | const FunctionType::ExtInfo &Info, |
| 196 | bool IsRecursive = false); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 197 | |
Daniel Dunbar | 270e203 | 2010-03-31 00:11:27 +0000 | [diff] [blame] | 198 | /// \brief Compute a new LLVM record layout object for the given record. |
| 199 | CGRecordLayout *ComputeRecordLayout(const RecordDecl *D); |
| 200 | |
Chris Lattner | 19009e6 | 2008-01-09 18:47:25 +0000 | [diff] [blame] | 201 | public: // These are internal details of CGT that shouldn't be used externally. |
Chris Lattner | fc3b8e9 | 2008-02-06 05:18:32 +0000 | [diff] [blame] | 202 | /// ConvertTagDeclType - Lay out a tagged decl type like struct or union or |
| 203 | /// enum. |
Chris Lattner | 8fb1dd0 | 2008-02-06 06:06:49 +0000 | [diff] [blame] | 204 | const llvm::Type *ConvertTagDeclType(const TagDecl *TD); |
Daniel Dunbar | 5627377 | 2008-09-17 00:51:38 +0000 | [diff] [blame] | 205 | |
| 206 | /// GetExpandedTypes - Expand the type \arg Ty into the LLVM |
| 207 | /// argument types it would be passed as on the provided vector \arg |
| 208 | /// ArgTys. See ABIArgInfo::Expand. |
Chris Lattner | bcaedae | 2010-06-30 19:14:05 +0000 | [diff] [blame] | 209 | void GetExpandedTypes(QualType Ty, std::vector<const llvm::Type*> &ArgTys, |
| 210 | bool IsRecursive); |
Michael J. Spencer | 9cac494 | 2010-10-19 06:39:39 +0000 | [diff] [blame] | 211 | |
John McCall | f16aa10 | 2010-08-22 21:01:12 +0000 | [diff] [blame] | 212 | /// IsZeroInitializable - Return whether a type can be |
| 213 | /// zero-initialized (in the C++ sense) with an LLVM zeroinitializer. |
| 214 | bool isZeroInitializable(QualType T); |
Michael J. Spencer | 9cac494 | 2010-10-19 06:39:39 +0000 | [diff] [blame] | 215 | |
John McCall | f16aa10 | 2010-08-22 21:01:12 +0000 | [diff] [blame] | 216 | /// IsZeroInitializable - Return whether a record type can be |
| 217 | /// zero-initialized (in the C++ sense) with an LLVM zeroinitializer. |
| 218 | bool isZeroInitializable(const CXXRecordDecl *RD); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 219 | }; |
Chris Lattner | a7674d8 | 2007-07-13 22:13:22 +0000 | [diff] [blame] | 220 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 221 | } // end namespace CodeGen |
| 222 | } // end namespace clang |
| 223 | |
| 224 | #endif |