LLVM
8.0.1
|
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
#include "llvm/IR/Comdat.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/GlobalObject.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Mangler.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCSectionCOFF.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCSectionWasm.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCSymbolELF.h"
#include "llvm/MC/MCValue.h"
#include "llvm/MC/SectionKind.h"
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include <cassert>
#include <string>
Go to the source code of this file.
Definition at line 1576 of file TargetLoweringObjectFileImpl.cpp.
References assert(), llvm::APInt::getBitWidth(), llvm::APInt::getLimitedValue(), Size, and llvm::utohexstr().
Referenced by scalarConstantToHexString().
Definition at line 1166 of file TargetLoweringObjectFileImpl.cpp.
References llvm::MCSectionMachO::hasAttribute(), llvm::MCAsmInfo::isSectionAtomizableBySymbols(), llvm::MachO::S_ATTR_NO_DEAD_STRIP, and llvm::ARMBuildAttrs::Section.
Referenced by llvm::TargetLoweringObjectFileMachO::getNameWithPrefix().
|
static |
Definition at line 902 of file TargetLoweringObjectFileImpl.cpp.
References C, llvm::GlobalValue::getComdat(), llvm::Comdat::getName(), and llvm::report_fatal_error().
Referenced by llvm::TargetLoweringObjectFileMachO::getExplicitSectionGlobal(), and llvm::TargetLoweringObjectFileMachO::SelectSectionForGlobal().
|
static |
Definition at line 491 of file TargetLoweringObjectFileImpl.cpp.
References llvm::dyn_cast(), llvm::MDOperand::get(), llvm::GlobalObject::getMetadata(), llvm::MDNode::getOperand(), llvm::TargetMachine::getSymbol(), llvm::LLVMContext::MD_associated, and llvm::report_fatal_error().
Referenced by llvm::TargetLoweringObjectFileELF::getExplicitSectionGlobal(), and llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal().
|
static |
Definition at line 1197 of file TargetLoweringObjectFileImpl.cpp.
References llvm::Triple::getArch(), llvm::TargetMachine::getTargetTriple(), llvm::COFF::IMAGE_SCN_CNT_CODE, llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA, llvm::COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA, llvm::COFF::IMAGE_SCN_MEM_16BIT, llvm::COFF::IMAGE_SCN_MEM_DISCARDABLE, llvm::COFF::IMAGE_SCN_MEM_EXECUTE, llvm::COFF::IMAGE_SCN_MEM_READ, llvm::COFF::IMAGE_SCN_MEM_WRITE, llvm::SectionKind::isBSS(), llvm::SectionKind::isMetadata(), llvm::SectionKind::isReadOnly(), llvm::SectionKind::isReadOnlyWithRel(), llvm::SectionKind::isText(), llvm::SectionKind::isThreadLocal(), isThumb(), llvm::SectionKind::isWriteable(), and llvm::Triple::thumb.
Referenced by llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileCOFF::getSectionForJumpTable(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().
|
static |
Definition at line 1302 of file TargetLoweringObjectFileImpl.cpp.
References llvm::SectionKind::isBSS(), llvm::SectionKind::isReadOnly(), llvm::SectionKind::isReadOnlyWithRel(), llvm::SectionKind::isText(), and llvm::SectionKind::isThreadLocal().
Referenced by llvm::TargetLoweringObjectFileCOFF::getSectionForJumpTable(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().
|
static |
Definition at line 1482 of file TargetLoweringObjectFileImpl.cpp.
References llvm::format(), llvm::MCContext::getAssociativeCOFFSection(), llvm::MCContext::getCOFFSection(), llvm::SectionKind::getData(), llvm::SectionKind::getReadOnly(), llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA, llvm::COFF::IMAGE_SCN_MEM_READ, llvm::COFF::IMAGE_SCN_MEM_WRITE, llvm::Triple::isKnownWindowsMSVCEnvironment(), llvm::Triple::isWindowsItaniumEnvironment(), and Name.
Referenced by llvm::TargetLoweringObjectFileCOFF::getStaticCtorSection(), and llvm::TargetLoweringObjectFileCOFF::getStaticDtorSection().
|
static |
Definition at line 1233 of file TargetLoweringObjectFileImpl.cpp.
References assert(), C, llvm::GlobalValue::getComdat(), llvm::Comdat::getName(), llvm::Module::getNamedValue(), llvm::GlobalValue::getParent(), and llvm::report_fatal_error().
Referenced by llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), getSelectionForCOFF(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().
|
static |
Definition at line 479 of file TargetLoweringObjectFileImpl.cpp.
References llvm::Comdat::Any, C, llvm::GlobalValue::getComdat(), llvm::Comdat::getName(), llvm::Comdat::getSelectionKind(), and llvm::report_fatal_error().
Referenced by llvm::TargetLoweringObjectFileELF::getExplicitSectionGlobal(), and selectELFSectionForGlobal().
|
static |
Definition at line 390 of file TargetLoweringObjectFileImpl.cpp.
References llvm::Triple::ELF, llvm::StringRef::empty(), llvm::SectionKind::getBSS(), llvm::getInstrProfSectionName(), llvm::SectionKind::getMetadata(), llvm::SectionKind::getThreadBSS(), llvm::SectionKind::getThreadData(), and llvm::StringRef::startswith().
Referenced by llvm::TargetLoweringObjectFileELF::getExplicitSectionGlobal().
|
static |
Definition at line 452 of file TargetLoweringObjectFileImpl.cpp.
References llvm::SectionKind::isExecuteOnly(), llvm::SectionKind::isMergeableConst(), llvm::SectionKind::isMergeableCString(), llvm::SectionKind::isMetadata(), llvm::SectionKind::isText(), llvm::SectionKind::isThreadLocal(), llvm::SectionKind::isWriteable(), llvm::ELF::SHF_ALLOC, llvm::ELF::SHF_ARM_PURECODE, llvm::ELF::SHF_EXECINSTR, llvm::ELF::SHF_MERGE, llvm::ELF::SHF_STRINGS, llvm::ELF::SHF_TLS, and llvm::ELF::SHF_WRITE.
Referenced by llvm::TargetLoweringObjectFileELF::getExplicitSectionGlobal(), and llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal().
|
static |
Definition at line 430 of file TargetLoweringObjectFileImpl.cpp.
References llvm::SectionKind::isBSS(), llvm::SectionKind::isThreadBSS(), llvm::ELF::SHT_FINI_ARRAY, llvm::ELF::SHT_INIT_ARRAY, llvm::ELF::SHT_NOBITS, llvm::ELF::SHT_NOTE, llvm::ELF::SHT_PREINIT_ARRAY, llvm::ELF::SHT_PROGBITS, and llvm::StringRef::startswith().
Referenced by llvm::TargetLoweringObjectFileELF::getExplicitSectionGlobal(), and selectELFSectionForGlobal().
|
static |
Definition at line 509 of file TargetLoweringObjectFileImpl.cpp.
References assert(), llvm::SectionKind::isMergeable1ByteCString(), llvm::SectionKind::isMergeable2ByteCString(), llvm::SectionKind::isMergeable4ByteCString(), llvm::SectionKind::isMergeableConst(), llvm::SectionKind::isMergeableConst16(), llvm::SectionKind::isMergeableConst32(), llvm::SectionKind::isMergeableConst4(), llvm::SectionKind::isMergeableConst8(), and llvm::SectionKind::isMergeableCString().
Referenced by llvm::TargetLoweringObjectFileELF::getExplicitSectionGlobal(), and selectELFSectionForGlobal().
|
static |
Definition at line 65 of file TargetLoweringObjectFileImpl.cpp.
References llvm::Module::getModuleFlagsMetadata(), and llvm::Module::Require.
Referenced by llvm::TargetLoweringObjectFileELF::emitModuleMetadata(), llvm::TargetLoweringObjectFileMachO::emitModuleMetadata(), and llvm::TargetLoweringObjectFileCOFF::emitModuleMetadata().
|
static |
Return the section prefix name used by options FunctionsSections and DataSections.
Definition at line 587 of file TargetLoweringObjectFileImpl.cpp.
References assert(), llvm::SectionKind::isBSS(), llvm::SectionKind::isData(), llvm::SectionKind::isReadOnly(), llvm::SectionKind::isReadOnlyWithRel(), llvm::SectionKind::isText(), llvm::SectionKind::isThreadBSS(), and llvm::SectionKind::isThreadData().
Referenced by selectELFSectionForGlobal(), and selectWasmSectionForGlobal().
|
static |
Definition at line 1250 of file TargetLoweringObjectFileImpl.cpp.
References llvm::Comdat::Any, C, llvm::Comdat::ExactMatch, llvm::GlobalValue::getBaseObject(), llvm::GlobalValue::getComdat(), getComdatGVForCOFF(), llvm::COFF::IMAGE_COMDAT_SELECT_ANY, llvm::COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE, llvm::COFF::IMAGE_COMDAT_SELECT_EXACT_MATCH, llvm::COFF::IMAGE_COMDAT_SELECT_LARGEST, llvm::COFF::IMAGE_COMDAT_SELECT_NODUPLICATES, llvm::COFF::IMAGE_COMDAT_SELECT_SAME_SIZE, llvm::Comdat::Largest, llvm::Comdat::NoDuplicates, and llvm::Comdat::SameSize.
Referenced by llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().
|
static |
Definition at line 728 of file TargetLoweringObjectFileImpl.cpp.
References llvm::format(), llvm::MCContext::getELFSection(), llvm::MCSymbol::getName(), Name, llvm::ELF::SHF_ALLOC, llvm::ELF::SHF_GROUP, llvm::ELF::SHF_WRITE, llvm::ELF::SHT_FINI_ARRAY, llvm::ELF::SHT_INIT_ARRAY, llvm::ELF::SHT_PROGBITS, and llvm::utostr().
Referenced by llvm::TargetLoweringObjectFileELF::getStaticCtorSection(), and llvm::TargetLoweringObjectFileELF::getStaticDtorSection().
|
static |
Definition at line 1657 of file TargetLoweringObjectFileImpl.cpp.
References llvm::Comdat::Any, C, llvm::GlobalValue::getComdat(), llvm::Comdat::getName(), llvm::Comdat::getSelectionKind(), and llvm::report_fatal_error().
Referenced by llvm::TargetLoweringObjectFileWasm::getExplicitSectionGlobal(), and selectWasmSectionForGlobal().
|
static |
Definition at line 1670 of file TargetLoweringObjectFileImpl.cpp.
References llvm::SectionKind::getData(), llvm::SectionKind::getText(), and llvm::SectionKind::isText().
Referenced by llvm::TargetLoweringObjectFileWasm::getExplicitSectionGlobal().
Definition at line 1586 of file TargetLoweringObjectFileImpl.cpp.
References APIntToHexString(), E, llvm::Constant::getAggregateElement(), llvm::Type::getArrayNumElements(), llvm::APInt::getNullValue(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), and I.
Referenced by llvm::TargetLoweringObjectFileCOFF::getSectionForConstant().
|
static |
Definition at line 604 of file TargetLoweringObjectFileImpl.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, C, F(), llvm::MCContext::GenericSectionID, llvm::Module::getDataLayout(), getELFComdat(), llvm::MCContext::getELFSection(), getELFSectionType(), getEntrySizeForKind(), llvm::Value::getName(), llvm::TargetMachine::getNameWithPrefix(), llvm::GlobalValue::getParent(), llvm::DataLayout::getPreferredAlignment(), getSectionPrefixForGlobal(), llvm::TargetMachine::getUniqueSectionNames(), llvm::SectionKind::isExecuteOnly(), llvm::SectionKind::isMergeableConst(), llvm::SectionKind::isMergeableCString(), Name, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::ELF::SHF_GROUP, and llvm::utostr().
Referenced by llvm::TargetLoweringObjectFileELF::getSectionForJumpTable(), and llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal().
|
static |
Definition at line 1701 of file TargetLoweringObjectFileImpl.cpp.
References C, F(), llvm::MCContext::GenericSectionID, llvm::Value::getName(), llvm::TargetMachine::getNameWithPrefix(), getSectionPrefixForGlobal(), llvm::TargetMachine::getUniqueSectionNames(), getWasmComdat(), llvm::MCContext::getWasmSection(), Name, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::TargetLoweringObjectFileWasm::SelectSectionForGlobal().