X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=include%2Fllvm-c%2FCore.h;h=9dbcbfea387fad9a471506e1004bc944d3b144f4;hp=485cf9481f2f9b2b0c2d07450594d9fdf364cfc9;hb=7c898facbc5c707c77f25f7fd9b512a099af62a8;hpb=437b107671a1dbe254ce488de1316ab082552331 diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index 485cf9481f2..9dbcbfea387 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -161,14 +161,15 @@ typedef enum { /* FIXME: These attributes are currently not included in the C API as a temporary measure until the API/ABI impact to the C API is understood and the path forward agreed upon. - LLVMAddressSafety = 1ULL << 32, - LLVMStackProtectStrongAttribute = 1ULL<<33, - LLVMCold = 1ULL << 34, - LLVMOptimizeNone = 1ULL << 35, - LLVMInAllocaAttribute = 1ULL << 36, - LLVMNonNullAttribute = 1ULL << 37, - LLVMJumpTableAttribute = 1ULL << 38, - LLVMDereferenceableAttribute = 1ULL << 39, + LLVMSanitizeAddressAttribute = 1ULL << 32, + LLVMStackProtectStrongAttribute = 1ULL<<35, + LLVMColdAttribute = 1ULL << 40, + LLVMOptimizeNoneAttribute = 1ULL << 42, + LLVMInAllocaAttribute = 1ULL << 43, + LLVMNonNullAttribute = 1ULL << 44, + LLVMJumpTableAttribute = 1ULL << 45, + LLVMConvergentAttribute = 1ULL << 46, + LLVMSafeStackAttribute = 1ULL << 47, */ } LLVMAttribute; @@ -996,6 +997,13 @@ unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy); */ void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest); +/** + * Get the type of the element at a given index in the structure. + * + * @see llvm::StructType::getTypeAtIndex() + */ +LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i); + /** * Determine whether a structure is packed. * @@ -1157,8 +1165,6 @@ LLVMTypeRef LLVMX86MMXType(void); macro(Argument) \ macro(BasicBlock) \ macro(InlineAsm) \ - macro(MDNode) \ - macro(MDString) \ macro(User) \ macro(Constant) \ macro(BlockAddress) \ @@ -1307,6 +1313,9 @@ LLVMBool LLVMIsUndef(LLVMValueRef Val); LLVMValueRef LLVMIsA##name(LLVMValueRef Val); LLVM_FOR_EACH_VALUE_SUBCLASS(LLVM_DECLARE_VALUE_CAST) +LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val); +LLVMValueRef LLVMIsAMDString(LLVMValueRef Val); + /** * @} */ @@ -1878,6 +1887,20 @@ LLVMValueRef LLVMAddAlias(LLVMModuleRef M, LLVMTypeRef Ty, LLVMValueRef Aliasee, */ void LLVMDeleteFunction(LLVMValueRef Fn); +/** + * Obtain the personality function attached to the function. + * + * @see llvm::Function::getPersonalityFn() + */ +LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn); + +/** + * Set the personality function attached to the function. + * + * @see llvm::Function::setPersonalityFn() + */ +void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn); + /** * Obtain the ID number from a function instance. * @@ -2496,6 +2519,63 @@ void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall); * @} */ +/** + * @defgroup LLVMCCoreValueInstructionTerminator Terminators + * + * Functions in this group only apply to instructions that map to + * llvm::TerminatorInst instances. + * + * @{ + */ + +/** + * Return the number of successors that this terminator has. + * + * @see llvm::TerminatorInst::getNumSuccessors + */ +unsigned LLVMGetNumSuccessors(LLVMValueRef Term); + +/** + * Return the specified successor. + * + * @see llvm::TerminatorInst::getSuccessor + */ +LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i); + +/** + * Update the specified successor to point at the provided block. + * + * @see llvm::TerminatorInst::setSuccessor + */ +void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block); + +/** + * Return if a branch is conditional. + * + * This only works on llvm::BranchInst instructions. + * + * @see llvm::BranchInst::isConditional + */ +LLVMBool LLVMIsConditional(LLVMValueRef Branch); + +/** + * Return the condition of a branch instruction. + * + * This only works on llvm::BranchInst instructions. + * + * @see llvm::BranchInst::getCondition + */ +LLVMValueRef LLVMGetCondition(LLVMValueRef Branch); + +/** + * Set the condition of a branch instruction. + * + * This only works on llvm::BranchInst instructions. + * + * @see llvm::BranchInst::setCondition + */ +void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond); + /** * Obtain the default destination basic block of a switch instruction. * @@ -2505,6 +2585,10 @@ void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall); */ LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr); +/** + * @} + */ + /** * @defgroup LLVMCCoreValueInstructionPHINode PHI Nodes *