Lines Matching refs:Module

1 //===- Module.cpp - Implement the Module class ----------------------------===//
9 // This file implements the Module class for the IR library.
13 #include "llvm/IR/Module.h"
70 // Primitive Module methods.
73 Module::Module(StringRef MID, LLVMContext &C)
80 Module &Module::operator=(Module &&Other) {
81 assert(&Context == &Other.Context && "Module must be in the same Context");
115 Module::~Module() {
124 void Module::removeDebugIntrinsicDeclarations() {
148 Module::createRNG(const StringRef Name) const {
152 // when the Module ID and thus the input filename is the same. This
159 // const reference to their IR Module. Alternatively we can always
160 // store salt metadata from the Module constructor.
170 GlobalValue *Module::getNamedValue(StringRef Name) const {
174 unsigned Module::getNumNamedValues() const {
180 unsigned Module::getMDKindID(StringRef Name) const {
187 void Module::getMDKindNames(SmallVectorImpl<StringRef> &Result) const {
191 void Module::getOperandBundleTags(SmallVectorImpl<StringRef> &Result) const {
204 FunctionCallee Module::getOrInsertFunction(StringRef Name, FunctionType *Ty,
221 FunctionCallee Module::getOrInsertFunction(StringRef Name, FunctionType *Ty) {
228 Function *Module::getFunction(StringRef Name) const {
243 GlobalVariable *Module::getGlobalVariable(StringRef Name,
258 Constant *Module::getOrInsertGlobal(
272 Constant *Module::getOrInsertGlobal(StringRef Name, Type *Ty) {
286 GlobalAlias *Module::getNamedAlias(StringRef Name) const {
290 GlobalIFunc *Module::getNamedIFunc(StringRef Name) const {
297 NamedMDNode *Module::getNamedMetadata(StringRef Name) const {
304 NamedMDNode *Module::getOrInsertNamedMetadata(StringRef Name) {
318 void Module::eraseNamedMetadata(NamedMDNode *NMD) {
325 bool Module::isValidModFlagBehavior(Metadata *MD, ModFlagBehavior &MFB) {
337 void Module::
354 Metadata *Module::getModuleFlag(StringRef Key) const {
368 NamedMDNode *Module::getOrInsertModuleFlagsMetadata() {
377 void Module::addModuleFlag(ModFlagBehavior Behavior, StringRef Key,
385 void Module::addModuleFlag(ModFlagBehavior Behavior, StringRef Key,
389 void Module::addModuleFlag(ModFlagBehavior Behavior, StringRef Key,
394 void Module::addModuleFlag(MDNode *Node) {
403 void Module::setModuleFlag(ModFlagBehavior Behavior, StringRef Key,
415 void Module::setModuleFlag(ModFlagBehavior Behavior, StringRef Key,
419 void Module::setModuleFlag(ModFlagBehavior Behavior, StringRef Key,
425 void Module::setDataLayout(StringRef Desc) { DL = DataLayout(Desc); }
427 void Module::setDataLayout(const DataLayout &Other) { DL = Other; }
429 DICompileUnit *Module::debug_compile_units_iterator::operator*() const {
432 DICompileUnit *Module::debug_compile_units_iterator::operator->() const {
436 void Module::debug_compile_units_iterator::SkipNoDebugCUs() {
442 iterator_range<Module::global_object_iterator> Module::global_objects() {
445 iterator_range<Module::const_global_object_iterator>
446 Module::global_objects() const {
450 iterator_range<Module::global_value_iterator> Module::global_values() {
453 iterator_range<Module::const_global_value_iterator>
454 Module::global_values() const {
459 // Methods to control the materialization of GlobalValues in the Module.
461 void Module::setMaterializer(GVMaterializer *GVM) {
463 "Module already has a GVMaterializer. Call materializeAll"
468 Error Module::materialize(GlobalValue *GV) {
475 Error Module::materializeAll() {
482 Error Module::materializeMetadata() {
492 std::vector<StructType *> Module::getIdentifiedStructTypes() const {
506 std::string Module::getUniqueIntrinsicName(StringRef BaseName, Intrinsic::ID Id,
563 void Module::dropAllReferences() {
577 unsigned Module::getNumberRegisterParameters() const {
585 unsigned Module::getDwarfVersion() const {
592 bool Module::isDwarf64() const {
597 unsigned Module::getCodeViewFlag() const {
604 unsigned Module::getInstructionCount() const {
611 Comdat *Module::getOrInsertComdat(StringRef Name) {
617 PICLevel::Level Module::getPICLevel() const {
627 void Module::setPICLevel(PICLevel::Level PL) {
633 PIELevel::Level Module::getPIELevel() const {
643 void Module::setPIELevel(PIELevel::Level PL) {
647 std::optional<CodeModel::Model> Module::getCodeModel() const {
657 void Module::setCodeModel(CodeModel::Model CL) {
665 std::optional<uint64_t> Module::getLargeDataThreshold() const {
675 void Module::setLargeDataThreshold(uint64_t Threshold) {
682 void Module::setProfileSummary(Metadata *M, ProfileSummary::Kind Kind) {
689 Metadata *Module::getProfileSummary(bool IsCS) const {
694 bool Module::getSemanticInterposition() const {
704 void Module::setSemanticInterposition(bool SI) {
708 void Module::setOwnedMemoryBuffer(std::unique_ptr<MemoryBuffer> MB) {
712 bool Module::getRtLibUseGOT() const {
717 void Module::setRtLibUseGOT() {
721 bool Module::getDirectAccessExternalData() const {
729 void Module::setDirectAccessExternalData(bool Value) {
733 UWTableKind Module::getUwtable() const {
739 void Module::setUwtable(UWTableKind Kind) {
743 FramePointerKind Module::getFramePointer() const {
749 void Module::setFramePointer(FramePointerKind Kind) {
753 StringRef Module::getStackProtectorGuard() const {
760 void Module::setStackProtectorGuard(StringRef Kind) {
765 StringRef Module::getStackProtectorGuardReg() const {
772 void Module::setStackProtectorGuardReg(StringRef Reg) {
777 StringRef Module::getStackProtectorGuardSymbol() const {
784 void Module::setStackProtectorGuardSymbol(StringRef Symbol) {
789 int Module::getStackProtectorGuardOffset() const {
796 void Module::setStackProtectorGuardOffset(int Offset) {
800 unsigned Module::getOverrideStackAlignment() const {
807 unsigned Module::getMaxTLSAlignment() const {
814 void Module::setOverrideStackAlignment(unsigned Align) {
818 static void addSDKVersionMD(const VersionTuple &V, Module &M, StringRef Name) {
828 M.addModuleFlag(Module::ModFlagBehavior::Warning, Name,
832 void Module::setSDKVersion(const VersionTuple &V) {
861 VersionTuple Module::getSDKVersion() const {
866 const Module &M, SmallVectorImpl<GlobalValue *> &Vec, bool CompilerUsed) {
880 void Module::setPartialSampleProfileRatio(const ModuleSummaryIndex &Index) {
900 StringRef Module::getDarwinTargetVariantTriple() const {
906 void Module::setDarwinTargetVariantTriple(StringRef T) {
911 VersionTuple Module::getDarwinTargetVariantSDKVersion() const {
915 void Module::setDarwinTargetVariantSDKVersion(VersionTuple Version) {