Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / native_client / src / trusted / validator_mips / decode.h
1 /*
2  * Copyright 2012 The Native Client Authors. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the LICENSE file.
5  * Copyright 2012, Google Inc.
6  */
7
8 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_MIPS_DECODE_H
9 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_MIPS_DECODE_H
10
11 #include "native_client/src/trusted/validator_mips/model.h"
12 #include "native_client/src/trusted/validator_mips/inst_classes.h"
13
14 namespace nacl_mips_dec {
15
16 struct DecoderState;
17
18 /*
19  * Creates a new DecodeState instance that can be used to make calls to
20  * decode.  The caller owns the result and should delete it when appropriate,
21  * by using delete_state below.
22  */
23 const DecoderState *init_decode();
24
25 /*
26  * Frees any resources previously allocated by a call to init_decode.
27  */
28 void delete_state(const DecoderState *);
29
30 /*
31  * Chooses a ClassDecoder that can answer questions about the given Instruction.
32  */
33 const ClassDecoder &decode(const Instruction, const DecoderState *);
34
35
36 }  // namespace
37
38 #endif  // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_MIPS_DECODE_H