aboutsummaryrefslogtreecommitdiff
path: root/bindings/python/clang/cindex.py
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-01-24 04:09:51 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-01-24 04:09:51 +0000
commit99d593ed41216ffc8e6ebb25fdcb5102c3866b99 (patch)
treee4227cb838184e912acf3859433e3974d04b23e0 /bindings/python/clang/cindex.py
parent1b945a7455e17fd792ef3bd3790dc88beea5faad (diff)
Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94356 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/python/clang/cindex.py')
-rw-r--r--bindings/python/clang/cindex.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py
index 2545c45ac8..9af4e4c64c 100644
--- a/bindings/python/clang/cindex.py
+++ b/bindings/python/clang/cindex.py
@@ -266,8 +266,6 @@ class Index(ClangObject):
primarily by providing an interface for reading and parsing translation
units.
"""
- def __init__(self, obj):
- ClangObject.__init__(self, obj)
@staticmethod
def create(excludeDecls=False, displayDiags=False):
@@ -300,13 +298,9 @@ class TranslationUnit(ClangObject):
The TranslationUnit class represents a source code translation unit and
provides read-only access to its top-level declarations.
"""
- def __init__(self, obj, free=False):
- ClangObject.__init__(self, obj)
- self.free = free
def __del__(self):
- if self.free and self.obj:
- TranslationUnit_dispose(self)
+ TranslationUnit_dispose(self)
@property
def cursor(self):
@@ -322,7 +316,7 @@ class TranslationUnit(ClangObject):
def read(ix, path):
"""Create a translation unit from the given AST file."""
ptr = TranslationUnit_read(ix, path)
- return TranslationUnit(ptr, True) if ptr else None
+ return TranslationUnit(ptr) if ptr else None
@staticmethod
def parse(ix, path, args = []):
@@ -333,7 +327,7 @@ class TranslationUnit(ClangObject):
# TODO: Support unsaved files.
argc, argv = len(args), create_string_vector(args)
ptr = TranslationUnit_parse(ix, path, argc, byref(argv), 0, 0)
- return TranslationUnit(ptr, True) if ptr else None
+ return TranslationUnit(ptr) if ptr else None
class File(ClangObject):
"""