Commit fd170d0f authored by phlo's avatar phlo

changed Program's base class to std::vector

parent 2a5361d1
......@@ -24,7 +24,7 @@ Program::Program(istream & f, string & p) : path(p)
size_t line_num = 1;
/* list of jump instructions at pc referencing a certain label */
deque<tuple<string, word_t, const string *>> labelled_jumps;
vector<tuple<string, word_t, const string *>> labelled_jumps;
for (string line_buf; getline(f, line_buf); line_num++)
{
......@@ -187,7 +187,7 @@ Program::Program(istream & f, string & p) : path(p)
/* Program::push_back *********************************************************/
void Program::push_back (Instruction_ptr op)
{
deque<Instruction_ptr>::push_back(op);
vector<Instruction_ptr>::push_back(op);
/* collect checkpoint ids */
if (Check_ptr c = dynamic_pointer_cast<Check>(op))
......
#ifndef PROGRAM_HH_
#define PROGRAM_HH_
#include <deque>
#include <istream>
#include <memory>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "common.hh"
......@@ -16,7 +16,7 @@ using Instruction_ptr = std::shared_ptr<Instruction>;
/*******************************************************************************
* Program
******************************************************************************/
struct Program : public std::deque<Instruction_ptr>
struct Program : public std::vector<Instruction_ptr>
{
using Predecessors = std::unordered_map<word_t, std::set<word_t>>;
......@@ -78,7 +78,7 @@ using Program_ptr = std::shared_ptr<Program>;
/*******************************************************************************
* Program_list
******************************************************************************/
using Program_list = std::deque<Program_ptr>;
using Program_list = std::vector<Program_ptr>;
/*******************************************************************************
* Program_list_ptr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment