1 //===--- CodeGenModule.h - Per-Module state for LLVM CodeGen ----*- 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 // This is the internal per-translation-unit state used for llvm translation. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef CLANG_CODEGEN_CODEGENMODULE_H 15 #define CLANG_CODEGEN_CODEGENMODULE_H 16 17 #include "clang/Basic/LangOptions.h" 18 #include "clang/AST/Attr.h" 19 #include "clang/AST/DeclCXX.h" 20 #include "clang/AST/DeclObjC.h" 21 #include "CGBlocks.h" 22 #include "CGCall.h" 23 #include "CGCXX.h" 24 #include "CGVTables.h" 25 #include "CGCXXABI.h" 26 #include "CodeGenTypes.h" 27 #include "GlobalDecl.h" 28 #include "Mangle.h" 29 #include "llvm/Module.h" 30 #include "llvm/ADT/DenseMap.h" 31 #include "llvm/ADT/StringMap.h" 32 #include "llvm/ADT/StringSet.h" 33 #include "llvm/ADT/SmallPtrSet.h" 34 #include "llvm/Support/ValueHandle.h" 35 36 namespace llvm { 37 class Module; 38 class Constant; 39 class Function; 40 class GlobalValue; 41 class TargetData; 42 class FunctionType; 43 class LLVMContext; 44 } 45 46 namespace clang { 47 class TargetCodeGenInfo; 48 class ASTContext; 49 class FunctionDecl; 50 class IdentifierInfo; 51 class ObjCMethodDecl; 52 class ObjCImplementationDecl; 53 class ObjCCategoryImplDecl; 54 class ObjCProtocolDecl; 55 class ObjCEncodeExpr; 56 class BlockExpr; 57 class CharUnits; 58 class Decl; 59 class Expr; 60 class Stmt; 61 class StringLiteral; 62 class NamedDecl; 63 class ValueDecl; 64 class VarDecl; 65 class LangOptions; 66 class CodeGenOptions; 67 class Diagnostic; 68 class AnnotateAttr; 69 class CXXDestructorDecl; 70 71 namespace CodeGen { 72 73 class CodeGenFunction; 74 class CGDebugInfo; 75 class CGObjCRuntime; 76 class MangleBuffer; 77 78 /// CodeGenModule - This class organizes the cross-function state that is used 79 /// while generating LLVM code. 80 class CodeGenModule : public BlockModule { 81 CodeGenModule(const CodeGenModule&); // DO NOT IMPLEMENT 82 void operator=(const CodeGenModule&); // DO NOT IMPLEMENT 83 84 typedef std::vector<std::pair<llvm::Constant*, int> > CtorList; 85 86 ASTContext &Context; 87 const LangOptions &Features; 88 const CodeGenOptions &CodeGenOpts; 89 llvm::Module &TheModule; 90 const llvm::TargetData &TheTargetData; 91 mutable const TargetCodeGenInfo *TheTargetCodeGenInfo; 92 Diagnostic &Diags; 93 CodeGenTypes Types; 94 95 /// VTables - Holds information about C++ vtables. 96 CodeGenVTables VTables; 97 friend class CodeGenVTables; 98 99 CGObjCRuntime* Runtime; 100 CXXABI* ABI; 101 CGDebugInfo* DebugInfo; 102 103 // WeakRefReferences - A set of references that have only been seen via 104 // a weakref so far. This is used to remove the weak of the reference if we ever 105 // see a direct reference or a definition. 106 llvm::SmallPtrSet<llvm::GlobalValue*, 10> WeakRefReferences; 107 108 /// DeferredDecls - This contains all the decls which have definitions but 109 /// which are deferred for emission and therefore should only be output if 110 /// they are actually used. If a decl is in this, then it is known to have 111 /// not been referenced yet. 112 llvm::StringMap<GlobalDecl> DeferredDecls; 113 114 /// DeferredDeclsToEmit - This is a list of deferred decls which we have seen 115 /// that *are* actually referenced. These get code generated when the module 116 /// is done. 117 std::vector<GlobalDecl> DeferredDeclsToEmit; 118 119 /// LLVMUsed - List of global values which are required to be 120 /// present in the object file; bitcast to i8*. This is used for 121 /// forcing visibility of symbols which may otherwise be optimized 122 /// out. 123 std::vector<llvm::WeakVH> LLVMUsed; 124 125 /// GlobalCtors - Store the list of global constructors and their respective 126 /// priorities to be emitted when the translation unit is complete. 127 CtorList GlobalCtors; 128 129 /// GlobalDtors - Store the list of global destructors and their respective 130 /// priorities to be emitted when the translation unit is complete. 131 CtorList GlobalDtors; 132 133 std::vector<llvm::Constant*> Annotations; 134 135 llvm::StringMap<llvm::Constant*> CFConstantStringMap; 136 llvm::StringMap<llvm::Constant*> ConstantStringMap; 137 llvm::DenseMap<const Decl*, llvm::Value*> StaticLocalDeclMap; 138 139 /// CXXGlobalInits - Global variables with initializers that need to run 140 /// before main. 141 std::vector<llvm::Constant*> CXXGlobalInits; 142 143 /// CXXGlobalDtors - Global destructor functions and arguments that need to 144 /// run on termination. 145 std::vector<std::pair<llvm::Constant*,llvm::Constant*> > CXXGlobalDtors; 146 147 /// CFConstantStringClassRef - Cached reference to the class for constant 148 /// strings. This value has type int * but is actually an Obj-C class pointer. 149 llvm::Constant *CFConstantStringClassRef; 150 151 /// NSConstantStringClassRef - Cached reference to the class for constant 152 /// strings. This value has type int * but is actually an Obj-C class pointer. 153 llvm::Constant *NSConstantStringClassRef; 154 155 /// Lazily create the Objective-C runtime 156 void createObjCRuntime(); 157 /// Lazily create the C++ ABI 158 void createCXXABI(); 159 160 llvm::LLVMContext &VMContext; 161 public: 162 CodeGenModule(ASTContext &C, const CodeGenOptions &CodeGenOpts, 163 llvm::Module &M, const llvm::TargetData &TD, Diagnostic &Diags); 164 165 ~CodeGenModule(); 166 167 /// Release - Finalize LLVM code generation. 168 void Release(); 169 170 /// getObjCRuntime() - Return a reference to the configured 171 /// Objective-C runtime. 172 CGObjCRuntime &getObjCRuntime() { 173 if (!Runtime) createObjCRuntime(); 174 return *Runtime; 175 } 176 177 /// hasObjCRuntime() - Return true iff an Objective-C runtime has 178 /// been configured. 179 bool hasObjCRuntime() { return !!Runtime; } 180 181 /// getCXXABI() - Return a reference to the configured 182 /// C++ ABI. 183 CXXABI &getCXXABI() { 184 if (!ABI) createCXXABI(); 185 return *ABI; 186 } 187 188 /// hasCXXABI() - Return true iff a C++ ABI has been configured. 189 bool hasCXXABI() { return !!ABI; } 190 191 llvm::Value *getStaticLocalDeclAddress(const VarDecl *VD) { 192 return StaticLocalDeclMap[VD]; 193 } 194 void setStaticLocalDeclAddress(const VarDecl *D, 195 llvm::GlobalVariable *GV) { 196 StaticLocalDeclMap[D] = GV; 197 } 198 199 CGDebugInfo *getDebugInfo() { return DebugInfo; } 200 ASTContext &getContext() const { return Context; } 201 const CodeGenOptions &getCodeGenOpts() const { return CodeGenOpts; } 202 const LangOptions &getLangOptions() const { return Features; } 203 llvm::Module &getModule() const { return TheModule; } 204 CodeGenTypes &getTypes() { return Types; } 205 MangleContext &getMangleContext() { 206 if (!ABI) createCXXABI(); 207 return ABI->getMangleContext(); 208 } 209 CodeGenVTables &getVTables() { return VTables; } 210 Diagnostic &getDiags() const { return Diags; } 211 const llvm::TargetData &getTargetData() const { return TheTargetData; } 212 llvm::LLVMContext &getLLVMContext() { return VMContext; } 213 const TargetCodeGenInfo &getTargetCodeGenInfo() const; 214 bool isTargetDarwin() const; 215 216 /// getDeclVisibilityMode - Compute the visibility of the decl \arg D. 217 LangOptions::VisibilityMode getDeclVisibilityMode(const Decl *D) const; 218 219 /// setGlobalVisibility - Set the visibility for the given LLVM 220 /// GlobalValue. 221 void setGlobalVisibility(llvm::GlobalValue *GV, const Decl *D) const; 222 223 llvm::Constant *GetAddrOfGlobal(GlobalDecl GD) { 224 if (isa<CXXConstructorDecl>(GD.getDecl())) 225 return GetAddrOfCXXConstructor(cast<CXXConstructorDecl>(GD.getDecl()), 226 GD.getCtorType()); 227 else if (isa<CXXDestructorDecl>(GD.getDecl())) 228 return GetAddrOfCXXDestructor(cast<CXXDestructorDecl>(GD.getDecl()), 229 GD.getDtorType()); 230 else if (isa<FunctionDecl>(GD.getDecl())) 231 return GetAddrOfFunction(GD); 232 else 233 return GetAddrOfGlobalVar(cast<VarDecl>(GD.getDecl())); 234 } 235 236 /// GetAddrOfGlobalVar - Return the llvm::Constant for the address of the 237 /// given global variable. If Ty is non-null and if the global doesn't exist, 238 /// then it will be greated with the specified type instead of whatever the 239 /// normal requested type would be. 240 llvm::Constant *GetAddrOfGlobalVar(const VarDecl *D, 241 const llvm::Type *Ty = 0); 242 243 /// GetAddrOfFunction - Return the address of the given function. If Ty is 244 /// non-null, then this function will use the specified type if it has to 245 /// create it. 246 llvm::Constant *GetAddrOfFunction(GlobalDecl GD, 247 const llvm::Type *Ty = 0); 248 249 /// GetAddrOfRTTIDescriptor - Get the address of the RTTI descriptor 250 /// for the given type. 251 llvm::Constant *GetAddrOfRTTIDescriptor(QualType Ty, bool ForEH = false); 252 253 /// GetAddrOfThunk - Get the address of the thunk for the given global decl. 254 llvm::Constant *GetAddrOfThunk(GlobalDecl GD, const ThunkInfo &Thunk); 255 256 /// GetWeakRefReference - Get a reference to the target of VD. 257 llvm::Constant *GetWeakRefReference(const ValueDecl *VD); 258 259 /// GetNonVirtualBaseClassOffset - Returns the offset from a derived class to 260 /// a class. Returns null if the offset is 0. 261 llvm::Constant * 262 GetNonVirtualBaseClassOffset(const CXXRecordDecl *ClassDecl, 263 const CXXBaseSpecifierArray &BasePath); 264 265 /// GetStringForStringLiteral - Return the appropriate bytes for a string 266 /// literal, properly padded to match the literal type. If only the address of 267 /// a constant is needed consider using GetAddrOfConstantStringLiteral. 268 std::string GetStringForStringLiteral(const StringLiteral *E); 269 270 /// GetAddrOfConstantCFString - Return a pointer to a constant CFString object 271 /// for the given string. 272 llvm::Constant *GetAddrOfConstantCFString(const StringLiteral *Literal); 273 274 /// GetAddrOfConstantNSString - Return a pointer to a constant NSString object 275 /// for the given string. 276 llvm::Constant *GetAddrOfConstantNSString(const StringLiteral *Literal); 277 278 /// GetAddrOfConstantStringFromLiteral - Return a pointer to a constant array 279 /// for the given string literal. 280 llvm::Constant *GetAddrOfConstantStringFromLiteral(const StringLiteral *S); 281 282 /// GetAddrOfConstantStringFromObjCEncode - Return a pointer to a constant 283 /// array for the given ObjCEncodeExpr node. 284 llvm::Constant *GetAddrOfConstantStringFromObjCEncode(const ObjCEncodeExpr *); 285 286 /// GetAddrOfConstantString - Returns a pointer to a character array 287 /// containing the literal. This contents are exactly that of the given 288 /// string, i.e. it will not be null terminated automatically; see 289 /// GetAddrOfConstantCString. Note that whether the result is actually a 290 /// pointer to an LLVM constant depends on Feature.WriteableStrings. 291 /// 292 /// The result has pointer to array type. 293 /// 294 /// \param GlobalName If provided, the name to use for the global 295 /// (if one is created). 296 llvm::Constant *GetAddrOfConstantString(const std::string& str, 297 const char *GlobalName=0); 298 299 /// GetAddrOfConstantCString - Returns a pointer to a character array 300 /// containing the literal and a terminating '\0' character. The result has 301 /// pointer to array type. 302 /// 303 /// \param GlobalName If provided, the name to use for the global (if one is 304 /// created). 305 llvm::Constant *GetAddrOfConstantCString(const std::string &str, 306 const char *GlobalName=0); 307 308 /// GetAddrOfCXXConstructor - Return the address of the constructor of the 309 /// given type. 310 llvm::GlobalValue *GetAddrOfCXXConstructor(const CXXConstructorDecl *D, 311 CXXCtorType Type); 312 313 /// GetAddrOfCXXDestructor - Return the address of the constructor of the 314 /// given type. 315 llvm::GlobalValue *GetAddrOfCXXDestructor(const CXXDestructorDecl *D, 316 CXXDtorType Type); 317 318 /// getBuiltinLibFunction - Given a builtin id for a function like 319 /// "__builtin_fabsf", return a Function* for "fabsf". 320 llvm::Value *getBuiltinLibFunction(const FunctionDecl *FD, 321 unsigned BuiltinID); 322 323 llvm::Function *getMemCpyFn(const llvm::Type *DestType, 324 const llvm::Type *SrcType, 325 const llvm::Type *SizeType); 326 327 llvm::Function *getMemMoveFn(const llvm::Type *DestType, 328 const llvm::Type *SrcType, 329 const llvm::Type *SizeType); 330 331 llvm::Function *getMemSetFn(const llvm::Type *DestType, 332 const llvm::Type *SizeType); 333 334 llvm::Function *getIntrinsic(unsigned IID, const llvm::Type **Tys = 0, 335 unsigned NumTys = 0); 336 337 /// EmitTopLevelDecl - Emit code for a single top level declaration. 338 void EmitTopLevelDecl(Decl *D); 339 340 /// AddUsedGlobal - Add a global which should be forced to be 341 /// present in the object file; these are emitted to the llvm.used 342 /// metadata global. 343 void AddUsedGlobal(llvm::GlobalValue *GV); 344 345 void AddAnnotation(llvm::Constant *C) { Annotations.push_back(C); } 346 347 /// AddCXXDtorEntry - Add a destructor and object to add to the C++ global 348 /// destructor function. 349 void AddCXXDtorEntry(llvm::Constant *DtorFn, llvm::Constant *Object); 350 351 /// CreateRuntimeFunction - Create a new runtime function with the specified 352 /// type and name. 353 llvm::Constant *CreateRuntimeFunction(const llvm::FunctionType *Ty, 354 llvm::StringRef Name); 355 /// CreateRuntimeVariable - Create a new runtime global variable with the 356 /// specified type and name. 357 llvm::Constant *CreateRuntimeVariable(const llvm::Type *Ty, 358 llvm::StringRef Name); 359 360 void UpdateCompletedType(const TagDecl *TD) { 361 // Make sure that this type is translated. 362 Types.UpdateCompletedType(TD); 363 } 364 365 /// EmitConstantExpr - Try to emit the given expression as a 366 /// constant; returns 0 if the expression cannot be emitted as a 367 /// constant. 368 llvm::Constant *EmitConstantExpr(const Expr *E, QualType DestType, 369 CodeGenFunction *CGF = 0); 370 371 /// EmitNullConstant - Return the result of value-initializing the given 372 /// type, i.e. a null expression of the given type. This is usually, 373 /// but not always, an LLVM null constant. 374 llvm::Constant *EmitNullConstant(QualType T); 375 376 llvm::Constant *EmitAnnotateAttr(llvm::GlobalValue *GV, 377 const AnnotateAttr *AA, unsigned LineNo); 378 379 llvm::Constant *EmitPointerToDataMember(const FieldDecl *FD); 380 381 /// ErrorUnsupported - Print out an error that codegen doesn't support the 382 /// specified stmt yet. 383 /// \param OmitOnError - If true, then this error should only be emitted if no 384 /// other errors have been reported. 385 void ErrorUnsupported(const Stmt *S, const char *Type, 386 bool OmitOnError=false); 387 388 /// ErrorUnsupported - Print out an error that codegen doesn't support the 389 /// specified decl yet. 390 /// \param OmitOnError - If true, then this error should only be emitted if no 391 /// other errors have been reported. 392 void ErrorUnsupported(const Decl *D, const char *Type, 393 bool OmitOnError=false); 394 395 /// SetInternalFunctionAttributes - Set the attributes on the LLVM 396 /// function for the given decl and function info. This applies 397 /// attributes necessary for handling the ABI as well as user 398 /// specified attributes like section. 399 void SetInternalFunctionAttributes(const Decl *D, llvm::Function *F, 400 const CGFunctionInfo &FI); 401 402 /// SetLLVMFunctionAttributes - Set the LLVM function attributes 403 /// (sext, zext, etc). 404 void SetLLVMFunctionAttributes(const Decl *D, 405 const CGFunctionInfo &Info, 406 llvm::Function *F); 407 408 /// SetLLVMFunctionAttributesForDefinition - Set the LLVM function attributes 409 /// which only apply to a function definintion. 410 void SetLLVMFunctionAttributesForDefinition(const Decl *D, llvm::Function *F); 411 412 /// ReturnTypeUsesSret - Return true iff the given type uses 'sret' when used 413 /// as a return type. 414 bool ReturnTypeUsesSret(const CGFunctionInfo &FI); 415 416 /// ConstructAttributeList - Get the LLVM attributes and calling convention to 417 /// use for a particular function type. 418 /// 419 /// \param Info - The function type information. 420 /// \param TargetDecl - The decl these attributes are being constructed 421 /// for. If supplied the attributes applied to this decl may contribute to the 422 /// function attributes and calling convention. 423 /// \param PAL [out] - On return, the attribute list to use. 424 /// \param CallingConv [out] - On return, the LLVM calling convention to use. 425 void ConstructAttributeList(const CGFunctionInfo &Info, 426 const Decl *TargetDecl, 427 AttributeListType &PAL, 428 unsigned &CallingConv); 429 430 void getMangledName(MangleBuffer &Buffer, GlobalDecl D); 431 void getMangledName(MangleBuffer &Buffer, const NamedDecl *ND); 432 void getMangledName(MangleBuffer &Buffer, const BlockDecl *BD); 433 void getMangledCXXCtorName(MangleBuffer &Buffer, 434 const CXXConstructorDecl *D, 435 CXXCtorType Type); 436 void getMangledCXXDtorName(MangleBuffer &Buffer, 437 const CXXDestructorDecl *D, 438 CXXDtorType Type); 439 440 void EmitTentativeDefinition(const VarDecl *D); 441 442 void EmitVTable(CXXRecordDecl *Class, bool DefinitionRequired); 443 444 enum GVALinkage { 445 GVA_Internal, 446 GVA_C99Inline, 447 GVA_CXXInline, 448 GVA_StrongExternal, 449 GVA_TemplateInstantiation, 450 GVA_ExplicitTemplateInstantiation 451 }; 452 453 llvm::GlobalVariable::LinkageTypes 454 getFunctionLinkage(const FunctionDecl *FD); 455 456 void setFunctionLinkage(const FunctionDecl *FD, llvm::GlobalValue *V) { 457 V->setLinkage(getFunctionLinkage(FD)); 458 } 459 460 /// getVTableLinkage - Return the appropriate linkage for the vtable, VTT, 461 /// and type information of the given class. 462 static llvm::GlobalVariable::LinkageTypes 463 getVTableLinkage(const CXXRecordDecl *RD); 464 465 /// GetTargetTypeStoreSize - Return the store size, in character units, of 466 /// the given LLVM type. 467 CharUnits GetTargetTypeStoreSize(const llvm::Type *Ty) const; 468 469 std::vector<const CXXRecordDecl*> DeferredVTables; 470 471 private: 472 llvm::GlobalValue *GetGlobalValue(llvm::StringRef Ref); 473 474 llvm::Constant *GetOrCreateLLVMFunction(llvm::StringRef MangledName, 475 const llvm::Type *Ty, 476 GlobalDecl D); 477 llvm::Constant *GetOrCreateLLVMGlobal(llvm::StringRef MangledName, 478 const llvm::PointerType *PTy, 479 const VarDecl *D); 480 481 /// SetCommonAttributes - Set attributes which are common to any 482 /// form of a global definition (alias, Objective-C method, 483 /// function, global variable). 484 /// 485 /// NOTE: This should only be called for definitions. 486 void SetCommonAttributes(const Decl *D, llvm::GlobalValue *GV); 487 488 /// SetFunctionDefinitionAttributes - Set attributes for a global definition. 489 void SetFunctionDefinitionAttributes(const FunctionDecl *D, 490 llvm::GlobalValue *GV); 491 492 /// SetFunctionAttributes - Set function attributes for a function 493 /// declaration. 494 void SetFunctionAttributes(GlobalDecl GD, 495 llvm::Function *F, 496 bool IsIncompleteFunction); 497 498 /// EmitGlobal - Emit code for a singal global function or var decl. Forward 499 /// declarations are emitted lazily. 500 void EmitGlobal(GlobalDecl D); 501 502 void EmitGlobalDefinition(GlobalDecl D); 503 504 void EmitGlobalFunctionDefinition(GlobalDecl GD); 505 void EmitGlobalVarDefinition(const VarDecl *D); 506 void EmitAliasDefinition(GlobalDecl GD); 507 void EmitObjCPropertyImplementations(const ObjCImplementationDecl *D); 508 void EmitObjCIvarInitializations(ObjCImplementationDecl *D); 509 510 // C++ related functions. 511 512 bool TryEmitDefinitionAsAlias(GlobalDecl Alias, GlobalDecl Target); 513 bool TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D); 514 515 void EmitNamespace(const NamespaceDecl *D); 516 void EmitLinkageSpec(const LinkageSpecDecl *D); 517 518 /// EmitCXXConstructors - Emit constructors (base, complete) from a 519 /// C++ constructor Decl. 520 void EmitCXXConstructors(const CXXConstructorDecl *D); 521 522 /// EmitCXXConstructor - Emit a single constructor with the given type from 523 /// a C++ constructor Decl. 524 void EmitCXXConstructor(const CXXConstructorDecl *D, CXXCtorType Type); 525 526 /// EmitCXXDestructors - Emit destructors (base, complete) from a 527 /// C++ destructor Decl. 528 void EmitCXXDestructors(const CXXDestructorDecl *D); 529 530 /// EmitCXXDestructor - Emit a single destructor with the given type from 531 /// a C++ destructor Decl. 532 void EmitCXXDestructor(const CXXDestructorDecl *D, CXXDtorType Type); 533 534 /// EmitCXXGlobalInitFunc - Emit the function that initializes C++ globals. 535 void EmitCXXGlobalInitFunc(); 536 537 /// EmitCXXGlobalDtorFunc - Emit the function that destroys C++ globals. 538 void EmitCXXGlobalDtorFunc(); 539 540 void EmitCXXGlobalVarDeclInitFunc(const VarDecl *D); 541 542 // FIXME: Hardcoding priority here is gross. 543 void AddGlobalCtor(llvm::Function *Ctor, int Priority=65535); 544 void AddGlobalDtor(llvm::Function *Dtor, int Priority=65535); 545 546 /// EmitCtorList - Generates a global array of functions and priorities using 547 /// the given list and name. This array will have appending linkage and is 548 /// suitable for use as a LLVM constructor or destructor array. 549 void EmitCtorList(const CtorList &Fns, const char *GlobalName); 550 551 void EmitAnnotations(void); 552 553 /// EmitFundamentalRTTIDescriptor - Emit the RTTI descriptors for the 554 /// given type. 555 void EmitFundamentalRTTIDescriptor(QualType Type); 556 557 /// EmitFundamentalRTTIDescriptors - Emit the RTTI descriptors for the 558 /// builtin types. 559 void EmitFundamentalRTTIDescriptors(); 560 561 /// EmitDeferred - Emit any needed decls for which code generation 562 /// was deferred. 563 void EmitDeferred(void); 564 565 /// EmitLLVMUsed - Emit the llvm.used metadata used to force 566 /// references to global which may otherwise be optimized out. 567 void EmitLLVMUsed(void); 568 569 /// MayDeferGeneration - Determine if the given decl can be emitted 570 /// lazily; this is only relevant for definitions. The given decl 571 /// must be either a function or var decl. 572 bool MayDeferGeneration(const ValueDecl *D); 573 }; 574 } // end namespace CodeGen 575 } // end namespace clang 576 577 #endif 578