move docu comments to header
authorMatthias Braun <matze@braunis.de>
Thu, 9 Jun 2011 11:06:07 +0000 (13:06 +0200)
committerMatthias Braun <matze@braunis.de>
Thu, 9 Jun 2011 11:06:07 +0000 (13:06 +0200)
ast.c
ast.h
ast_t.h
main.c

diff --git a/ast.c b/ast.c
index f34668b..a2812b8 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -48,10 +48,7 @@ struct obstack ast_obstack;
 
 static int indent;
 
-/** If set, implicit casts are printed. */
 bool print_implicit_casts = false;
-
-/** If set parenthesis are printed to indicate operator precedence. */
 bool print_parenthesis = false;
 
 static void print_statement(const statement_t *statement);
@@ -1952,30 +1949,12 @@ expression_classification_t is_constant_expression(const expression_t *expressio
        panic("invalid expression found (is constant expression)");
 }
 
-/**
- * Initialize the AST construction.
- */
 void init_ast(void)
 {
        obstack_init(&ast_obstack);
 }
 
-/**
- * Free the AST.
- */
 void exit_ast(void)
 {
        obstack_free(&ast_obstack, NULL);
 }
-
-/**
- * Allocate an AST object of the given size.
- *
- * @param size  the size of the object to allocate
- *
- * @return  A new allocated object in the AST memeory space.
- */
-void *(allocate_ast)(size_t size)
-{
-       return _allocate_ast(size);
-}
diff --git a/ast.h b/ast.h
index adb7e89..9020f99 100644 (file)
--- a/ast.h
+++ b/ast.h
@@ -87,17 +87,23 @@ typedef union  statement_t                           statement_t;
 
 typedef struct translation_unit_t                    translation_unit_t;
 
-void  init_ast(void);
-void  exit_ast(void);
+/**
+ * Initialize the AST construction.
+ */
+void init_ast(void);
+
+/**
+ * Free the AST.
+ */
+void exit_ast(void);
 
-void  print_expression(const expression_t *expression);
-void  print_initializer(const initializer_t *initializer);
-void  print_ast(const translation_unit_t *unit);
-void  print_indent(void);
-void  print_declaration(const entity_t *entity);
-void  print_entity(const entity_t *entity);
-void  change_indent(int delta);
-void *allocate_ast(size_t size);
+void print_expression(const expression_t *expression);
+void print_initializer(const initializer_t *initializer);
+void print_ast(const translation_unit_t *unit);
+void print_indent(void);
+void print_declaration(const entity_t *entity);
+void print_entity(const entity_t *entity);
+void change_indent(int delta);
 
 typedef enum expression_classification_t {
        EXPR_CLASS_VARIABLE,
diff --git a/ast_t.h b/ast_t.h
index 15d8735..601d578 100644 (file)
--- a/ast_t.h
+++ b/ast_t.h
@@ -667,7 +667,7 @@ struct translation_unit_t {
        statement_t *global_asm;
 };
 
-static inline void *_allocate_ast(size_t size)
+static inline void *allocate_ast(size_t size)
 {
        return obstack_alloc(&ast_obstack, size);
 }
@@ -682,8 +682,6 @@ static inline bool is_invalid_statement(statement_t *statement)
        return statement->base.kind == STATEMENT_INVALID;
 }
 
-#define allocate_ast(size)                 _allocate_ast(size)
-
 /**
  * Allocate an AST node with given size and
  * initialize all fields with zero.
@@ -695,4 +693,9 @@ static inline void *allocate_ast_zero(size_t size)
        return res;
 }
 
+/** If set, implicit casts are printed. */
+extern bool print_implicit_casts;
+/** If set parenthesis are printed to indicate operator precedence. */
+extern bool print_parenthesis;
+
 #endif
diff --git a/main.c b/main.c
index cc2a67e..c31427f 100644 (file)
--- a/main.c
+++ b/main.c
@@ -110,12 +110,6 @@ unsigned           force_long_double_size    = 0;
 bool               enable_main_collect2_hack = false;
 bool               freestanding              = false;
 
-/* to switch on printing of implicit casts */
-extern bool print_implicit_casts;
-
-/* to switch on printing of parenthesis to indicate operator precedence */
-extern bool print_parenthesis;
-
 static machine_triple_t *target_machine;
 static const char       *target_triple;
 static int               verbose;