LLVM 20.0.0git
|
#include "llvm/AsmParser/LLParser.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/AsmParser/LLToken.h"
#include "llvm/AsmParser/SlotMapping.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/AutoUpgrade.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/Comdat.h"
#include "llvm/IR/ConstantRange.h"
#include "llvm/IR/ConstantRangeList.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalIFunc.h"
#include "llvm/IR/GlobalObject.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/Value.h"
#include "llvm/IR/ValueSymbolTable.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/ModRef.h"
#include "llvm/Support/SaveAndRestore.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstring>
#include <optional>
#include <vector>
#include "llvm/IR/Attributes.inc"
#include "llvm/IR/Metadata.def"
Go to the source code of this file.
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
#define | GET_ATTR_NAMES |
#define | ATTRIBUTE_ENUM(ENUM_NAME, DISPLAY_NAME) |
#define | HANDLE_SPECIALIZED_MDNODE_LEAF(CLASS) |
#define | DECLARE_FIELD(NAME, TYPE, INIT) TYPE NAME INIT |
#define | NOP_FIELD(NAME, TYPE, INIT) |
#define | REQUIRE_FIELD(NAME, TYPE, INIT) |
#define | PARSE_MD_FIELD(NAME, TYPE, DEFAULT) |
#define | PARSE_MD_FIELDS() |
#define | GET_OR_DISTINCT(CLASS, ARGS) (IsDistinct ? CLASS::getDistinct ARGS : CLASS::get ARGS) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
#define | VISIT_MD_FIELDS(OPTIONAL, REQUIRED) |
Functions | |
static std::string | getTypeString (Type *T) |
static void | dropIntrinsicWithUnknownMetadataArgument (IntrinsicInst *II) |
static bool | isValidVisibilityForLinkage (unsigned V, unsigned L) |
static bool | isValidDLLStorageClassForLinkage (unsigned S, unsigned L) |
static void | maybeSetDSOLocal (bool DSOLocal, GlobalValue &GV) |
static bool | isSanitizer (lltok::Kind Kind) |
static Attribute::AttrKind | tokenToAttribute (lltok::Kind Kind) |
static bool | upgradeMemoryAttr (MemoryEffects &ME, lltok::Kind Kind) |
static GlobalValue * | createGlobalFwdRef (Module *M, PointerType *PTy) |
static unsigned | parseOptionalLinkageAux (lltok::Kind Kind, bool &HasLinkage) |
static std::optional< MemoryEffects::Location > | keywordToLoc (lltok::Kind Tok) |
static std::optional< ModRefInfo > | keywordToModRef (lltok::Kind Tok) |
static unsigned | keywordToFPClassTest (lltok::Kind Tok) |
bool | isOldDbgFormatIntrinsic (StringRef Name) |
static void | resolveFwdRef (ValueInfo *Fwd, ValueInfo &Resolved) |
Variables | |
static cl::opt< bool > | AllowIncompleteIR ("allow-incomplete-ir", cl::init(false), cl::Hidden, cl::desc("Allow incomplete IR on a best effort basis (references to unknown " "metadata will be dropped)")) |
llvm::cl::opt< bool > | UseNewDbgInfoFormat |
cl::opt< cl::boolOrDefault > | PreserveInputDbgFormat |
bool | WriteNewDbgInfoFormatToBitcode |
cl::opt< bool > | WriteNewDbgInfoFormat |
static ValueInfo | EmptyVI |
static const auto | FwdVIRef = (GlobalValueSummaryMapTy::value_type *)-8 |
#define ATTRIBUTE_ENUM | ( | ENUM_NAME, | |
DISPLAY_NAME | |||
) |
Definition at line 5151 of file LLParser.cpp.
#define GET_ATTR_NAMES |
#define GET_OR_DISTINCT | ( | CLASS, | |
ARGS | |||
) | (IsDistinct ? CLASS::getDistinct ARGS : CLASS::get ARGS) |
Definition at line 5173 of file LLParser.cpp.
#define HANDLE_SPECIALIZED_MDNODE_LEAF | ( | CLASS | ) |
#define NOP_FIELD | ( | NAME, | |
TYPE, | |||
INIT | |||
) |
Definition at line 5152 of file LLParser.cpp.
#define PARSE_MD_FIELD | ( | NAME, | |
TYPE, | |||
DEFAULT | |||
) |
Definition at line 5156 of file LLParser.cpp.
#define PARSE_MD_FIELDS | ( | ) |
Definition at line 5159 of file LLParser.cpp.
#define REQUIRE_FIELD | ( | NAME, | |
TYPE, | |||
INIT | |||
) |
Definition at line 5153 of file LLParser.cpp.
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
#define VISIT_MD_FIELDS | ( | OPTIONAL, | |
REQUIRED | |||
) |
|
inlinestatic |
Definition at line 1751 of file LLParser.cpp.
References llvm::GlobalValue::ExternalWeakLinkage, llvm::Type::getInt8Ty(), and llvm::GlobalValue::NotThreadLocal.
|
static |
Definition at line 155 of file LLParser.cpp.
References assert(), llvm::SmallVectorBase< Size_T >::empty(), II, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
static |
Definition at line 71 of file LLParser.cpp.
References llvm::raw_string_ostream::str().
Referenced by StackAccess::print().
Definition at line 6309 of file LLParser.cpp.
References llvm::Intrinsic::lookupIntrinsicID(), and Name.
|
static |
Definition at line 1304 of file LLParser.cpp.
References llvm::lltok::kw_no_sanitize_address, llvm::lltok::kw_no_sanitize_hwaddress, and llvm::lltok::kw_sanitize_address_dyninit.
Definition at line 1139 of file LLParser.cpp.
References llvm::GlobalValue::DefaultStorageClass, and llvm::GlobalValue::isLocalLinkage().
Definition at line 1135 of file LLParser.cpp.
References llvm::GlobalValue::DefaultVisibility, and llvm::GlobalValue::isLocalLinkage().
|
static |
Definition at line 2566 of file LLParser.cpp.
References llvm::fcAllFlags, llvm::fcInf, llvm::fcNan, llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcNormal, llvm::fcPosInf, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcPosZero, llvm::fcQNan, llvm::fcSNan, llvm::fcSubnormal, llvm::fcZero, llvm::lltok::kw_all, llvm::lltok::kw_inf, llvm::lltok::kw_nan, llvm::lltok::kw_ninf, llvm::lltok::kw_nnorm, llvm::lltok::kw_norm, llvm::lltok::kw_nsub, llvm::lltok::kw_nzero, llvm::lltok::kw_pinf, llvm::lltok::kw_pnorm, llvm::lltok::kw_psub, llvm::lltok::kw_pzero, llvm::lltok::kw_qnan, llvm::lltok::kw_snan, llvm::lltok::kw_sub, and llvm::lltok::kw_zero.
|
static |
Definition at line 2485 of file LLParser.cpp.
References llvm::ArgMem, llvm::InaccessibleMem, llvm::lltok::kw_argmem, and llvm::lltok::kw_inaccessiblemem.
|
static |
Definition at line 2496 of file LLParser.cpp.
References llvm::lltok::kw_none, llvm::lltok::kw_read, llvm::lltok::kw_readwrite, llvm::lltok::kw_write, llvm::Mod, llvm::ModRef, llvm::NoModRef, and llvm::Ref.
|
static |
Definition at line 1146 of file LLParser.cpp.
References llvm::GlobalValue::setDSOLocal().
|
static |
Definition at line 2020 of file LLParser.cpp.
References llvm::GlobalValue::AppendingLinkage, llvm::GlobalValue::AvailableExternallyLinkage, llvm::GlobalValue::CommonLinkage, llvm::GlobalValue::ExternalLinkage, llvm::GlobalValue::ExternalWeakLinkage, llvm::GlobalValue::InternalLinkage, llvm::lltok::kw_appending, llvm::lltok::kw_available_externally, llvm::lltok::kw_common, llvm::lltok::kw_extern_weak, llvm::lltok::kw_external, llvm::lltok::kw_internal, llvm::lltok::kw_linkonce, llvm::lltok::kw_linkonce_odr, llvm::lltok::kw_private, llvm::lltok::kw_weak, llvm::lltok::kw_weak_odr, llvm::GlobalValue::LinkOnceAnyLinkage, llvm::GlobalValue::LinkOnceODRLinkage, llvm::GlobalValue::PrivateLinkage, llvm::GlobalValue::WeakAnyLinkage, and llvm::GlobalValue::WeakODRLinkage.
Definition at line 9216 of file LLParser.cpp.
References assert(), llvm::ValueInfo::isReadOnly(), llvm::ValueInfo::isWriteOnly(), llvm::ValueInfo::setReadOnly(), and llvm::ValueInfo::setWriteOnly().
|
static |
Definition at line 1536 of file LLParser.cpp.
References llvm::Attribute::None.
|
static |
Definition at line 1654 of file LLParser.cpp.
References llvm::MemoryEffectsBase< LocationEnum >::argMemOnly(), llvm::MemoryEffectsBase< LocationEnum >::inaccessibleMemOnly(), llvm::MemoryEffectsBase< LocationEnum >::inaccessibleOrArgMemOnly(), llvm::lltok::kw_argmemonly, llvm::lltok::kw_inaccessiblemem_or_argmemonly, llvm::lltok::kw_inaccessiblememonly, llvm::MemoryEffectsBase< LocationEnum >::none(), llvm::MemoryEffectsBase< LocationEnum >::readOnly(), and llvm::MemoryEffectsBase< LocationEnum >::writeOnly().
|
static |
|
static |
Definition at line 8857 of file LLParser.cpp.
Referenced by llvm::yaml::CustomMappingTraits< GlobalValueSummaryMapTy >::fixAliaseeLinks().
|
static |
Definition at line 9214 of file LLParser.cpp.
|
extern |
|
extern |
Referenced by llvm::printMIR(), llvm::PrintFunctionPass::run(), and llvm::PrintModulePass::run().
|
extern |
Definition at line 47 of file BasicBlock.cpp.
Referenced by llvm::BitcodeWriterPass::run(), and llvm::ThinLTOBitcodeWriterPass::run().