1 : // Copyright 2013 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 :
15 : #include "syzygy/block_graph/filterable.h"
16 :
17 : namespace block_graph {
18 :
19 E : bool Filterable::IsFiltered(const block_graph::BlockGraph::Block* block) const {
20 E : DCHECK(block != NULL);
21 E : if (filter_ == NULL)
22 E : return false;
23 E : return block_graph::IsFiltered(*filter_, block);
24 E : }
25 :
26 E : bool Filterable::IsFiltered(const block_graph::BasicBlock* basic_block) const {
27 E : DCHECK(basic_block != NULL);
28 E : if (filter_ == NULL)
29 E : return false;
30 E : return block_graph::IsFiltered(*filter_, basic_block);
31 E : }
32 :
33 : bool Filterable::IsFiltered(
34 E : const block_graph::BasicCodeBlock* basic_block) const {
35 E : DCHECK(basic_block != NULL);
36 E : if (filter_ == NULL)
37 E : return false;
38 E : return block_graph::IsFiltered(*filter_, basic_block);
39 E : }
40 :
41 : bool Filterable::IsFiltered(
42 E : const block_graph::BasicDataBlock* basic_block) const {
43 E : DCHECK(basic_block != NULL);
44 E : if (filter_ == NULL)
45 E : return false;
46 E : return block_graph::IsFiltered(*filter_, basic_block);
47 E : }
48 :
49 E : bool Filterable::IsFiltered(const block_graph::Instruction& instruction) const {
50 E : if (filter_ == NULL)
51 E : return false;
52 E : return block_graph::IsFiltered(*filter_, instruction);
53 E : }
54 :
55 : } // namespace block_graph
|