jreese

oas1.c

Jul 5th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.23 KB | None | 0 0
  1. /* GOAS front-end language hooks and GCC middle-end interface
  2.    Copyright (C) 2012
  3.    Free Software Foundation, Inc.
  4.  
  5.    This file is part of GCC.
  6.  
  7.    GCC is free software; you can redistribute it and/or modify it under
  8.    the terms of the GNU General Public License as published by the Free
  9.    Software Foundation; either version 3, or (at your option) any later
  10.    version.
  11.  
  12.    GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  13.    WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14.    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15.    for more details.
  16.  
  17.    You should have received a copy of the GNU General Public License
  18.    along with GCC; see the file COPYING3.  If not see
  19.    <http://www.gnu.org/licenses/>.  
  20. */
  21.  
  22. #include "config.h"
  23. #include "system.h"
  24. #include "ansidecl.h"
  25. #include "coretypes.h"
  26. #include "tm.h"
  27. #include "opts.h"
  28. #include "tree.h"
  29. #include "tree-iterator.h"
  30. #include "tree-pass.h"
  31. #include "gimple.h"
  32. #include "toplev.h"
  33. #include "debug.h"
  34. #include "options.h"
  35. #include "flags.h"
  36. #include "convert.h"
  37. #include "diagnostic-core.h"
  38. #include "langhooks.h"
  39. #include "langhooks-def.h"
  40. #include "target.h"
  41. #include "cgraph.h"
  42.  
  43. #include <gmp.h>
  44. #include <mpfr.h>
  45.  
  46. #include "vec.h"
  47. #include "hashtab.h"
  48.  
  49. #include "oas1.h"
  50. #include <stdio.h>
  51.  
  52. #include "oas_lang.h"
  53. VEC(tree,gc) * global_decls_vec;
  54.  
  55. /* bison symbols */
  56. extern FILE *oas_in;
  57. extern int oas_parse(void);
  58.  
  59. struct GTY(()) lang_identifier  {
  60.   struct tree_identifier common;
  61. };
  62.  
  63. /* Data structures required by the GCC middle-end  */
  64. union GTY((desc ("0"),
  65.        chain_next ("(union lang_tree_node *) TREE_CHAIN (&%h.generic)")))
  66. lang_tree_node {
  67.   union tree_node GTY((tag ("0"), desc ("tree_node_structure (&%h)"))) generic;
  68.   int GTY((tag("1"), desc("1"))) andi;
  69. };
  70.  
  71. struct GTY(()) lang_type {
  72.   char dummy;
  73. };
  74.  
  75. /* Language-specific declaration information.  */
  76.  
  77. struct GTY(()) lang_decl {
  78.   char dummy;
  79. };
  80.  
  81. struct GTY(()) language_function
  82. {
  83.   char dummy;
  84. };
  85.  
  86. /* Parsing language hook */
  87. void oas_parse_file (int debug_flag ATTRIBUTE_UNUSED) {
  88.   /* Call the bison parser */
  89.   oas_parse();
  90. }
  91.  
  92. tree oas_type_for_size (unsigned precision ATTRIBUTE_UNUSED,
  93.             int unsignedp ATTRIBUTE_UNUSED) {
  94.   printf("TYPE_FOR_SIZE!");
  95.   gcc_unreachable ();
  96. }
  97.  
  98. tree oas_type_for_mode (enum machine_mode mode ATTRIBUTE_UNUSED,
  99.             int unsignedp ATTRIBUTE_UNUSED) {
  100.   printf("TYPE_FOR_MODE!");
  101.   gcc_unreachable ();
  102. }
  103.  
  104. tree oas_pushdecl (tree decl ATTRIBUTE_UNUSED) {
  105.   printf("PUSH_DECL!");
  106.   gcc_unreachable ();
  107. }
  108.  
  109. bool oas_global_bindings_p (void) {
  110.   printf("GLOBAL_BIND!");
  111.   gcc_unreachable ();
  112. }
  113. tree
  114. oas_getdecls (void)
  115. {
  116.   printf("GET_DECLS!");
  117.   tree global_decls = NULL_TREE;
  118.  
  119.   return global_decls;
  120. }
  121.  
  122. tree
  123. convert (tree type ATTRIBUTE_UNUSED, tree expr ATTRIBUTE_UNUSED)
  124. {
  125.   printf("CONVERT!");
  126.   return NULL;
  127. }
  128.  
  129. /* The language hooks data structure. This is the main interface between the
  130.  * GCC front-end  and the GCC middle-end/back-end. A list of language hooks could
  131.  * be found in <gcc>/langhooks.h
  132.  */
  133. struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
  134.  
  135. #include "debug.h"
  136. #include "gt-oas-oas1.h"
  137. #include "gtype-oas.h"
Advertisement
Add Comment
Please, Sign In to add comment