From 616f1fa757b8bca224f020bce4a23a042db34311 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 29 Nov 2016 10:39:41 +0100 Subject: [PATCH] interface/python.cc: document order of superclasses In particular, explain that the order of the superclasses is the opposite of the order of the corresponding annotations. Signed-off-by: Sven Verdoolaege --- interface/python.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/interface/python.cc b/interface/python.cc index 84f048d7..d8a992d4 100644 --- a/interface/python.cc +++ b/interface/python.cc @@ -53,6 +53,10 @@ static void die(const char *msg) /* Return a sequence of the types of which the given type declaration is * marked as being a subtype. + * The order of the types is the opposite of the order in which they + * appear in the source. In particular, the first annotation + * is the one that is closest to the annotated type and the corresponding + * type is then also the first that will appear in the sequence of types. */ static vector find_superclasses(RecordDecl *decl) { @@ -484,7 +488,9 @@ static void print_method_return(FunctionDecl *method) } /* Print a python method corresponding to the C function "method". - * "super" contains the superclasses of the class to which the method belongs. + * "super" contains the superclasses of the class to which the method belongs, + * with the first element corresponding to the annotation that appears + * closest to the annotated type. * * If the first argument of "method" is something other than an instance * of the class, then mark the python method as static. @@ -700,6 +706,8 @@ void isl_class::print_constructor(FunctionDecl *cons) } /* Print the header of the class "name" with superclasses "super". + * The order of the superclasses is the opposite of the order + * in which the corresponding annotations appear in the source code. */ static void print_class_header(const string &name, const vector &super) { -- 2.11.4.GIT