PostgreSQL Source Code  git master
llvmjit_wrap.cpp File Reference
#include "postgres.h"
#include <llvm-c/Core.h>
#include <llvm/IR/Attributes.h>
#include <llvm/IR/Function.h>
#include <llvm/MC/SubtargetFeature.h>
#include <llvm/Support/Host.h>
#include "jit/llvmjit.h"
Include dependency graph for llvmjit_wrap.cpp:

Go to the source code of this file.

Functions

unsigned LLVMGetAttributeCountAtIndexPG (LLVMValueRef F, uint32 Idx)
 
LLVMTypeRef LLVMGetFunctionReturnType (LLVMValueRef r)
 
LLVMTypeRef LLVMGetFunctionType (LLVMValueRef r)
 
LLVMTypeRef LLVMGlobalGetValueType (LLVMValueRef g)
 

Function Documentation

◆ LLVMGetAttributeCountAtIndexPG()

unsigned LLVMGetAttributeCountAtIndexPG ( LLVMValueRef  F,
uint32  Idx 
)

Definition at line 68 of file llvmjit_wrap.cpp.

69 {
70  /*
71  * This is more expensive, so only do when using a problematic LLVM
72  * version.
73  */
74 #if LLVM_VERSION_MAJOR < 4
75  if (!llvm::unwrap<llvm::Function>(F)->getAttributes().hasAttributes(Idx))
76  return 0;
77 #endif
78 
79  /*
80  * There is no nice public API to determine the count nicely, so just
81  * always fall back to LLVM's C API.
82  */
83  return LLVMGetAttributeCountAtIndex(F, Idx);
84 }
#define F(X, Y, Z)
Definition: md5.c:60

References F.

Referenced by llvm_copy_attributes_at_index().

◆ LLVMGetFunctionReturnType()

LLVMTypeRef LLVMGetFunctionReturnType ( LLVMValueRef  r)

Definition at line 87 of file llvmjit_wrap.cpp.

88 {
89  return llvm::wrap(llvm::unwrap<llvm::Function>(r)->getReturnType());
90 }

Referenced by load_return_type().

◆ LLVMGetFunctionType()

LLVMTypeRef LLVMGetFunctionType ( LLVMValueRef  r)

Definition at line 93 of file llvmjit_wrap.cpp.

94 {
95  return llvm::wrap(llvm::unwrap<llvm::Function>(r)->getFunctionType());
96 }

Referenced by build_EvalXFuncInt(), BuildV1Call(), llvm_function_reference(), llvm_pg_func(), llvm_pg_var_func_type(), and slot_compile_deform().

◆ LLVMGlobalGetValueType()

LLVMTypeRef LLVMGlobalGetValueType ( LLVMValueRef  g)

Definition at line 100 of file llvmjit_wrap.cpp.

101 {
102  return llvm::wrap(llvm::unwrap<llvm::GlobalValue>(g)->getValueType());
103 }

Referenced by llvm_pg_var_type().