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.
8 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_MIPS_DECODE_H
9 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_MIPS_DECODE_H
11 #include "native_client/src/trusted/validator_mips/model.h"
12 #include "native_client/src/trusted/validator_mips/inst_classes.h"
14 namespace nacl_mips_dec {
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.
23 const DecoderState *init_decode();
26 * Frees any resources previously allocated by a call to init_decode.
28 void delete_state(const DecoderState *);
31 * Chooses a ClassDecoder that can answer questions about the given Instruction.
33 const ClassDecoder &decode(const Instruction, const DecoderState *);
38 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_MIPS_DECODE_H