MipsCopyDepsProcessor.java 954 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package targets.mips;
  7. import API.CodeProcessorInterface;
  8. import common.Block;
  9. import common.Code;
  10. import java.util.LinkedHashMap;
  11. /**
  12. *
  13. * @author EUGENIO CARVALHO
  14. */
  15. public class MipsCopyDepsProcessor implements CodeProcessorInterface {
  16. protected Code tac;
  17. public MipsCopyDepsProcessor() {
  18. }
  19. @Override
  20. public void Exec(Code c, LinkedHashMap<String, CodeProcessorInterface> cp) throws Exception {
  21. Block currentBlock = c.Block(),
  22. tacBlock = c.Parent.getBlocks().get(currentBlock.getName());
  23. // System.out.println("EXEC COPY DEPS:" + currentBlock.getName() + "\n" + tacBlock.GetDependences());
  24. for (String dep : tacBlock.GetDependences()) {
  25. currentBlock.AddDependence(dep);
  26. }
  27. }
  28. }