tccon.pas 4.5 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. symconst,symtable,aasm,types,
  32. hcodegen,pass_1,cpubase;
  33. {*****************************************************************************
  34. FirstRealConst
  35. *****************************************************************************}
  36. procedure firstrealconst(var p : ptree);
  37. begin
  38. p^.location.loc:=LOC_MEM;
  39. end;
  40. {*****************************************************************************
  41. FirstFixConst
  42. *****************************************************************************}
  43. procedure firstfixconst(var p : ptree);
  44. begin
  45. p^.location.loc:=LOC_MEM;
  46. end;
  47. {*****************************************************************************
  48. FirstOrdConst
  49. *****************************************************************************}
  50. procedure firstordconst(var p : ptree);
  51. begin
  52. p^.location.loc:=LOC_MEM;
  53. end;
  54. {*****************************************************************************
  55. FirstStringConst
  56. *****************************************************************************}
  57. procedure firststringconst(var p : ptree);
  58. begin
  59. { if cs_ansistrings in aktlocalswitches then
  60. p^.resulttype:=cansistringdef
  61. else
  62. p^.resulttype:=cshortstringdef; }
  63. case p^.stringtype of
  64. st_shortstring :
  65. p^.resulttype:=cshortstringdef;
  66. st_ansistring :
  67. p^.resulttype:=cansistringdef;
  68. st_widestring :
  69. p^.resulttype:=cwidestringdef;
  70. st_longstring :
  71. p^.resulttype:=clongstringdef;
  72. end;
  73. p^.location.loc:=LOC_MEM;
  74. end;
  75. {*****************************************************************************
  76. FirstSetConst
  77. *****************************************************************************}
  78. procedure firstsetconst(var p : ptree);
  79. begin
  80. p^.location.loc:=LOC_MEM;
  81. end;
  82. {*****************************************************************************
  83. FirstNilN
  84. *****************************************************************************}
  85. procedure firstniln(var p : ptree);
  86. begin
  87. p^.resulttype:=voidpointerdef;
  88. p^.location.loc:=LOC_MEM;
  89. end;
  90. end.
  91. {
  92. $Log$
  93. Revision 1.8 1999-08-04 00:23:38 florian
  94. * renamed i386asm and i386base to cpuasm and cpubase
  95. Revision 1.7 1999/08/03 22:03:29 peter
  96. * moved bitmask constants to sets
  97. * some other type/const renamings
  98. Revision 1.6 1999/05/27 19:45:16 peter
  99. * removed oldasm
  100. * plabel -> pasmlabel
  101. * -a switches to source writing automaticly
  102. * assembler readers OOPed
  103. * asmsymbol automaticly external
  104. * jumptables and other label fixes for asm readers
  105. Revision 1.5 1999/05/01 13:24:50 peter
  106. * merged nasm compiler
  107. * old asm moved to oldasm/
  108. Revision 1.4 1999/02/22 02:15:47 peter
  109. * updates for ag386bin
  110. Revision 1.3 1998/11/17 00:36:48 peter
  111. * more ansistring fixes
  112. Revision 1.2 1998/11/05 12:03:04 peter
  113. * released useansistring
  114. * removed -Sv, its now available in fpc modes
  115. Revision 1.1 1998/09/23 20:42:24 peter
  116. * splitted pass_1
  117. }