47#include <system_error>
57#define DEBUG_TYPE "ir"
75 *Major = LLVM_VERSION_MAJOR;
77 *Minor = LLVM_VERSION_MINOR;
79 *Patch = LLVM_VERSION_PATCH;
85 return strdup(Message);
108 void *DiagnosticContext) {
109 unwrap(
C)->setDiagnosticHandlerCallBack(
117 unwrap(
C)->getDiagnosticHandlerCallBack());
121 return unwrap(
C)->getDiagnosticContext();
125 void *OpaqueHandle) {
128 unwrap(
C)->setYieldCallback(YieldCallback, OpaqueHandle);
132 return unwrap(
C)->shouldDiscardValueNames();
136 unwrap(
C)->setDiscardValueNames(Discard);
161 return Attribute::AttrKind::EndAttrKinds;
172 return unwrap(
A).getKindAsEnum();
177 if (Attr.isEnumAttribute())
179 return Attr.getValueAsInt();
191 return wrap(Attr.getValueAsType());
209 const char *K,
unsigned KLength,
210 const char *V,
unsigned VLength) {
217 auto S =
unwrap(
A).getKindAsString();
224 auto S =
unwrap(
A).getValueAsString();
231 return Attr.isEnumAttribute() || Attr.isIntAttribute();
235 return unwrap(
A).isStringAttribute();
239 return unwrap(
A).isTypeAttribute();
243 std::string MsgStorage;
256 switch(
unwrap(DI)->getSeverity()) {
290 auto &Str =
unwrap(M)->getModuleIdentifier();
300 auto &Str =
unwrap(M)->getSourceFileName();
311 return unwrap(M)->getDataLayoutStr().c_str();
319 unwrap(M)->setDataLayout(DataLayoutStr);
324 return unwrap(M)->getTargetTriple().str().c_str();
343 return Module::ModFlagBehavior::Error;
345 return Module::ModFlagBehavior::Warning;
347 return Module::ModFlagBehavior::Require;
349 return Module::ModFlagBehavior::Override;
351 return Module::ModFlagBehavior::Append;
353 return Module::ModFlagBehavior::AppendUnique;
361 case Module::ModFlagBehavior::Error:
363 case Module::ModFlagBehavior::Warning:
365 case Module::ModFlagBehavior::Require:
367 case Module::ModFlagBehavior::Override:
369 case Module::ModFlagBehavior::Append:
371 case Module::ModFlagBehavior::AppendUnique:
380 unwrap(M)->getModuleFlagsMetadata(MFEs);
384 for (
unsigned i = 0; i < MFEs.
size(); ++i) {
385 const auto &ModuleFlag = MFEs[i];
387 Result[i].Key = ModuleFlag.Key->getString().data();
388 Result[i].KeyLen = ModuleFlag.Key->getString().size();
389 Result[i].Metadata =
wrap(ModuleFlag.Val);
408 unsigned Index,
size_t *Len) {
423 const char *Key,
size_t KeyLen) {
424 return wrap(
unwrap(M)->getModuleFlag({Key, KeyLen}));
428 const char *Key,
size_t KeyLen,
431 {Key, KeyLen},
unwrap(Val));
450 char **ErrorMessage) {
454 *ErrorMessage = strdup(EC.message().c_str());
463 std::string E =
"Error printing to file: " + dest.
error().message();
464 *ErrorMessage = strdup(E.c_str());
478 return strdup(buf.c_str());
495 auto &Str =
unwrap(M)->getModuleInlineAsm();
501 size_t AsmStringSize,
const char *Constraints,
502 size_t ConstraintsSize,
LLVMBool HasSideEffects,
517 HasSideEffects, IsAlignStack, AD, CanThrow));
522 Value *Val = unwrap<Value>(InlineAsmVal);
523 StringRef AsmString = cast<InlineAsm>(Val)->getAsmString();
525 *Len = AsmString.
size();
526 return AsmString.
data();
531 Value *Val = unwrap<Value>(InlineAsmVal);
532 StringRef ConstraintString = cast<InlineAsm>(Val)->getConstraintString();
534 *Len = ConstraintString.
size();
535 return ConstraintString.
data();
540 Value *Val = unwrap<Value>(InlineAsmVal);
555 Value *Val = unwrap<Value>(InlineAsmVal);
556 return (
LLVMTypeRef)cast<InlineAsm>(Val)->getFunctionType();
560 Value *Val = unwrap<Value>(InlineAsmVal);
561 return cast<InlineAsm>(Val)->hasSideEffects();
565 Value *Val = unwrap<Value>(InlineAsmVal);
566 return cast<InlineAsm>(Val)->isAlignStack();
570 Value *Val = unwrap<Value>(InlineAsmVal);
571 return cast<InlineAsm>(Val)->canThrow();
634 return unwrap(Ty)->isSized();
652 os <<
"Printing <null> Type";
656 return strdup(buf.c_str());
706 return unwrap<IntegerType>(IntegerTy)->getBitWidth();
767 return wrap(FunctionType::get(
unwrap(ReturnType), Tys, IsVarArg != 0));
771 return unwrap<FunctionType>(FunctionTy)->isVarArg();
775 return wrap(unwrap<FunctionType>(FunctionTy)->getReturnType());
779 return unwrap<FunctionType>(FunctionTy)->getNumParams();
784 for (
Type *
T : Ty->params())
810 if (!
Type->hasName())
812 return Type->getName().data();
818 unwrap<StructType>(StructTy)->setBody(Tys, Packed != 0);
822 return unwrap<StructType>(StructTy)->getNumElements();
826 StructType *Ty = unwrap<StructType>(StructTy);
832 StructType *Ty = unwrap<StructType>(StructTy);
837 return unwrap<StructType>(StructTy)->isPacked();
841 return unwrap<StructType>(StructTy)->isOpaque();
845 return unwrap<StructType>(StructTy)->isLiteral();
860 for (
auto *
T :
unwrap(Tp)->subtypes()) {
893 auto *Ty =
unwrap(WrappedTy);
894 if (
auto *ATy = dyn_cast<ArrayType>(Ty))
895 return wrap(ATy->getElementType());
896 return wrap(cast<VectorType>(Ty)->getElementType());
900 return unwrap(Tp)->getNumContainedTypes();
904 return unwrap<ArrayType>(ArrayTy)->getNumElements();
908 return unwrap<ArrayType>(ArrayTy)->getNumElements();
912 return unwrap<PointerType>(
PointerTy)->getAddressSpace();
916 return unwrap<VectorType>(VectorTy)->getElementCount().getKnownMinValue();
920 return wrap(unwrap<ConstantPtrAuth>(PtrAuth)->getPointer());
924 return wrap(unwrap<ConstantPtrAuth>(PtrAuth)->getKey());
928 return wrap(unwrap<ConstantPtrAuth>(PtrAuth)->getDiscriminator());
932 return wrap(unwrap<ConstantPtrAuth>(PtrAuth)->getAddrDiscriminator());
963 unsigned TypeParamCount,
965 unsigned IntParamCount) {
974 return Type->getName().data();
979 return Type->getNumTypeParameters();
990 return Type->getNumIntParameters();
995 return Type->getIntParameter(
Idx);
1007 switch(
unwrap(Val)->getValueID()) {
1009#define HANDLE_VALUE(Name) \
1010 case Value::Name##Val: \
1011 return LLVM##Name##ValueKind;
1012#include "llvm/IR/Value.def"
1020 *
Length = V->getName().size();
1021 return V->getName().data();
1047 os <<
"Printing <null> Value";
1051 return strdup(buf.c_str());
1065 os <<
"Printing <null> DbgRecord";
1069 return strdup(buf.c_str());
1077 return unwrap<Instruction>(Inst)->hasMetadata();
1081 auto *
I = unwrap<Instruction>(Inst);
1082 assert(
I &&
"Expected instruction");
1083 if (
auto *MD =
I->getMetadata(KindID))
1093 assert((isa<MDNode>(MD) || isa<ConstantAsMetadata>(MD)) &&
1094 "Expected a metadata node or a canonicalized constant");
1096 if (
MDNode *
N = dyn_cast<MDNode>(MD))
1105 unwrap<Instruction>(Inst)->setMetadata(KindID,
N);
1123 for (
unsigned i = 0; i < MVEs.
size(); ++i) {
1124 const auto &ModuleFlag = MVEs[i];
1125 Result[i].Kind = ModuleFlag.first;
1126 Result[i].Metadata =
wrap(ModuleFlag.second);
1128 *NumEntries = MVEs.
size();
1134 size_t *NumEntries) {
1137 unwrap<Instruction>(
Value)->getAllMetadata(Entries);
1143#define LLVM_DEFINE_VALUE_CAST(name) \
1144 LLVMValueRef LLVMIsA##name(LLVMValueRef Val) { \
1145 return wrap(static_cast<Value*>(dyn_cast_or_null<name>(unwrap(Val)))); \
1151 if (
auto *MD = dyn_cast_or_null<MetadataAsValue>(
unwrap(Val)))
1152 if (isa<MDNode>(MD->getMetadata()) ||
1153 isa<ValueAsMetadata>(MD->getMetadata()))
1159 if (
auto *MD = dyn_cast_or_null<MetadataAsValue>(
unwrap(Val)))
1160 if (isa<ValueAsMetadata>(MD->getMetadata()))
1166 if (
auto *MD = dyn_cast_or_null<MetadataAsValue>(
unwrap(Val)))
1167 if (isa<MDString>(MD->getMetadata()))
1176 if (
I == V->use_end())
1203 if (
auto *
C = dyn_cast<ConstantAsMetadata>(
Op))
1204 return wrap(
C->getValue());
1210 if (
auto *MD = dyn_cast<MetadataAsValue>(V)) {
1211 if (
auto *L = dyn_cast<ValueAsMetadata>(MD->getMetadata())) {
1212 assert(Index == 0 &&
"Function-local metadata can only have one operand");
1213 return wrap(L->getValue());
1216 cast<MDNode>(MD->getMetadata()), Index);
1219 return wrap(cast<User>(V)->getOperand(Index));
1224 return wrap(&cast<User>(V)->getOperandUse(Index));
1228 unwrap<User>(Val)->setOperand(Index,
unwrap(
Op));
1233 if (isa<MetadataAsValue>(V))
1236 return cast<User>(V)->getNumOperands();
1258 return isa<Constant>(
unwrap(Ty));
1263 return C->isNullValue();
1268 return isa<UndefValue>(
unwrap(Val));
1272 return isa<PoisonValue>(
unwrap(Val));
1306 for (
auto *OV :
ArrayRef(Vals, Count)) {
1311 else if (
auto *
C = dyn_cast<Constant>(V))
1313 else if (
auto *MDV = dyn_cast<MetadataAsValue>(V)) {
1314 MD = MDV->getMetadata();
1315 assert(!isa<LocalAsMetadata>(MD) &&
"Unexpected function-local metadata "
1316 "outside of direct argument to call");
1320 "Expected only one operand to function-local metadata");
1339 if (
auto *
C = dyn_cast<Constant>(V))
1341 if (
auto *MAV = dyn_cast<MetadataAsValue>(V))
1342 return wrap(MAV->getMetadata());
1347 if (
const auto *MD = dyn_cast<MetadataAsValue>(
unwrap(V)))
1348 if (
const MDString *S = dyn_cast<MDString>(MD->getMetadata())) {
1349 *
Length = S->getString().size();
1350 return S->getString().data();
1357 auto *MD = unwrap<MetadataAsValue>(V);
1358 if (isa<ValueAsMetadata>(MD->getMetadata()))
1360 return cast<MDNode>(MD->getMetadata())->getNumOperands();
1366 if (
I ==
Mod->named_metadata_end())
1374 if (
I ==
Mod->named_metadata_begin())
1396 const char *
Name,
size_t NameLen) {
1401 const char *
Name,
size_t NameLen) {
1402 return wrap(
unwrap(M)->getOrInsertNamedMetadata({
Name, NameLen}));
1412 auto *MD = unwrap<MetadataAsValue>(V);
1413 if (
auto *MDV = dyn_cast<ValueAsMetadata>(MD->getMetadata())) {
1414 *Dest =
wrap(MDV->getValue());
1417 const auto *
N = cast<MDNode>(MD->getMetadata());
1418 const unsigned numOperands =
N->getNumOperands();
1420 for (
unsigned i = 0; i < numOperands; i++)
1426 auto *MD = cast<MetadataAsValue>(
unwrap(V));
1427 auto *
N = cast<MDNode>(MD->getMetadata());
1428 N->replaceOperandWith(Index, unwrap<Metadata>(Replacement));
1433 return N->getNumOperands();
1444 for (
unsigned i=0;i<
N->getNumOperands();i++)
1459 if (!
Length)
return nullptr;
1461 if (
const auto *
I = dyn_cast<Instruction>(
unwrap(Val))) {
1462 if (
const auto &
DL =
I->getDebugLoc()) {
1463 S =
DL->getDirectory();
1465 }
else if (
const auto *GV = dyn_cast<GlobalVariable>(
unwrap(Val))) {
1467 GV->getDebugInfo(GVEs);
1470 S = DGV->getDirectory();
1471 }
else if (
const auto *
F = dyn_cast<Function>(
unwrap(Val))) {
1473 S = DSP->getDirectory();
1475 assert(0 &&
"Expected Instruction, GlobalVariable or Function");
1483 if (!
Length)
return nullptr;
1485 if (
const auto *
I = dyn_cast<Instruction>(
unwrap(Val))) {
1486 if (
const auto &
DL =
I->getDebugLoc()) {
1487 S =
DL->getFilename();
1489 }
else if (
const auto *GV = dyn_cast<GlobalVariable>(
unwrap(Val))) {
1491 GV->getDebugInfo(GVEs);
1494 S = DGV->getFilename();
1495 }
else if (
const auto *
F = dyn_cast<Function>(
unwrap(Val))) {
1497 S = DSP->getFilename();
1499 assert(0 &&
"Expected Instruction, GlobalVariable or Function");
1508 if (
const auto *
I = dyn_cast<Instruction>(
unwrap(Val))) {
1509 if (
const auto &
DL =
I->getDebugLoc()) {
1512 }
else if (
const auto *GV = dyn_cast<GlobalVariable>(
unwrap(Val))) {
1514 GV->getDebugInfo(GVEs);
1518 }
else if (
const auto *
F = dyn_cast<Function>(
unwrap(Val))) {
1522 assert(0 &&
"Expected Instruction, GlobalVariable or Function");
1530 if (
const auto *
I = dyn_cast<Instruction>(
unwrap(Val)))
1531 if (
const auto &
DL =
I->getDebugLoc())
1532 C =
DL->getColumn();
1540 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy),
N, SignExtend != 0));
1547 return wrap(ConstantInt::get(
1553 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy),
StringRef(Str),
1558 unsigned SLen,
uint8_t Radix) {
1559 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy),
StringRef(Str, SLen),
1577 return unwrap<ConstantInt>(ConstantVal)->getZExtValue();
1581 return unwrap<ConstantInt>(ConstantVal)->getSExtValue();
1585 ConstantFP *cFP = unwrap<ConstantFP>(ConstantVal) ;
1596 APF.
convert(APFloat::IEEEdouble(), APFloat::rmNearestTiesToEven, &APFLosesInfo);
1597 *LosesInfo = APFLosesInfo;
1609 DontNullTerminate == 0));
1618 DontNullTerminate == 0));
1628 return wrap(unwrap<Constant>(
C)->getAggregateElement(
Idx));
1632 return wrap(unwrap<ConstantDataSequential>(
C)->getElementAsConstant(idx));
1636 return unwrap<ConstantDataSequential>(
C)->isString();
1640 StringRef Str = unwrap<ConstantDataSequential>(
C)->getAsString();
1646 StringRef Str = unwrap<ConstantDataSequential>(
C)->getRawDataValues();
1647 *SizeInBytes = Str.size();
1664 size_t SizeInBytes) {
1673 Constant **Elements = unwrap<Constant>(ConstantVals, Count);
1687 Constant **Elements = unwrap<Constant>(ConstantVals, Count);
1688 StructType *Ty = unwrap<StructType>(StructTy);
1701 unwrap<Constant>(
Ptr), unwrap<ConstantInt>(Key),
1702 unwrap<ConstantInt>(Disc), unwrap<Constant>(AddrDisc)));
1711#define HANDLE_INST(num, opc, clas) case num: return LLVM##opc;
1712#include "llvm/IR/Instruction.def"
1720#define HANDLE_INST(num, opc, clas) case LLVM##opc: return num;
1721#include "llvm/IR/Instruction.def"
1786 unwrap<Constant>(RHSConstant)));
1792 unwrap<Constant>(RHSConstant)));
1798 unwrap<Constant>(RHSConstant)));
1803 unwrap<Constant>(RHSConstant)));
1809 unwrap<Constant>(RHSConstant)));
1815 unwrap<Constant>(RHSConstant)));
1820 unwrap<Constant>(RHSConstant)));
1827 Constant *Val = unwrap<Constant>(ConstantVal);
1833 unsigned NumIndices) {
1836 Constant *Val = unwrap<Constant>(ConstantVal);
1843 unsigned NumIndices,
1847 Constant *Val = unwrap<Constant>(ConstantVal);
1893 unwrap<Constant>(IndexConstant)));
1900 unwrap<Constant>(ElementValueConstant),
1901 unwrap<Constant>(IndexConstant)));
1910 unwrap<Constant>(VectorBConstant),
1915 const char *Constraints,
1919 Constraints, HasSideEffects, IsAlignStack));
1931 return wrap(unwrap<BlockAddress>(BlockAddr)->getBasicBlock());
1941 return unwrap<GlobalValue>(
Global)->isDeclaration();
1945 switch (unwrap<GlobalValue>(
Global)->getLinkage()) {
1991 errs() <<
"LLVMSetLinkage(): LLVMLinkOnceODRAutoHideLinkage is no "
1992 "longer supported.");
2018 <<
"LLVMSetLinkage(): LLVMDLLImportLinkage is no longer supported.");
2023 <<
"LLVMSetLinkage(): LLVMDLLExportLinkage is no longer supported.");
2030 errs() <<
"LLVMSetLinkage(): LLVMGhostLinkage is no longer supported.");
2041 return unwrap<GlobalValue>(
Global)->getSection().data();
2045 unwrap<GlobalObject>(
Global)->setSection(Section);
2050 unwrap<GlobalValue>(
Global)->getVisibility());
2054 unwrap<GlobalValue>(
Global)
2060 unwrap<GlobalValue>(
Global)->getDLLStorageClass());
2064 unwrap<GlobalValue>(
Global)->setDLLStorageClass(
2069 switch (unwrap<GlobalValue>(
Global)->getUnnamedAddr()) {
2070 case GlobalVariable::UnnamedAddr::None:
2072 case GlobalVariable::UnnamedAddr::Local:
2074 case GlobalVariable::UnnamedAddr::Global:
2083 switch (UnnamedAddr) {
2094 return unwrap<GlobalValue>(
Global)->hasGlobalUnnamedAddr();
2098 unwrap<GlobalValue>(
Global)->setUnnamedAddr(
2099 HasUnnamedAddr ? GlobalValue::UnnamedAddr::Global
2100 : GlobalValue::UnnamedAddr::None);
2112 return GV->getAlign() ? GV->getAlign()->value() : 0;
2114 return F->getAlign() ?
F->getAlign()->value() : 0;
2116 return AI->getAlign().value();
2117 if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
2118 return LI->getAlign().value();
2120 return SI->getAlign().value();
2122 return RMWI->getAlign().value();
2124 return CXI->getAlign().value();
2127 "only GlobalValue, AllocaInst, LoadInst, StoreInst, AtomicRMWInst, "
2128 "and AtomicCmpXchgInst have alignment");
2135 else if (
Function *
F = dyn_cast<Function>(
P))
2137 else if (
AllocaInst *AI = dyn_cast<AllocaInst>(
P))
2138 AI->setAlignment(
Align(Bytes));
2139 else if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
2140 LI->setAlignment(
Align(Bytes));
2141 else if (
StoreInst *SI = dyn_cast<StoreInst>(
P))
2142 SI->setAlignment(
Align(Bytes));
2144 RMWI->setAlignment(
Align(Bytes));
2146 CXI->setAlignment(
Align(Bytes));
2149 "only GlobalValue, AllocaInst, LoadInst, StoreInst, AtomicRMWInst, and "
2150 "and AtomicCmpXchgInst have alignment");
2154 size_t *NumEntries) {
2158 Instr->getAllMetadata(Entries);
2160 unwrap<GlobalObject>(
Value)->getAllMetadata(Entries);
2186 unwrap<GlobalObject>(
Global)->setMetadata(Kind, unwrap<MDNode>(MD));
2191 unwrap<GlobalObject>(
Global)->addMetadata(Kind, *unwrap<MDNode>(MD));
2195 unwrap<GlobalObject>(
Global)->eraseMetadata(Kind);
2199 unwrap<GlobalObject>(
Global)->clearMetadata();
2203 unwrap<GlobalVariable>(
Global)->addDebugInfo(
2204 unwrap<DIGlobalVariableExpression>(GVE));
2219 nullptr, GlobalVariable::NotThreadLocal,
2235 if (
I ==
Mod->global_end())
2243 if (
I ==
Mod->global_begin())
2265 unwrap<GlobalVariable>(GlobalVar)->eraseFromParent();
2276 unwrap<GlobalVariable>(GlobalVar)->setInitializer(
2277 ConstantVal ? unwrap<Constant>(ConstantVal) :
nullptr);
2281 return unwrap<GlobalVariable>(GlobalVar)->isThreadLocal();
2285 unwrap<GlobalVariable>(GlobalVar)->setThreadLocal(IsThreadLocal != 0);
2289 return unwrap<GlobalVariable>(GlobalVar)->isConstant();
2293 unwrap<GlobalVariable>(GlobalVar)->setConstant(IsConstant != 0);
2297 switch (unwrap<GlobalVariable>(GlobalVar)->getThreadLocalMode()) {
2298 case GlobalVariable::NotThreadLocal:
2300 case GlobalVariable::GeneralDynamicTLSModel:
2302 case GlobalVariable::LocalDynamicTLSModel:
2304 case GlobalVariable::InitialExecTLSModel:
2306 case GlobalVariable::LocalExecTLSModel:
2336 return unwrap<GlobalVariable>(GlobalVar)->isExternallyInitialized();
2340 unwrap<GlobalVariable>(GlobalVar)->setExternallyInitialized(IsExtInit);
2350 unwrap<Constant>(Aliasee),
unwrap(M)));
2354 const char *
Name,
size_t NameLen) {
2361 if (
I ==
Mod->alias_end())
2369 if (
I ==
Mod->alias_begin())
2391 return wrap(unwrap<GlobalAlias>(Alias)->getAliasee());
2395 unwrap<GlobalAlias>(Alias)->setAliasee(unwrap<Constant>(Aliasee));
2418 if (
I ==
Mod->end())
2426 if (
I ==
Mod->begin())
2432 Function *Func = unwrap<Function>(Fn);
2434 if (++
I == Func->getParent()->end())
2440 Function *Func = unwrap<Function>(Fn);
2442 if (
I == Func->getParent()->begin())
2448 unwrap<Function>(Fn)->eraseFromParent();
2452 return unwrap<Function>(Fn)->hasPersonalityFn();
2456 return wrap(unwrap<Function>(Fn)->getPersonalityFn());
2460 unwrap<Function>(Fn)->setPersonalityFn(
2461 PersonalityFn ? unwrap<Constant>(PersonalityFn) :
nullptr);
2466 return F->getIntrinsicID();
2471 assert(
ID < llvm::Intrinsic::num_intrinsics &&
"Intrinsic ID out of range");
2478 size_t ParamCount) {
2487 *NameLength = Str.size();
2499 size_t ParamCount,
size_t *NameLength) {
2503 *NameLength = Str.length();
2504 return strdup(Str.c_str());
2509 size_t ParamCount,
size_t *NameLength) {
2513 *NameLength = Str.length();
2514 return strdup(Str.c_str());
2527 return unwrap<Function>(Fn)->getCallingConv();
2531 return unwrap<Function>(Fn)->setCallingConv(
2537 return F->hasGC()?
F->getGC().c_str() :
nullptr;
2550 return wrap(
F->getPrefixData());
2555 return F->hasPrefixData();
2560 Constant *prefix = unwrap<Constant>(prefixData);
2561 F->setPrefixData(prefix);
2566 return wrap(
F->getPrologueData());
2571 return F->hasPrologueData();
2576 Constant *prologue = unwrap<Constant>(prologueData);
2577 F->setPrologueData(prologue);
2582 unwrap<Function>(
F)->addAttributeAtIndex(
Idx,
unwrap(
A));
2586 auto AS = unwrap<Function>(
F)->getAttributes().getAttributes(
Idx);
2587 return AS.getNumAttributes();
2592 auto AS = unwrap<Function>(
F)->getAttributes().getAttributes(
Idx);
2600 return wrap(unwrap<Function>(
F)->getAttributeAtIndex(
2606 const char *K,
unsigned KLen) {
2608 unwrap<Function>(
F)->getAttributeAtIndex(
Idx,
StringRef(K, KLen)));
2617 const char *K,
unsigned KLen) {
2618 unwrap<Function>(
F)->removeAttributeAtIndex(
Idx,
StringRef(K, KLen));
2623 Function *Func = unwrap<Function>(Fn);
2625 Func->addFnAttr(Attr);
2633 return unwrap<Function>(FnRef)->arg_size();
2637 Function *Fn = unwrap<Function>(FnRef);
2639 *ParamRefs++ =
wrap(&
A);
2643 Function *Fn = unwrap<Function>(FnRef);
2652 Function *Func = unwrap<Function>(Fn);
2654 if (
I == Func->arg_end())
2660 Function *Func = unwrap<Function>(Fn);
2662 if (
I == Func->arg_begin())
2670 if (
A->getArgNo() + 1 >= Fn->
arg_size())
2677 if (
A->getArgNo() == 0)
2679 return wrap(&
A->getParent()->arg_begin()[
A->getArgNo() - 1]);
2690 const char *
Name,
size_t NameLen,
2700 const char *
Name,
size_t NameLen) {
2707 if (
I ==
Mod->ifunc_end())
2715 if (
I ==
Mod->ifunc_begin())
2737 return wrap(unwrap<GlobalIFunc>(IFunc)->getResolver());
2741 unwrap<GlobalIFunc>(IFunc)->setResolver(unwrap<Constant>(
Resolver));
2745 unwrap<GlobalIFunc>(IFunc)->eraseFromParent();
2749 unwrap<GlobalIFunc>(IFunc)->removeFromParent();
2777 return wrap(
unwrap(Bundle)->inputs()[Index]);
2787 return isa<BasicBlock>(
unwrap(Val));
2791 return wrap(unwrap<BasicBlock>(Val));
2807 return unwrap<Function>(FnRef)->size();
2811 Function *Fn = unwrap<Function>(FnRef);
2813 *BasicBlocksRefs++ =
wrap(&BB);
2817 return wrap(&unwrap<Function>(Fn)->getEntryBlock());
2821 Function *Func = unwrap<Function>(Fn);
2823 if (
I == Func->end())
2829 Function *Func = unwrap<Function>(Fn);
2831 if (
I == Func->begin())
2839 if (++
I ==
Block->getParent()->end())
2847 if (
I ==
Block->getParent()->begin())
2861 assert(CurBB &&
"current insertion point is invalid!");
2867 unwrap<Function>(Fn)->insert(unwrap<Function>(Fn)->end(),
unwrap(BB));
2933 if (++
I == Instr->getParent()->end())
2941 if (
I == Instr->getParent()->begin())
2947 unwrap<Instruction>(Inst)->removeFromParent();
2951 unwrap<Instruction>(Inst)->eraseFromParent();
2955 unwrap<Instruction>(Inst)->deleteValue();
2965 return unwrap<ICmpInst>(Inst)->hasSameSign();
2969 unwrap<ICmpInst>(Inst)->setSameSign(SameSign);
2986 return wrap(
C->clone());
2992 return (
I &&
I->isTerminator()) ?
wrap(
I) :
nullptr;
2997 auto I = Instr->DebugMarker->StoredDbgRecords.begin();
2998 if (
I == Instr->DebugMarker->StoredDbgRecords.end())
3005 auto I = Instr->DebugMarker->StoredDbgRecords.rbegin();
3006 if (
I == Instr->DebugMarker->StoredDbgRecords.rend())
3014 if (++
I ==
Record->getInstruction()->DebugMarker->StoredDbgRecords.end())
3022 if (
I ==
Record->getInstruction()->DebugMarker->StoredDbgRecords.begin())
3029 return FPI->arg_size();
3031 return unwrap<CallBase>(Instr)->arg_size();
3037 return unwrap<CallBase>(Instr)->getCallingConv();
3041 return unwrap<CallBase>(Instr)->setCallingConv(
3047 auto *Call = unwrap<CallBase>(Instr);
3050 Call->addAttributeAtIndex(
Idx, AlignAttr);
3055 unwrap<CallBase>(
C)->addAttributeAtIndex(
Idx,
unwrap(
A));
3060 auto *Call = unwrap<CallBase>(
C);
3061 auto AS = Call->getAttributes().getAttributes(
Idx);
3062 return AS.getNumAttributes();
3067 auto *Call = unwrap<CallBase>(
C);
3068 auto AS = Call->getAttributes().getAttributes(
Idx);
3076 return wrap(unwrap<CallBase>(
C)->getAttributeAtIndex(
3082 const char *K,
unsigned KLen) {
3084 unwrap<CallBase>(
C)->getAttributeAtIndex(
Idx,
StringRef(K, KLen)));
3093 const char *K,
unsigned KLen) {
3094 unwrap<CallBase>(
C)->removeAttributeAtIndex(
Idx,
StringRef(K, KLen));
3098 return wrap(unwrap<CallBase>(Instr)->getCalledOperand());
3102 return wrap(unwrap<CallBase>(Instr)->getFunctionType());
3106 return unwrap<CallBase>(
C)->getNumOperandBundles();
3118 return unwrap<CallInst>(Call)->isTailCall();
3122 unwrap<CallInst>(Call)->setTailCall(isTailCall);
3136 return wrap(unwrap<InvokeInst>(Invoke)->getNormalDest());
3141 return wrap(CRI->getUnwindDest());
3143 return wrap(CSI->getUnwindDest());
3145 return wrap(unwrap<InvokeInst>(Invoke)->getUnwindDest());
3149 unwrap<InvokeInst>(Invoke)->setNormalDest(
unwrap(
B));
3154 return CRI->setUnwindDest(
unwrap(
B));
3156 return CSI->setUnwindDest(
unwrap(
B));
3158 unwrap<InvokeInst>(Invoke)->setUnwindDest(
unwrap(
B));
3162 return wrap(unwrap<CallBrInst>(CallBr)->getDefaultDest());
3166 return unwrap<CallBrInst>(CallBr)->getNumIndirectDests();
3170 return wrap(unwrap<CallBrInst>(CallBr)->getIndirectDest(
Idx));
3176 return unwrap<Instruction>(Term)->getNumSuccessors();
3180 return wrap(unwrap<Instruction>(Term)->getSuccessor(i));
3184 return unwrap<Instruction>(Term)->setSuccessor(i,
unwrap(
block));
3190 return unwrap<BranchInst>(Branch)->isConditional();
3194 return wrap(unwrap<BranchInst>(Branch)->getCondition());
3198 return unwrap<BranchInst>(Branch)->setCondition(
unwrap(
Cond));
3204 return wrap(unwrap<SwitchInst>(Switch)->getDefaultDest());
3210 return wrap(unwrap<AllocaInst>(Alloca)->getAllocatedType());
3216 return unwrap<GEPOperator>(
GEP)->isInBounds();
3220 return unwrap<GetElementPtrInst>(
GEP)->setIsInBounds(InBounds);
3224 return wrap(unwrap<GEPOperator>(
GEP)->getSourceElementType());
3241 PHINode *PhiVal = unwrap<PHINode>(PhiNode);
3242 for (
unsigned I = 0;
I != Count; ++
I)
3247 return unwrap<PHINode>(PhiNode)->getNumIncomingValues();
3251 return wrap(unwrap<PHINode>(PhiNode)->getIncomingValue(Index));
3255 return wrap(unwrap<PHINode>(PhiNode)->getIncomingBlock(Index));
3262 if (
auto *
GEP = dyn_cast<GEPOperator>(
I))
3263 return GEP->getNumIndices();
3264 if (
auto *EV = dyn_cast<ExtractValueInst>(
I))
3265 return EV->getNumIndices();
3266 if (
auto *
IV = dyn_cast<InsertValueInst>(
I))
3267 return IV->getNumIndices();
3269 "LLVMGetNumIndices applies only to extractvalue and insertvalue!");
3274 if (
auto *EV = dyn_cast<ExtractValueInst>(
I))
3275 return EV->getIndices().data();
3276 if (
auto *
IV = dyn_cast<InsertValueInst>(
I))
3277 return IV->getIndices().data();
3279 "LLVMGetIndices applies only to extractvalue and insertvalue!");
3296 I.setHeadBit(BeforeDbgRecords);
3303 unwrap<Instruction>(Instr),
false);
3310 unwrap<Instruction>(Instr),
true);
3326 unwrap(Builder)->SetInsertPoint(BB);
3330 return wrap(
unwrap(Builder)->GetInsertBlock());
3334 unwrap(Builder)->ClearInsertionPoint();
3338 unwrap(Builder)->Insert(unwrap<Instruction>(Instr));
3343 unwrap(Builder)->Insert(unwrap<Instruction>(Instr),
Name);
3353 return wrap(
unwrap(Builder)->getCurrentDebugLocation().getAsMDNode());
3358 unwrap(Builder)->SetCurrentDebugLocation(
DebugLoc(unwrap<MDNode>(Loc)));
3365 L ? cast<MDNode>(unwrap<MetadataAsValue>(L)->getMetadata()) :
nullptr;
3372 Context,
unwrap(Builder)->getCurrentDebugLocation().getAsMDNode()));
3376 unwrap(Builder)->SetInstDebugLocation(unwrap<Instruction>(Inst));
3380 unwrap(Builder)->AddMetadataToInst(unwrap<Instruction>(Inst));
3386 unwrap(Builder)->setDefaultFPMathTag(FPMathTag
3387 ? unwrap<MDNode>(FPMathTag)
3396 return wrap(
unwrap(Builder)->getDefaultFPMathTag());
3429 unsigned NumDests) {
3438 unsigned NumBundles,
const char *
Name) {
3441 for (
auto *Bundle :
ArrayRef(Bundles, NumBundles)) {
3447 unwrap<FunctionType>(Ty),
unwrap(Fn),
unwrap(DefaultDest),
3466 for (
auto *Bundle :
ArrayRef(Bundles, NumBundles)) {
3483 unwrap<Function>(PersFn));
3497 if (ParentPad ==
nullptr) {
3511 unsigned NumHandlers,
const char *
Name) {
3512 if (ParentPad ==
nullptr) {
3517 NumHandlers,
Name));
3522 return wrap(
unwrap(
B)->CreateCatchRet(unwrap<CatchPadInst>(CatchPad),
3528 return wrap(
unwrap(
B)->CreateCleanupRet(unwrap<CleanupPadInst>(CatchPad),
3538 unwrap<SwitchInst>(Switch)->addCase(unwrap<ConstantInt>(OnVal),
unwrap(Dest));
3542 unwrap<IndirectBrInst>(IndirectBr)->addDestination(
unwrap(Dest));
3546 return unwrap<LandingPadInst>(LandingPad)->getNumClauses();
3550 return wrap(unwrap<LandingPadInst>(LandingPad)->getClause(
Idx));
3554 unwrap<LandingPadInst>(LandingPad)->addClause(unwrap<Constant>(ClauseVal));
3558 return unwrap<LandingPadInst>(LandingPad)->isCleanup();
3562 unwrap<LandingPadInst>(LandingPad)->setCleanup(Val);
3566 unwrap<CatchSwitchInst>(CatchSwitch)->addHandler(
unwrap(Dest));
3570 return unwrap<CatchSwitchInst>(CatchSwitch)->getNumHandlers();
3576 *Handlers++ =
wrap(
H);
3580 return wrap(unwrap<CatchPadInst>(CatchPad)->getCatchSwitch());
3584 unwrap<CatchPadInst>(CatchPad)
3585 ->setCatchSwitch(unwrap<CatchSwitchInst>(CatchSwitch));
3591 return wrap(unwrap<FuncletPadInst>(Funclet)->getArgOperand(i));
3595 unwrap<FuncletPadInst>(Funclet)->setArgOperand(i,
unwrap(
value));
3782 if (
auto *
I = dyn_cast<BinaryOperator>(Neg))
3783 I->setHasNoUnsignedWrap();
3796 Value *
P = unwrap<Value>(ArithInst);
3797 return cast<Instruction>(
P)->hasNoUnsignedWrap();
3801 Value *
P = unwrap<Value>(ArithInst);
3802 cast<Instruction>(
P)->setHasNoUnsignedWrap(HasNUW);
3806 Value *
P = unwrap<Value>(ArithInst);
3807 return cast<Instruction>(
P)->hasNoSignedWrap();
3811 Value *
P = unwrap<Value>(ArithInst);
3812 cast<Instruction>(
P)->setHasNoSignedWrap(HasNSW);
3816 Value *
P = unwrap<Value>(DivOrShrInst);
3817 return cast<Instruction>(
P)->isExact();
3821 Value *
P = unwrap<Value>(DivOrShrInst);
3822 cast<Instruction>(
P)->setIsExact(IsExact);
3826 Value *
P = unwrap<Value>(NonNegInst);
3827 return cast<Instruction>(
P)->hasNonNeg();
3831 Value *
P = unwrap<Value>(NonNegInst);
3832 cast<Instruction>(
P)->setNonNeg(IsNonNeg);
3836 Value *
P = unwrap<Value>(FPMathInst);
3842 Value *
P = unwrap<Value>(FPMathInst);
3847 Value *Val = unwrap<Value>(V);
3848 return isa<FPMathOperator>(Val);
3852 Value *
P = unwrap<Value>(Inst);
3853 return cast<PossiblyDisjointInst>(
P)->isDisjoint();
3857 Value *
P = unwrap<Value>(Inst);
3858 cast<PossiblyDisjointInst>(
P)->setIsDisjoint(IsDisjoint);
3938 return AtomicOrdering::AcquireRelease;
3940 return AtomicOrdering::SequentiallyConsistent;
3953 case AtomicOrdering::AcquireRelease:
3955 case AtomicOrdering::SequentiallyConsistent:
4049 unsigned NumIndices,
const char *
Name) {
4056 unsigned NumIndices,
const char *
Name) {
4065 unsigned NumIndices,
const char *
Name,
4091 if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
4092 return LI->isVolatile();
4094 return SI->isVolatile();
4096 return AI->isVolatile();
4097 return cast<AtomicCmpXchgInst>(
P)->isVolatile();
4102 if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
4103 return LI->setVolatile(isVolatile);
4105 return SI->setVolatile(isVolatile);
4107 return AI->setVolatile(isVolatile);
4108 return cast<AtomicCmpXchgInst>(
P)->setVolatile(isVolatile);
4112 return unwrap<AtomicCmpXchgInst>(CmpXchgInst)->isWeak();
4116 return unwrap<AtomicCmpXchgInst>(CmpXchgInst)->setWeak(isWeak);
4122 if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
4123 O = LI->getOrdering();
4124 else if (
StoreInst *SI = dyn_cast<StoreInst>(
P))
4125 O = SI->getOrdering();
4126 else if (
FenceInst *FI = dyn_cast<FenceInst>(
P))
4127 O = FI->getOrdering();
4129 O = cast<AtomicRMWInst>(
P)->getOrdering();
4137 if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
4138 return LI->setOrdering(O);
4139 else if (
FenceInst *FI = dyn_cast<FenceInst>(
P))
4140 return FI->setOrdering(O);
4142 return ARWI->setOrdering(O);
4143 return cast<StoreInst>(
P)->setOrdering(O);
4271 unwrap(Src), SrcIsSigned,
unwrap(DestTy), DestIsSigned));
4308 unsigned NumBundles,
const char *
Name) {
4311 for (
auto *Bundle :
ArrayRef(Bundles, NumBundles)) {
4352 unsigned Index,
const char *
Name) {
4434 return I->getShuffleMask().size();
4440 return I->getMaskValue(Elt);
4446 return unwrap<Instruction>(Inst)->isAtomic();
4470 assert(
I->isAtomic() &&
"Expected an atomic instruction");
4476 assert(
I->isAtomic() &&
"Expected an atomic instruction");
4490 return cast<AtomicCmpXchgInst>(
P)->setSuccessOrdering(O);
4503 return cast<AtomicCmpXchgInst>(
P)->setFailureOrdering(O);
4523 char **OutMessage) {
4526 if (std::error_code EC = MBOrErr.
getError()) {
4527 *OutMessage = strdup(EC.message().c_str());
4530 *OutMemBuf =
wrap(MBOrErr.
get().release());
4535 char **OutMessage) {
4537 if (std::error_code EC = MBOrErr.
getError()) {
4538 *OutMessage = strdup(EC.message().c_str());
4541 *OutMemBuf =
wrap(MBOrErr.
get().release());
4546 const char *InputData,
4547 size_t InputDataLength,
4548 const char *BufferName,
4553 RequiresNullTerminator).
release());
4557 const char *InputData,
4558 size_t InputDataLength,
4559 const char *BufferName) {
4567 return unwrap(MemBuf)->getBufferStart();
4571 return unwrap(MemBuf)->getBufferSize();
4594 return unwrap<legacy::PassManager>(PM)->run(*
unwrap(M));
4598 return unwrap<legacy::FunctionPassManager>(FPM)->doInitialization();
4602 return unwrap<legacy::FunctionPassManager>(FPM)->run(*unwrap<Function>(
F));
4606 return unwrap<legacy::FunctionPassManager>(FPM)->doFinalization();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file contains the simple types necessary to represent the attributes associated with functions a...
static const Function * getParent(const Value *V)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
#define LLVM_EXTENSION
LLVM_EXTENSION - Support compilers where we have a keyword to suppress pedantic diagnostics.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
Given that RA is a live value
static char getTypeID(Type *Ty)
LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef C, unsigned idx)
static Module::ModFlagBehavior map_to_llvmModFlagBehavior(LLVMModuleFlagBehavior Behavior)
#define LLVM_DEFINE_VALUE_CAST(name)
static LLVMValueMetadataEntry * llvm_getMetadata(size_t *NumEntries, llvm::function_ref< void(MetadataEntries &)> AccessMD)
static GEPNoWrapFlags mapFromLLVMGEPNoWrapFlags(LLVMGEPNoWrapFlags GEPFlags)
static MDNode * extractMDNode(MetadataAsValue *MAV)
static void LLVMPositionBuilderImpl(IRBuilder<> *Builder, BasicBlock *Block, Instruction *Instr, bool BeforeDbgRecords)
static LLVMOpcode map_to_llvmopcode(int opcode)
static LLVMFastMathFlags mapToLLVMFastMathFlags(FastMathFlags FMF)
static FastMathFlags mapFromLLVMFastMathFlags(LLVMFastMathFlags FMF)
LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char Str[], uint8_t Radix)
static AtomicOrdering mapFromLLVMOrdering(LLVMAtomicOrdering Ordering)
static Intrinsic::ID llvm_map_to_intrinsic_id(unsigned ID)
static LLVMModuleFlagBehavior map_from_llvmModFlagBehavior(Module::ModFlagBehavior Behavior)
static LLVMAtomicOrdering mapToLLVMOrdering(AtomicOrdering Ordering)
LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
static LLVMValueRef getMDNodeOperandImpl(LLVMContext &Context, const MDNode *N, unsigned Index)
LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char Str[], unsigned SLen)
static int map_from_llvmopcode(LLVMOpcode code)
static LLVMAtomicRMWBinOp mapToLLVMRMWBinOp(AtomicRMWInst::BinOp BinOp)
static AtomicRMWInst::BinOp mapFromLLVMRMWBinOp(LLVMAtomicRMWBinOp BinOp)
LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal)
LLVMValueRef LLVMConstIntOfStringAndSize(LLVMTypeRef IntTy, const char Str[], unsigned SLen, uint8_t Radix)
static LLVMContext & getGlobalContext()
static LLVMGEPNoWrapFlags mapToLLVMGEPNoWrapFlags(GEPNoWrapFlags GEPFlags)
BasicBlock ** unwrap(LLVMBasicBlockRef *BBs)
Module.h This file contains the declarations for the Module class.
if(auto Err=PB.parsePassPipeline(MPM, Passes)) return wrap(std MPM run * Mod
const SmallVectorImpl< MachineOperand > & Cond
static BinaryOperator * CreateMul(Value *S1, Value *S2, const Twine &Name, BasicBlock::iterator InsertBefore, Value *FlagsOp)
static BinaryOperator * CreateAdd(Value *S1, Value *S2, const Twine &Name, BasicBlock::iterator InsertBefore, Value *FlagsOp)
static Instruction * CreateNeg(Value *S1, const Twine &Name, BasicBlock::iterator InsertBefore, Value *FlagsOp)
static Type * getValueType(Value *V)
Returns the type of the given value/instruction V.
static SymbolRef::Type getType(const Symbol *Sym)
unify loop Fixup each natural loop to have a single exit block
static std::optional< unsigned > getOpcode(ArrayRef< VPValue * > Values)
Returns the opcode of Values or ~0 if they do not all agree.
static Function * getFunction(FunctionType *Ty, const Twine &Name, Module *M)
static const uint32_t IV[8]
LLVM_ABI opStatus convert(const fltSemantics &ToSemantics, roundingMode RM, bool *losesInfo)
LLVM_ABI double convertToDouble() const
Converts this APFloat to host double value.
Class for arbitrary precision integers.
an instruction to allocate memory on the stack
This class represents an incoming formal argument to a Function.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
An instruction that atomically checks whether a specified value is in a memory location,...
an instruction that atomically reads a memory location, combines it with another value,...
BinOp
This enumeration lists the possible modifications atomicrmw can make.
@ USubCond
Subtract only if no unsigned overflow.
@ FMinimum
*p = minimum(old, v) minimum matches the behavior of llvm.minimum.
@ Min
*p = old <signed v ? old : v
@ USubSat
*p = usub.sat(old, v) usub.sat matches the behavior of llvm.usub.sat.
@ FMaximum
*p = maximum(old, v) maximum matches the behavior of llvm.maximum.
@ UIncWrap
Increment one up to a maximum value.
@ Max
*p = old >signed v ? old : v
@ UMin
*p = old <unsigned v ? old : v
@ FMin
*p = minnum(old, v) minnum matches the behavior of llvm.minnum.
@ UMax
*p = old >unsigned v ? old : v
@ FMax
*p = maxnum(old, v) maxnum matches the behavior of llvm.maxnum.
@ UDecWrap
Decrement one until a minimum value or zero.
static LLVM_ABI Attribute::AttrKind getAttrKindFromName(StringRef AttrName)
static LLVM_ABI Attribute get(LLVMContext &Context, AttrKind Kind, uint64_t Val=0)
Return a uniquified Attribute object.
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results,...
static LLVM_ABI Attribute getWithAlignment(LLVMContext &Context, Align Alignment)
Return a uniquified Attribute object that has the specific alignment set.
LLVM Basic Block Representation.
LLVM_ABI void print(raw_ostream &OS, AssemblyAnnotationWriter *AAW=nullptr, bool ShouldPreserveUseListOrder=false, bool IsForDebug=false) const
Print the basic block to an output stream with an optional AssemblyAnnotationWriter.
static BasicBlock * Create(LLVMContext &Context, const Twine &Name="", Function *Parent=nullptr, BasicBlock *InsertBefore=nullptr)
Creates a new BasicBlock.
LLVM_ABI void moveAfter(BasicBlock *MovePos)
Unlink this basic block from its current function and insert it right after MovePos in the function M...
LLVM_ABI void removeFromParent()
Unlink 'this' from the containing function, but do not delete it.
const Function * getParent() const
Return the enclosing method, or null if none.
LLVM_ABI SymbolTableList< BasicBlock >::iterator eraseFromParent()
Unlink 'this' from the containing function and delete it.
InstListType::iterator iterator
Instruction iterators...
LLVM_ABI LLVMContext & getContext() const
Get the context in which this basic block lives.
void moveBefore(BasicBlock *MovePos)
Unlink this basic block from its current function and insert it into the function that MovePos lives ...
static LLVM_ABI BlockAddress * get(Function *F, BasicBlock *BB)
Return a BlockAddress for the specified function and basic block.
static LLVM_ABI Instruction::CastOps getCastOpcode(const Value *Val, bool SrcIsSigned, Type *Ty, bool DstIsSigned)
Returns the opcode necessary to cast Val into Ty using usual casting rules.
handler_range handlers()
iteration adapter for range-for loops.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
static LLVM_ABI Constant * get(ArrayType *T, ArrayRef< Constant * > V)
static LLVM_ABI Constant * getString(LLVMContext &Context, StringRef Initializer, bool AddNull=true)
This method constructs a CDS and initializes it with a text string.
static Constant * getRaw(StringRef Data, uint64_t NumElements, Type *ElementTy)
getRaw() constructor - Return a constant with array type with an element count and element type match...
static LLVM_ABI Constant * getIntToPtr(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static LLVM_ABI Constant * getExtractElement(Constant *Vec, Constant *Idx, Type *OnlyIfReducedTy=nullptr)
static LLVM_ABI Constant * getAlignOf(Type *Ty)
getAlignOf constant expr - computes the alignment of a type in a target independent way (Note: the re...
static Constant * getNUWSub(Constant *C1, Constant *C2)
static Constant * getInBoundsGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant * > IdxList)
Create an "inbounds" getelementptr.
static LLVM_ABI Constant * getPointerCast(Constant *C, Type *Ty)
Create a BitCast, AddrSpaceCast, or a PtrToInt cast constant expression.
static LLVM_ABI Constant * getTruncOrBitCast(Constant *C, Type *Ty)
static Constant * getNSWAdd(Constant *C1, Constant *C2)
static LLVM_ABI Constant * getSub(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
static LLVM_ABI Constant * getNot(Constant *C)
static LLVM_ABI Constant * getInsertElement(Constant *Vec, Constant *Elt, Constant *Idx, Type *OnlyIfReducedTy=nullptr)
static LLVM_ABI Constant * getPtrToInt(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static LLVM_ABI Constant * getShuffleVector(Constant *V1, Constant *V2, ArrayRef< int > Mask, Type *OnlyIfReducedTy=nullptr)
static LLVM_ABI Constant * getSizeOf(Type *Ty)
getSizeOf constant expr - computes the (alloc) size of a type (in address-units, not bits) in a targe...
static LLVM_ABI Constant * getXor(Constant *C1, Constant *C2)
static Constant * getNSWNeg(Constant *C)
static Constant * getNSWSub(Constant *C1, Constant *C2)
static Constant * getNUWAdd(Constant *C1, Constant *C2)
static LLVM_ABI Constant * getAddrSpaceCast(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static Constant * getGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant * > IdxList, GEPNoWrapFlags NW=GEPNoWrapFlags::none(), std::optional< ConstantRange > InRange=std::nullopt, Type *OnlyIfReducedTy=nullptr)
Getelementptr form.
static LLVM_ABI Constant * getAdd(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
static LLVM_ABI Constant * getBitCast(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static LLVM_ABI Constant * getNeg(Constant *C, bool HasNSW=false)
static LLVM_ABI Constant * getTrunc(Constant *C, Type *Ty, bool OnlyIfReduced=false)
ConstantFP - Floating Point Values [float, double].
const APFloat & getValueAPF() const
static LLVM_ABI ConstantPointerNull * get(PointerType *T)
Static factory methods - Return objects of the specified value.
static LLVM_ABI ConstantPtrAuth * get(Constant *Ptr, ConstantInt *Key, ConstantInt *Disc, Constant *AddrDisc)
Return a pointer signed with the specified parameters.
This class represents a range of values.
static LLVM_ABI Constant * get(StructType *T, ArrayRef< Constant * > V)
static Constant * getAnon(ArrayRef< Constant * > V, bool Packed=false)
Return an anonymous struct that has the specified elements.
static LLVM_ABI Constant * get(ArrayRef< Constant * > V)
This is an important base class in LLVM.
static LLVM_ABI Constant * getAllOnesValue(Type *Ty)
static LLVM_ABI Constant * getNullValue(Type *Ty)
Constructor to create a '0' constant of arbitrary type.
Subprogram description. Uses SubclassData1.
This class represents an Operation in the Expression.
Base class for non-instruction debug metadata records that have positions within IR.
Basic diagnostic printer that uses an underlying raw_ostream.
Represents either an error or a value T.
std::error_code getError() const
This instruction compares its operands according to the predicate given to the constructor.
Convenience struct for specifying and reasoning about fast-math flags.
void setAllowContract(bool B=true)
bool noSignedZeros() const
void setAllowReciprocal(bool B=true)
bool allowReciprocal() const
void setNoSignedZeros(bool B=true)
bool allowReassoc() const
Flag queries.
void setNoNaNs(bool B=true)
void setAllowReassoc(bool B=true)
Flag setters.
void setApproxFunc(bool B=true)
void setNoInfs(bool B=true)
bool allowContract() const
An instruction for ordering other memory operations.
static LLVM_ABI FixedVectorType * get(Type *ElementType, unsigned NumElts)
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
BasicBlockListType::iterator iterator
iterator_range< arg_iterator > args()
void setPersonalityFn(Constant *Fn)
Function::iterator insert(Function::iterator Position, BasicBlock *BB)
Insert BB in the basic block list at Position.
Represents flags for the getelementptr instruction/expression.
static GEPNoWrapFlags inBounds()
static GEPNoWrapFlags noUnsignedWrap()
static GEPNoWrapFlags noUnsignedSignedWrap()
bool hasNoUnsignedSignedWrap() const
bool hasNoUnsignedWrap() const
GEPNoWrapFlags getNoWrapFlags() const
an instruction for type-safe pointer arithmetic to access elements of arrays and structs
LLVM_ABI void setNoWrapFlags(GEPNoWrapFlags NW)
Set nowrap flags for GEP instruction.
static LLVM_ABI GlobalAlias * create(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage, const Twine &Name, Constant *Aliasee, Module *Parent)
If a parent module is specified, the alias is automatically inserted into the end of the specified mo...
static LLVM_ABI GlobalIFunc * create(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage, const Twine &Name, Constant *Resolver, Module *Parent)
If a parent module is specified, the ifunc is automatically inserted into the end of the specified mo...
void setUnnamedAddr(UnnamedAddr Val)
void setThreadLocalMode(ThreadLocalMode Val)
void setLinkage(LinkageTypes LT)
DLLStorageClassTypes
Storage classes of global values for PE targets.
Module * getParent()
Get the module that this global value is contained inside of...
VisibilityTypes
An enumeration for the kinds of visibility of global values.
@ PrivateLinkage
Like Internal, but omit from symbol table.
@ CommonLinkage
Tentative definitions.
@ InternalLinkage
Rename collisions when linking (static functions).
@ LinkOnceAnyLinkage
Keep one copy of function when linking (inline)
@ WeakODRLinkage
Same, but only replaced by something equivalent.
@ ExternalLinkage
Externally visible function.
@ WeakAnyLinkage
Keep one copy of named function when linking (weak)
@ AppendingLinkage
Special purpose, only applies to global arrays.
@ AvailableExternallyLinkage
Available for inspection, not emission.
@ ExternalWeakLinkage
ExternalWeak linkage description.
@ LinkOnceODRLinkage
Same, but only replaced by something equivalent.
const Constant * getInitializer() const
getInitializer - Return the initializer for this global variable.
bool hasInitializer() const
Definitions have initializers, declarations don't.
This instruction compares its operands according to the predicate given to the constructor.
void SetInsertPoint(BasicBlock *TheBB)
This specifies that created instructions should be appended to the end of the specified block.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
static LLVM_ABI InlineAsm * get(FunctionType *Ty, StringRef AsmString, StringRef Constraints, bool hasSideEffects, bool isAlignStack=false, AsmDialect asmDialect=AD_ATT, bool canThrow=false)
InlineAsm::get - Return the specified uniqued inline asm string.
Class to represent integer types.
static LLVM_ABI IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
unsigned getBitWidth() const
Get the number of bits in this IntegerType.
This is an important class for using LLVM in a threaded context.
void(*)(LLVMContext *Context, void *OpaqueHandle) YieldCallbackTy
Defines the type of a yield callback.
An instruction for reading from memory.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static LLVM_ABI MDString * get(LLVMContext &Context, StringRef Str)
static std::unique_ptr< MemoryBuffer > getMemBuffer(StringRef InputData, StringRef BufferName="", bool RequiresNullTerminator=true)
Open the specified memory range as a MemoryBuffer.
static std::unique_ptr< MemoryBuffer > getMemBufferCopy(StringRef InputData, const Twine &BufferName="")
Open the specified memory range as a MemoryBuffer, copying the contents and taking ownership of it.
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, bool IsVolatile=false, std::optional< Align > Alignment=std::nullopt)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful,...
static ErrorOr< std::unique_ptr< MemoryBuffer > > getSTDIN()
Read all of stdin into a file buffer, and return it.
A Module instance is used to store all the information related to an LLVM module.
global_iterator global_begin()
ifunc_iterator ifunc_begin()
ModFlagBehavior
This enumeration defines the supported behaviors of module flags.
global_iterator global_end()
NamedMDListType::iterator named_metadata_iterator
The named metadata iterators.
IFuncListType::iterator ifunc_iterator
The Global IFunc iterators.
named_metadata_iterator named_metadata_begin()
ifunc_iterator ifunc_end()
alias_iterator alias_end()
alias_iterator alias_begin()
FunctionListType::iterator iterator
The Function iterators.
GlobalListType::iterator global_iterator
The Global Variable iterator.
AliasListType::iterator alias_iterator
The Global Alias iterators.
named_metadata_iterator named_metadata_end()
LLVM_ABI StringRef getName() const
Module * getParent()
Get the module that holds this named metadata collection.
A container for an operand bundle being viewed as a set of values rather than a set of uses.
void addIncoming(Value *V, BasicBlock *BB)
Add an incoming value to the end of the PHI list.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
static LLVM_ABI PoisonValue * get(Type *T)
Static factory methods - Return an 'poison' object of the specified type.
A global registry used in conjunction with static constructors to make pluggable components (like tar...
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
static LLVM_ABI ScalableVectorType * get(Type *ElementType, unsigned MinNumElts)
This instruction constructs a fixed permutation of two input vectors.
ArrayRef< int > getShuffleMask() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
An instruction for storing to memory.
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Class to represent struct types.
static LLVM_ABI StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
ArrayRef< Type * > elements() const
static LLVM_ABI StructType * getTypeByName(LLVMContext &C, StringRef Name)
Return the type with the specified name, or null if there is none by that name.
static LLVM_ABI StructType * create(LLVMContext &Context, StringRef Name)
This creates an identified struct.
LLVM_ABI Type * getTypeAtIndex(const Value *V) const
Given an index value into the type, return the type of the element.
Class to represent target extensions types, which are generally unintrospectable from target-independ...
static LLVM_ABI TargetExtType * get(LLVMContext &Context, StringRef Name, ArrayRef< Type * > Types={}, ArrayRef< unsigned > Ints={})
Return a target extension type having the specified name and optional type and integer parameters.
Triple - Helper class for working with autoconf configuration names.
The instances of the Type class are immutable: once they are created, they are never changed.
static LLVM_ABI Type * getFloatTy(LLVMContext &C)
LLVM_ABI TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
static LLVM_ABI Type * getFP128Ty(LLVMContext &C)
static LLVM_ABI Type * getPPC_FP128Ty(LLVMContext &C)
static LLVM_ABI Type * getDoubleTy(LLVMContext &C)
static LLVM_ABI Type * getLabelTy(LLVMContext &C)
static LLVM_ABI IntegerType * getInt8Ty(LLVMContext &C)
static LLVM_ABI IntegerType * getInt32Ty(LLVMContext &C)
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
static LLVM_ABI Type * getHalfTy(LLVMContext &C)
bool isBFloatTy() const
Return true if this is 'bfloat', a 16-bit bfloat type.
@ X86_AMXTyID
AMX vectors (8192 bits, X86 specific)
@ TypedPointerTyID
Typed pointer used by some GPU targets.
@ HalfTyID
16-bit floating point type
@ TargetExtTyID
Target extension type.
@ VoidTyID
type with no size
@ ScalableVectorTyID
Scalable SIMD vector type.
@ FloatTyID
32-bit floating point type
@ IntegerTyID
Arbitrary bit width integers.
@ FixedVectorTyID
Fixed width SIMD vector type.
@ BFloatTyID
16-bit floating point type (7-bit significand)
@ DoubleTyID
64-bit floating point type
@ X86_FP80TyID
80-bit floating point type (X87)
@ PPC_FP128TyID
128-bit floating point type (two 64-bits, PowerPC)
@ FP128TyID
128-bit floating point type (112-bit significand)
static LLVM_ABI IntegerType * getInt1Ty(LLVMContext &C)
static LLVM_ABI IntegerType * getInt64Ty(LLVMContext &C)
static LLVM_ABI Type * getX86_AMXTy(LLVMContext &C)
static LLVM_ABI Type * getBFloatTy(LLVMContext &C)
static LLVM_ABI Type * getVoidTy(LLVMContext &C)
bool isHalfTy() const
Return true if this is 'half', a 16-bit IEEE fp type.
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
static LLVM_ABI Type * getX86_FP80Ty(LLVMContext &C)
static LLVM_ABI IntegerType * getInt16Ty(LLVMContext &C)
static LLVM_ABI Type * getMetadataTy(LLVMContext &C)
static LLVM_ABI IntegerType * getInt128Ty(LLVMContext &C)
static LLVM_ABI Type * getTokenTy(LLVMContext &C)
static LLVM_ABI UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
A Use represents the edge between a Value definition and its users.
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
LLVM_ABI void setName(const Twine &Name)
Change the name of the value.
LLVM_ABI void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
use_iterator_impl< Use > use_iterator
LLVM_ABI LLVMContext & getContext() const
All values hold a context through their type.
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
An efficient, type-erasing, non-owning reference to a callable.
self_iterator getIterator()
FunctionPassManager manages FunctionPasses.
PassManager manages ModulePassManagers.
A raw_ostream that writes to a file descriptor.
bool has_error() const
Return the value of the flag in this raw_fd_ostream indicating whether an output error has been encou...
std::error_code error() const
void close()
Manually flush the stream and close the file.
A raw_ostream that writes to an std::string.
typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, false >::type iterator
LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name)
Obtain a Type from a context by its registered name.
LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A)
Check for the different types of attributes.
LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A)
Get the type attribute's value.
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen)
void LLVMContextSetDiagnosticHandler(LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
Set the diagnostic handler for this context.
const char * LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's value.
uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A)
Get the enum attribute's value.
LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A)
LLVMAttributeRef LLVMCreateConstantRangeAttribute(LLVMContextRef C, unsigned KindID, unsigned NumBits, const uint64_t LowerWords[], const uint64_t UpperWords[])
Create a ConstantRange attribute.
unsigned LLVMGetEnumAttributeKindForName(const char *Name, size_t SLen)
Return an unique id given the name of a enum attribute, or 0 if no attribute by that name exists.
LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C)
Get the diagnostic handler of this context.
void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
Set the yield callback function for this context.
char * LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI)
Return a string representation of the DiagnosticInfo.
LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength)
Create a string attribute.
unsigned LLVMGetSyncScopeID(LLVMContextRef C, const char *Name, size_t SLen)
Maps a synchronization scope name to a ID unique within this context.
void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard)
Set whether the given context discards all value names.
unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen)
unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A)
Get the unique id corresponding to the enum attribute passed as argument.
void * LLVMContextGetDiagnosticContext(LLVMContextRef C)
Get the diagnostic context of this context.
LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID, LLVMTypeRef type_ref)
Create a type attribute.
unsigned LLVMGetLastEnumAttributeKind(void)
LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C)
Retrieve whether the given context is set to discard all value names.
LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A)
LLVMContextRef LLVMGetGlobalContext()
Obtain the global context instance.
void LLVMContextDispose(LLVMContextRef C)
Destroy a context instance.
void(* LLVMYieldCallback)(LLVMContextRef, void *)
LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID, uint64_t Val)
Create an enum attribute.
const char * LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's kind.
LLVMContextRef LLVMContextCreate()
Create a new context.
void(* LLVMDiagnosticHandler)(LLVMDiagnosticInfoRef, void *)
LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI)
Return an enum LLVMDiagnosticSeverity.
LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef B, LLVMValueRef *RetVals, unsigned N)
LLVMValueRef LLVMBuildMul(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef B)
LLVMValueRef LLVMBuildSub(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst)
LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef B, LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMBuildGEPWithNoWrapFlags(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name, LLVMGEPNoWrapFlags NoWrapFlags)
Creates a GetElementPtr instruction.
LLVMValueRef LLVMBuildAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMBuilderRef LLVMCreateBuilder(void)
void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool isWeak)
LLVMValueRef LLVMBuildOr(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMPositionBuilderBeforeInstrAndDbgRecords(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr and any attached debug records.
LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef B, LLVMValueRef Val, const char *Name)
void LLVMDisposeBuilder(LLVMBuilderRef Builder)
void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name)
void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint)
Sets the disjoint flag for the instruction.
LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst)
LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn)
void LLVMSetAtomicRMWBinOp(LLVMValueRef Inst, LLVMAtomicRMWBinOp BinOp)
LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildInvokeWithOperandBundles(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
LLVMValueRef LLVMBuildXor(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst)
LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
unsigned LLVMGetNumMaskElements(LLVMValueRef SVInst)
Get the number of elements in the mask of a ShuffleVector instruction.
void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr)
LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers)
Obtain the basic blocks acting as handlers for a catchswitch instruction.
LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i)
LLVMValueRef LLVMBuildAnd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch)
LLVMValueRef LLVMBuildCallBr(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMBasicBlockRef DefaultDest, LLVMBasicBlockRef *IndirectDests, unsigned NumIndirectDests, LLVMValueRef *Args, unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildCall2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW)
LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder)
Get location information used by debugging information.
LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildSelect(LLVMBuilderRef B, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name)
void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr)
Set the builder position before Instr but after any attached debug records.
LLVMBool LLVMCanValueUseFastMathFlags(LLVMValueRef V)
Check if a given value can potentially have fast math flags.
void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value)
LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef B, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else)
LLVMBool LLVMGetNUW(LLVMValueRef ArithInst)
LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned, LLVMTypeRef DestTy, LLVMBool DestIsSigned)
void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name)
LLVMValueRef LLVMBuildSRem(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Deprecated: This cast is always signed.
LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
Deprecated: Returning the NULL location will crash.
LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef B, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name)
LLVMValueRef LLVMBuildShl(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
LLVMValueRef LLVMBuildMemMove(LLVMBuilderRef B, LLVMValueRef Dst, unsigned DstAlign, LLVMValueRef Src, unsigned SrcAlign, LLVMValueRef Size)
Creates and inserts a memmove between the specified pointers.
LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemAccessInst)
LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, unsigned Idx, const char *Name)
int LLVMGetMaskValue(LLVMValueRef SVInst, unsigned Elt)
Get the mask value at position Elt in the mask of a ShuffleVector instruction.
void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest)
LLVMValueRef LLVMBuildBr(LLVMBuilderRef B, LLVMBasicBlockRef Dest)
LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef B, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name)
void LLVMPositionBuilderBeforeDbgRecords(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, LLVMValueRef Instr)
Set the builder position before Instr and any attached debug records, or if Instr is null set the pos...
void LLVMSetFastMathFlags(LLVMValueRef FPMathInst, LLVMFastMathFlags FMF)
Sets the flags for which fast-math-style optimizations are allowed for this value.
LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, LLVMBool IsSigned, const char *Name)
LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
LLVMValueRef LLVMBuildCallWithOperandBundles(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad)
LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef B, LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx)
unsigned LLVMGetAtomicSyncScopeID(LLVMValueRef AtomicInst)
Returns the synchronization scope ID of an atomic instruction.
LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef B, LLVMValueRef List, LLVMTypeRef Ty, const char *Name)
LLVMValueRef LLVMBuildAtomicCmpXchgSyncScope(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, unsigned SSID)
LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMBool LLVMIsAtomic(LLVMValueRef Inst)
Returns whether an instruction is an atomic instruction, e.g., atomicrmw, cmpxchg,...
void LLVMSetVolatile(LLVMValueRef MemAccessInst, LLVMBool isVolatile)
void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool NewValue)
LLVMValueRef LLVMBuildFRem(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildURem(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMBool LLVMGetNSW(LLVMValueRef ArithInst)
LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildFree(LLVMBuilderRef B, LLVMValueRef PointerVal)
LLVMValueRef LLVMBuildNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
LLVMValueRef LLVMBuildFSub(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMBasicBlockRef UnwindBB, unsigned NumHandlers, const char *Name)
LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PointerVal, const char *Name)
LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool singleThread)
LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests)
LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef B)
LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildSExt(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst)
Attempts to set the debug location for the given instruction using the current debug location for the...
void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc)
Set location information used by debugging information.
LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef B, LLVMTypeRef Ty, const char *Name)
LLVMBool LLVMGetVolatile(LLVMValueRef MemAccessInst)
void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L)
Deprecated: Passing the NULL location will crash.
LLVMValueRef LLVMBuildPhi(LLVMBuilderRef B, LLVMTypeRef Ty, const char *Name)
void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest)
LLVMBool LLVMGetNNeg(LLVMValueRef NonNegInst)
Gets if the instruction has the non-negative flag set.
LLVMValueRef LLVMBuildAtomicRMWSyncScope(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, unsigned SSID)
LLVMValueRef LLVMBuildRet(LLVMBuilderRef B, LLVMValueRef V)
LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder)
Get the dafult floating-point math metadata for a given builder.
LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef B, LLVMValueRef AggVal, unsigned Index, const char *Name)
LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name)
Deprecated: Use LLVMBuildGlobalString instead, which has identical behavior.
LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block)
LLVMValueRef LLVMBuildFMul(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildLShr(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef Inst)
LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
LLVMValueRef LLVMBuildMemSet(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Val, LLVMValueRef Len, unsigned Align)
Creates and inserts a memset to the specified pointer and the specified value.
void LLVMSetAtomicSyncScopeID(LLVMValueRef AtomicInst, unsigned SSID)
Sets the synchronization scope ID of an atomic instruction.
LLVMContextRef LLVMGetBuilderContext(LLVMBuilderRef Builder)
Obtain the context to which this builder is associated.
LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef B, LLVMTypeRef Ty, const char *Name)
LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef B, LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name)
void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW)
LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)
LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef B, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef B, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name)
LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val)
LLVMValueRef LLVMBuildICmp(LLVMBuilderRef B, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal)
LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering Ordering, LLVMBool isSingleThread, const char *Name)
void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch)
Set the parent catchswitch instruction of a catchpad instruction.
LLVMValueRef LLVMBuildFenceSyncScope(LLVMBuilderRef B, LLVMAtomicOrdering Ordering, unsigned SSID, const char *Name)
LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, LLVMValueRef Instr)
Set the builder position before Instr but after any attached debug records, or if Instr is null set t...
unsigned LLVMGetNumClauses(LLVMValueRef LandingPad)
int LLVMGetUndefMaskElem(void)
void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad)
Get the parent catchswitch instruction of a catchpad instruction.
LLVMFastMathFlags LLVMGetFastMathFlags(LLVMValueRef FPMathInst)
Get the flags for which fast-math-style optimizations are allowed for this value.
LLVMBool LLVMGetIsDisjoint(LLVMValueRef Inst)
Gets whether the instruction has the disjoint flag set.
LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef B, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases)
void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg)
Sets the non-negative flag for the instruction.
LLVMValueRef LLVMBuildMemCpy(LLVMBuilderRef B, LLVMValueRef Dst, unsigned DstAlign, LLVMValueRef Src, unsigned SrcAlign, LLVMValueRef Size)
Creates and inserts a memcpy between the specified pointers.
void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest)
void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact)
LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
LLVMValueRef LLVMBuildAShr(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name)
void LLVMSetOrdering(LLVMValueRef MemAccessInst, LLVMAtomicOrdering Ordering)
LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildStore(LLVMBuilderRef B, LLVMValueRef Val, LLVMValueRef PointerVal)
void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst)
Adds the metadata registered with the given builder to the given instruction.
LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst)
LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef B, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name)
void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder, LLVMMetadataRef FPMathTag)
Set the default floating-point math metadata for the given builder.
LLVMValueRef LLVMBuildZExt(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildNot(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator)
size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName)
const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
LLVMModuleProviderRef LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M)
Changes the type of M so it can be passed to FunctionPassManagers and the JIT.
void LLVMDisposeModuleProvider(LLVMModuleProviderRef MP)
Destroys the module M.
char * LLVMPrintModuleToString(LLVMModuleRef M)
Return a string representation of the module.
LLVMNamedMDNodeRef LLVMGetOrInsertNamedMetadata(LLVMModuleRef M, const char *Name, size_t NameLen)
Retrieve a NamedMDNode with the given name, creating a new node if no such node exists.
LLVMValueRef LLVMGetNamedFunctionWithLength(LLVMModuleRef M, const char *Name, size_t Length)
Obtain a Function value from a Module by its name.
unsigned LLVMGetDebugLocColumn(LLVMValueRef Val)
Return the column number of the debug location for this value, which must be an llvm::Instruction.
LLVMNamedMDNodeRef LLVMGetNamedMetadata(LLVMModuleRef M, const char *Name, size_t NameLen)
Retrieve a NamedMDNode with the given name, returning NULL if no such node exists.
LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMContextRef C)
Create a new, empty module in a specific context.
const char * LLVMGetTarget(LLVMModuleRef M)
Obtain the target triple for a module.
LLVMBool LLVMGetInlineAsmCanUnwind(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet may unwind the stack.
const char * LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len)
Get inline assembly for a module.
LLVMBool LLVMGetInlineAsmNeedsAlignedStack(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet needs an aligned stack.
LLVMBool LLVMGetInlineAsmHasSideEffects(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet has side effects.
unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name)
Obtain the number of operands for named metadata in a module.
void LLVMDumpModule(LLVMModuleRef M)
Dump a representation of a module to stderr.
void LLVMSetTarget(LLVMModuleRef M, const char *TripleStr)
Set the target triple for a module.
LLVMTypeRef LLVMGetInlineAsmFunctionType(LLVMValueRef InlineAsmVal)
Get the function type of the inline assembly snippet.
LLVMBool LLVMIsNewDbgInfoFormat(LLVMModuleRef M)
Soon to be deprecated.
LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M)
Obtain the context to which this module is associated.
LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal)
Get the dialect used by the inline asm snippet.
void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm)
Deprecated: Use LLVMSetModuleInlineAsm2 instead.
LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn)
Advance a Function iterator to the next Function.
const char * LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len)
Obtain the identifier of a module.
const char * LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len)
Obtain the module's original source file name.
LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID)
Create a new, empty module in the global context.
const char * LLVMGetDataLayoutStr(LLVMModuleRef M)
Obtain the data layout for a module.
LLVMModuleFlagBehavior LLVMModuleFlagEntriesGetFlagBehavior(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the flag behavior for a module flag entry at a specific index.
void LLVMSetIsNewDbgInfoFormat(LLVMModuleRef M, LLVMBool UseNewFormat)
Soon to be deprecated.
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name)
Deprecated: Use LLVMGetTypeByName2 instead.
void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len)
Set the identifier of a module to a string Ident with length Len.
const char * LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the template string used for an inline assembly snippet.
LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty, const char *AsmString, size_t AsmStringSize, const char *Constraints, size_t ConstraintsSize, LLVMBool HasSideEffects, LLVMBool IsAlignStack, LLVMInlineAsmDialect Dialect, LLVMBool CanThrow)
Create the specified uniqued inline asm string.
const char * LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the raw constraint string for an inline assembly snippet.
LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NMD)
Advance a NamedMDNode iterator to the next NamedMDNode.
void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, LLVMValueRef *Dest)
Obtain the named metadata operands for a module.
LLVMMetadataRef LLVMGetModuleFlag(LLVMModuleRef M, const char *Key, size_t KeyLen)
Add a module-level flag to the module-level flags metadata if it doesn't already exist.
LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy)
Add a function to a module under a specified name.
LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn)
Decrement a Function iterator to the previous Function.
const char * LLVMGetDebugLocDirectory(LLVMValueRef Val, unsigned *Length)
Return the directory of the debug location for this value, which must be an llvm::Instruction,...
void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, LLVMValueRef Val)
Add an operand to named metadata.
unsigned LLVMGetDebugLocLine(LLVMValueRef Val)
Return the line number of the debug location for this value, which must be an llvm::Instruction,...
LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the metadata for a module flag entry at a specific index.
void LLVMAddModuleFlag(LLVMModuleRef M, LLVMModuleFlagBehavior Behavior, const char *Key, size_t KeyLen, LLVMMetadataRef Val)
Add a module-level flag to the module-level flags metadata if it doesn't already exist.
LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M)
Obtain an iterator to the last Function in a Module.
LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NMD)
Decrement a NamedMDNode iterator to the previous NamedMDNode.
const char * LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NMD, size_t *NameLen)
Retrieve the name of a NamedMDNode.
LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name)
Obtain a Function value from a Module by its name.
const char * LLVMGetDebugLocFilename(LLVMValueRef Val, unsigned *Length)
Return the filename of the debug location for this value, which must be an llvm::Instruction,...
void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len)
Append inline assembly to a module.
void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr)
Set the data layout for a module.
void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries)
Destroys module flags metadata entries.
void LLVMDisposeModule(LLVMModuleRef M)
Destroy a module instance.
LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the last NamedMDNode in a Module.
void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len)
Set inline assembly for a module.
LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M)
Obtain an iterator to the first Function in a Module.
LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the first NamedMDNode in a Module.
const char * LLVMModuleFlagEntriesGetKey(LLVMModuleFlagEntry *Entries, unsigned Index, size_t *Len)
Returns the key for a module flag entry at a specific index.
void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name, size_t Len)
Set the original source file name of a module to a string Name with length Len.
LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage)
Print a representation of a module to a file.
const char * LLVMGetDataLayout(LLVMModuleRef M)
LLVMModuleFlagEntry * LLVMCopyModuleFlagsMetadata(LLVMModuleRef M, size_t *Len)
Returns the module flags as an array of flag-key-value triples.
LLVMOperandBundleRef LLVMCreateOperandBundle(const char *Tag, size_t TagLen, LLVMValueRef *Args, unsigned NumArgs)
Create a new operand bundle.
unsigned LLVMGetNumOperandBundleArgs(LLVMOperandBundleRef Bundle)
Obtain the number of operands for an operand bundle.
const char * LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len)
Obtain the tag of an operand bundle as a string.
void LLVMDisposeOperandBundle(LLVMOperandBundleRef Bundle)
Destroy an operand bundle.
LLVMValueRef LLVMGetOperandBundleArgAtIndex(LLVMOperandBundleRef Bundle, unsigned Index)
Obtain the operand for an operand bundle at the given index.
LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef P)
Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.
LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
Constructs a new function-by-function pass pipeline over the module provider.
LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
Finalizes all of the function passes scheduled in the function pass manager.
void LLVMDisposePassManager(LLVMPassManagerRef PM)
Frees the memory of a pass pipeline.
LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F)
Executes all of the function passes scheduled in the function pass manager on the provided function.
LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM)
Initializes all of the function passes scheduled in the function pass manager.
LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M)
Initializes, executes on the provided module, and finalizes all of the passes scheduled in the pass m...
LLVMPassManagerRef LLVMCreatePassManager()
Constructs a new whole-module pass pipeline.
void LLVMStopMultithreaded()
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
LLVMBool LLVMStartMultithreaded()
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
LLVMBool LLVMIsMultithreaded()
Check whether LLVM is executing in thread-safe mode or not.
LLVMTypeRef LLVMBFloatType(void)
LLVMTypeRef LLVMPPCFP128Type(void)
LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C)
Obtain a 16-bit floating point type from a context.
LLVMTypeRef LLVMHalfType(void)
Obtain a floating point type from the global context.
LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C)
Obtain a 16-bit brain floating point type from a context.
LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (two 64-bits) from a context.
LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C)
Obtain a 64-bit floating point type from a context.
LLVMTypeRef LLVMDoubleType(void)
LLVMTypeRef LLVMFP128Type(void)
LLVMTypeRef LLVMX86FP80Type(void)
LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C)
Obtain a 32-bit floating point type from a context.
LLVMTypeRef LLVMFloatType(void)
LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (112-bit mantissa) from a context.
LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C)
Obtain a 80-bit floating point type (X87) from a context.
LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy)
Obtain the Type this function Type returns.
LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, LLVMTypeRef *ParamTypes, unsigned ParamCount, LLVMBool IsVarArg)
Obtain a function type consisting of a specified signature.
LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy)
Returns whether a function type is variadic.
unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy)
Obtain the number of parameters this function accepts.
void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest)
Obtain the types of a function's parameters.
LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)
Obtain an integer type from a context with specified bit width.
LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMInt16Type(void)
LLVMTypeRef LLVMInt1Type(void)
Obtain an integer type from the global context with a specified bit width.
LLVMTypeRef LLVMInt8Type(void)
LLVMTypeRef LLVMIntType(unsigned NumBits)
LLVMTypeRef LLVMInt32Type(void)
LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits)
LLVMTypeRef LLVMInt64Type(void)
LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C)
unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy)
LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMInt128Type(void)
LLVMTypeRef LLVMX86AMXType(void)
LLVMTypeRef LLVMVoidType(void)
These are similar to the above functions except they operate on the global context.
unsigned LLVMGetTargetExtTypeNumTypeParams(LLVMTypeRef TargetExtTy)
Obtain the number of type parameters for this target extension type.
LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C)
Create a X86 AMX type in a context.
const char * LLVMGetTargetExtTypeName(LLVMTypeRef TargetExtTy)
Obtain the name for this target extension type.
LLVMTypeRef LLVMLabelType(void)
LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)
Create a void type in a context.
LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C)
Create a token type in a context.
unsigned LLVMGetTargetExtTypeNumIntParams(LLVMTypeRef TargetExtTy)
Obtain the number of int parameters for this target extension type.
LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C)
Create a label type in a context.
LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C)
Create a metadata type in a context.
LLVMTypeRef LLVMGetTargetExtTypeTypeParam(LLVMTypeRef TargetExtTy, unsigned Idx)
Get the type parameter at the given index for the target extension type.
LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, const char *Name, LLVMTypeRef *TypeParams, unsigned TypeParamCount, unsigned *IntParams, unsigned IntParamCount)
Create a target extension type in LLVM context.
unsigned LLVMGetTargetExtTypeIntParam(LLVMTypeRef TargetExtTy, unsigned Idx)
Get the int parameter at the given index for the target extension type.
LLVMValueRef LLVMGetConstantPtrAuthAddrDiscriminator(LLVMValueRef PtrAuth)
Get the address discriminator value for the associated ConstantPtrAuth constant.
LLVMBool LLVMPointerTypeIsOpaque(LLVMTypeRef Ty)
Determine whether a pointer is opaque.
LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace)
Create an opaque pointer type in a context.
LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a vector type that contains a defined type and has a specific number of elements.
LLVMTypeRef LLVMGetElementType(LLVMTypeRef WrappedTy)
Obtain the element type of an array or vector type.
LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a vector type that contains a defined type and has a scalable number of elements.
LLVMValueRef LLVMGetConstantPtrAuthDiscriminator(LLVMValueRef PtrAuth)
Get the discriminator value for the associated ConstantPtrAuth constant.
uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
LLVMValueRef LLVMGetConstantPtrAuthKey(LLVMValueRef PtrAuth)
Get the key value for the associated ConstantPtrAuth constant.
unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
LLVMValueRef LLVMGetConstantPtrAuthPointer(LLVMValueRef PtrAuth)
Get the pointer value for the associated ConstantPtrAuth constant.
unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy)
Obtain the address space of a pointer type.
LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount)
Create a fixed size array type that refers to a specific type.
unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy)
Obtain the (possibly scalable) number of elements in a vector type.
LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a fixed size array type that refers to a specific type.
void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr)
Returns type's subtypes.
LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace)
Create a pointer type that points to a defined type.
unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp)
Return the number of types in the derived type.
LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in a context.
void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest)
Get the elements within a structure.
LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i)
Get the type of the element at a given index in the structure.
LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy)
Determine whether a structure is packed.
LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
Create an empty structure in a context having a specified name.
void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Set the contents of a structure type.
LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy)
Determine whether a structure is opaque.
LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in the global context.
unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy)
Get the number of elements defined inside the structure.
const char * LLVMGetStructName(LLVMTypeRef Ty)
Obtain the name of a structure.
LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy)
Determine whether a structure is literal.
void LLVMDumpType(LLVMTypeRef Ty)
Dump a representation of a type to stderr.
LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty)
Whether the type has a known size.
LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty)
Obtain the context to which this type instance is associated.
char * LLVMPrintTypeToString(LLVMTypeRef Ty)
Return a string representation of the type.
LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)
Obtain the enumerated type of a Type instance.
LLVMTailCallKind
Tail call kind for LLVMSetTailCallKind and LLVMGetTailCallKind.
LLVMOpcode
External users depend on the following values being stable.
unsigned LLVMAttributeIndex
unsigned LLVMFastMathFlags
Flags to indicate what fast-math-style optimizations are allowed on operations.
unsigned LLVMGEPNoWrapFlags
Flags that constrain the allowed wrap semantics of a getelementptr instruction.
@ LLVMDLLImportLinkage
Obsolete.
@ LLVMInternalLinkage
Rename collisions when linking (static functions)
@ LLVMLinkOnceAnyLinkage
Keep one copy of function when linking (inline)
@ LLVMExternalLinkage
Externally visible function.
@ LLVMExternalWeakLinkage
ExternalWeak linkage description.
@ LLVMLinkOnceODRLinkage
Same, but only replaced by something equivalent.
@ LLVMPrivateLinkage
Like Internal, but omit from symbol table.
@ LLVMDLLExportLinkage
Obsolete.
@ LLVMLinkerPrivateLinkage
Like Private, but linker removes.
@ LLVMWeakODRLinkage
Same, but only replaced by something equivalent.
@ LLVMGhostLinkage
Obsolete.
@ LLVMWeakAnyLinkage
Keep one copy of function when linking (weak)
@ LLVMAppendingLinkage
Special purpose, only applies to global arrays.
@ LLVMCommonLinkage
Tentative definitions.
@ LLVMLinkOnceODRAutoHideLinkage
Obsolete.
@ LLVMLinkerPrivateWeakLinkage
Like LinkerPrivate, but is weak.
@ LLVMAvailableExternallyLinkage
@ LLVMHalfTypeKind
16 bit floating point type
@ LLVMFP128TypeKind
128 bit floating point type (112-bit mantissa)
@ LLVMIntegerTypeKind
Arbitrary bit width integers.
@ LLVMPointerTypeKind
Pointers.
@ LLVMX86_FP80TypeKind
80 bit floating point type (X87)
@ LLVMX86_AMXTypeKind
X86 AMX.
@ LLVMMetadataTypeKind
Metadata.
@ LLVMScalableVectorTypeKind
Scalable SIMD vector type.
@ LLVMArrayTypeKind
Arrays.
@ LLVMBFloatTypeKind
16 bit brain floating point type
@ LLVMStructTypeKind
Structures.
@ LLVMLabelTypeKind
Labels.
@ LLVMDoubleTypeKind
64 bit floating point type
@ LLVMVoidTypeKind
type with no size
@ LLVMTokenTypeKind
Tokens.
@ LLVMFloatTypeKind
32 bit floating point type
@ LLVMFunctionTypeKind
Functions.
@ LLVMVectorTypeKind
Fixed width SIMD vector type.
@ LLVMPPC_FP128TypeKind
128 bit floating point type (two 64-bits)
@ LLVMTargetExtTypeKind
Target extension type.
@ LLVMInstructionValueKind
@ LLVMGlobalUnnamedAddr
Address of the GV is globally insignificant.
@ LLVMLocalUnnamedAddr
Address of the GV is locally insignificant.
@ LLVMNoUnnamedAddr
Address of the GV is significant.
@ LLVMModuleFlagBehaviorRequire
Adds a requirement that another module flag be present and have a specified value after linking is pe...
@ LLVMModuleFlagBehaviorWarning
Emits a warning if two values disagree.
@ LLVMModuleFlagBehaviorOverride
Uses the specified value, regardless of the behavior or value of the other module.
@ LLVMModuleFlagBehaviorAppendUnique
Appends the two values, which are required to be metadata nodes.
@ LLVMModuleFlagBehaviorAppend
Appends the two values, which are required to be metadata nodes.
@ LLVMModuleFlagBehaviorError
Emits an error if two values disagree, otherwise the resulting value is that of the operands.
@ LLVMAtomicRMWBinOpXor
Xor a value and return the old one.
@ LLVMAtomicRMWBinOpXchg
Set the new value and return the one old.
@ LLVMAtomicRMWBinOpSub
Subtract a value and return the old one.
@ LLVMAtomicRMWBinOpUMax
Sets the value if it's greater than the original using an unsigned comparison and return the old one.
@ LLVMAtomicRMWBinOpUSubSat
Subtracts the value, clamping to zero.
@ LLVMAtomicRMWBinOpAnd
And a value and return the old one.
@ LLVMAtomicRMWBinOpUDecWrap
Decrements the value, wrapping back to the input value when decremented below zero.
@ LLVMAtomicRMWBinOpFMax
Sets the value if it's greater than the original using an floating point comparison and return the ol...
@ LLVMAtomicRMWBinOpMin
Sets the value if it's Smaller than the original using a signed comparison and return the old one.
@ LLVMAtomicRMWBinOpOr
OR a value and return the old one.
@ LLVMAtomicRMWBinOpFMin
Sets the value if it's smaller than the original using an floating point comparison and return the ol...
@ LLVMAtomicRMWBinOpMax
Sets the value if it's greater than the original using a signed comparison and return the old one.
@ LLVMAtomicRMWBinOpFMaximum
Sets the value if it's greater than the original using an floating point comparison and return the ol...
@ LLVMAtomicRMWBinOpFMinimum
Sets the value if it's smaller than the original using an floating point comparison and return the ol...
@ LLVMAtomicRMWBinOpUIncWrap
Increments the value, wrapping back to zero when incremented above input value.
@ LLVMAtomicRMWBinOpFAdd
Add a floating point value and return the old one.
@ LLVMAtomicRMWBinOpFSub
Subtract a floating point value and return the old one.
@ LLVMAtomicRMWBinOpAdd
Add a value and return the old one.
@ LLVMAtomicRMWBinOpUMin
Sets the value if it's greater than the original using an unsigned comparison and return the old one.
@ LLVMAtomicRMWBinOpNand
Not-And a value and return the old one.
@ LLVMAtomicRMWBinOpUSubCond
Subtracts the value only if no unsigned overflow.
@ LLVMFastMathAllowReassoc
@ LLVMFastMathNoSignedZeros
@ LLVMFastMathAllowContract
@ LLVMFastMathAllowReciprocal
@ LLVMGeneralDynamicTLSModel
@ LLVMLocalDynamicTLSModel
@ LLVMInitialExecTLSModel
@ LLVMAtomicOrderingAcquireRelease
provides both an Acquire and a Release barrier (for fences and operations which both read and write m...
@ LLVMAtomicOrderingRelease
Release is similar to Acquire, but with a barrier of the sort necessary to release a lock.
@ LLVMAtomicOrderingAcquire
Acquire provides a barrier of the sort necessary to acquire a lock to access other memory with normal...
@ LLVMAtomicOrderingMonotonic
guarantees that if you take all the operations affecting a specific address, a consistent ordering ex...
@ LLVMAtomicOrderingSequentiallyConsistent
provides Acquire semantics for loads and Release semantics for stores.
@ LLVMAtomicOrderingNotAtomic
A load or store which is not atomic.
@ LLVMAtomicOrderingUnordered
Lowest level of atomicity, guarantees somewhat sane results, lock free.
@ LLVMInlineAsmDialectATT
@ LLVMInlineAsmDialectIntel
LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB)
Obtain the last instruction in a basic block.
void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to after another one.
LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn)
Obtain the first basic block in a function.
LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, const char *Name)
Create a new basic block without inserting it into a function.
LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
Go backwards in a basic block iterator.
LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
Obtain the last basic block in a function.
LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef BBRef, const char *Name)
Insert a basic block in a function using the global context.
LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
Obtain the terminator instruction for a basic block.
const char * LLVMGetBasicBlockName(LLVMBasicBlockRef BB)
Obtain the string name of a basic block.
void LLVMAppendExistingBasicBlock(LLVMValueRef Fn, LLVMBasicBlockRef BB)
Append the given basic block to the basic block list of the given function.
void LLVMDeleteBasicBlock(LLVMBasicBlockRef BBRef)
Remove a basic block from a function and delete it.
LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, LLVMBasicBlockRef BBRef, const char *Name)
Insert a basic block in a function before another basic block.
void LLVMGetBasicBlocks(LLVMValueRef FnRef, LLVMBasicBlockRef *BasicBlocksRefs)
Obtain all of the basic blocks in a function.
void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to before another one.
LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
Obtain the function to which a basic block belongs.
LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
Obtain the basic block that corresponds to the entry point of a function.
LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
Obtain the first instruction in a basic block.
void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder, LLVMBasicBlockRef BB)
Insert the given basic block after the insertion point of the given builder.
LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
Convert a basic block instance to a value type.
LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BBRef)
Remove a basic block from a function.
LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB)
Advance a basic block iterator.
unsigned LLVMCountBasicBlocks(LLVMValueRef FnRef)
Obtain the number of basic blocks in a function.
LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef FnRef, const char *Name)
Append a basic block to the end of a function using the global context.
LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, LLVMValueRef FnRef, const char *Name)
Append a basic block to the end of a function.
LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val)
Determine whether an LLVMValueRef is itself a basic block.
LLVMValueRef LLVMConstantPtrAuth(LLVMValueRef Ptr, LLVMValueRef Key, LLVMValueRef Disc, LLVMValueRef AddrDisc)
Create a ConstantPtrAuth constant with the given values.
LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx)
Get element of a constant aggregate (struct, array or vector) at the specified index.
LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size)
Create a ConstantVector from values.
LLVMValueRef LLVMConstStringInContext2(LLVMContextRef C, const char *Str, size_t Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
LLVMValueRef LLVMConstDataArray(LLVMTypeRef ElementTy, const char *Data, size_t SizeInBytes)
Create a ConstantDataArray from raw values.
LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length)
Create a ConstantArray from values.
LLVMBool LLVMIsConstantString(LLVMValueRef C)
Returns true if the specified constant is an array of i8.
LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, uint64_t Length)
Create a ConstantArray from values.
const char * LLVMGetAsString(LLVMValueRef C, size_t *Length)
Get the given constant data sequential as a string.
LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count)
Create a non-anonymous ConstantStruct from values.
LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create a ConstantStruct in the global Context.
const char * LLVMGetRawDataValues(LLVMValueRef C, size_t *SizeInBytes)
Get the raw, underlying bytes of the given constant data sequential.
LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create an anonymous ConstantStruct with the specified values.
LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential with string content in the global context.
LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty)
LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty)
LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstGEPWithNoWrapFlags(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices, LLVMGEPNoWrapFlags NoWrapFlags)
Creates a constant GetElementPtr expression.
LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal)
LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant)
LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal)
LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant)
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant)
LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB)
LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal)
LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, LLVMBool IsAlignStack)
Deprecated: Use LLVMGetInlineAsm instead.
LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal)
LLVMValueRef LLVMGetBlockAddressFunction(LLVMValueRef BlockAddr)
Gets the function associated with a given BlockAddress constant value.
LLVMBasicBlockRef LLVMGetBlockAddressBasicBlock(LLVMValueRef BlockAddr)
Gets the basic block associated with a given BlockAddress constant value.
LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global)
LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global)
Returns the "value type" of a global value.
unsigned LLVMGetAlignment(LLVMValueRef V)
Obtain the preferred alignment of the value.
void LLVMSetSection(LLVMValueRef Global, const char *Section)
void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr)
void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind, LLVMMetadataRef MD)
Sets a metadata attachment, erasing the existing metadata attachment if it already exists for the giv...
void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage)
void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr)
Deprecated: Use LLVMSetUnnamedAddress instead.
LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global)
unsigned LLVMValueMetadataEntriesGetKind(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the kind of a value metadata entry at a specific index.
void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class)
LLVMVisibility LLVMGetVisibility(LLVMValueRef Global)
LLVMValueMetadataEntry * LLVMGlobalCopyAllMetadata(LLVMValueRef Value, size_t *NumEntries)
Retrieves an array of metadata entries representing the metadata attached to this value.
void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes)
Set the preferred alignment of the value.
const char * LLVMGetSection(LLVMValueRef Global)
void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz)
LLVMLinkage LLVMGetLinkage(LLVMValueRef Global)
void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind)
Erases a metadata attachment of the given kind if it exists.
LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global)
LLVMBool LLVMIsDeclaration(LLVMValueRef Global)
void LLVMGlobalClearMetadata(LLVMValueRef Global)
Removes all metadata attachments from this value.
void LLVMGlobalAddMetadata(LLVMValueRef Global, unsigned Kind, LLVMMetadataRef MD)
Adds a metadata attachment.
LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global)
Deprecated: Use LLVMGetUnnamedAddress instead.
LLVMMetadataRef LLVMValueMetadataEntriesGetMetadata(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the underlying metadata node of a value metadata entry at a specific index.
void LLVMDisposeValueMetadataEntries(LLVMValueMetadataEntry *Entries)
Destroys value metadata entries.
void LLVMGlobalAddDebugInfo(LLVMValueRef Global, LLVMMetadataRef GVE)
Add debuginfo metadata to this global.
LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, LLVMBool SignExtend)
Obtain a constant value for an integer type.
LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy, unsigned NumWords, const uint64_t Words[])
Obtain a constant value for an integer of arbitrary precision.
long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal)
Obtain the sign extended value for an integer constant value.
LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text)
Obtain a constant for a floating point value parsed from a string.
double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *LosesInfo)
Obtain the double value for an floating point constant value.
LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N)
Obtain a constant value referring to a double floating point value.
unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal)
Obtain the zero extended value for an integer constant value.
LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty)
Obtain a constant value referring to a poison value of a type.
LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty)
Obtain a constant that is a constant pointer pointing to NULL for a specified type.
LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty)
Obtain a constant value referring to an undefined value of a type.
LLVMBool LLVMIsNull(LLVMValueRef Val)
Determine whether a value instance is null.
LLVMValueRef LLVMConstNull(LLVMTypeRef Ty)
Obtain a constant value referring to the null instance of a type.
LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty)
Obtain a constant value referring to the instance of a type consisting of all ones.
LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg)
Obtain the previous parameter to a function.
void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align)
Set the alignment for a function parameter.
unsigned LLVMCountParams(LLVMValueRef FnRef)
Obtain the number of parameters in a function.
void LLVMGetParams(LLVMValueRef FnRef, LLVMValueRef *ParamRefs)
Obtain the parameters in a function.
LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
Obtain the first parameter to a function.
LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
Obtain the last parameter to a function.
LLVMValueRef LLVMGetParam(LLVMValueRef FnRef, unsigned index)
Obtain the parameter at the specified index.
LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
Obtain the next parameter to a function.
LLVMValueRef LLVMGetParamParent(LLVMValueRef V)
Obtain the function to which this argument belongs.
void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Add an attribute to a function.
LLVMValueRef LLVMGetPrefixData(LLVMValueRef Fn)
Gets the prefix data associated with a function.
LLVMValueRef LLVMGetPrologueData(LLVMValueRef Fn)
Gets the prologue data associated with a function.
LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Retrieves the type of an intrinsic.
unsigned LLVMGetIntrinsicID(LLVMValueRef Fn)
Obtain the ID number from a function instance.
LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn)
Obtain the personality function attached to the function.
unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx)
LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn)
Check whether the given function has a personality function.
void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
void LLVMSetPrefixData(LLVMValueRef Fn, LLVMValueRef prefixData)
Sets the prefix data for the function.
char * LLVMIntrinsicCopyOverloadedName(unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength)
Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.
const char * LLVMGetGC(LLVMValueRef Fn)
Obtain the name of the garbage collector to use during code generation.
void LLVMSetGC(LLVMValueRef Fn, const char *GC)
Define the garbage collector to use during code generation.
void LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData)
Sets the prologue data for the function.
void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn)
Set the personality function attached to the function.
void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn)
Obtain the calling function of a function.
LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID)
Obtain if the intrinsic identified by the given ID is overloaded.
char * LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength)
Copies the name of an overloaded intrinsic identified by a given list of parameter types.
void LLVMDeleteFunction(LLVMValueRef Fn)
Remove a function from its containing module and deletes it.
void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen)
Obtain the intrinsic ID number which matches the given function name.
const char * LLVMIntrinsicGetName(unsigned ID, size_t *NameLength)
Retrieves the name of an intrinsic.
LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Get or insert the declaration of an intrinsic.
LLVMBool LLVMHasPrologueData(LLVMValueRef Fn)
Check if a given function has prologue data.
LLVMBool LLVMHasPrefixData(LLVMValueRef Fn)
Check if a given function has prefix data.
void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC)
Set the calling convention of a function.
void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V)
Add a target-dependent attribute to a function.
LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
LLVMValueRef LLVMIsAMDString(LLVMValueRef Val)
LLVMBool LLVMIsPoison(LLVMValueRef Val)
Determine whether a value instance is poisonous.
LLVMValueKind LLVMGetValueKind(LLVMValueRef Val)
Obtain the enumerated type of a Value instance.
void LLVMDumpValue(LLVMValueRef Val)
Dump a representation of a value to stderr.
const char * LLVMGetValueName(LLVMValueRef Val)
Deprecated: Use LLVMGetValueName2 instead.
LLVMContextRef LLVMGetValueContext(LLVMValueRef Val)
Obtain the context to which this value is associated.
void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal)
Replace all uses of a value with another one.
const char * LLVMGetValueName2(LLVMValueRef Val, size_t *Length)
Obtain the string name of a value.
void LLVMSetValueName(LLVMValueRef Val, const char *Name)
Deprecated: Use LLVMSetValueName2 instead.
LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val)
char * LLVMPrintDbgRecordToString(LLVMDbgRecordRef Record)
Return a string representation of the DbgRecord.
LLVMBool LLVMIsUndef(LLVMValueRef Val)
Determine whether a value instance is undefined.
LLVMTypeRef LLVMTypeOf(LLVMValueRef Val)
Obtain the type of a value.
char * LLVMPrintValueToString(LLVMValueRef Val)
Return a string representation of the value.
LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val)
LLVMBool LLVMIsConstant(LLVMValueRef Ty)
Determine whether the specified value instance is constant.
void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen)
Set the string name of a value.
LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the first GlobalIFunc in a Module.
LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalIFunc value from a Module by its name.
void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module.
LLVMValueRef LLVMAddGlobalIFunc(LLVMModuleRef M, const char *Name, size_t NameLen, LLVMTypeRef Ty, unsigned AddrSpace, LLVMValueRef Resolver)
Add a global indirect function to a module under a specified name.
LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc)
Advance a GlobalIFunc iterator to the next GlobalIFunc.
LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc)
Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
LLVMValueRef LLVMGetGlobalIFuncResolver(LLVMValueRef IFunc)
Retrieves the resolver function associated with this indirect function, or NULL if it doesn't not exi...
void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver)
Sets the resolver function associated with this indirect function.
LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the last GlobalIFunc in a Module.
void LLVMEraseGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module and delete it.
LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca)
Obtain the type that is being allocated by the alloca instruction.
void LLVMSetTailCall(LLVMValueRef Call, LLVMBool isTailCall)
Set whether a call instruction is a tail call.
void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A)
unsigned LLVMGetNumOperandBundles(LLVMValueRef C)
Obtain the number of operand bundles attached to this instruction.
void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr)
Obtain the calling convention for a call instruction.
LLVMBasicBlockRef LLVMGetCallBrDefaultDest(LLVMValueRef CallBr)
Get the default destination of a CallBr instruction.
LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr)
Obtain the pointer to the function invoked by this instruction.
void LLVMSetNormalDest(LLVMValueRef Invoke, LLVMBasicBlockRef B)
Set the normal destination basic block.
LLVMBool LLVMIsTailCall(LLVMValueRef Call)
Obtain whether a call instruction is a tail call.
LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
unsigned LLVMGetCallBrNumIndirectDests(LLVMValueRef CallBr)
Get the number of indirect destinations of a CallBr instruction.
void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef Invoke)
Return the normal destination basic block.
unsigned LLVMGetNumArgOperands(LLVMValueRef Instr)
Obtain the argument count for a call instruction.
void LLVMSetTailCallKind(LLVMValueRef Call, LLVMTailCallKind kind)
Set the call kind of the call instruction.
LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueRef C, unsigned Index)
Obtain the operand bundle attached to this instruction at the given index.
LLVMBasicBlockRef LLVMGetCallBrIndirectDest(LLVMValueRef CallBr, unsigned Idx)
Get the indirect destination of a CallBr instruction at the given index.
LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef Call)
Obtain a tail call kind of the call instruction.
void LLVMSetUnwindDest(LLVMValueRef Invoke, LLVMBasicBlockRef B)
Set the unwind destination basic block.
LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef Instr)
Obtain the function type called by this instruction.
LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef Invoke)
Return the unwind destination basic block.
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned align)
unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx)
void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC)
Set the calling convention for a call instruction.
LLVMGEPNoWrapFlags LLVMGEPGetNoWrapFlags(LLVMValueRef GEP)
Get the no-wrap related flags for the given GEP instruction.
LLVMBool LLVMIsInBounds(LLVMValueRef GEP)
Check whether the given GEP operator is inbounds.
void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds)
Set the given GEP instruction to be inbounds or not.
LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP)
Get the source element type of the given GEP operator.
void LLVMGEPSetNoWrapFlags(LLVMValueRef GEP, LLVMGEPNoWrapFlags NoWrapFlags)
Set the no-wrap related flags for the given GEP instruction.
unsigned LLVMGetNumIndices(LLVMValueRef Inst)
Obtain the number of indices.
const unsigned * LLVMGetIndices(LLVMValueRef Inst)
Obtain the indices as an array.
LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMValueRef.
void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, LLVMBasicBlockRef *IncomingBlocks, unsigned Count)
Add an incoming value to the end of a PHI list.
unsigned LLVMCountIncoming(LLVMValueRef PhiNode)
Obtain the number of incoming basic blocks to a PHI node.
LLVMValueRef LLVMGetCondition(LLVMValueRef Branch)
Return the condition of a branch instruction.
LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i)
Return the specified successor.
void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond)
Set the condition of a branch instruction.
void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block)
Update the specified successor to point at the provided block.
LLVMBool LLVMIsConditional(LLVMValueRef Branch)
Return if a branch is conditional.
LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef Switch)
Obtain the default destination basic block of a switch instruction.
unsigned LLVMGetNumSuccessors(LLVMValueRef Term)
Return the number of successors that this terminator has.
LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst)
Obtain the float predicate of an instruction.
int LLVMHasMetadata(LLVMValueRef Inst)
Determine whether an instruction has any metadata attached.
void LLVMInstructionRemoveFromParent(LLVMValueRef Inst)
Remove an instruction.
LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
Obtain the instruction that occurred before this one.
LLVMDbgRecordRef LLVMGetPreviousDbgRecord(LLVMDbgRecordRef Rec)
Obtain the previous DbgRecord in the sequence or NULL if there are no more.
LLVMDbgRecordRef LLVMGetFirstDbgRecord(LLVMValueRef Inst)
Obtain the first debug record attached to an instruction.
LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
Obtain the code opcode for an individual instruction.
LLVMDbgRecordRef LLVMGetNextDbgRecord(LLVMDbgRecordRef Rec)
Obtain the next DbgRecord in the sequence or NULL if there are no more.
LLVMDbgRecordRef LLVMGetLastDbgRecord(LLVMValueRef Inst)
Obtain the last debug record attached to an instruction.
LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst)
Determine whether an instruction is a terminator.
LLVMValueMetadataEntry * LLVMInstructionGetAllMetadataOtherThanDebugLoc(LLVMValueRef Value, size_t *NumEntries)
Returns the metadata associated with an instruction value, but filters out all the debug locations.
void LLVMDeleteInstruction(LLVMValueRef Inst)
Delete an instruction.
LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
Obtain the basic block to which an instruction belongs.
LLVMBool LLVMGetICmpSameSign(LLVMValueRef Inst)
Get whether or not an icmp instruction has the samesign flag.
LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst)
Create a copy of 'this' instruction that is identical in all ways except the following:
void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
void LLVMSetMetadata(LLVMValueRef Inst, unsigned KindID, LLVMValueRef Val)
Set metadata associated with an instruction value.
LLVMValueRef LLVMGetMetadata(LLVMValueRef Inst, unsigned KindID)
Return metadata associated with an instruction value.
LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst)
Obtain the predicate of an instruction.
LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
Obtain the instruction that occurs after the one specified.
void LLVMSetICmpSameSign(LLVMValueRef Inst, LLVMBool SameSign)
Set the samesign flag on an icmp instruction.
LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index)
Obtain the use of an operand at a specific index in a llvm::User value.
int LLVMGetNumOperands(LLVMValueRef Val)
Obtain the number of operands in a llvm::User value.
void LLVMSetOperand(LLVMValueRef Val, unsigned Index, LLVMValueRef Op)
Set an operand at a specific index in a llvm::User value.
LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index)
Obtain an operand at a specific index in a llvm::User value.
LLVMValueRef LLVMGetUser(LLVMUseRef U)
Obtain the user value for a user.
LLVMValueRef LLVMGetUsedValue(LLVMUseRef U)
Obtain the value this use corresponds to.
LLVMUseRef LLVMGetNextUse(LLVMUseRef U)
Obtain the next use of a value.
LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val)
Obtain the first use of a value.
#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)
void LLVMDisposeMessage(char *Message)
char * LLVMCreateMessage(const char *Message)
void LLVMGetVersion(unsigned *Major, unsigned *Minor, unsigned *Patch)
Return the major, minor, and patch version of LLVM.
void LLVMShutdown()
Deallocate and destroy all ManagedStatic variables.
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
struct LLVMOpaqueAttributeRef * LLVMAttributeRef
Used to represent an attributes.
struct LLVMOpaqueNamedMDNode * LLVMNamedMDNodeRef
Represents an LLVM Named Metadata Node.
struct LLVMOpaquePassManager * LLVMPassManagerRef
struct LLVMOpaqueDbgRecord * LLVMDbgRecordRef
struct LLVMOpaqueDiagnosticInfo * LLVMDiagnosticInfoRef
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
struct LLVMOpaqueBuilder * LLVMBuilderRef
Represents an LLVM basic block builder.
struct LLVMOpaqueUse * LLVMUseRef
Used to get the users and usees of a Value.
struct LLVMOpaqueBasicBlock * LLVMBasicBlockRef
Represents a basic block of instructions in LLVM IR.
struct LLVMOpaqueType * LLVMTypeRef
Each value in the LLVM IR has a type, an LLVMTypeRef.
struct LLVMOpaqueMetadata * LLVMMetadataRef
Represents an LLVM Metadata.
struct LLVMOpaqueModule * LLVMModuleRef
The top-level container for all other LLVM Intermediate Representation (IR) objects.
struct LLVMOpaqueModuleProvider * LLVMModuleProviderRef
Interface used to provide a module to JIT or interpreter.
struct LLVMOpaqueOperandBundle * LLVMOperandBundleRef
LLVMValueRef LLVMAddAlias2(LLVMModuleRef M, LLVMTypeRef ValueTy, unsigned AddrSpace, LLVMValueRef Aliasee, const char *Name)
Add a GlobalAlias with the given value type, address space and aliasee.
LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the last GlobalAlias in a Module.
LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA)
Decrement a GlobalAlias iterator to the previous GlobalAlias.
void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee)
Set the target value of an alias.
LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the first GlobalAlias in a Module.
LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias)
Retrieve the target value of an alias.
LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalAlias value from a Module by its name.
LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA)
Advance a GlobalAlias iterator to the next GlobalAlias.
LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar)
LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar)
LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar)
LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar)
void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal)
LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar)
LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M)
LLVMValueRef LLVMGetNamedGlobalWithLength(LLVMModuleRef M, const char *Name, size_t Length)
LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M)
void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode)
LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar)
void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit)
LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name)
LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name, unsigned AddressSpace)
void LLVMDeleteGlobal(LLVMValueRef GlobalVar)
void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant)
LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name)
LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar)
void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
LLVM_ABI Function * getOrInsertDeclaration(Module *M, ID id, ArrayRef< Type * > Tys={})
Look up the Function declaration of the intrinsic id in the Module M.
LLVM_ABI std::string getNameNoUnnamedTypes(ID Id, ArrayRef< Type * > Tys)
Return the LLVM name for an intrinsic.
LLVM_ABI StringRef getName(ID id)
Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".
LLVM_ABI ID lookupIntrinsicID(StringRef Name)
This does the actual lookup of an intrinsic ID which matches the given function name.
LLVM_ABI bool isOverloaded(ID id)
Returns true if the intrinsic can be overloaded.
LLVM_ABI FunctionType * getType(LLVMContext &Context, ID id, ArrayRef< Type * > Tys={})
Return the function type for an intrinsic.
@ SingleThread
Synchronized with respect to signal handlers executing in the same thread.
@ System
Synchronized with respect to all concurrently executing threads.
@ OF_TextWithCRLF
The file should be opened in text mode and use a carriage linefeed '\r '.
This is an optimization pass for GlobalISel generic memory operations.
constexpr bool llvm_is_multithreaded()
Returns true if LLVM is compiled with support for multi-threading, and false otherwise.
LLVM_ABI void initializePrintModulePassWrapperPass(PassRegistry &)
void setAtomicSyncScopeID(Instruction *I, SyncScope::ID SSID)
A helper function that sets an atomic operation's sync scope.
OperandBundleDefT< Value * > OperandBundleDef
LLVM_ABI void initializeVerifierLegacyPassPass(PassRegistry &)
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
std::optional< SyncScope::ID > getAtomicSyncScopeID(const Instruction *I)
A helper function that returns an atomic operation's sync scope; returns std::nullopt if it is not an...
LLVM_ABI void initializeCore(PassRegistry &)
Initialize all passes linked into the Core library.
LLVM_ABI void initializeDominatorTreeWrapperPassPass(PassRegistry &)
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_malloc(size_t Sz)
LLVM_ABI void initializePrintFunctionPassWrapperPass(PassRegistry &)
constexpr int PoisonMaskElem
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
@ Global
Append to llvm.global_dtors.
AtomicOrdering
Atomic ordering for LLVM's memory model.
constexpr T divideCeil(U Numerator, V Denominator)
Returns the integer ceil(Numerator / Denominator).
LLVM_ABI void llvm_shutdown()
llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
LLVMAttributeRef wrap(Attribute Attr)
LLVM_ABI void initializeSafepointIRVerifierPass(PassRegistry &)
LLVMModuleFlagBehavior Behavior
This struct is a compact representation of a valid (non-zero power of two) alignment.
void(*)(const DiagnosticInfo *DI, void *Context) DiagnosticHandlerTy
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.