tccon.pas 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl
  4. Type checking and register allocation for constants
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit tccon;
  19. interface
  20. uses
  21. tree;
  22. procedure firstrealconst(var p : ptree);
  23. procedure firstfixconst(var p : ptree);
  24. procedure firstordconst(var p : ptree);
  25. procedure firststringconst(var p : ptree);
  26. procedure firstsetconst(var p : ptree);
  27. procedure firstniln(var p : ptree);
  28. implementation
  29. uses
  30. cobjects,verbose,globals,systems,
  31. symtable,aasm,types,
  32. hcodegen,pass_1
  33. {$ifdef i386}
  34. ,i386base
  35. {$endif}
  36. {$ifdef m68k}
  37. ,m68k
  38. {$endif}
  39. ;
  40. {*****************************************************************************
  41. FirstRealConst
  42. *****************************************************************************}
  43. procedure firstrealconst(var p : ptree);
  44. begin
  45. p^.location.loc:=LOC_MEM;
  46. end;
  47. {*****************************************************************************
  48. FirstFixConst
  49. *****************************************************************************}
  50. procedure firstfixconst(var p : ptree);
  51. begin
  52. p^.location.loc:=LOC_MEM;
  53. end;
  54. {*****************************************************************************
  55. FirstOrdConst
  56. *****************************************************************************}
  57. procedure firstordconst(var p : ptree);
  58. begin
  59. p^.location.loc:=LOC_MEM;
  60. end;
  61. {*****************************************************************************
  62. FirstStringConst
  63. *****************************************************************************}
  64. procedure firststringconst(var p : ptree);
  65. begin
  66. { if cs_ansistrings in aktlocalswitches then
  67. p^.resulttype:=cansistringdef
  68. else
  69. p^.resulttype:=cshortstringdef; }
  70. case p^.stringtype of
  71. st_shortstring :
  72. p^.resulttype:=cshortstringdef;
  73. st_ansistring :
  74. p^.resulttype:=cansistringdef;
  75. st_widestring :
  76. p^.resulttype:=cwidestringdef;
  77. st_longstring :
  78. p^.resulttype:=clongstringdef;
  79. end;
  80. p^.location.loc:=LOC_MEM;
  81. end;
  82. {*****************************************************************************
  83. FirstSetConst
  84. *****************************************************************************}
  85. procedure firstsetconst(var p : ptree);
  86. begin
  87. p^.location.loc:=LOC_MEM;
  88. end;
  89. {*****************************************************************************
  90. FirstNilN
  91. *****************************************************************************}
  92. procedure firstniln(var p : ptree);
  93. begin
  94. p^.resulttype:=voidpointerdef;
  95. p^.location.loc:=LOC_MEM;
  96. end;
  97. end.
  98. {
  99. $Log$
  100. Revision 1.6 1999-05-27 19:45:16 peter
  101. * removed oldasm
  102. * plabel -> pasmlabel
  103. * -a switches to source writing automaticly
  104. * assembler readers OOPed
  105. * asmsymbol automaticly external
  106. * jumptables and other label fixes for asm readers
  107. Revision 1.5 1999/05/01 13:24:50 peter
  108. * merged nasm compiler
  109. * old asm moved to oldasm/
  110. Revision 1.4 1999/02/22 02:15:47 peter
  111. * updates for ag386bin
  112. Revision 1.3 1998/11/17 00:36:48 peter
  113. * more ansistring fixes
  114. Revision 1.2 1998/11/05 12:03:04 peter
  115. * released useansistring
  116. * removed -Sv, its now available in fpc modes
  117. Revision 1.1 1998/09/23 20:42:24 peter
  118. * splitted pass_1
  119. }