hlcgx86.pas 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. {
  2. Copyright (c) 1998-2010 by Florian Klaempfl and Jonas Maebe
  3. Member of the Free Pascal development team
  4. This unit contains routines to create a pass-through high-level code
  5. generator. This is used by most regular code generators.
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit hlcgx86;
  20. interface
  21. {$i fpcdefs.inc}
  22. uses
  23. aasmdata,
  24. symtype,symdef,
  25. parabase,
  26. hlcgobj, hlcg2ll;
  27. type
  28. { thlcgx86 }
  29. thlcgx86 = class(thlcg2ll)
  30. protected
  31. procedure gen_load_uninitialized_function_result(list: TAsmList; pd: tprocdef; resdef: tdef; const resloc: tcgpara); override;
  32. end;
  33. implementation
  34. uses
  35. cgbase,
  36. cpubase,aasmcpu;
  37. { thlcgx86 }
  38. procedure thlcgx86.gen_load_uninitialized_function_result(list: TAsmList; pd: tprocdef; resdef: tdef; const resloc: tcgpara);
  39. begin
  40. { the caller will pop a value from the fpu stack }
  41. if assigned(resloc.location) and
  42. (resloc.location^.loc=LOC_FPUREGISTER) then
  43. list.concat(taicpu.op_none(A_FLDZ));
  44. end;
  45. end.