[pygobject/llvm: 6/17] add a name for PyObject/GObject structs
- From: Johan Dahlin <johan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject/llvm: 6/17] add a name for PyObject/GObject structs
- Date: Wed, 21 Jul 2010 22:35:22 +0000 (UTC)
commit a6b210ce4b9017d8d273835d3b68e9a46b2af498
Author: Johan Dahlin <johan gnome org>
Date: Mon Jul 5 20:32:57 2010 -0300
add a name for PyObject/GObject structs
gi/llvm-compiler.cpp | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/gi/llvm-compiler.cpp b/gi/llvm-compiler.cpp
index 6e4ec85..277ca4d 100644
--- a/gi/llvm-compiler.cpp
+++ b/gi/llvm-compiler.cpp
@@ -90,7 +90,6 @@ PyObject* _PyGObject_New(GObject *o) {
using namespace pygi;
static llvm::IRBuilder<> Builder(llvm::getGlobalContext());
-// PyObject = { ssize_t ob_refcnt, struct* ob_type }
// PyTupleObject = { ssize_t ob_refcnt, struct* ob_type, ssize_t ob_size, PyObject* }
static llvm::Type* pyObjectPtr = NULL;
static llvm::Type* gObjectPtr = NULL;
@@ -482,9 +481,16 @@ LLVMCompiler::createPyNone()
void
LLVMCompiler::loadSymbols()
{
- // llvm
- pyObjectPtr = llvm::PointerType::getUnqual(llvm::StructType::get(mCtx, NULL, NULL));
- gObjectPtr = llvm::PointerType::getUnqual(llvm::StructType::get(mCtx, NULL, NULL));
+ // PyObject = { ssize_t ob_refcnt, struct* ob_type }
+ llvm::StructType *pyObject = llvm::StructType::get(mCtx,
+ llvm::TypeBuilder<ssize_t, false>::get(mCtx),
+ llvm::TypeBuilder<void*, false>::get(mCtx), NULL);
+ mModule->addTypeName("PyObject", pyObject);
+ pyObjectPtr = llvm::PointerType::getUnqual(pyObject);
+
+ llvm::StructType *gObject = llvm::StructType::get(mCtx, NULL, NULL);
+ mModule->addTypeName("GObject", gObject);
+ gObjectPtr = llvm::PointerType::getUnqual(gObject);
_PyLong_CheckFunc =
llvm::cast<llvm::Function>(mModule->getOrInsertFunction("_PyLong_Check",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]