wpo.pas 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. wpobase, wpoinfo;
  29. { called after command line parameters have been parsed }
  30. procedure InitWpo;
  31. begin
  32. { always create so we don't have to litter the source with if-tests }
  33. wpoinfomanager:=twpoinfomanager.create;
  34. { register the classes we can/should potentially use }
  35. wpoinfomanager.registerwpocomponentclass(tprogdevirtinfo);
  36. wpoinfomanager.registerwpocomponentclass(twpodeadcodeinfofromexternallinker);
  37. { assign input/output feedback files }
  38. if (wpofeedbackinput<>'') then
  39. wpoinfomanager.setwpoinputfile(wpofeedbackinput);
  40. if (wpofeedbackoutput<>'') then
  41. wpoinfomanager.setwpooutputfile(wpofeedbackoutput);
  42. { parse input }
  43. wpoinfomanager.parseandcheckwpoinfo;
  44. end;
  45. procedure DoneWpo;
  46. begin
  47. wpoinfomanager.free;
  48. wpoinfomanager:=nil;
  49. wpofeedbackinput:='';
  50. wpofeedbackoutput:='';
  51. end;
  52. end.