tccon.pas 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. ,i386
  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:=cstringdef;
  70. p^.location.loc:=LOC_MEM;
  71. end;
  72. {*****************************************************************************
  73. FirstSetConst
  74. *****************************************************************************}
  75. procedure firstsetconst(var p : ptree);
  76. begin
  77. p^.location.loc:=LOC_MEM;
  78. end;
  79. {*****************************************************************************
  80. FirstNilN
  81. *****************************************************************************}
  82. procedure firstniln(var p : ptree);
  83. begin
  84. p^.resulttype:=voidpointerdef;
  85. p^.location.loc:=LOC_MEM;
  86. end;
  87. end.
  88. {
  89. $Log$
  90. Revision 1.1 1998-09-23 20:42:24 peter
  91. * splitted pass_1
  92. }