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

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

Issue 12223109: SECCOMP-BPF: Refactor the BPF sandbox API to use fewer "static" fields and methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make sure unnamed namespaces are always top-level Created 7 years, 10 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 | Annotate | Revision Log
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 <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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698