2
0

wpo.pas 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. {
  2. Copyright (c) 2008 by Jonas Maebe
  3. Collects all whole program optimization plugin untits
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. unit wpo;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. { all units with whole program optimisation components }
  22. optvirt,optdead;
  23. procedure InitWpo;
  24. procedure DoneWpo;
  25. implementation
  26. uses
  27. globals,
  28. comphook,
  29. wpobase, wpoinfo;
  30. { called after command line parameters have been parsed }
  31. procedure InitWpo;
  32. begin
  33. { always create so we don't have to litter the source with if-tests }
  34. wpoinfomanager:=twpoinfomanager.create;
  35. { register the classes we can/should potentially use }
  36. wpoinfomanager.registerwpocomponentclass(tprogdevirtinfo);
  37. wpoinfomanager.registerwpocomponentclass(twpodeadcodeinfofromexternallinker);
  38. { assign input/output feedback files }
  39. if (wpofeedbackinput<>'') then
  40. wpoinfomanager.setwpoinputfile(wpofeedbackinput);
  41. if (wpofeedbackoutput<>'') then
  42. wpoinfomanager.setwpooutputfile(wpofeedbackoutput);
  43. { parse input }
  44. wpoinfomanager.parseandcheckwpoinfo;
  45. { abort if error }
  46. if (codegenerror) then
  47. raise ECompilerAbort.Create;
  48. end;
  49. procedure DoneWpo;
  50. begin
  51. wpoinfomanager.free;
  52. wpoinfomanager:=nil;
  53. wpofeedbackinput:='';
  54. wpofeedbackoutput:='';
  55. end;
  56. end.