| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdio.h> |
| 6 |
| 5 #include "sandbox/linux/seccomp-bpf/codegen.h" | 7 #include "sandbox/linux/seccomp-bpf/codegen.h" |
| 6 | 8 |
| 7 | 9 |
| 8 namespace { | 10 namespace { |
| 9 | 11 |
| 10 // Helper function for Traverse(). | 12 // Helper function for Traverse(). |
| 11 void TraverseRecursively(std::set<playground2::Instruction *> *visited, | 13 void TraverseRecursively(std::set<playground2::Instruction *> *visited, |
| 12 playground2::Instruction *instruction) { | 14 playground2::Instruction *instruction) { |
| 13 if (visited->find(instruction) == visited->end()) { | 15 if (visited->find(instruction) == visited->end()) { |
| 14 visited->insert(instruction); | 16 visited->insert(instruction); |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 CutGraphIntoBasicBlocks(instructions, branch_targets, &all_blocks); | 730 CutGraphIntoBasicBlocks(instructions, branch_targets, &all_blocks); |
| 729 MergeTails(&all_blocks); | 731 MergeTails(&all_blocks); |
| 730 BasicBlocks basic_blocks; | 732 BasicBlocks basic_blocks; |
| 731 TopoSortBasicBlocks(first_block, all_blocks, &basic_blocks); | 733 TopoSortBasicBlocks(first_block, all_blocks, &basic_blocks); |
| 732 ComputeRelativeJumps(&basic_blocks, all_blocks); | 734 ComputeRelativeJumps(&basic_blocks, all_blocks); |
| 733 ConcatenateBasicBlocks(basic_blocks, program); | 735 ConcatenateBasicBlocks(basic_blocks, program); |
| 734 return; | 736 return; |
| 735 } | 737 } |
| 736 | 738 |
| 737 } // namespace | 739 } // namespace |
| OLD | NEW |