#include "CodeGenModule.h"
#include "ABIInfo.h"
#include "CGBlocks.h"
#include "CGCUDARuntime.h"
#include "CGCXXABI.h"
#include "CGCall.h"
#include "CGDebugInfo.h"
#include "CGHLSLRuntime.h"
#include "CGObjCRuntime.h"
#include "CGOpenCLRuntime.h"
#include "CGOpenMPRuntime.h"
#include "CGOpenMPRuntimeGPU.h"
#include "CodeGenFunction.h"
#include "CodeGenPGO.h"
#include "ConstantEmitter.h"
#include "CoverageMappingGen.h"
#include "TargetInfo.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTLambda.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Mangle.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/CodeGenOptions.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/Module.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/Version.h"
#include "clang/CodeGen/BackendUtil.h"
#include "clang/CodeGen/ConstantInitBuilder.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/IR/AttributeMask.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ProfileSummary.h"
#include "llvm/ProfileData/InstrProfReader.h"
#include "llvm/ProfileData/SampleProf.h"
#include "llvm/Support/CRC.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/xxhash.h"
#include "llvm/TargetParser/RISCVISAInfo.h"
#include "llvm/TargetParser/Triple.h"
#include "llvm/TargetParser/X86TargetParser.h"
#include "llvm/Transforms/Utils/BuildLibCalls.h"
#include <optional>
#include <set>
Go to the source code of this file.
static llvm::cl::opt< bool > LimitedCoverage ("limited-coverage-experimental", llvm::cl::Hidden, llvm::cl::desc("Emit limited coverage mapping information (experimental)")) static CGCXXABI * createCXXABI (CodeGenModule &CGM) static std::unique_ptr< TargetCodeGenInfo > createTargetCodeGenInfo (CodeGenModule &CGM) static const llvm::GlobalValue * getAliasedGlobal (const llvm::GlobalValue *GV) static bool checkAliasedGlobal (const ASTContext &Context, DiagnosticsEngine &Diags, SourceLocation Location, bool IsIFunc, const llvm::GlobalValue *Alias, const llvm::GlobalValue *&GV, const llvm::MapVector< GlobalDecl, StringRef > &MangledDeclNames, SourceRange AliasRange) static void checkAliasForTocData (llvm::GlobalVariable *GVar, const CodeGenOptions &CodeGenOpts, DiagnosticsEngine &Diags, SourceLocation Location) static std::optional< llvm::GlobalValue::VisibilityTypes > getLLVMVisibility (clang::LangOptions::VisibilityFromDLLStorageClassKinds K) static void setLLVMVisibility (llvm::GlobalValue &GV, std::optional< llvm::GlobalValue::VisibilityTypes > V) static void setVisibilityFromDLLStorageClass (const clang::LangOptions &LO, llvm::Module &M) static bool isStackProtectorOn (const LangOptions &LangOpts, const llvm::Triple &Triple, clang::LangOptions::StackProtectorMode Mode) static bool shouldAssumeDSOLocal (const CodeGenModule &CGM, llvm::GlobalValue *GV) static llvm::GlobalVariable::ThreadLocalMode GetLLVMTLSModel (StringRef S) static std::string getCPUSpecificMangling (const CodeGenModule &CGM, StringRef Name) static void AppendCPUSpecificCPUDispatchMangling (const CodeGenModule &CGM, const CPUSpecificAttr *Attr, unsigned CPUIndex, raw_ostream &Out) static bool isUniqueInternalLinkageDecl (GlobalDecl GD, CodeGenModule &CGM) static std::string getMangledNameImpl (CodeGenModule &CGM, GlobalDecl GD, const NamedDecl *ND, bool OmitMultiVersionMangling=false) static void removeImageAccessQualifier (std::string &TyName) static unsigned ArgInfoAddressSpace (LangAS AS) static bool hasUnwindExceptions (const LangOptions &LangOpts) Determines whether the language options require us to model unwind exceptions.Add link options implied by the given module, including modules it depends on, using a postorder walk.
Definition at line 3119 of file CodeGenModule.cpp.
References addLinkOptionsPostorder(), clang::CodeGen::TargetCodeGenInfo::getDependentLibraryOption(), clang::CodeGen::CodeGenModule::getLLVMContext(), clang::CodeGen::CodeGenModule::getTarget(), clang::CodeGen::CodeGenModule::getTargetCodeGenInfo(), clang::TargetInfo::getTriple(), clang::Module::Imports, clang::Module::LinkLibraries, clang::Module::Parent, clang::Module::UseExportAsModuleLinkName, and Visited.
Referenced by addLinkOptionsPostorder().
◆ allowKCFIIdentifier() static bool allowKCFIIdentifier ( StringRef Name ) static ◆ AllTrivialInitializers() ◆ AppendCPUSpecificCPUDispatchMangling() static void AppendCPUSpecificCPUDispatchMangling ( const CodeGenModule & CGM, const CPUSpecificAttr * Attr, unsigned CPUIndex, raw_ostream & Out ) static ◆ ArgInfoAddressSpace() ◆ castStringLiteralToDefaultAddressSpace() static llvm::Constant * castStringLiteralToDefaultAddressSpace ( CodeGenModule & CGM, llvm::GlobalVariable * GV ) static ◆ checkAliasedGlobal() ◆ checkAliasForTocData() ◆ createCXXABI() ◆ createTargetCodeGenInfo()Definition at line 108 of file CodeGenModule.cpp.
References clang::CodeGen::createAArch64TargetCodeGenInfo(), clang::CodeGen::createAIXTargetCodeGenInfo(), clang::CodeGen::createAMDGPUTargetCodeGenInfo(), clang::CodeGen::createARCTargetCodeGenInfo(), clang::CodeGen::createARMTargetCodeGenInfo(), clang::CodeGen::createAVRTargetCodeGenInfo(), clang::CodeGen::createBPFTargetCodeGenInfo(), clang::CodeGen::createCommonSPIRTargetCodeGenInfo(), clang::CodeGen::createCSKYTargetCodeGenInfo(), clang::CodeGen::createDefaultTargetCodeGenInfo(), clang::CodeGen::createDirectXTargetCodeGenInfo(), clang::CodeGen::createHexagonTargetCodeGenInfo(), clang::CodeGen::createLanaiTargetCodeGenInfo(), clang::CodeGen::createLoongArchTargetCodeGenInfo(), clang::CodeGen::createM68kTargetCodeGenInfo(), clang::CodeGen::createMIPSTargetCodeGenInfo(), clang::CodeGen::createMSP430TargetCodeGenInfo(), clang::CodeGen::createNVPTXTargetCodeGenInfo(), clang::CodeGen::createPNaClTargetCodeGenInfo(), clang::CodeGen::createPPC32TargetCodeGenInfo(), clang::CodeGen::createPPC64_SVR4_TargetCodeGenInfo(), clang::CodeGen::createPPC64TargetCodeGenInfo(), clang::CodeGen::createRISCVTargetCodeGenInfo(), clang::CodeGen::createSparcV8TargetCodeGenInfo(), clang::CodeGen::createSparcV9TargetCodeGenInfo(), clang::CodeGen::createSPIRVTargetCodeGenInfo(), clang::CodeGen::createSystemZTargetCodeGenInfo(), clang::CodeGen::createTCETargetCodeGenInfo(), clang::CodeGen::createVETargetCodeGenInfo(), clang::CodeGen::createWebAssemblyTargetCodeGenInfo(), clang::CodeGen::createWindowsAArch64TargetCodeGenInfo(), clang::CodeGen::createWindowsARMTargetCodeGenInfo(), clang::CodeGen::createWindowsMIPSTargetCodeGenInfo(), clang::CodeGen::createWinX86_32TargetCodeGenInfo(), clang::CodeGen::createWinX86_64TargetCodeGenInfo(), clang::CodeGen::createX86_32TargetCodeGenInfo(), clang::CodeGen::createX86_64TargetCodeGenInfo(), clang::CodeGen::createXCoreTargetCodeGenInfo(), clang::CodeGenOptions::FloatABI, clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getTarget(), and clang::TargetInfo::getTriple().
Referenced by clang::CodeGen::CodeGenModule::getTargetCodeGenInfo().
◆ EmitGlobalDeclMetadata() static void EmitGlobalDeclMetadata ( CodeGenModule & CGM, llvm::NamedMDNode *& GlobalMetadata, GlobalDecl D, llvm::GlobalValue * Addr ) static ◆ emitUsed() static void emitUsed ( CodeGenModule & CGM, StringRef Name, std::vector< llvm::WeakTrackingVH > & List ) static ◆ GeneralizeFunctionType() ◆ GeneralizeType() ◆ GenerateStringLiteral() static llvm::GlobalVariable * GenerateStringLiteral ( llvm::Constant * C, llvm::GlobalValue::LinkageTypes LT, CodeGenModule & CGM, StringRef GlobalName, CharUnits Alignment ) staticDefinition at line 6587 of file CodeGenModule.cpp.
References clang::C, clang::CharUnits::getAsAlign(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::GetGlobalConstantAddressSpace(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), clang::ASTContext::getTargetAddressSpace(), LT, clang::CodeGen::CodeGenModule::setDSOLocal(), and clang::CodeGen::CodeGenModule::supportsCOMDAT().
Referenced by clang::CodeGen::CodeGenModule::GetAddrOfConstantCString(), and clang::CodeGen::CodeGenModule::GetAddrOfConstantStringFromLiteral().
◆ getAliasedGlobal() static const llvm::GlobalValue * getAliasedGlobal ( const llvm::GlobalValue * GV ) static ◆ GetConstantCFStringEntry() static llvm::StringMapEntry< llvm::GlobalVariable * > & GetConstantCFStringEntry ( llvm::StringMap< llvm::GlobalVariable * > & Map, const StringLiteral * Literal, bool TargetIsLSB, bool & IsUTF16, unsigned & StringLength ) static ◆ getCPUSpecificMangling() static std::string getCPUSpecificMangling ( const CodeGenModule & CGM, StringRef Name ) static ◆ getFMVPriority() static uint64_t getFMVPriority ( const TargetInfo & TI, const CodeGenFunction::FMVResolverOption & RO ) static ◆ GetLLVMTLSModel() static llvm::GlobalVariable::ThreadLocalMode GetLLVMTLSModel ( StringRef S ) static ◆ getLLVMVisibility() ◆ getMangledNameImpl()Definition at line 1877 of file CodeGenModule.cpp.
References clang::CodeGen::ABIInfo::appendAttributeMangling(), AppendCPUSpecificCPUDispatchMangling(), clang::CC_X86RegCall, clang::CPUDispatch, clang::CPUSpecific, clang::CodeGen::TargetCodeGenInfo::getABIInfo(), clang::FunctionType::getCallConv(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::NamedDecl::getIdentifier(), clang::GlobalDecl::getKernelReferenceKind(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CGCXXABI::getMangleContext(), clang::CodeGen::CodeGenModule::getModuleNameHash(), clang::GlobalDecl::getMultiVersionIndex(), clang::IdentifierInfo::getName(), clang::CodeGen::CodeGenModule::getTargetCodeGenInfo(), clang::GlobalDecl::getWithDecl(), isUniqueInternalLinkageDecl(), clang::MangleContext::mangleName(), clang::MangleContext::needsUniqueInternalLinkageNames(), clang::None, clang::CodeGen::CodeGenModule::printPostfixForExternalizedDecl(), clang::ASTContext::shouldExternalize(), clang::MangleContext::shouldMangleDeclName(), clang::Stub, clang::Target, clang::TargetClones, and clang::TargetVersion.
Referenced by clang::CodeGen::CodeGenModule::getMangledName().
◆ getMultiversionLinkage() ◆ GetPointerConstant() static llvm::Constant * GetPointerConstant ( llvm::LLVMContext & Context, const void * Ptr ) static ◆ GetRuntimeFunctionDecl() ◆ hasImplicitAttr()template<typename AttrT >
◆ HasNonDllImportDtor() ◆ hasUnwindExceptions() ◆ isStackProtectorOn() ◆ isUniqueInternalLinkageDecl() ◆ isVarDeclStrongDefinition()Definition at line 5798 of file CodeGenModule.cpp.
References D, clang::RecordDecl::fields(), clang::CharUnits::fromQuantity(), clang::Type::getAs(), clang::TargetInfo::getCXXABI(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ValueDecl::getType(), clang::ASTContext::getTypeAlignIfKnown(), clang::Decl::hasAttr(), clang::ASTContext::isAlignmentRequired(), clang::TargetCXXABI::isMicrosoft(), shouldBeInCOMDAT(), and clang::ASTContext::toBits().
Referenced by clang::CodeGen::CodeGenModule::getLLVMLinkageForDeclarator().
◆ LimitedCoverage() ◆ needsDestructMethod() ◆ removeImageAccessQualifier() static void removeImageAccessQualifier ( std::string & TyName ) static ◆ replaceDeclarationWith() static void replaceDeclarationWith ( llvm::GlobalValue * Old, llvm::Constant * New ) staticDefinition at line 4407 of file CodeGenModule.cpp.
◆ replaceUsesOfNonProtoConstant() static void replaceUsesOfNonProtoConstant ( llvm::Constant * old, llvm::Function * newFn ) static ◆ ReplaceUsesOfNonProtoTypeWithRealFunction() static void ReplaceUsesOfNonProtoTypeWithRealFunction ( llvm::GlobalValue * Old, llvm::Function * NewFn ) staticReplaceUsesOfNonProtoTypeWithRealFunction - This function is called when we implement a function with no prototype, e.g.
"int foo() {}". If there are existing call uses of the old function in the module, this adjusts them to call the new function directly.
This is not just a cleanup: the always_inline pass requires direct calls to functions to be able to inline them. If there is a bitcast in the way, it won't inline them. Instcombine normally deletes these calls, but it isn't run at -O0.
Definition at line 6067 of file CodeGenModule.cpp.
References replaceUsesOfNonProtoConstant().
◆ requiresMemberFunctionPointerTypeMetadata() ◆ setLinkageForGV() static void setLinkageForGV ( llvm::GlobalValue * GV, const NamedDecl * ND ) static ◆ setLLVMVisibility() static void setLLVMVisibility ( llvm::GlobalValue & GV, std::optional< llvm::GlobalValue::VisibilityTypes > V ) static ◆ setVisibilityFromDLLStorageClass() static void setVisibilityFromDLLStorageClass ( const clang::LangOptions & LO, llvm::Module & M ) static ◆ setWindowsItaniumDLLImport() static void setWindowsItaniumDLLImport ( CodeGenModule & CGM, bool Local, llvm::Function * F, StringRef Name ) static ◆ shouldAssumeDSOLocal() static bool shouldAssumeDSOLocal ( const CodeGenModule & CGM, llvm::GlobalValue * GV ) static ◆ shouldBeInCOMDAT()Definition at line 5462 of file CodeGenModule.cpp.
References D, clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::GetGVALinkageForFunction(), clang::ASTContext::GetGVALinkageForVariable(), clang::GVA_AvailableExternally, clang::GVA_DiscardableODR, clang::GVA_Internal, clang::GVA_StrongExternal, clang::GVA_StrongODR, clang::Decl::hasAttr(), and clang::CodeGen::CodeGenModule::supportsCOMDAT().
Referenced by isVarDeclStrongDefinition(), and clang::CodeGen::CodeGenModule::maybeSetTrivialComdat().
◆ AnnotationSection const char AnnotationSection[] = "llvm.metadata" staticRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4