Skip to content

Commit ec4abbf

Browse files
authored
expose Function::getFunctionType to LLVM c api
1 parent 0668bb2 commit ec4abbf

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

llvm/include/llvm-c/Core.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3016,6 +3016,13 @@ LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn);
30163016
*/
30173017
LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn);
30183018

3019+
/**
3020+
* Obtain function type.
3021+
*
3022+
* @see llvm::Function::getFunctionType()
3023+
*/
3024+
LLVMTypeRef LLVMGetFunctionType(LLVMValueRef Fn);
3025+
30193026
/**
30203027
* Obtain the next parameter to a function.
30213028
*

llvm/lib/IR/Core.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2658,6 +2658,10 @@ void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align) {
26582658
A->addAttr(Attribute::getWithAlignment(A->getContext(), Align(align)));
26592659
}
26602660

2661+
LLVMTypeRef LLVMGetFunctionType(LLVMValueRef Fn) {
2662+
return wrap(unwrap<Function>(Fn)->getFunctionType());
2663+
}
2664+
26612665
/*--.. Operations on ifuncs ................................................--*/
26622666

26632667
LLVMValueRef LLVMAddGlobalIFunc(LLVMModuleRef M,

0 commit comments

Comments
 (0)