44#include <system_error>
50#define DEBUG_TYPE "ir"
68 *Major = LLVM_VERSION_MAJOR;
70 *Minor = LLVM_VERSION_MINOR;
72 *Patch = LLVM_VERSION_PATCH;
78 return strdup(Message);
101 void *DiagnosticContext) {
102 unwrap(
C)->setDiagnosticHandlerCallBack(
110 unwrap(
C)->getDiagnosticHandlerCallBack());
114 return unwrap(
C)->getDiagnosticContext();
118 void *OpaqueHandle) {
121 unwrap(
C)->setYieldCallback(YieldCallback, OpaqueHandle);
125 return unwrap(
C)->shouldDiscardValueNames();
129 unwrap(
C)->setDiscardValueNames(Discard);
150 return Attribute::AttrKind::EndAttrKinds;
166 if (Attr.isEnumAttribute())
168 return Attr.getValueAsInt();
180 return wrap(Attr.getValueAsType());
198 const char *K,
unsigned KLength,
199 const char *V,
unsigned VLength) {
220 return Attr.isEnumAttribute() || Attr.isIntAttribute();
232 std::string MsgStorage;
245 switch(
unwrap(DI)->getSeverity()) {
279 auto &Str =
unwrap(M)->getModuleIdentifier();
289 auto &Str =
unwrap(M)->getSourceFileName();
300 return unwrap(M)->getDataLayoutStr().c_str();
308 unwrap(M)->setDataLayout(DataLayoutStr);
313 return unwrap(M)->getTargetTriple().c_str();
332 return Module::ModFlagBehavior::Error;
334 return Module::ModFlagBehavior::Warning;
336 return Module::ModFlagBehavior::Require;
338 return Module::ModFlagBehavior::Override;
340 return Module::ModFlagBehavior::Append;
342 return Module::ModFlagBehavior::AppendUnique;
350 case Module::ModFlagBehavior::Error:
352 case Module::ModFlagBehavior::Warning:
354 case Module::ModFlagBehavior::Require:
356 case Module::ModFlagBehavior::Override:
358 case Module::ModFlagBehavior::Append:
360 case Module::ModFlagBehavior::AppendUnique:
369 unwrap(M)->getModuleFlagsMetadata(MFEs);
373 for (
unsigned i = 0; i < MFEs.
size(); ++i) {
374 const auto &ModuleFlag = MFEs[i];
376 Result[i].Key = ModuleFlag.Key->getString().data();
377 Result[i].KeyLen = ModuleFlag.Key->getString().size();
378 Result[i].Metadata =
wrap(ModuleFlag.Val);
397 unsigned Index,
size_t *Len) {
412 const char *Key,
size_t KeyLen) {
413 return wrap(
unwrap(M)->getModuleFlag({Key, KeyLen}));
417 const char *Key,
size_t KeyLen,
420 {Key, KeyLen},
unwrap(Val));
424 return unwrap(M)->IsNewDbgInfoFormat;
428 unwrap(M)->setIsNewDbgInfoFormat(UseNewFormat);
439 char **ErrorMessage) {
443 *ErrorMessage = strdup(EC.message().c_str());
447 unwrap(M)->print(dest,
nullptr);
452 std::string E =
"Error printing to file: " + dest.
error().message();
453 *ErrorMessage = strdup(E.c_str());
464 unwrap(M)->print(os,
nullptr);
467 return strdup(buf.c_str());
484 auto &Str =
unwrap(M)->getModuleInlineAsm();
490 size_t AsmStringSize,
const char *Constraints,
491 size_t ConstraintsSize,
LLVMBool HasSideEffects,
506 HasSideEffects, IsAlignStack, AD, CanThrow));
511 Value *Val = unwrap<Value>(InlineAsmVal);
512 const std::string &AsmString = cast<InlineAsm>(Val)->getAsmString();
514 *Len = AsmString.length();
515 return AsmString.c_str();
520 Value *Val = unwrap<Value>(InlineAsmVal);
521 const std::string &ConstraintString =
522 cast<InlineAsm>(Val)->getConstraintString();
524 *Len = ConstraintString.length();
525 return ConstraintString.c_str();
530 Value *Val = unwrap<Value>(InlineAsmVal);
545 Value *Val = unwrap<Value>(InlineAsmVal);
546 return (
LLVMTypeRef)cast<InlineAsm>(Val)->getFunctionType();
550 Value *Val = unwrap<Value>(InlineAsmVal);
551 return cast<InlineAsm>(Val)->hasSideEffects();
555 Value *Val = unwrap<Value>(InlineAsmVal);
556 return cast<InlineAsm>(Val)->isAlignStack();
560 Value *Val = unwrap<Value>(InlineAsmVal);
561 return cast<InlineAsm>(Val)->canThrow();
626 return unwrap(Ty)->isSized();
644 os <<
"Printing <null> Type";
648 return strdup(buf.c_str());
698 return unwrap<IntegerType>(IntegerTy)->getBitWidth();
765 return wrap(FunctionType::get(
unwrap(ReturnType), Tys, IsVarArg != 0));
769 return unwrap<FunctionType>(FunctionTy)->isVarArg();
773 return wrap(unwrap<FunctionType>(FunctionTy)->getReturnType());
777 return unwrap<FunctionType>(FunctionTy)->getNumParams();
782 for (
Type *
T : Ty->params())
808 if (!
Type->hasName())
810 return Type->getName().data();
816 unwrap<StructType>(StructTy)->setBody(Tys, Packed != 0);
820 return unwrap<StructType>(StructTy)->getNumElements();
824 StructType *Ty = unwrap<StructType>(StructTy);
830 StructType *Ty = unwrap<StructType>(StructTy);
835 return unwrap<StructType>(StructTy)->isPacked();
839 return unwrap<StructType>(StructTy)->isOpaque();
843 return unwrap<StructType>(StructTy)->isLiteral();
858 for (
auto *
T :
unwrap(Tp)->subtypes()) {
890 auto *Ty =
unwrap(WrappedTy);
891 if (
auto *ATy = dyn_cast<ArrayType>(Ty))
892 return wrap(ATy->getElementType());
893 return wrap(cast<VectorType>(Ty)->getElementType());
897 return unwrap(Tp)->getNumContainedTypes();
901 return unwrap<ArrayType>(ArrayTy)->getNumElements();
905 return unwrap<ArrayType>(ArrayTy)->getNumElements();
909 return unwrap<PointerType>(
PointerTy)->getAddressSpace();
913 return unwrap<VectorType>(VectorTy)->getElementCount().getKnownMinValue();
944 unsigned TypeParamCount,
946 unsigned IntParamCount) {
962 switch(
unwrap(Val)->getValueID()) {
964#define HANDLE_VALUE(Name) \
965 case Value::Name##Val: \
966 return LLVM##Name##ValueKind;
967#include "llvm/IR/Value.def"
975 *
Length = V->getName().size();
976 return V->getName().data();
984 return unwrap(Val)->getName().data();
1002 os <<
"Printing <null> Value";
1006 return strdup(buf.c_str());
1016 os <<
"Printing <null> DbgRecord";
1020 return strdup(buf.c_str());
1028 return unwrap<Instruction>(Inst)->hasMetadata();
1032 auto *
I = unwrap<Instruction>(Inst);
1033 assert(
I &&
"Expected instruction");
1034 if (
auto *MD =
I->getMetadata(KindID))
1044 assert((isa<MDNode>(MD) || isa<ConstantAsMetadata>(MD)) &&
1045 "Expected a metadata node or a canonicalized constant");
1047 if (
MDNode *
N = dyn_cast<MDNode>(MD))
1056 unwrap<Instruction>(Inst)->setMetadata(KindID,
N);
1074 for (
unsigned i = 0; i < MVEs.
size(); ++i) {
1075 const auto &ModuleFlag = MVEs[i];
1076 Result[i].Kind = ModuleFlag.first;
1077 Result[i].Metadata =
wrap(ModuleFlag.second);
1079 *NumEntries = MVEs.
size();
1085 size_t *NumEntries) {
1088 unwrap<Instruction>(
Value)->getAllMetadata(Entries);
1094#define LLVM_DEFINE_VALUE_CAST(name) \
1095 LLVMValueRef LLVMIsA##name(LLVMValueRef Val) { \
1096 return wrap(static_cast<Value*>(dyn_cast_or_null<name>(unwrap(Val)))); \
1102 if (
auto *MD = dyn_cast_or_null<MetadataAsValue>(
unwrap(Val)))
1103 if (isa<MDNode>(MD->getMetadata()) ||
1104 isa<ValueAsMetadata>(MD->getMetadata()))
1110 if (
auto *MD = dyn_cast_or_null<MetadataAsValue>(
unwrap(Val)))
1111 if (isa<ValueAsMetadata>(MD->getMetadata()))
1117 if (
auto *MD = dyn_cast_or_null<MetadataAsValue>(
unwrap(Val)))
1118 if (isa<MDString>(MD->getMetadata()))
1127 if (
I == V->use_end())
1154 if (
auto *
C = dyn_cast<ConstantAsMetadata>(
Op))
1155 return wrap(
C->getValue());
1161 if (
auto *MD = dyn_cast<MetadataAsValue>(V)) {
1162 if (
auto *L = dyn_cast<ValueAsMetadata>(MD->getMetadata())) {
1163 assert(
Index == 0 &&
"Function-local metadata can only have one operand");
1164 return wrap(L->getValue());
1167 cast<MDNode>(MD->getMetadata()),
Index);
1170 return wrap(cast<User>(V)->getOperand(
Index));
1175 return wrap(&cast<User>(V)->getOperandUse(
Index));
1184 if (isa<MetadataAsValue>(V))
1187 return cast<User>(V)->getNumOperands();
1209 return isa<Constant>(
unwrap(Ty));
1214 return C->isNullValue();
1219 return isa<UndefValue>(
unwrap(Val));
1223 return isa<PoisonValue>(
unwrap(Val));
1257 for (
auto *OV :
ArrayRef(Vals, Count)) {
1262 else if (
auto *
C = dyn_cast<Constant>(V))
1264 else if (
auto *MDV = dyn_cast<MetadataAsValue>(V)) {
1265 MD = MDV->getMetadata();
1266 assert(!isa<LocalAsMetadata>(MD) &&
"Unexpected function-local metadata "
1267 "outside of direct argument to call");
1271 "Expected only one operand to function-local metadata");
1290 if (
auto *
C = dyn_cast<Constant>(V))
1292 if (
auto *MAV = dyn_cast<MetadataAsValue>(V))
1293 return wrap(MAV->getMetadata());
1298 if (
const auto *MD = dyn_cast<MetadataAsValue>(
unwrap(V)))
1299 if (
const MDString *S = dyn_cast<MDString>(MD->getMetadata())) {
1300 *
Length = S->getString().size();
1301 return S->getString().data();
1308 auto *MD = unwrap<MetadataAsValue>(V);
1309 if (isa<ValueAsMetadata>(MD->getMetadata()))
1311 return cast<MDNode>(MD->getMetadata())->getNumOperands();
1347 const char *
Name,
size_t NameLen) {
1352 const char *
Name,
size_t NameLen) {
1353 return wrap(
unwrap(M)->getOrInsertNamedMetadata({
Name, NameLen}));
1363 auto *MD = unwrap<MetadataAsValue>(V);
1364 if (
auto *MDV = dyn_cast<ValueAsMetadata>(MD->getMetadata())) {
1365 *Dest =
wrap(MDV->getValue());
1368 const auto *
N = cast<MDNode>(MD->getMetadata());
1369 const unsigned numOperands =
N->getNumOperands();
1371 for (
unsigned i = 0; i < numOperands; i++)
1377 auto *MD = cast<MetadataAsValue>(
unwrap(V));
1378 auto *
N = cast<MDNode>(MD->getMetadata());
1379 N->replaceOperandWith(
Index, unwrap<Metadata>(Replacement));
1384 return N->getNumOperands();
1395 for (
unsigned i=0;i<
N->getNumOperands();i++)
1410 if (!
Length)
return nullptr;
1412 if (
const auto *
I = dyn_cast<Instruction>(
unwrap(Val))) {
1413 if (
const auto &
DL =
I->getDebugLoc()) {
1414 S =
DL->getDirectory();
1416 }
else if (
const auto *GV = dyn_cast<GlobalVariable>(
unwrap(Val))) {
1418 GV->getDebugInfo(GVEs);
1421 S = DGV->getDirectory();
1422 }
else if (
const auto *
F = dyn_cast<Function>(
unwrap(Val))) {
1424 S = DSP->getDirectory();
1426 assert(0 &&
"Expected Instruction, GlobalVariable or Function");
1434 if (!
Length)
return nullptr;
1436 if (
const auto *
I = dyn_cast<Instruction>(
unwrap(Val))) {
1437 if (
const auto &
DL =
I->getDebugLoc()) {
1438 S =
DL->getFilename();
1440 }
else if (
const auto *GV = dyn_cast<GlobalVariable>(
unwrap(Val))) {
1442 GV->getDebugInfo(GVEs);
1445 S = DGV->getFilename();
1446 }
else if (
const auto *
F = dyn_cast<Function>(
unwrap(Val))) {
1448 S = DSP->getFilename();
1450 assert(0 &&
"Expected Instruction, GlobalVariable or Function");
1459 if (
const auto *
I = dyn_cast<Instruction>(
unwrap(Val))) {
1460 if (
const auto &
DL =
I->getDebugLoc()) {
1463 }
else if (
const auto *GV = dyn_cast<GlobalVariable>(
unwrap(Val))) {
1465 GV->getDebugInfo(GVEs);
1469 }
else if (
const auto *
F = dyn_cast<Function>(
unwrap(Val))) {
1473 assert(0 &&
"Expected Instruction, GlobalVariable or Function");
1481 if (
const auto *
I = dyn_cast<Instruction>(
unwrap(Val)))
1482 if (
const auto &
DL =
I->getDebugLoc())
1483 C =
DL->getColumn();
1491 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy),
N, SignExtend != 0));
1498 return wrap(ConstantInt::get(
1504 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy),
StringRef(Str),
1509 unsigned SLen, uint8_t Radix) {
1510 return wrap(ConstantInt::get(unwrap<IntegerType>(IntTy),
StringRef(Str, SLen),
1528 return unwrap<ConstantInt>(ConstantVal)->getZExtValue();
1532 return unwrap<ConstantInt>(ConstantVal)->getSExtValue();
1536 ConstantFP *cFP = unwrap<ConstantFP>(ConstantVal) ;
1547 APF.
convert(APFloat::IEEEdouble(), APFloat::rmNearestTiesToEven, &APFLosesInfo);
1548 *LosesInfo = APFLosesInfo;
1560 DontNullTerminate == 0));
1569 DontNullTerminate == 0));
1579 return wrap(unwrap<Constant>(
C)->getAggregateElement(
Idx));
1583 return wrap(unwrap<ConstantDataSequential>(
C)->getElementAsConstant(idx));
1587 return unwrap<ConstantDataSequential>(
C)->isString();
1591 StringRef Str = unwrap<ConstantDataSequential>(
C)->getAsString();
1611 Constant **Elements = unwrap<Constant>(ConstantVals, Count);
1625 Constant **Elements = unwrap<Constant>(ConstantVals, Count);
1626 StructType *Ty = unwrap<StructType>(StructTy);
1642#define HANDLE_INST(num, opc, clas) case num: return LLVM##opc;
1643#include "llvm/IR/Instruction.def"
1651#define HANDLE_INST(num, opc, clas) case LLVM##opc: return num;
1652#include "llvm/IR/Instruction.def"
1691 unwrap<Constant>(RHSConstant)));
1697 unwrap<Constant>(RHSConstant)));
1703 unwrap<Constant>(RHSConstant)));
1708 unwrap<Constant>(RHSConstant)));
1714 unwrap<Constant>(RHSConstant)));
1720 unwrap<Constant>(RHSConstant)));
1725 unwrap<Constant>(RHSConstant)));
1731 unwrap<Constant>(RHSConstant)));
1737 unwrap<Constant>(RHSConstant)));
1742 unwrap<Constant>(RHSConstant)));
1748 unwrap<Constant>(LHSConstant),
1749 unwrap<Constant>(RHSConstant)));
1755 unwrap<Constant>(LHSConstant),
1756 unwrap<Constant>(RHSConstant)));
1761 unwrap<Constant>(RHSConstant)));
1768 Constant *Val = unwrap<Constant>(ConstantVal);
1774 unsigned NumIndices) {
1777 Constant *Val = unwrap<Constant>(ConstantVal);
1822 unwrap<Constant>(IndexConstant)));
1829 unwrap<Constant>(ElementValueConstant),
1830 unwrap<Constant>(IndexConstant)));
1839 unwrap<Constant>(VectorBConstant),
1844 const char *Constraints,
1848 Constraints, HasSideEffects, IsAlignStack));
1860 return wrap(unwrap<BlockAddress>(BlockAddr)->getBasicBlock());
1870 return unwrap<GlobalValue>(
Global)->isDeclaration();
1874 switch (unwrap<GlobalValue>(
Global)->getLinkage()) {
1920 errs() <<
"LLVMSetLinkage(): LLVMLinkOnceODRAutoHideLinkage is no "
1921 "longer supported.");
1947 <<
"LLVMSetLinkage(): LLVMDLLImportLinkage is no longer supported.");
1952 <<
"LLVMSetLinkage(): LLVMDLLExportLinkage is no longer supported.");
1959 errs() <<
"LLVMSetLinkage(): LLVMGhostLinkage is no longer supported.");
1970 return unwrap<GlobalValue>(
Global)->getSection().data();
1974 unwrap<GlobalObject>(
Global)->setSection(Section);
1979 unwrap<GlobalValue>(
Global)->getVisibility());
1983 unwrap<GlobalValue>(
Global)
1989 unwrap<GlobalValue>(
Global)->getDLLStorageClass());
1993 unwrap<GlobalValue>(
Global)->setDLLStorageClass(
1998 switch (unwrap<GlobalValue>(
Global)->getUnnamedAddr()) {
1999 case GlobalVariable::UnnamedAddr::None:
2001 case GlobalVariable::UnnamedAddr::Local:
2003 case GlobalVariable::UnnamedAddr::Global:
2012 switch (UnnamedAddr) {
2023 return unwrap<GlobalValue>(
Global)->hasGlobalUnnamedAddr();
2027 unwrap<GlobalValue>(
Global)->setUnnamedAddr(
2028 HasUnnamedAddr ? GlobalValue::UnnamedAddr::Global
2029 : GlobalValue::UnnamedAddr::None);
2033 return wrap(unwrap<GlobalValue>(
Global)->getValueType());
2041 return GV->getAlign() ? GV->getAlign()->value() : 0;
2043 return AI->getAlign().value();
2044 if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
2045 return LI->getAlign().value();
2047 return SI->getAlign().value();
2049 return RMWI->getAlign().value();
2051 return CXI->getAlign().value();
2054 "only GlobalValue, AllocaInst, LoadInst, StoreInst, AtomicRMWInst, "
2055 "and AtomicCmpXchgInst have alignment");
2062 else if (
AllocaInst *AI = dyn_cast<AllocaInst>(
P))
2063 AI->setAlignment(
Align(Bytes));
2064 else if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
2065 LI->setAlignment(
Align(Bytes));
2066 else if (
StoreInst *SI = dyn_cast<StoreInst>(
P))
2067 SI->setAlignment(
Align(Bytes));
2069 RMWI->setAlignment(
Align(Bytes));
2071 CXI->setAlignment(
Align(Bytes));
2074 "only GlobalValue, AllocaInst, LoadInst, StoreInst, AtomicRMWInst, and "
2075 "and AtomicCmpXchgInst have alignment");
2079 size_t *NumEntries) {
2083 Instr->getAllMetadata(Entries);
2085 unwrap<GlobalObject>(
Value)->getAllMetadata(Entries);
2111 unwrap<GlobalObject>(
Global)->setMetadata(Kind, unwrap<MDNode>(MD));
2115 unwrap<GlobalObject>(
Global)->eraseMetadata(Kind);
2119 unwrap<GlobalObject>(
Global)->clearMetadata();
2134 nullptr, GlobalVariable::NotThreadLocal,
2175 unwrap<GlobalVariable>(GlobalVar)->eraseFromParent();
2186 unwrap<GlobalVariable>(GlobalVar)
2187 ->setInitializer(unwrap<Constant>(ConstantVal));
2191 return unwrap<GlobalVariable>(GlobalVar)->isThreadLocal();
2195 unwrap<GlobalVariable>(GlobalVar)->setThreadLocal(IsThreadLocal != 0);
2199 return unwrap<GlobalVariable>(GlobalVar)->isConstant();
2203 unwrap<GlobalVariable>(GlobalVar)->setConstant(IsConstant != 0);
2207 switch (unwrap<GlobalVariable>(GlobalVar)->getThreadLocalMode()) {
2208 case GlobalVariable::NotThreadLocal:
2210 case GlobalVariable::GeneralDynamicTLSModel:
2212 case GlobalVariable::LocalDynamicTLSModel:
2214 case GlobalVariable::InitialExecTLSModel:
2216 case GlobalVariable::LocalExecTLSModel:
2246 return unwrap<GlobalVariable>(GlobalVar)->isExternallyInitialized();
2250 unwrap<GlobalVariable>(GlobalVar)->setExternallyInitialized(IsExtInit);
2260 unwrap<Constant>(Aliasee),
unwrap(M)));
2264 const char *
Name,
size_t NameLen) {
2301 return wrap(unwrap<GlobalAlias>(Alias)->getAliasee());
2305 unwrap<GlobalAlias>(Alias)->setAliasee(unwrap<Constant>(Aliasee));
2337 Function *Func = unwrap<Function>(Fn);
2339 if (++
I == Func->getParent()->end())
2345 Function *Func = unwrap<Function>(Fn);
2347 if (
I == Func->getParent()->begin())
2353 unwrap<Function>(Fn)->eraseFromParent();
2357 return unwrap<Function>(Fn)->hasPersonalityFn();
2361 return wrap(unwrap<Function>(Fn)->getPersonalityFn());
2365 unwrap<Function>(Fn)->setPersonalityFn(unwrap<Constant>(PersonalityFn));
2370 return F->getIntrinsicID();
2375 assert(
ID < llvm::Intrinsic::num_intrinsics &&
"Intrinsic ID out of range");
2382 size_t ParamCount) {
2391 *NameLength = Str.size();
2405 size_t *NameLength) {
2409 *NameLength = Str.length();
2410 return strdup(Str.c_str());
2416 size_t *NameLength) {
2420 *NameLength = Str.length();
2421 return strdup(Str.c_str());
2434 return unwrap<Function>(Fn)->getCallingConv();
2438 return unwrap<Function>(Fn)->setCallingConv(
2444 return F->hasGC()?
F->getGC().c_str() :
nullptr;
2457 return wrap(
F->getPrefixData());
2462 return F->hasPrefixData();
2467 Constant *prefix = unwrap<Constant>(prefixData);
2468 F->setPrefixData(prefix);
2473 return wrap(
F->getPrologueData());
2478 return F->hasPrologueData();
2483 Constant *prologue = unwrap<Constant>(prologueData);
2484 F->setPrologueData(prologue);
2489 unwrap<Function>(
F)->addAttributeAtIndex(
Idx,
unwrap(
A));
2493 auto AS = unwrap<Function>(
F)->getAttributes().getAttributes(
Idx);
2494 return AS.getNumAttributes();
2499 auto AS = unwrap<Function>(
F)->getAttributes().getAttributes(
Idx);
2507 return wrap(unwrap<Function>(
F)->getAttributeAtIndex(
2513 const char *K,
unsigned KLen) {
2515 unwrap<Function>(
F)->getAttributeAtIndex(
Idx,
StringRef(K, KLen)));
2524 const char *K,
unsigned KLen) {
2525 unwrap<Function>(
F)->removeAttributeAtIndex(
Idx,
StringRef(K, KLen));
2530 Function *Func = unwrap<Function>(Fn);
2532 Func->addFnAttr(Attr);
2540 return unwrap<Function>(FnRef)->arg_size();
2544 Function *Fn = unwrap<Function>(FnRef);
2546 *ParamRefs++ =
wrap(&
A);
2550 Function *Fn = unwrap<Function>(FnRef);
2559 Function *Func = unwrap<Function>(Fn);
2561 if (
I == Func->arg_end())
2567 Function *Func = unwrap<Function>(Fn);
2569 if (
I == Func->arg_begin())
2577 if (
A->getArgNo() + 1 >= Fn->
arg_size())
2584 if (
A->getArgNo() == 0)
2586 return wrap(&
A->getParent()->arg_begin()[
A->getArgNo() - 1]);
2597 const char *
Name,
size_t NameLen,
2607 const char *
Name,
size_t NameLen) {
2644 return wrap(unwrap<GlobalIFunc>(IFunc)->getResolver());
2648 unwrap<GlobalIFunc>(IFunc)->setResolver(unwrap<Constant>(
Resolver));
2652 unwrap<GlobalIFunc>(IFunc)->eraseFromParent();
2656 unwrap<GlobalIFunc>(IFunc)->removeFromParent();
2679 return unwrap(Bundle)->inputs().size();
2694 return isa<BasicBlock>(
unwrap(Val));
2698 return wrap(unwrap<BasicBlock>(Val));
2702 return unwrap(BB)->getName().data();
2714 return unwrap<Function>(FnRef)->size();
2718 Function *Fn = unwrap<Function>(FnRef);
2720 *BasicBlocksRefs++ =
wrap(&BB);
2724 return wrap(&unwrap<Function>(Fn)->getEntryBlock());
2728 Function *Func = unwrap<Function>(Fn);
2730 if (
I == Func->end())
2736 Function *Func = unwrap<Function>(Fn);
2738 if (
I == Func->begin())
2746 if (++
I ==
Block->getParent()->end())
2754 if (
I ==
Block->getParent()->begin())
2768 assert(CurBB &&
"current insertion point is invalid!");
2774 unwrap<Function>(Fn)->insert(unwrap<Function>(Fn)->end(),
unwrap(BB));
2800 unwrap(BBRef)->eraseFromParent();
2804 unwrap(BBRef)->removeFromParent();
2840 if (++
I == Instr->getParent()->end())
2848 if (
I == Instr->getParent()->begin())
2854 unwrap<Instruction>(Inst)->removeFromParent();
2858 unwrap<Instruction>(Inst)->eraseFromParent();
2862 unwrap<Instruction>(Inst)->deleteValue();
2869 if (CE->getOpcode() == Instruction::ICmp)
2878 if (CE->getOpcode() == Instruction::FCmp)
2891 return wrap(
C->clone());
2897 return (
I &&
I->isTerminator()) ?
wrap(
I) :
nullptr;
2902 return FPI->arg_size();
2904 return unwrap<CallBase>(Instr)->arg_size();
2910 return unwrap<CallBase>(Instr)->getCallingConv();
2914 return unwrap<CallBase>(Instr)->setCallingConv(
2920 auto *Call = unwrap<CallBase>(Instr);
2923 Call->addAttributeAtIndex(
Idx, AlignAttr);
2928 unwrap<CallBase>(
C)->addAttributeAtIndex(
Idx,
unwrap(
A));
2933 auto *Call = unwrap<CallBase>(
C);
2934 auto AS = Call->getAttributes().getAttributes(
Idx);
2935 return AS.getNumAttributes();
2940 auto *Call = unwrap<CallBase>(
C);
2941 auto AS = Call->getAttributes().getAttributes(
Idx);
2949 return wrap(unwrap<CallBase>(
C)->getAttributeAtIndex(
2955 const char *K,
unsigned KLen) {
2957 unwrap<CallBase>(
C)->getAttributeAtIndex(
Idx,
StringRef(K, KLen)));
2966 const char *K,
unsigned KLen) {
2967 unwrap<CallBase>(
C)->removeAttributeAtIndex(
Idx,
StringRef(K, KLen));
2971 return wrap(unwrap<CallBase>(Instr)->getCalledOperand());
2975 return wrap(unwrap<CallBase>(Instr)->getFunctionType());
2979 return unwrap<CallBase>(
C)->getNumOperandBundles();
2991 return unwrap<CallInst>(Call)->isTailCall();
2995 unwrap<CallInst>(Call)->setTailCall(isTailCall);
3009 return wrap(unwrap<InvokeInst>(Invoke)->getNormalDest());
3014 return wrap(CRI->getUnwindDest());
3016 return wrap(CSI->getUnwindDest());
3018 return wrap(unwrap<InvokeInst>(Invoke)->getUnwindDest());
3022 unwrap<InvokeInst>(Invoke)->setNormalDest(
unwrap(
B));
3027 return CRI->setUnwindDest(
unwrap(
B));
3029 return CSI->setUnwindDest(
unwrap(
B));
3031 unwrap<InvokeInst>(Invoke)->setUnwindDest(
unwrap(
B));
3037 return unwrap<Instruction>(Term)->getNumSuccessors();
3041 return wrap(unwrap<Instruction>(Term)->getSuccessor(i));
3045 return unwrap<Instruction>(Term)->setSuccessor(i,
unwrap(
block));
3051 return unwrap<BranchInst>(Branch)->isConditional();
3055 return wrap(unwrap<BranchInst>(Branch)->getCondition());
3059 return unwrap<BranchInst>(Branch)->setCondition(
unwrap(
Cond));
3065 return wrap(unwrap<SwitchInst>(Switch)->getDefaultDest());
3071 return wrap(unwrap<AllocaInst>(Alloca)->getAllocatedType());
3077 return unwrap<GEPOperator>(
GEP)->isInBounds();
3081 return unwrap<GetElementPtrInst>(
GEP)->setIsInBounds(InBounds);
3085 return wrap(unwrap<GEPOperator>(
GEP)->getSourceElementType());
3092 PHINode *PhiVal = unwrap<PHINode>(PhiNode);
3093 for (
unsigned I = 0;
I != Count; ++
I)
3098 return unwrap<PHINode>(PhiNode)->getNumIncomingValues();
3102 return wrap(unwrap<PHINode>(PhiNode)->getIncomingValue(
Index));
3106 return wrap(unwrap<PHINode>(PhiNode)->getIncomingBlock(
Index));
3113 if (
auto *
GEP = dyn_cast<GEPOperator>(
I))
3114 return GEP->getNumIndices();
3115 if (
auto *EV = dyn_cast<ExtractValueInst>(
I))
3116 return EV->getNumIndices();
3117 if (
auto *
IV = dyn_cast<InsertValueInst>(
I))
3118 return IV->getNumIndices();
3120 "LLVMGetNumIndices applies only to extractvalue and insertvalue!");
3125 if (
auto *EV = dyn_cast<ExtractValueInst>(
I))
3126 return EV->getIndices().data();
3127 if (
auto *
IV = dyn_cast<InsertValueInst>(
I))
3128 return IV->getIndices().data();
3130 "LLVMGetIndices applies only to extractvalue and insertvalue!");
3147 auto I = Instr ? unwrap<Instruction>(Instr)->getIterator() : BB->
end();
3148 unwrap(Builder)->SetInsertPoint(BB,
I);
3153 unwrap(Builder)->SetInsertPoint(
I->getParent(),
I->getIterator());
3158 unwrap(Builder)->SetInsertPoint(BB);
3162 return wrap(
unwrap(Builder)->GetInsertBlock());
3166 unwrap(Builder)->ClearInsertionPoint();
3170 unwrap(Builder)->Insert(unwrap<Instruction>(Instr));
3175 unwrap(Builder)->Insert(unwrap<Instruction>(Instr),
Name);
3185 return wrap(
unwrap(Builder)->getCurrentDebugLocation().getAsMDNode());
3190 unwrap(Builder)->SetCurrentDebugLocation(
DebugLoc(unwrap<MDNode>(Loc)));
3197 L ? cast<MDNode>(unwrap<MetadataAsValue>(L)->getMetadata()) :
nullptr;
3204 Context,
unwrap(Builder)->getCurrentDebugLocation().getAsMDNode()));
3208 unwrap(Builder)->SetInstDebugLocation(unwrap<Instruction>(Inst));
3212 unwrap(Builder)->AddMetadataToInst(unwrap<Instruction>(Inst));
3218 unwrap(Builder)->setDefaultFPMathTag(FPMathTag
3219 ? unwrap<MDNode>(FPMathTag)
3224 return wrap(
unwrap(Builder)->getDefaultFPMathTag());
3257 unsigned NumDests) {
3275 for (
auto *Bundle :
ArrayRef(Bundles, NumBundles)) {
3291 unwrap(
B)->GetInsertBlock()->getParent()->setPersonalityFn(
3292 unwrap<Function>(PersFn));
3306 if (ParentPad ==
nullptr) {
3320 unsigned NumHandlers,
const char *
Name) {
3321 if (ParentPad ==
nullptr) {
3326 NumHandlers,
Name));
3331 return wrap(
unwrap(
B)->CreateCatchRet(unwrap<CatchPadInst>(CatchPad),
3337 return wrap(
unwrap(
B)->CreateCleanupRet(unwrap<CleanupPadInst>(CatchPad),
3347 unwrap<SwitchInst>(Switch)->addCase(unwrap<ConstantInt>(OnVal),
unwrap(Dest));
3351 unwrap<IndirectBrInst>(IndirectBr)->addDestination(
unwrap(Dest));
3355 return unwrap<LandingPadInst>(LandingPad)->getNumClauses();
3359 return wrap(unwrap<LandingPadInst>(LandingPad)->getClause(
Idx));
3363 unwrap<LandingPadInst>(LandingPad)->addClause(unwrap<Constant>(
ClauseVal));
3367 return unwrap<LandingPadInst>(LandingPad)->isCleanup();
3371 unwrap<LandingPadInst>(LandingPad)->setCleanup(Val);
3375 unwrap<CatchSwitchInst>(CatchSwitch)->addHandler(
unwrap(Dest));
3379 return unwrap<CatchSwitchInst>(CatchSwitch)->getNumHandlers();
3385 *Handlers++ =
wrap(
H);
3389 return wrap(unwrap<CatchPadInst>(CatchPad)->getCatchSwitch());
3393 unwrap<CatchPadInst>(CatchPad)
3394 ->setCatchSwitch(unwrap<CatchSwitchInst>(CatchSwitch));
3400 return wrap(unwrap<FuncletPadInst>(Funclet)->getArgOperand(i));
3404 unwrap<FuncletPadInst>(Funclet)->setArgOperand(i,
unwrap(
value));
3591 if (
auto *
I = dyn_cast<BinaryOperator>(Neg))
3592 I->setHasNoUnsignedWrap();
3605 Value *
P = unwrap<Value>(ArithInst);
3606 return cast<Instruction>(
P)->hasNoUnsignedWrap();
3610 Value *
P = unwrap<Value>(ArithInst);
3611 cast<Instruction>(
P)->setHasNoUnsignedWrap(HasNUW);
3615 Value *
P = unwrap<Value>(ArithInst);
3616 return cast<Instruction>(
P)->hasNoSignedWrap();
3620 Value *
P = unwrap<Value>(ArithInst);
3621 cast<Instruction>(
P)->setHasNoSignedWrap(HasNSW);
3625 Value *
P = unwrap<Value>(DivOrShrInst);
3626 return cast<Instruction>(
P)->isExact();
3630 Value *
P = unwrap<Value>(DivOrShrInst);
3631 cast<Instruction>(
P)->setIsExact(IsExact);
3635 Value *
P = unwrap<Value>(NonNegInst);
3636 return cast<Instruction>(
P)->hasNonNeg();
3640 Value *
P = unwrap<Value>(NonNegInst);
3641 cast<Instruction>(
P)->setNonNeg(IsNonNeg);
3645 Value *
P = unwrap<Value>(FPMathInst);
3651 Value *
P = unwrap<Value>(FPMathInst);
3656 Value *Val = unwrap<Value>(V);
3657 return isa<FPMathOperator>(Val);
3661 Value *
P = unwrap<Value>(Inst);
3662 return cast<PossiblyDisjointInst>(
P)->isDisjoint();
3666 Value *
P = unwrap<Value>(Inst);
3667 cast<PossiblyDisjointInst>(
P)->setIsDisjoint(IsDisjoint);
3747 return AtomicOrdering::AcquireRelease;
3749 return AtomicOrdering::SequentiallyConsistent;
3762 case AtomicOrdering::AcquireRelease:
3764 case AtomicOrdering::SequentiallyConsistent:
3837 unsigned NumIndices,
const char *
Name) {
3844 unsigned NumIndices,
const char *
Name) {
3869 if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
3870 return LI->isVolatile();
3872 return SI->isVolatile();
3874 return AI->isVolatile();
3875 return cast<AtomicCmpXchgInst>(
P)->isVolatile();
3880 if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
3881 return LI->setVolatile(isVolatile);
3883 return SI->setVolatile(isVolatile);
3885 return AI->setVolatile(isVolatile);
3886 return cast<AtomicCmpXchgInst>(
P)->setVolatile(isVolatile);
3890 return unwrap<AtomicCmpXchgInst>(CmpXchgInst)->isWeak();
3894 return unwrap<AtomicCmpXchgInst>(CmpXchgInst)->setWeak(isWeak);
3900 if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
3901 O = LI->getOrdering();
3902 else if (
StoreInst *SI = dyn_cast<StoreInst>(
P))
3903 O = SI->getOrdering();
3904 else if (
FenceInst *FI = dyn_cast<FenceInst>(
P))
3905 O = FI->getOrdering();
3907 O = cast<AtomicRMWInst>(
P)->getOrdering();
3915 if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
3916 return LI->setOrdering(O);
3917 else if (
FenceInst *FI = dyn_cast<FenceInst>(
P))
3918 return FI->setOrdering(O);
3920 return ARWI->setOrdering(O);
3921 return cast<StoreInst>(
P)->setOrdering(O);
4049 unwrap(Src), SrcIsSigned,
unwrap(DestTy), DestIsSigned));
4086 unsigned NumBundles,
const char *
Name) {
4089 for (
auto *Bundle :
ArrayRef(Bundles, NumBundles)) {
4190 return I->getShuffleMask().size();
4196 return I->getMaskValue(Elt);
4206 else if (
FenceInst *FI = dyn_cast<FenceInst>(
P))
4208 else if (
StoreInst *SI = dyn_cast<StoreInst>(
P))
4210 else if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
4212 return cast<AtomicCmpXchgInst>(
P)->getSyncScopeID() ==
4221 return I->setSyncScopeID(SSID);
4222 else if (
FenceInst *FI = dyn_cast<FenceInst>(
P))
4223 return FI->setSyncScopeID(SSID);
4224 else if (
StoreInst *SI = dyn_cast<StoreInst>(
P))
4225 return SI->setSyncScopeID(SSID);
4226 else if (
LoadInst *LI = dyn_cast<LoadInst>(
P))
4227 return LI->setSyncScopeID(SSID);
4228 return cast<AtomicCmpXchgInst>(
P)->setSyncScopeID(SSID);
4241 return cast<AtomicCmpXchgInst>(
P)->setSuccessOrdering(O);
4254 return cast<AtomicCmpXchgInst>(
P)->setFailureOrdering(O);
4274 char **OutMessage) {
4277 if (std::error_code EC = MBOrErr.
getError()) {
4278 *OutMessage = strdup(EC.message().c_str());
4281 *OutMemBuf =
wrap(MBOrErr.
get().release());
4286 char **OutMessage) {
4288 if (std::error_code EC = MBOrErr.
getError()) {
4289 *OutMessage = strdup(EC.message().c_str());
4292 *OutMemBuf =
wrap(MBOrErr.
get().release());
4297 const char *InputData,
4298 size_t InputDataLength,
4299 const char *BufferName,
4304 RequiresNullTerminator).
release());
4308 const char *InputData,
4309 size_t InputDataLength,
4310 const char *BufferName) {
4318 return unwrap(MemBuf)->getBufferStart();
4322 return unwrap(MemBuf)->getBufferSize();
4345 return unwrap<legacy::PassManager>(PM)->run(*
unwrap(M));
4349 return unwrap<legacy::FunctionPassManager>(FPM)->doInitialization();
4353 return unwrap<legacy::FunctionPassManager>(FPM)->run(*unwrap<Function>(
F));
4357 return unwrap<legacy::FunctionPassManager>(FPM)->doFinalization();
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 Function * getFunction(Constant *C)
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 MDNode * extractMDNode(MetadataAsValue *MAV)
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()
Module.h This file contains the declarations for the Module class.
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)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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 const uint32_t IV[8]
opStatus convert(const fltSemantics &ToSemantics, roundingMode RM, bool *losesInfo)
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.
@ Min
*p = old <signed v ? old : v
@ 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.
bool isStringAttribute() const
Return true if the attribute is a string (target-dependent) attribute.
static Attribute::AttrKind getAttrKindFromName(StringRef AttrName)
StringRef getKindAsString() const
Return the attribute's kind as a string.
static Attribute get(LLVMContext &Context, AttrKind Kind, uint64_t Val=0)
Return a uniquified Attribute object.
Attribute::AttrKind getKindAsEnum() const
Return the attribute's kind as an enum (Attribute::AttrKind).
StringRef getValueAsString() const
Return the attribute's value as a string.
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results,...
bool isTypeAttribute() const
Return true if the attribute is a type attribute.
static Attribute getWithAlignment(LLVMContext &Context, Align Alignment)
Return a uniquified Attribute object that has the specific alignment set.
LLVM Basic Block Representation.
static BasicBlock * Create(LLVMContext &Context, const Twine &Name="", Function *Parent=nullptr, BasicBlock *InsertBefore=nullptr)
Creates a new BasicBlock.
const Function * getParent() const
Return the enclosing method, or null if none.
InstListType::iterator iterator
Instruction iterators...
static BlockAddress * get(Function *F, BasicBlock *BB)
Return a BlockAddress for the specified function and basic block.
static 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 Constant * get(ArrayType *T, ArrayRef< Constant * > V)
static Constant * getString(LLVMContext &Context, StringRef Initializer, bool AddNull=true)
This method constructs a CDS and initializes it with a text string.
A constant value that is initialized with an expression using other constant values.
static Constant * getFCmp(unsigned short pred, Constant *LHS, Constant *RHS, bool OnlyIfReduced=false)
static Constant * getIntToPtr(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static Constant * getExtractElement(Constant *Vec, Constant *Idx, Type *OnlyIfReducedTy=nullptr)
static 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 Constant * getPointerCast(Constant *C, Type *Ty)
Create a BitCast, AddrSpaceCast, or a PtrToInt cast constant expression.
static Constant * getTruncOrBitCast(Constant *C, Type *Ty)
static Constant * getNSWAdd(Constant *C1, Constant *C2)
static Constant * getSub(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
static Constant * getNot(Constant *C)
static Constant * getInsertElement(Constant *Vec, Constant *Elt, Constant *Idx, Type *OnlyIfReducedTy=nullptr)
static Constant * getPtrToInt(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static Constant * getICmp(unsigned short pred, Constant *LHS, Constant *RHS, bool OnlyIfReduced=false)
get* - Return some common constants without having to specify the full Instruction::OPCODE identifier...
static Constant * getGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant * > IdxList, bool InBounds=false, std::optional< ConstantRange > InRange=std::nullopt, Type *OnlyIfReducedTy=nullptr)
Getelementptr form.
static Constant * getShuffleVector(Constant *V1, Constant *V2, ArrayRef< int > Mask, Type *OnlyIfReducedTy=nullptr)
static Constant * getSizeOf(Type *Ty)
getSizeOf constant expr - computes the (alloc) size of a type (in address-units, not bits) in a targe...
static Constant * getXor(Constant *C1, Constant *C2)
static Constant * getMul(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
static Constant * getNSWNeg(Constant *C)
static Constant * getNSWSub(Constant *C1, Constant *C2)
static Constant * getShl(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
static Constant * getNUWAdd(Constant *C1, Constant *C2)
static Constant * getAddrSpaceCast(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static Constant * getAdd(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
static Constant * getBitCast(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static Constant * getNSWMul(Constant *C1, Constant *C2)
static Constant * getNeg(Constant *C, bool HasNSW=false)
static Constant * getTrunc(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static Constant * getNUWMul(Constant *C1, Constant *C2)
ConstantFP - Floating Point Values [float, double].
const APFloat & getValueAPF() const
static ConstantPointerNull * get(PointerType *T)
Static factory methods - Return objects of the specified value.
This class represents a range of values.
static 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 Constant * get(ArrayRef< Constant * > V)
This is an important base class in LLVM.
static Constant * getAllOnesValue(Type *Ty)
static Constant * getNullValue(Type *Ty)
Constructor to create a '0' constant of arbitrary type.
This class represents an Operation in the Expression.
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 FixedVectorType * get(Type *ElementType, unsigned NumElts)
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
BasicBlockListType::iterator iterator
static Intrinsic::ID lookupIntrinsicID(StringRef Name)
This does the actual lookup of an intrinsic ID which matches the given function name.
iterator_range< arg_iterator > args()
Function::iterator insert(Function::iterator Position, BasicBlock *BB)
Insert BB in the basic block list at Position.
static 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 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.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
static 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 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 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()
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 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 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 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 StructType * getTypeByName(LLVMContext &C, StringRef Name)
Return the type with the specified name, or null if there is none by that name.
static StructType * create(LLVMContext &Context, StringRef Name)
This creates an identified struct.
Type * getTypeAtIndex(const Value *V) const
Given an index value into the type, return the type of the element.
static TargetExtType * get(LLVMContext &Context, StringRef Name, ArrayRef< Type * > Types=std::nullopt, ArrayRef< unsigned > Ints=std::nullopt)
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 Type * getHalfTy(LLVMContext &C)
static Type * getDoubleTy(LLVMContext &C)
static Type * getX86_FP80Ty(LLVMContext &C)
static Type * getBFloatTy(LLVMContext &C)
static IntegerType * getInt1Ty(LLVMContext &C)
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
static Type * getX86_AMXTy(LLVMContext &C)
bool isBFloatTy() const
Return true if this is 'bfloat', a 16-bit bfloat type.
static Type * getMetadataTy(LLVMContext &C)
@ X86_MMXTyID
MMX vectors (64 bits, X86 specific)
@ 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 Type * getX86_MMXTy(LLVMContext &C)
static Type * getVoidTy(LLVMContext &C)
static Type * getLabelTy(LLVMContext &C)
static Type * getFP128Ty(LLVMContext &C)
static IntegerType * getInt16Ty(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.
static IntegerType * getInt8Ty(LLVMContext &C)
static IntegerType * getInt128Ty(LLVMContext &C)
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
static Type * getTokenTy(LLVMContext &C)
static IntegerType * getInt32Ty(LLVMContext &C)
static IntegerType * getInt64Ty(LLVMContext &C)
static Type * getFloatTy(LLVMContext &C)
static Type * getPPC_FP128Ty(LLVMContext &C)
static 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.
use_iterator_impl< Use > use_iterator
LLVMContext & getContext() const
All values hold a context through their type.
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.
LLVMContextRef LLVMGetGlobalContext()
Obtain the global context instance.
unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A)
Get the unique id corresponding to the enum attribute passed as argument.
void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard)
Set whether the given context discards all value names.
uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A)
Get the enum attribute's value.
LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A)
Get the type attribute's value.
unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name, unsigned SLen)
LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI)
Return an enum LLVMDiagnosticSeverity.
char * LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI)
Return a string representation of the DiagnosticInfo.
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.
LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C)
Retrieve whether the given context is set to discard all value names.
LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID, LLVMTypeRef type_ref)
Create a type attribute.
LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C, const char *K, unsigned KLength, const char *V, unsigned VLength)
Create a string attribute.
LLVMAttributeRef LLVMCreateConstantRangeAttribute(LLVMContextRef C, unsigned KindID, unsigned NumBits, const uint64_t LowerWords[], const uint64_t UpperWords[])
Create a ConstantRange attribute.
void LLVMContextDispose(LLVMContextRef C)
Destroy a context instance.
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.
LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name)
Obtain a Type from a context by its registered name.
LLVMContextRef LLVMContextCreate()
Create a new context.
void(* LLVMYieldCallback)(LLVMContextRef, void *)
unsigned LLVMGetLastEnumAttributeKind(void)
LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A)
LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A)
const char * LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length)
Get the string attribute's value.
void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback, void *OpaqueHandle)
Set the yield callback function for this context.
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen)
void LLVMContextSetDiagnosticHandler(LLVMContextRef C, LLVMDiagnosticHandler Handler, void *DiagnosticContext)
Set the diagnostic handler for this context.
void(* LLVMDiagnosticHandler)(LLVMDiagnosticInfoRef, void *)
void * LLVMContextGetDiagnosticContext(LLVMContextRef C)
Get the diagnostic context of this context.
LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A)
Check for the different types of attributes.
LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PointerVal, const char *Name)
LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str, const char *Name)
LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering Ordering, LLVMBool isSingleThread, const char *Name)
LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)
LLVMBool LLVMGetIsDisjoint(LLVMValueRef Inst)
Gets whether the instruction has the disjoint flag set.
LLVMValueRef LLVMBuildNot(LLVMBuilderRef B, LLVMValueRef V, 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 LLVMBuildNSWSub(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildAnd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
void LLVMClearInsertionPosition(LLVMBuilderRef Builder)
LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool isWeak)
void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW)
LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef B, LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildFMul(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildZExt(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildSExt(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder, LLVMMetadataRef FPMathTag)
Set the default floating-point math metadata for the given builder.
LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef B, LLVMValueRef AggVal, unsigned Index, const char *Name)
LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef B, LLVMRealPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst)
LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned, LLVMTypeRef DestTy, LLVMBool DestIsSigned)
LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef Inst)
void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW)
LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildShl(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc)
Set location information used by debugging information.
int LLVMGetUndefMaskElem(void)
LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst)
LLVMValueRef LLVMBuildFRem(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef B, LLVMTypeRef Ty, const char *Name)
LLVMValueRef LLVMBuildSelect(LLVMBuilderRef B, LLVMValueRef If, LLVMValueRef Then, LLVMValueRef Else, const char *Name)
LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
void LLVMSetIsDisjoint(LLVMValueRef Inst, LLVMBool IsDisjoint)
Sets the disjoint flag for the instruction.
LLVMValueRef LLVMBuildMul(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef B, LLVMTypeRef Ty, const char *Name)
LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef B, LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name)
LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef B, LLVMValueRef *RetVals, unsigned N)
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)
LLVMValueRef LLVMBuildCallWithOperandBundles(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, LLVMOperandBundleRef *Bundles, unsigned NumBundles, const char *Name)
LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetOrdering(LLVMValueRef MemAccessInst, LLVMAtomicOrdering Ordering)
void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val)
LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i)
LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef B, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned Index, const char *Name)
LLVMValueRef LLVMBuildAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, 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.
LLVMValueRef LLVMBuildBr(LLVMBuilderRef B, LLVMBasicBlockRef Dest)
LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildSRem(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMDisposeBuilder(LLVMBuilderRef Builder)
int LLVMGetMaskValue(LLVMValueRef SVInst, unsigned Elt)
Get the mask value at position Elt in the mask of a ShuffleVector instruction.
LLVMValueRef LLVMBuildFSub(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx)
LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder)
Get location information used by debugging information.
LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef B, LLVMValueRef List, LLVMTypeRef Ty, const char *Name)
LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C)
LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Cmp, LLVMValueRef New, LLVMAtomicOrdering SuccessOrdering, LLVMAtomicOrdering FailureOrdering, LLVMBool singleThread)
LLVMValueRef LLVMBuildICmp(LLVMBuilderRef B, LLVMIntPredicate Op, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad)
Get the parent catchswitch instruction of a catchpad instruction.
void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool NewValue)
LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildURem(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetAtomicRMWBinOp(LLVMValueRef Inst, LLVMAtomicRMWBinOp BinOp)
LLVMValueRef LLVMBuildCall2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Fn, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal)
LLVMValueRef LLVMBuildOr(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMBool LLVMGetNUW(LLVMValueRef ArithInst)
LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L)
Deprecated: Passing the NULL location will crash.
LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, LLVMBool IsSigned, const char *Name)
LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder)
Get the dafult floating-point math metadata for a given builder.
LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch)
Set the parent catchswitch instruction of a catchpad instruction.
LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, unsigned Idx, const char *Name)
unsigned LLVMGetNumClauses(LLVMValueRef LandingPad)
LLVMBool LLVMGetNNeg(LLVMValueRef NonNegInst)
Gets if the instruction has the non-negative flag set.
LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildStore(LLVMBuilderRef B, LLVMValueRef Val, LLVMValueRef PointerVal)
LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMBasicBlockRef UnwindBB, unsigned NumHandlers, const char *Name)
LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
Deprecated: This cast is always signed.
LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Val, const char *Name)
LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers)
Obtain the basic blocks acting as handlers for a catchswitch instruction.
LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemAccessInst)
LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef B, LLVMValueRef If, LLVMBasicBlockRef Then, LLVMBasicBlockRef Else)
LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, unsigned NumDests)
void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest)
LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
LLVMValueRef LLVMBuildXor(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str, const char *Name)
LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst)
LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef B, LLVMValueRef Val, const char *Name)
void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value)
LLVMValueRef LLVMBuildMemCpy(LLVMBuilderRef B, LLVMValueRef Dst, unsigned DstAlign, LLVMValueRef Src, unsigned SrcAlign, LLVMValueRef Size)
Creates and inserts a memcpy between the specified pointers.
LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef B, LLVMTypeRef ElemTy, LLVMValueRef LHS, LLVMValueRef RHS, 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 LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst)
Adds the metadata registered with the given builder to the given instruction.
LLVMValueRef LLVMBuildSub(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef B)
LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef B, LLVMValueRef V1, LLVMValueRef V2, LLVMValueRef Mask, const char *Name)
void LLVMSetVolatile(LLVMValueRef MemAccessInst, LLVMBool isVolatile)
LLVMValueRef LLVMBuildFree(LLVMBuilderRef B, LLVMValueRef PointerVal)
LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, LLVMValueRef *Indices, unsigned NumIndices, const char *Name)
unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch)
LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMBuilderRef LLVMCreateBuilder(void)
void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst, LLVMAtomicOrdering Ordering)
LLVMValueRef LLVMBuildPhi(LLVMBuilderRef B, LLVMTypeRef Ty, const char *Name)
LLVMBool LLVMCanValueUseFastMathFlags(LLVMValueRef V)
Check if a given value can potentially have fast math flags.
void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal, LLVMBasicBlockRef Dest)
LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst)
LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn)
LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef B, LLVMValueRef V, LLVMBasicBlockRef Else, unsigned NumCases)
void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr)
LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name)
LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad)
LLVMBool LLVMGetNSW(LLVMValueRef ArithInst)
LLVMValueRef LLVMBuildMemMove(LLVMBuilderRef B, LLVMValueRef Dst, unsigned DstAlign, LLVMValueRef Src, unsigned SrcAlign, LLVMValueRef Size)
Creates and inserts a memmove between the specified pointers.
LLVMValueRef LLVMBuildLShr(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
unsigned LLVMGetNumMaskElements(LLVMValueRef SVInst)
Get the number of elements in the mask of a ShuffleVector instruction.
LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef B)
LLVMValueRef LLVMBuildRet(LLVMBuilderRef B, LLVMValueRef V)
void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest)
LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef B, LLVMValueRef VecVal, LLVMValueRef Index, const char *Name)
void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr)
LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder)
Deprecated: Returning the NULL location will crash.
LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)
void LLVMSetNNeg(LLVMValueRef NonNegInst, LLVMBool IsNonNeg)
Sets the non-negative flag for the instruction.
void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact)
LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder)
LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad, LLVMValueRef *Args, unsigned NumArgs, const char *Name)
void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name)
void LLVMSetFastMathFlags(LLVMValueRef FPMathInst, LLVMFastMathFlags FMF)
Sets the flags for which fast-math-style optimizations are allowed for this value.
LLVMFastMathFlags LLVMGetFastMathFlags(LLVMValueRef FPMathInst)
Get the flags for which fast-math-style optimizations are allowed for this value.
LLVMValueRef LLVMBuildNeg(LLVMBuilderRef B, LLVMValueRef V, const char *Name)
LLVMBool LLVMGetVolatile(LLVMValueRef MemAccessInst)
LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)
void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, LLVMValueRef Instr)
void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block)
LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef B, LLVMValueRef VecVal, LLVMValueRef EltVal, LLVMValueRef Index, const char *Name)
LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad, LLVMBasicBlockRef BB)
void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf)
size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf)
LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, size_t InputDataLength, const char *BufferName, LLVMBool RequiresNullTerminator)
LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path, LLVMMemoryBufferRef *OutMemBuf, char **OutMessage)
const char * LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf)
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, size_t InputDataLength, const char *BufferName)
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.
const char * LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len)
Obtain the identifier of a module.
void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr)
Set the data layout for a module.
LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, LLVMTypeRef FunctionTy)
Add a function to a module under a specified name.
LLVMBool LLVMIsNewDbgInfoFormat(LLVMModuleRef M)
Soon to be deprecated.
LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NMD)
Decrement a NamedMDNode iterator to the previous NamedMDNode.
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name)
Deprecated: Use LLVMGetTypeByName2 instead.
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.
void LLVMDumpModule(LLVMModuleRef M)
Dump a representation of a module to stderr.
void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len)
Append inline assembly to a module.
LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M)
Obtain an iterator to the first Function in a Module.
const char * LLVMGetDebugLocFilename(LLVMValueRef Val, unsigned *Length)
Return the filename of the debug location for this value, which must be an llvm::Instruction,...
LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage)
Print a representation of a module to a file.
void LLVMDisposeModule(LLVMModuleRef M)
Destroy a module instance.
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 * LLVMGetDebugLocDirectory(LLVMValueRef Val, unsigned *Length)
Return the directory of the debug location for this value, which must be an llvm::Instruction,...
const char * LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len)
Get inline assembly for a module.
const char * LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len)
Obtain the module's original source file name.
const char * LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NMD, size_t *NameLen)
Retrieve the name of a NamedMDNode.
LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M)
Obtain the context to which this module is associated.
const char * LLVMGetInlineAsmConstraintString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the raw constraint string for an inline assembly snippet.
LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID, LLVMContextRef C)
Create a new, empty module in a specific context.
LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the metadata for a module flag entry at a specific index.
const char * LLVMModuleFlagEntriesGetKey(LLVMModuleFlagEntry *Entries, unsigned Index, size_t *Len)
Returns the key for a module flag entry at a specific index.
LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M)
Obtain an iterator to the last Function in a Module.
void LLVMSetTarget(LLVMModuleRef M, const char *Triple)
Set the target triple for a module.
const char * LLVMGetDataLayoutStr(LLVMModuleRef M)
Obtain the data layout for a module.
const char * LLVMGetInlineAsmAsmString(LLVMValueRef InlineAsmVal, size_t *Len)
Get the template string used for an inline assembly snippet.
LLVMModuleFlagBehavior LLVMModuleFlagEntriesGetFlagBehavior(LLVMModuleFlagEntry *Entries, unsigned Index)
Returns the flag behavior for a module flag entry at a specific index.
unsigned LLVMGetDebugLocColumn(LLVMValueRef Val)
Return the column number of the debug location for this value, which must be an llvm::Instruction.
unsigned LLVMGetDebugLocLine(LLVMValueRef Val)
Return the line number of the debug location for this value, which must be an llvm::Instruction,...
LLVMBool LLVMGetInlineAsmNeedsAlignedStack(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet needs an aligned stack.
LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID)
Create a new, empty module in the global context.
LLVMModuleFlagEntry * LLVMCopyModuleFlagsMetadata(LLVMModuleRef M, size_t *Len)
Returns the module flags as an array of flag-key-value triples.
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.
void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm)
Deprecated: Use LLVMSetModuleInlineAsm2 instead.
LLVMBool LLVMGetInlineAsmHasSideEffects(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet has side effects.
void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries)
Destroys module flags metadata entries.
LLVMInlineAsmDialect LLVMGetInlineAsmDialect(LLVMValueRef InlineAsmVal)
Get the dialect used by the inline asm snippet.
unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name)
Obtain the number of operands for named metadata in a module.
const char * LLVMGetTarget(LLVMModuleRef M)
Obtain the target triple for a module.
LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NMD)
Advance a NamedMDNode iterator to the next NamedMDNode.
void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len)
Set inline assembly for a module.
LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the last NamedMDNode in a Module.
LLVMBool LLVMGetInlineAsmCanUnwind(LLVMValueRef InlineAsmVal)
Get if the inline asm snippet may unwind the stack.
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.
const char * LLVMGetDataLayout(LLVMModuleRef M)
LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name)
Obtain a Function value from a Module by its name.
void LLVMSetIsNewDbgInfoFormat(LLVMModuleRef M, LLVMBool UseNewFormat)
Soon to be deprecated.
LLVMNamedMDNodeRef LLVMGetNamedMetadata(LLVMModuleRef M, const char *Name, size_t NameLen)
Retrieve a NamedMDNode with the given name, returning NULL if no such node exists.
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 LLVMGetPreviousFunction(LLVMValueRef Fn)
Decrement a Function iterator to the previous Function.
char * LLVMPrintModuleToString(LLVMModuleRef M)
Return a string representation of the module.
void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name, LLVMValueRef *Dest)
Obtain the named metadata operands for a module.
LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn)
Advance a Function iterator to the next Function.
LLVMTypeRef LLVMGetInlineAsmFunctionType(LLVMValueRef InlineAsmVal)
Get the function type of the inline assembly snippet.
void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len)
Set the identifier of a module to a string Ident with length Len.
void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name, LLVMValueRef Val)
Add an operand to named metadata.
LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M)
Obtain an iterator to the first NamedMDNode in a Module.
LLVMValueRef LLVMGetOperandBundleArgAtIndex(LLVMOperandBundleRef Bundle, unsigned Index)
Obtain the operand for an operand bundle at the given index.
unsigned LLVMGetNumOperandBundleArgs(LLVMOperandBundleRef Bundle)
Obtain the number of operands for an operand bundle.
LLVMOperandBundleRef LLVMCreateOperandBundle(const char *Tag, size_t TagLen, LLVMValueRef *Args, unsigned NumArgs)
Create a new operand bundle.
void LLVMDisposeOperandBundle(LLVMOperandBundleRef Bundle)
Destroy an operand bundle.
const char * LLVMGetOperandBundleTag(LLVMOperandBundleRef Bundle, size_t *Len)
Obtain the tag of an operand bundle as a string.
LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M)
Initializes, executes on the provided module, and finalizes all of the passes scheduled in the pass m...
LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef P)
Deprecated: Use LLVMCreateFunctionPassManagerForModule instead.
LLVMPassManagerRef LLVMCreatePassManager()
Constructs a new whole-module pass pipeline.
void LLVMDisposePassManager(LLVMPassManagerRef PM)
Frees the memory of a pass pipeline.
LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM)
Finalizes all of the function passes scheduled in the function pass manager.
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.
LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M)
Constructs a new function-by-function pass pipeline over the module provider.
LLVMBool LLVMIsMultithreaded()
Check whether LLVM is executing in thread-safe mode or not.
LLVMBool LLVMStartMultithreaded()
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
void LLVMStopMultithreaded()
Deprecated: Multi-threading can only be enabled/disabled with the compile time define LLVM_ENABLE_THR...
LLVMTypeRef LLVMFP128Type(void)
LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (112-bit mantissa) from a context.
LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C)
Obtain a 64-bit floating point type from a context.
LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C)
Obtain a 80-bit floating point type (X87) from a context.
LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C)
Obtain a 16-bit floating point type from a context.
LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C)
Obtain a 16-bit brain floating point type from a context.
LLVMTypeRef LLVMBFloatType(void)
LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C)
Obtain a 32-bit floating point type from a context.
LLVMTypeRef LLVMHalfType(void)
Obtain a floating point type from the global context.
LLVMTypeRef LLVMX86FP80Type(void)
LLVMTypeRef LLVMPPCFP128Type(void)
LLVMTypeRef LLVMFloatType(void)
LLVMTypeRef LLVMDoubleType(void)
LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C)
Obtain a 128-bit floating point type (two 64-bits) from a context.
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 LLVMFunctionType(LLVMTypeRef ReturnType, LLVMTypeRef *ParamTypes, unsigned ParamCount, LLVMBool IsVarArg)
Obtain a function type consisting of a specified signature.
LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy)
Obtain the Type this function Type returns.
LLVMTypeRef LLVMInt64Type(void)
LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits)
LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C)
Obtain an integer type from a context with specified bit width.
LLVMTypeRef LLVMInt32Type(void)
LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMIntType(unsigned NumBits)
LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C)
LLVMTypeRef LLVMInt8Type(void)
LLVMTypeRef LLVMInt1Type(void)
Obtain an integer type from the global context with a specified bit width.
LLVMTypeRef LLVMInt128Type(void)
unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy)
LLVMTypeRef LLVMInt16Type(void)
LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C)
Create a X86 MMX type in a context.
LLVMTypeRef LLVMVoidType(void)
These are similar to the above functions except they operate on the global context.
LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C)
Create a X86 AMX type in a context.
LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C)
Create a metadata type in a context.
LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C)
Create a token type in a context.
LLVMTypeRef LLVMX86AMXType(void)
LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C)
Create a label type in a context.
LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, const char *Name, LLVMTypeRef *TypeParams, unsigned TypeParamCount, unsigned *IntParams, unsigned IntParamCount)
Create a target extension type in LLVM context.
LLVMTypeRef LLVMX86MMXType(void)
LLVMTypeRef LLVMLabelType(void)
LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C)
Create a void type in a context.
unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
LLVMTypeRef LLVMGetElementType(LLVMTypeRef WrappedTy)
Obtain the element type of an array or vector type.
unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy)
Obtain the address space of a pointer type.
uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy)
Obtain the length of an array type.
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 LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a vector type that contains a defined type and has a specific number of elements.
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 LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a fixed size array type that refers to a specific type.
LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType, unsigned ElementCount)
Create a vector type that contains a defined type and has a scalable number of elements.
LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount)
Create a fixed size array type that refers to a specific type.
void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr)
Returns type's subtypes.
unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy)
Obtain the (possibly scalable) number of elements in a vector type.
void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Set the contents of a structure type.
LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy)
Determine whether a structure is packed.
LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i)
Get the type of the element at a given index in the structure.
LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in the global context.
const char * LLVMGetStructName(LLVMTypeRef Ty)
Obtain the name of a structure.
void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest)
Get the elements within a structure.
LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy)
Determine whether a structure is opaque.
unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy)
Get the number of elements defined inside the structure.
LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name)
Create an empty structure in a context having a specified name.
LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy)
Determine whether a structure is literal.
LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed)
Create a new structure type in a context.
LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty)
Whether the type has a known size.
LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty)
Obtain the enumerated type of a Type instance.
char * LLVMPrintTypeToString(LLVMTypeRef Ty)
Return a string representation of the type.
void LLVMDumpType(LLVMTypeRef Ty)
Dump a representation of a type to stderr.
LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty)
Obtain the context to which this type instance is associated.
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.
@ 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.
@ LLVMX86_MMXTypeKind
X86 MMX.
@ 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.
@ 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.
@ 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.
@ 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
LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB)
Advance a basic block iterator.
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 LLVMGetFirstBasicBlock(LLVMValueRef Fn)
Obtain the first basic block in a function.
LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val)
Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C, const char *Name)
Create a new basic block without inserting it into a function.
void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BBRef)
Remove a basic block from a function.
void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to before another one.
LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB)
Convert a basic block instance to a value type.
void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder, LLVMBasicBlockRef BB)
Insert the given basic block after the insertion point of the given builder.
void LLVMGetBasicBlocks(LLVMValueRef FnRef, LLVMBasicBlockRef *BasicBlocksRefs)
Obtain all of the 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.
LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB)
Obtain the terminator instruction for a basic block.
unsigned LLVMCountBasicBlocks(LLVMValueRef FnRef)
Obtain the number of basic blocks in a function.
void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
Move a basic block to after another one.
LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn)
Obtain the last basic block in a function.
LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C, LLVMValueRef FnRef, const char *Name)
Append a basic block to the end of a function.
LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB)
Obtain the function to which a basic block belongs.
LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB)
Obtain the first instruction in a basic block.
LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB)
Obtain the last instruction in a basic block.
LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C, LLVMBasicBlockRef BBRef, const char *Name)
Insert a basic block in a function before another basic block.
LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef BBRef, const char *Name)
Insert a basic block in a function using the global context.
LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn)
Obtain the basic block that corresponds to the entry point of a function.
LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val)
Determine whether an LLVMValueRef is itself a basic block.
const char * LLVMGetBasicBlockName(LLVMBasicBlockRef BB)
Obtain the string name of a basic block.
LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB)
Go backwards in a basic block iterator.
LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create a ConstantStruct in the global Context.
LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, unsigned Length)
Create a ConstantArray from values.
LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals, uint64_t Length)
Create a ConstantArray from values.
LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size)
Create a ConstantVector from values.
LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, LLVMValueRef *ConstantVals, unsigned Count)
Create a non-anonymous ConstantStruct from values.
LLVMBool LLVMIsConstantString(LLVMValueRef C)
Returns true if the specified constant is an array of i8.
LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx)
Get element of a constant aggregate (struct, array or vector) at the specified index.
LLVMValueRef LLVMConstString(const char *Str, unsigned Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential with string content in the global context.
const char * LLVMGetAsString(LLVMValueRef C, size_t *Length)
Get the given constant data sequential as a string.
LLVMValueRef LLVMConstStringInContext2(LLVMContextRef C, const char *Str, size_t Length, LLVMBool DontNullTerminate)
Create a ConstantDataSequential and initialize it with a string.
LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed)
Create an anonymous ConstantStruct with the specified values.
LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty)
LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal)
LLVMValueRef LLVMGetBlockAddressFunction(LLVMValueRef BlockAddr)
Gets the function associated with a given BlockAddress constant value.
LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant, LLVMValueRef IndexConstant)
LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant, LLVMValueRef ElementValueConstant, LLVMValueRef IndexConstant)
LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMBasicBlockRef LLVMGetBlockAddressBasicBlock(LLVMValueRef BlockAddr)
Gets the basic block associated with a given BlockAddress constant value.
LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty)
LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString, const char *Constraints, LLVMBool HasSideEffects, LLVMBool IsAlignStack)
Deprecated: Use LLVMGetInlineAsm instead.
LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType)
LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal)
LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate, LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal, LLVMValueRef *ConstantIndices, unsigned NumIndices)
LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, LLVMValueRef VectorBConstant, LLVMValueRef MaskConstant)
LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal)
LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB)
LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal)
LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant)
void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind, LLVMMetadataRef MD)
Sets a metadata attachment, erasing the existing metadata attachment if it already exists for the giv...
unsigned LLVMValueMetadataEntriesGetKind(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the kind of a value metadata entry at a specific index.
void LLVMDisposeValueMetadataEntries(LLVMValueMetadataEntry *Entries)
Destroys value metadata entries.
void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz)
LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global)
void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes)
Set the preferred alignment of the value.
LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global)
const char * LLVMGetSection(LLVMValueRef Global)
LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global)
Returns the "value type" of a global value.
LLVMBool LLVMIsDeclaration(LLVMValueRef Global)
LLVMVisibility LLVMGetVisibility(LLVMValueRef Global)
void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class)
LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global)
Deprecated: Use LLVMGetUnnamedAddress instead.
LLVMLinkage LLVMGetLinkage(LLVMValueRef Global)
LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global)
LLVMMetadataRef LLVMValueMetadataEntriesGetMetadata(LLVMValueMetadataEntry *Entries, unsigned Index)
Returns the underlying metadata node of a value metadata entry at a specific index.
void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr)
void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage)
void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr)
Deprecated: Use LLVMSetUnnamedAddress instead.
void LLVMGlobalClearMetadata(LLVMValueRef Global)
Removes all metadata attachments from this value.
unsigned LLVMGetAlignment(LLVMValueRef V)
Obtain the preferred alignment of the value.
void LLVMSetSection(LLVMValueRef Global, const char *Section)
void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind)
Erases a metadata attachment of the given kind if it exists.
LLVMValueMetadataEntry * LLVMGlobalCopyAllMetadata(LLVMValueRef Value, size_t *NumEntries)
Retrieves an array of metadata entries representing the metadata attached to this value.
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.
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.
long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal)
Obtain the sign extended value for an integer constant value.
unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal)
Obtain the zero extended value for an integer constant value.
LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N)
Obtain a constant value referring to a double floating point value.
LLVMBool LLVMIsNull(LLVMValueRef Val)
Determine whether a value instance is null.
LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty)
Obtain a constant value referring to an undefined value of a type.
LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty)
Obtain a constant value referring to a poison value of a type.
LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty)
Obtain a constant value referring to the instance of a type consisting of all ones.
LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty)
Obtain a constant that is a constant pointer pointing to NULL for a specified type.
LLVMValueRef LLVMConstNull(LLVMTypeRef Ty)
Obtain a constant value referring to the null instance of a type.
unsigned LLVMCountParams(LLVMValueRef FnRef)
Obtain the number of parameters in a function.
LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg)
Obtain the previous parameter to a function.
LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg)
Obtain the next parameter to a function.
LLVMValueRef LLVMGetParamParent(LLVMValueRef V)
Obtain the function to which this argument belongs.
LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn)
Obtain the first parameter to a function.
void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align)
Set the alignment for a function parameter.
LLVMValueRef LLVMGetParam(LLVMValueRef FnRef, unsigned index)
Obtain the parameter at the specified index.
LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn)
Obtain the last parameter to a function.
void LLVMGetParams(LLVMValueRef FnRef, LLVMValueRef *ParamRefs)
Obtain the parameters in a function.
void LLVMSetGC(LLVMValueRef Fn, const char *GC)
Define the garbage collector to use during code generation.
const char * LLVMGetGC(LLVMValueRef Fn)
Obtain the name of the garbage collector to use during code generation.
LLVMValueRef LLVMGetPrologueData(LLVMValueRef Fn)
Gets the prologue data associated with a function.
void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx)
LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn)
Check whether the given function has a personality function.
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.
unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn)
Obtain the calling function of a function.
LLVMValueRef LLVMGetPrefixData(LLVMValueRef Fn)
Gets the prefix data associated with a 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.
LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn)
Obtain the personality function attached to the function.
void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn)
Set the personality function attached to the function.
LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID)
Obtain if the intrinsic identified by the given ID is overloaded.
void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A)
Add an attribute to a function.
void LLVMDeleteFunction(LLVMValueRef Fn)
Remove a function from its containing module and deletes it.
const 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 LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData)
Sets the prologue data for the function.
const char * LLVMIntrinsicCopyOverloadedName(unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount, size_t *NameLength)
Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead.
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 LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC)
Set the calling convention of a function.
LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod, unsigned ID, LLVMTypeRef *ParamTypes, size_t ParamCount)
Create or insert the declaration of an intrinsic.
LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID)
void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, const char *V)
Add a target-dependent attribute to 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.
LLVMValueKind LLVMGetValueKind(LLVMValueRef Val)
Obtain the enumerated type of a Value instance.
const char * LLVMGetValueName(LLVMValueRef Val)
Deprecated: Use LLVMGetValueName2 instead.
LLVMTypeRef LLVMTypeOf(LLVMValueRef Val)
Obtain the type of a value.
LLVMBool LLVMIsConstant(LLVMValueRef Ty)
Determine whether the specified value instance is constant.
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.
char * LLVMPrintDbgRecordToString(LLVMDbgRecordRef Record)
Return a string representation of the DbgRecord.
void LLVMSetValueName(LLVMValueRef Val, const char *Name)
Deprecated: Use LLVMSetValueName2 instead.
void LLVMDumpValue(LLVMValueRef Val)
Dump a representation of a value to stderr.
LLVMBool LLVMIsUndef(LLVMValueRef Val)
Determine whether a value instance is undefined.
LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val)
LLVMBool LLVMIsPoison(LLVMValueRef Val)
Determine whether a value instance is poisonous.
LLVMValueRef LLVMIsAMDString(LLVMValueRef Val)
void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen)
Set the string name of a value.
LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val)
char * LLVMPrintValueToString(LLVMValueRef Val)
Return a string representation of the value.
void LLVMEraseGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module and delete it.
void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc)
Remove a global indirect function from its parent module.
LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc)
Advance a GlobalIFunc iterator to the next GlobalIFunc.
LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalIFunc value from a Module by its name.
LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the last GlobalIFunc in a 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.
void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver)
Sets the resolver function associated with this indirect function.
LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M)
Obtain an iterator to the first GlobalIFunc in a Module.
LLVMValueRef LLVMGetGlobalIFuncResolver(LLVMValueRef IFunc)
Retrieves the resolver function associated with this indirect function, or NULL if it doesn't not exi...
LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc)
Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca)
Obtain the type that is being allocated by the alloca instruction.
LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueRef C, unsigned Index)
Obtain the operand bundle attached to this instruction at the given index.
LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr)
Obtain the pointer to the function invoked by this instruction.
void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs)
unsigned LLVMGetNumArgOperands(LLVMValueRef Instr)
Obtain the argument count for a call instruction.
void LLVMSetNormalDest(LLVMValueRef Invoke, LLVMBasicBlockRef B)
Set the normal destination basic block.
unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr)
Obtain the calling convention for a call instruction.
LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef Instr)
Obtain the function type called by this instruction.
unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx)
void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, LLVMAttributeRef A)
unsigned LLVMGetNumOperandBundles(LLVMValueRef C)
Obtain the number of operand bundles attached to this instruction.
void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC)
Set the calling convention for a call instruction.
LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef Invoke)
Return the normal destination basic block.
void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, unsigned KindID)
void LLVMSetUnwindDest(LLVMValueRef Invoke, LLVMBasicBlockRef B)
Set the unwind destination basic block.
void LLVMSetTailCall(LLVMValueRef Call, LLVMBool isTailCall)
Set whether a call instruction is a tail call.
LLVMBool LLVMIsTailCall(LLVMValueRef Call)
Obtain whether a call instruction is a tail call.
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned align)
void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
LLVMTailCallKind LLVMGetTailCallKind(LLVMValueRef Call)
Obtain a tail call kind of the call instruction.
void LLVMSetTailCallKind(LLVMValueRef Call, LLVMTailCallKind kind)
Set the call kind of the call instruction.
LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, const char *K, unsigned KLen)
LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef Invoke)
Return the unwind destination basic block.
LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP)
Get the source element type of the given GEP operator.
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.
const unsigned * LLVMGetIndices(LLVMValueRef Inst)
Obtain the indices as an array.
unsigned LLVMGetNumIndices(LLVMValueRef Inst)
Obtain the number of indices.
void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues, LLVMBasicBlockRef *IncomingBlocks, unsigned Count)
Add an incoming value to the end of a PHI list.
LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMValueRef.
unsigned LLVMCountIncoming(LLVMValueRef PhiNode)
Obtain the number of incoming basic blocks to a PHI node.
LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index)
Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
unsigned LLVMGetNumSuccessors(LLVMValueRef Term)
Return the number of successors that this terminator has.
LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef Switch)
Obtain the default destination basic block of a switch instruction.
void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block)
Update the specified successor to point at the provided block.
void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond)
Set the condition of a branch instruction.
LLVMValueRef LLVMGetCondition(LLVMValueRef Branch)
Return the condition of a branch instruction.
LLVMBool LLVMIsConditional(LLVMValueRef Branch)
Return if a branch is conditional.
LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i)
Return the specified successor.
LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst)
Create a copy of 'this' instruction that is identical in all ways except the following:
LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst)
Obtain the instruction that occurs after the one specified.
void LLVMDeleteInstruction(LLVMValueRef Inst)
Delete an instruction.
LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst)
Determine whether an instruction is a terminator.
LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst)
Obtain the code opcode for an individual instruction.
LLVMValueMetadataEntry * LLVMInstructionGetAllMetadataOtherThanDebugLoc(LLVMValueRef Value, size_t *NumEntries)
Returns the metadata associated with an instruction value, but filters out all the debug locations.
LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst)
Obtain the float predicate of an instruction.
int LLVMHasMetadata(LLVMValueRef Inst)
Determine whether an instruction has any metadata attached.
void LLVMInstructionEraseFromParent(LLVMValueRef Inst)
Remove and delete an instruction.
void LLVMInstructionRemoveFromParent(LLVMValueRef Inst)
Remove an instruction.
LLVMValueRef LLVMGetMetadata(LLVMValueRef Inst, unsigned KindID)
Return metadata associated with an instruction value.
LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst)
Obtain the predicate of an instruction.
void LLVMSetMetadata(LLVMValueRef Inst, unsigned KindID, LLVMValueRef Val)
Set metadata associated with an instruction value.
LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst)
Obtain the basic block to which an instruction belongs.
LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst)
Obtain the instruction that occurred before this one.
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.
LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index)
Obtain the use of 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.
LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val)
Obtain the first use of a value.
LLVMUseRef LLVMGetNextUse(LLVMUseRef U)
Obtain the next use of a value.
LLVMValueRef LLVMGetUsedValue(LLVMUseRef U)
Obtain the value this use corresponds to.
#define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)
void LLVMShutdown()
Deallocate and destroy all ManagedStatic variables.
void LLVMGetVersion(unsigned *Major, unsigned *Minor, unsigned *Patch)
Return the major, minor, and patch version of LLVM.
void LLVMDisposeMessage(char *Message)
char * LLVMCreateMessage(const char *Message)
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
void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee)
Set the target value of an alias.
LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the last GlobalAlias in a Module.
LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA)
Advance a GlobalAlias iterator to the next GlobalAlias.
LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias)
Retrieve the target value of an alias.
LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA)
Decrement a GlobalAlias iterator to the previous GlobalAlias.
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 LLVMGetFirstGlobalAlias(LLVMModuleRef M)
Obtain an iterator to the first GlobalAlias in a Module.
LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M, const char *Name, size_t NameLen)
Obtain a GlobalAlias value from a Module by its name.
void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant)
void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode)
LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar)
LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M)
LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar)
LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar)
LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name)
LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M)
void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit)
LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar)
void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal)
LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar)
void LLVMDeleteGlobal(LLVMValueRef GlobalVar)
LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar)
LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar)
LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name, unsigned AddressSpace)
void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal)
LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
FunctionType * getType(LLVMContext &Context, ID id, ArrayRef< Type * > Tys=std::nullopt)
Return the function type for an intrinsic.
std::string getNameNoUnnamedTypes(ID Id, ArrayRef< Type * > Tys)
Return the LLVM name for an intrinsic.
StringRef getName(ID id)
Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".
bool isOverloaded(ID id)
Returns true if the intrinsic can be overloaded.
Function * getDeclaration(Module *M, ID id, ArrayRef< Type * > Tys=std::nullopt)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
@ 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.
void initializeSafepointIRVerifierPass(PassRegistry &)
uint64_t divideCeil(uint64_t Numerator, uint64_t Denominator)
Returns the integer ceil(Numerator / Denominator).
void initializeVerifierLegacyPassPass(PassRegistry &)
OperandBundleDefT< Value * > OperandBundleDef
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
void initializeCore(PassRegistry &)
Initialize all passes linked into the Core library.
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_malloc(size_t Sz)
constexpr int PoisonMaskElem
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.
Attribute unwrap(LLVMAttributeRef Attr)
void initializeDominatorTreeWrapperPassPass(PassRegistry &)
void initializePrintModulePassWrapperPass(PassRegistry &)
void llvm_shutdown()
llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
LLVMAttributeRef wrap(Attribute Attr)
void initializePrintFunctionPassWrapperPass(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.