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)
 

Function Documentation

◆ LLVMGetAttributeCountAtIndexPG()

unsigned LLVMGetAttributeCountAtIndexPG ( LLVMValueRef  F,
uint32  Idx 
)

Definition at line 62 of file llvmjit_wrap.cpp.

Referenced by llvm_copy_attributes_at_index().

63 {
64  /*
65  * This is more expensive, so only do when using a problematic LLVM
66  * version.
67  */
68 #if LLVM_VERSION_MAJOR < 4
69  if (!llvm::unwrap<llvm::Function>(F)->getAttributes().hasAttributes(Idx))
70  return 0;
71 #endif
72 
73  /*
74  * There is no nice public API to determine the count nicely, so just
75  * always fall back to LLVM's C API.
76  */
77  return LLVMGetAttributeCountAtIndex(F, Idx);
78 }
#define F(x)
Definition: blf.c:249