From 7bcfd6eb6d77f64fc0d2ab5c866c08d2a521574a Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sun, 24 Jan 2010 04:10:06 +0000 Subject: [PATCH] cindex/Python: Remove Declaration class, this has been removed from the API. llvm-svn: 94358 --- clang/bindings/python/clang/cindex.py | 51 +-------------------------- 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py index 2c7a04e3d946..43d9caf1c496 100644 --- a/clang/bindings/python/clang/cindex.py +++ b/clang/bindings/python/clang/cindex.py @@ -179,16 +179,6 @@ class Cursor(Structure): """ return Cursor_is_def(self) - def get_declaration(self): - """ - Return the underlying declaration for the cursor. If the cursor kind - is a declaration, then this simpy returns the declaration. If the - cursor is a reference, then this returns the referenced declaration. - """ - if not self.is_declaration(): - raise Exception("Cursor does not refer to a Declaration") - return Cursor_decl(self) - def get_definition(self): """ If the cursor is a reference to a declaration or a declaration of @@ -334,48 +324,9 @@ class File(ClangObject): """Return the last modification time of the file, if valid.""" return File_time(self) -class Declaration(ClangObject): - """ - The Declaration class represents a declaration with a translation unit. - """ - def __init__(self, obj): - ClangObject.__init__(self, obj) - - # Figure out the kind of cursor and inject a base class that provides - # some declaration-specific functionality. - self.cursor = Declaration_cursor(self) - - @property - def kind(self): - """Retur the kind of cursor.""" - return self.cursor.kind - - @property - def spelling(self): - """Return the spelling (name) of the declaration.""" - return Declaration_spelling(self) - - def load(self, fun, data = None): - """ - Recursively visit any elements declared or referenced within this - declaration. - """ - f = lambda d, c, x: fun(Declaration(d), c, x) - Declaration_load(self, Callback(f), data) - -# Specific declaration kinds -class ClassDeclaration: - pass - -class FunctionDeclaration: - pass - -class TypedefDeclaration: - pass - # Additional Functions and Types -# Wrap calls to TranslationUnit._load and Decl._load. +# Wrap calls to Cursor_visit. Callback = CFUNCTYPE(None, c_void_p, Cursor, c_void_p) # String Functions -- GitLab