tccon.pas 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. {$ifndef OLDASM}
  35. ,i386base
  36. {$else}
  37. ,i386
  38. {$endif}
  39. {$endif}
  40. {$ifdef m68k}
  41. ,m68k
  42. {$endif}
  43. ;
  44. {*****************************************************************************
  45. FirstRealConst
  46. *****************************************************************************}
  47. procedure firstrealconst(var p : ptree);
  48. begin
  49. p^.location.loc:=LOC_MEM;
  50. end;
  51. {*****************************************************************************
  52. FirstFixConst
  53. *****************************************************************************}
  54. procedure firstfixconst(var p : ptree);
  55. begin
  56. p^.location.loc:=LOC_MEM;
  57. end;
  58. {*****************************************************************************
  59. FirstOrdConst
  60. *****************************************************************************}
  61. procedure firstordconst(var p : ptree);
  62. begin
  63. p^.location.loc:=LOC_MEM;
  64. end;
  65. {*****************************************************************************
  66. FirstStringConst
  67. *****************************************************************************}
  68. procedure firststringconst(var p : ptree);
  69. begin
  70. { if cs_ansistrings in aktlocalswitches then
  71. p^.resulttype:=cansistringdef
  72. else
  73. p^.resulttype:=cshortstringdef; }
  74. case p^.stringtype of
  75. st_shortstring :
  76. p^.resulttype:=cshortstringdef;
  77. st_ansistring :
  78. p^.resulttype:=cansistringdef;
  79. st_widestring :
  80. p^.resulttype:=cwidestringdef;
  81. st_longstring :
  82. p^.resulttype:=clongstringdef;
  83. end;
  84. p^.location.loc:=LOC_MEM;
  85. end;
  86. {*****************************************************************************
  87. FirstSetConst
  88. *****************************************************************************}
  89. procedure firstsetconst(var p : ptree);
  90. begin
  91. p^.location.loc:=LOC_MEM;
  92. end;
  93. {*****************************************************************************
  94. FirstNilN
  95. *****************************************************************************}
  96. procedure firstniln(var p : ptree);
  97. begin
  98. p^.resulttype:=voidpointerdef;
  99. p^.location.loc:=LOC_MEM;
  100. end;
  101. end.
  102. {
  103. $Log$
  104. Revision 1.5 1999-05-01 13:24:50 peter
  105. * merged nasm compiler
  106. * old asm moved to oldasm/
  107. Revision 1.4 1999/02/22 02:15:47 peter
  108. * updates for ag386bin
  109. Revision 1.3 1998/11/17 00:36:48 peter
  110. * more ansistring fixes
  111. Revision 1.2 1998/11/05 12:03:04 peter
  112. * released useansistring
  113. * removed -Sv, its now available in fpc modes
  114. Revision 1.1 1998/09/23 20:42:24 peter
  115. * splitted pass_1
  116. }