Add Function and some Function methods

This commit is contained in:
Siu Kwan Lam 2013-01-25 15:41:38 -06:00
commit c76096bbcb
5 changed files with 40 additions and 2 deletions

View file

@ -0,0 +1,19 @@
from binding import *
from namespace import llvm
from GlobalValue import GlobalValue
from Constant import Constant
from Type import Type
from DerivedTypes import FunctionType
from LLVMContext import LLVMContext
@llvm.Class(GlobalValue)
class Function:
_include_ = 'llvm/Function.h'
_downcast_ = GlobalValue, Constant
getReturnType = Method(ptr(Type))
getFunctionType = Method(ptr(FunctionType))
getContext = Method(ref(LLVMContext))
isVarArg = Method(cast(Bool, bool))
getIntrinsicID = Method(cast(Unsigned, int))
isIntrinsic = Method(cast(Bool, bool))

View file

@ -0,0 +1,8 @@
from binding import *
from namespace import llvm
from Constant import Constant
@llvm.Class(Constant)
class GlobalValue:
_include_ = 'llvm/GlobalValue.h'

View file

@ -3,6 +3,7 @@ from namespace import llvm
from LLVMContext import LLVMContext
from StringRef import StringRef
from Constant import Constant
from Function import Function
from DerivedTypes import FunctionType
from raw_ostream import raw_ostream
from AssemblyAnnotationWriter import AssemblyAnnotationWriter

View file

@ -24,4 +24,4 @@ class Value:
getName = Method(cast(StringRef, str))
setName = Method(Void, cast(str, StringRef))
replaceAllUsesWith = Method(Void, ptr(Value))
replaceAllUsesWith = Method(Void, ptr(Value))