Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: sandbox/linux/seccomp-bpf/codegen.cc

Issue 570163003: Large IWYU cleanup for seccomp-bpf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@trap-errorcode
Patch Set: Sort #includes Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sandbox/linux/seccomp-bpf/codegen.h ('k') | sandbox/linux/seccomp-bpf/codegen_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "sandbox/linux/seccomp-bpf/codegen.h"
6
5 #include <stdio.h> 7 #include <stdio.h>
6 8
9 #include <set>
10
7 #include "base/logging.h" 11 #include "base/logging.h"
8 #include "sandbox/linux/seccomp-bpf/codegen.h" 12 #include "sandbox/linux/seccomp-bpf/basicblock.h"
13 #include "sandbox/linux/seccomp-bpf/die.h"
14 #include "sandbox/linux/seccomp-bpf/instruction.h"
15 #include "sandbox/linux/seccomp-bpf/linux_seccomp.h"
9 16
10 namespace { 17 namespace {
11 18
12 // Helper function for Traverse(). 19 // Helper function for Traverse().
13 void TraverseRecursively(std::set<sandbox::Instruction*>* visited, 20 void TraverseRecursively(std::set<sandbox::Instruction*>* visited,
14 sandbox::Instruction* instruction) { 21 sandbox::Instruction* instruction) {
15 if (visited->find(instruction) == visited->end()) { 22 if (visited->find(instruction) == visited->end()) {
16 visited->insert(instruction); 23 visited->insert(instruction);
17 switch (BPF_CLASS(instruction->code)) { 24 switch (BPF_CLASS(instruction->code)) {
18 case BPF_JMP: 25 case BPF_JMP:
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 CutGraphIntoBasicBlocks(instructions, branch_targets, &all_blocks); 768 CutGraphIntoBasicBlocks(instructions, branch_targets, &all_blocks);
762 MergeTails(&all_blocks); 769 MergeTails(&all_blocks);
763 BasicBlocks basic_blocks; 770 BasicBlocks basic_blocks;
764 TopoSortBasicBlocks(first_block, all_blocks, &basic_blocks); 771 TopoSortBasicBlocks(first_block, all_blocks, &basic_blocks);
765 ComputeRelativeJumps(&basic_blocks, all_blocks); 772 ComputeRelativeJumps(&basic_blocks, all_blocks);
766 ConcatenateBasicBlocks(basic_blocks, program); 773 ConcatenateBasicBlocks(basic_blocks, program);
767 return; 774 return;
768 } 775 }
769 776
770 } // namespace sandbox 777 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf/codegen.h ('k') | sandbox/linux/seccomp-bpf/codegen_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698