Refactor raw_svector_stream_helper

This commit is contained in:
Siu Kwan Lam 2013-01-23 15:24:37 -06:00
commit e9be14ca0e
5 changed files with 42 additions and 22 deletions

View file

@ -2,7 +2,9 @@ from binding import *
from namespace import llvm
from LLVMContext import LLVMContext
from StringRef import StringRef
from raw_ostream import raw_svector_ostream_helper
from Constant import Constant
from DerivedTypes import FunctionType
from raw_ostream import raw_ostream
from AssemblyAnnotationWriter import AssemblyAnnotationWriter
# class Module
@ -34,13 +36,10 @@ setModuleInlineAsm = Module.method(Void, StringRef.From(str))
appendModuleInlineAsm = Module.method(Void, StringRef.From(str))
# Function Accessors
#getOrInsertFunction = Module.method(Constant, StringRef.From(str), FunctionType.Pointer)
getOrInsertFunction = Module.method(Constant.Pointer, StringRef.From(str), FunctionType.Pointer)
# Utilities
dump = Module.method(Void)
print_ = Module.method(Void, raw_svector_ostream_helper.Ref,
AssemblyAnnotationWriter.Pointer)
print_ = Module.method(Void, raw_ostream.Ref, AssemblyAnnotationWriter.Pointer)
print_.realname = 'print'
dropAllReferences = Module.method(Void)

View file

@ -1,7 +1,7 @@
from binding import *
from namespace import llvm
from LLVMContext import LLVMContext
from raw_ostream import raw_svector_ostream_helper
from raw_ostream import raw_ostream
Type = llvm.Class()
Type.include.add('llvm/Type.h')
@ -13,7 +13,7 @@ PointerType = SequentialType.Subclass()
getContext = Type.method(LLVMContext.Ref)
dump = Type.method(Void)
print_ = Type.method(Void, raw_svector_ostream_helper.Ref)
print_ = Type.method(Void, raw_ostream.Ref)
print_.realname = 'print'
def type_checker():

View file

@ -5,13 +5,8 @@ from StringRef import StringRef
raw_ostream = llvm.Class()
raw_ostream.include.add("llvm/Support/raw_ostream.h")
delete = raw_ostream.delete()
raw_svector_ostream = raw_ostream.Subclass()
raw_svector_ostream.include.add("llvm/Support/raw_os_ostream.h")
# extra class to help binding
raw_svector_ostream_helper = raw_svector_ostream.Subclass()
create = raw_svector_ostream_helper.staticmethod(
raw_svector_ostream_helper.Pointer)
delete = raw_svector_ostream_helper.delete()
str = raw_svector_ostream_helper.method(StringRef.To(str))
str = raw_svector_ostream.method(StringRef.To(str))