clang/gcc: Fix compilation issues with clang 3.0 and gcc 4.6

This patch addresses a number of minor issues that cause problems when
compiling with clang >= 3.0 and gcc >= 4.6. Most importantly, it
avoids using the deprecated ext/hash_map and instead uses
unordered_map (and similarly so for the hash_set). To make use of the
new STL containers, g++ and clang has to be invoked with "-std=c++0x",
and this is now added for all gcc versions >= 4.6, and for clang >=
3.0. For gcc >= 4.3 and <= 4.5 and clang <= 3.0 we use the tr1
unordered_map to avoid the deprecation warning.

The addition of c++0x in turn causes a few problems, as the
compiler is more stringent and adds a number of new warnings. Below,
the most important issues are enumerated:

1) the use of namespaces is more strict, e.g. for isnan, and all
   headers opening the entire namespace std are now fixed.

2) another other issue caused by the more stringent compiler is the
   narrowing of the embedded python, which used to be a char array,
   and is now unsigned char since there were values larger than 128.

3) a particularly odd issue that arose with the new c++0x behaviour is
   found in range.hh, where the operator< causes gcc to complain about
   the template type parsing (the "<" is interpreted as the beginning
   of a template argument), and the problem seems to be related to the
   begin/end members introduced for the range-type iteration, which is
   a new feature in c++11.

As a minor update, this patch also fixes the build flags for the clang
debug target that used to be shared with gcc and incorrectly use
"-ggdb".
This commit is contained in:
Andreas Hansson 2012-04-14 05:43:31 -04:00
parent 29482e90ba
commit b6aa6d55eb
34 changed files with 199 additions and 77 deletions

View file

@ -486,7 +486,7 @@ CXX_V = readCommand([main['CXX'],'-V'], exception=False)
main['GCC'] = CXX_version and CXX_version.find('g++') >= 0
main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0
main['ICC'] = CXX_V and CXX_V.find('Intel') >= 0
main['CLANG'] = CXX_V and CXX_V.find('clang') >= 0
main['CLANG'] = CXX_version and CXX_version.find('clang') >= 0
if main['GCC'] + main['SUNCC'] + main['ICC'] + main['CLANG'] > 1:
print 'Error: How can we have two at the same time?'
Exit(1)
@ -496,7 +496,6 @@ if main['GCC']:
main.Append(CCFLAGS=['-pipe'])
main.Append(CCFLAGS=['-fno-strict-aliasing'])
main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef'])
main.Append(CXXFLAGS=['-Wno-deprecated'])
# Read the GCC version to check for versions with bugs
# Note CCVERSION doesn't work here because it is run with the CC
# before we override it from the command line
@ -506,6 +505,8 @@ if main['GCC']:
not compareVersions(gcc_version, '4.4.2'):
print 'Info: Tree vectorizer in GCC 4.4.1 & 4.4.2 is buggy, disabling.'
main.Append(CCFLAGS=['-fno-tree-vectorize'])
if compareVersions(gcc_version, '4.6') >= 0:
main.Append(CXXFLAGS=['-std=c++0x'])
elif main['ICC']:
pass #Fix me... add warning flags once we clean up icc warnings
elif main['SUNCC']:
@ -533,6 +534,12 @@ elif main['CLANG']:
main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef'])
main.Append(CCFLAGS=['-Wno-tautological-compare'])
main.Append(CCFLAGS=['-Wno-self-assign'])
# Ruby makes frequent use of extraneous parantheses in the printing
# of if-statements
main.Append(CCFLAGS=['-Wno-parentheses'])
if compareVersions(clang_version, "3") >= 0:
main.Append(CXXFLAGS=['-std=c++0x'])
else:
print 'Error: Don\'t know what compiler options to use for your compiler.'
print ' Please fix SConstruct and src/SConscript and try again.'

View file

@ -32,6 +32,8 @@ import os, subprocess
Import('main')
from m5.util import compareVersions
elf_files = []
def ElfFile(filename):
elf_files.append(File(filename))
@ -91,9 +93,11 @@ ElfFile('libelf_msize.c')
m4env = main.Clone()
if m4env['GCC']:
major,minor,dot = [int(x) for x in m4env['GCC_VERSION'].split('.')]
if major >= 4:
if compareVersions(m4env['GCC_VERSION'], '4') >= 0:
m4env.Append(CCFLAGS=['-Wno-pointer-sign'])
if compareVersions(m4env['GCC_VERSION'], '4.6') >= 0:
m4env.Append(CCFLAGS=['-Wno-unused-but-set-variable',
'-Wno-implicit-function-declaration'])
if m4env['CLANG']:
m4env.Append(CCFLAGS=['-Wno-initializer-overrides', '-Wno-pointer-sign'])
m4env.Append(CCFLAGS=['-Wno-implicit'])

View file

@ -791,7 +791,7 @@ def embedPyFile(target, source, env):
namespace {
const char data_${sym}[] = {
const uint8_t data_${sym}[] = {
''')
code.indent()
step = 16
@ -852,7 +852,7 @@ def makeEnv(label, objsfx, strip = False, **kwargs):
swig_env.Append(CCFLAGS='-Wno-sign-compare')
swig_env.Append(CCFLAGS='-Wno-parentheses')
swig_env.Append(CCFLAGS='-Wno-unused-label')
if compareVersions(env['GCC_VERSION'], '4.6.0') != -1:
if compareVersions(env['GCC_VERSION'], '4.6') >= 0:
swig_env.Append(CCFLAGS='-Wno-unused-but-set-variable')
if env['CLANG']:
swig_env.Append(CCFLAGS=['-Wno-unused-label'])
@ -931,7 +931,7 @@ def makeEnv(label, objsfx, strip = False, **kwargs):
# Debug binary
ccflags = {}
if env['GCC'] or env['CLANG']:
if env['GCC']:
if sys.platform == 'sunos5':
ccflags['debug'] = '-gstabs+'
else:
@ -949,6 +949,11 @@ elif env['ICC']:
ccflags['opt'] = '-g -O'
ccflags['fast'] = '-fast'
ccflags['prof'] = '-fast -g -pg'
elif env['CLANG']:
ccflags['debug'] = '-g -O0'
ccflags['opt'] = '-g -O3'
ccflags['fast'] = '-O3'
ccflags['prof'] = '-O3 -g -pg'
else:
print 'Unknown compiler, please fix compiler options'
Exit(1)

View file

@ -70,7 +70,7 @@ using namespace AlphaISA;
}};
output exec {{
#include <math.h>
#include <cmath>
#include "arch/alpha/registers.hh"
#include "arch/alpha/regredir.hh"

View file

@ -44,7 +44,6 @@
#include "base/bitfield.hh"
#include "base/misc.hh"
#include "base/trace.hh"
using namespace std;
namespace AlphaISA
{

View file

@ -94,6 +94,6 @@ output exec {{
#include "sim/sim_exit.hh"
using namespace ArmISA;
using std::isnan;
}};

View file

@ -540,13 +540,13 @@ namespace ArmISA
} // namespace ArmISA
namespace __hash_namespace {
__hash_namespace_begin
template<>
struct hash<ArmISA::ExtMachInst> : public hash<uint32_t> {
size_t operator()(const ArmISA::ExtMachInst &emi) const {
return hash<uint32_t>::operator()((uint32_t)emi);
};
};
}
__hash_namespace_end
#endif

View file

@ -45,7 +45,7 @@ output header {{
}};
output decoder {{
#include <math.h>
#include <cmath>
#include "arch/mips/dsp.hh"
#include "arch/mips/dt_constants.hh"
@ -69,7 +69,7 @@ using namespace MipsISA;
}};
output exec {{
#include <math.h>
#include <cmath>
#include "arch/generic/memhelpers.hh"
#include "arch/mips/dsp.hh"

View file

@ -66,7 +66,6 @@ output decoder {{
#include "cpu/thread_context.hh"
using namespace PowerISA;
using std::isnan;
}};
output exec {{
@ -87,6 +86,5 @@ output exec {{
#include "sim/sim_exit.hh"
using namespace PowerISA;
using std::isnan;
}};

View file

@ -89,7 +89,7 @@ typedef GenericISA::SimplePCState<MachInst> PCState;
} // PowerISA namespace
namespace __hash_namespace {
__hash_namespace_begin
template<>
struct hash<PowerISA::ExtMachInst> : public hash<uint32_t> {
@ -98,6 +98,6 @@ struct hash<PowerISA::ExtMachInst> : public hash<uint32_t> {
};
};
} // namespace __hash_namespace
__hash_namespace_end
#endif // __ARCH_POWER_TYPES_HH__

View file

@ -683,7 +683,7 @@ decode OP default Unknown::unknown()
0x47: FpUnimpl::fmovrqlez();
0x51: fcmps({{
uint8_t fcc;
if (isnan(Frs1s) || isnan(Frs2s))
if (std::isnan(Frs1s) || std::isnan(Frs2s))
fcc = 3;
else if (Frs1s < Frs2s)
fcc = 1;
@ -698,7 +698,7 @@ decode OP default Unknown::unknown()
}});
0x52: fcmpd({{
uint8_t fcc;
if (isnan(Frs1) || isnan(Frs2))
if (std::isnan(Frs1) || std::isnan(Frs2))
fcc = 3;
else if (Frs1 < Frs2)
fcc = 1;
@ -714,7 +714,7 @@ decode OP default Unknown::unknown()
0x53: FpUnimpl::fcmpq();
0x55: fcmpes({{
uint8_t fcc = 0;
if (isnan(Frs1s) || isnan(Frs2s))
if (std::isnan(Frs1s) || std::isnan(Frs2s))
fault = new FpExceptionIEEE754;
if (Frs1s < Frs2s)
fcc = 1;
@ -727,7 +727,7 @@ decode OP default Unknown::unknown()
}});
0x56: fcmped({{
uint8_t fcc = 0;
if (isnan(Frs1) || isnan(Frs2))
if (std::isnan(Frs1) || std::isnan(Frs2))
fault = new FpExceptionIEEE754;
if (Frs1 < Frs2)
fcc = 1;

View file

@ -44,7 +44,6 @@
#include "base/bitfield.hh"
#include "base/misc.hh"
#include "base/trace.hh"
using namespace std;
namespace SparcISA
{

View file

@ -98,7 +98,7 @@ class TlbMap
if (intersect(r))
return tree.end();
return tree.insert(std::make_pair<TlbRange,TlbEntry*>(r, d)).first;
return tree.insert(std::make_pair(r, d)).first;
}
size_t

View file

@ -285,7 +285,7 @@ let {{
// OF = SF = AF = 0
ccFlagBits = ccFlagBits & ~(OFBit | SFBit | AFBit |
ZFBit | PFBit | CFBit);
if (isnan(FpSrcReg1) || isnan(FpSrcReg2))
if (std::isnan(FpSrcReg1) || std::isnan(FpSrcReg2))
ccFlagBits = ccFlagBits | (ZFBit | PFBit | CFBit);
else if(FpSrcReg1 < FpSrcReg2)
ccFlagBits = ccFlagBits | CFBit;

View file

@ -1404,7 +1404,7 @@ let {{
}
uint64_t resBits = 0;
bool nanop = isnan(arg1) || isnan(arg2);
bool nanop = std::isnan(arg1) || std::isnan(arg2);
switch (ext & mask(3)) {
case 0:
if (arg1 == arg2 && !nanop)
@ -1492,7 +1492,7 @@ let {{
// OF = SF = AF = 0
ccFlagBits = ccFlagBits & ~(OFBit | SFBit | AFBit |
ZFBit | PFBit | CFBit);
if (isnan(arg1) || isnan(arg2))
if (std::isnan(arg1) || std::isnan(arg2))
ccFlagBits = ccFlagBits | (ZFBit | PFBit | CFBit);
else if(arg1 < arg2)
ccFlagBits = ccFlagBits | CFBit;

View file

@ -280,7 +280,7 @@ namespace X86ISA
}
namespace __hash_namespace {
__hash_namespace_begin
template<>
struct hash<X86ISA::ExtMachInst> {
size_t operator()(const X86ISA::ExtMachInst &emi) const {
@ -298,7 +298,7 @@ namespace __hash_namespace {
emi.stackSize ^ emi.dispSize;
};
};
}
__hash_namespace_end
// These two functions allow ExtMachInst to be used with SERIALIZE_SCALAR
// and UNSERIALIZE_SCALAR.

View file

@ -1,4 +1,16 @@
/*
* Copyright (c) 2012 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
* not be construed as granting a license to any other intellectual
* property including but not limited to intellectual property relating
* to a hardware implementation of the functionality of the software
* licensed hereunder. You may use the software subject to the license
* terms below provided that you ensure that this notice is replicated
* unmodified and in its entirety in all distributions of the software,
* modified or unmodified, in source code or in binary form.
*
* Copyright (c) 2003-2005 The Regents of The University of Michigan
* All rights reserved.
*
@ -26,29 +38,106 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Authors: Nathan Binkert
* Andreas Hansson
*/
#ifndef __HASHMAP_HH__
#define __HASHMAP_HH__
#if defined(__GNUC__) && __GNUC__ >= 3
#if defined(__GNUC__)
// for compilers that deprecate ext/hash_map, i.e. gcc >= 4.3 and
// clang, use unordered_map
// we need to determine what is available, as in the non-c++0x case,
// e.g. gcc >= 4.3 and <= 4.5, the containers are in the std::tr1
// namespace, and only gcc >= 4.6 (with -std=c++0x) adds the final
// container implementation in the std namespace
#if defined(__clang__)
// align with -std=c++0x only for clang >= 3.0 in CCFLAGS and also
// check if the header is present as this depends on what clang was
// built against, using XCode clang 3.1, for example, the header is
// not present without adding -stdlib=libc++
#if (__clang_major__ >= 3 && __has_include(<unordered_map>))
#define HAVE_STD_UNORDERED_MAP 1
#else
// we only support clang versions above 2.9 and these all have the tr1
// unordered_map
#define HAVE_STD_TR1_UNORDERED_MAP 1
#endif
#else
// align with -std=c++0x only for gcc >= 4.6 in CCFLAGS, contrary to
// clang we can rely entirely on the compiler version
#if ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
#define HAVE_STD_UNORDERED_MAP 1
#else
#define HAVE_STD_TR1_UNORDERED_MAP 1
#endif
#endif
// set a default value of 0
#ifndef HAVE_STD_UNORDERED_MAP
#define HAVE_STD_UNORDERED_MAP 0
#endif
// set a default value of 0
#ifndef HAVE_STD_TR1_UNORDERED_MAP
#define HAVE_STD_TR1_UNORDERED_MAP 0
#endif
// now we are ready to deal with the actual includes based on what is
// available
#if (HAVE_STD_UNORDERED_MAP || HAVE_STD_TR1_UNORDERED_MAP)
#define hash_map unordered_map
#define hash_multimap unordered_multimap
#define hash_set unordered_set
#define hash_multiset unordered_multiset
// these versions also have an existing hash function for strings
#define HAVE_STRING_HASH 1
#if HAVE_STD_UNORDERED_MAP
// clang or gcc >= 4.6
#include <unordered_map>
#include <unordered_set>
// note that this assumes that -std=c++0x is added to the command line
// which is done in the SConstruct CXXFLAGS for gcc >= 4.6 and clang
// >= 3.0
#define __hash_namespace std
#define __hash_namespace_begin namespace std {
#define __hash_namespace_end }
#else
// clang <= 3.0, gcc >= 4.3 and < 4.6
#include <tr1/unordered_map>
#include <tr1/unordered_set>
#define __hash_namespace std::tr1
#define __hash_namespace_begin namespace std { namespace tr1 {
#define __hash_namespace_end } }
#endif
#else
// gcc < 4.3
#include <ext/hash_map>
#include <ext/hash_set>
#define __hash_namespace __gnu_cxx
#define __hash_namespace_begin namespace __gnu_cxx {
#define __hash_namespace_end }
#endif
#else
// non GNU compiler
#include <hash_map>
#include <hash_set>
#define __hash_namsepace std
#define __hash_namespace_begin namespace std {
#define __hash_namespace_end }
#endif
#include <string>
#include "base/types.hh"
#if defined(__GNUC__) && __GNUC__ >= 3
#define __hash_namespace __gnu_cxx
#else
#define __hash_namespace std
#endif
namespace m5 {
using ::__hash_namespace::hash_multimap;
using ::__hash_namespace::hash_multiset;
@ -62,8 +151,8 @@ namespace m5 {
// Some default Hashing Functions
//
namespace __hash_namespace {
#if defined(__APPLE__) || !defined(__LP64__) && !defined(__alpha__) && !defined(__SUNPRO_CC)
__hash_namespace_begin
#if !defined(__LP64__) && !defined(__alpha__) && !defined(__SUNPRO_CC)
template<>
struct hash<uint64_t> {
size_t operator()(uint64_t r) const {
@ -79,6 +168,9 @@ namespace __hash_namespace {
};
#endif
// if the hash functions for strings are not already defined, then
// declare them here
#if !defined(HAVE_STRING_HASH)
template<>
struct hash<std::string> {
size_t operator()(const std::string &s) const {
@ -92,6 +184,7 @@ namespace __hash_namespace {
return (__stl_hash_string(r.first.c_str())) ^ r.second;
}
};
} // namespace __hash_namespace
#endif
__hash_namespace_end
#endif // __HASHMAP_HH__

View file

@ -29,6 +29,7 @@
* Steve Reinhardt
*/
#include <algorithm>
#include <fstream>
#include <iostream>
#include <string>

View file

@ -316,7 +316,13 @@ template <class T, class U>
inline bool
operator<(const Range<T> &range, const U &pos)
{
return range.end < pos;
// with -std=gnu++0x, gcc and clang get confused when range.end is
// compared to pos using the operator "<", and the parser expects it
// to be the opening bracket for a template parameter,
// i.e. range.end<pos>(...);, the reason seems to be the range-type
// iteration introduced in c++11 where begin and end are members
// that return iterators
return operator<(range.end, pos);
}
/**

View file

@ -166,7 +166,7 @@ ValueToString(Result value, int precision)
{
stringstream val;
if (!isnan(value)) {
if (!std::isnan(value)) {
if (precision != -1)
val.precision(precision);
else if (value == rint(value))
@ -211,15 +211,15 @@ void
ScalarPrint::operator()(ostream &stream) const
{
if ((flags.isSet(nozero) && value == 0.0) ||
(flags.isSet(nonan) && isnan(value)))
(flags.isSet(nonan) && std::isnan(value)))
return;
stringstream pdfstr, cdfstr;
if (!isnan(pdf))
if (!std::isnan(pdf))
ccprintf(pdfstr, "%.2f%%", pdf * 100.0);
if (!isnan(cdf))
if (!std::isnan(cdf))
ccprintf(cdfstr, "%.2f%%", cdf * 100.0);
ccprintf(stream, "%-40s %12s %10s %10s", name,

View file

@ -68,7 +68,7 @@ InOrderDynInst::InOrderDynInst(InOrderCPU *cpu,
inFrontEnd(true), frontSked(NULL), backSked(NULL),
squashingStage(0), predictTaken(false), procDelaySlotOnMispred(false),
fetchMemReq(NULL), dataMemReq(NULL), instEffAddr(0), eaCalcDone(false),
lqIdx(0), sqIdx(0), instListIt(NULL), onInstList(false)
lqIdx(0), sqIdx(0), onInstList(false)
{
for(int i = 0; i < MaxInstSrcRegs; i++) {
_readySrcRegIdx[i] = false;

View file

@ -31,6 +31,7 @@
#include <cassert>
#include <iomanip>
#include <iostream>
#include "base/hashmap.hh"
#include "mem/ruby/common/TypeDefines.hh"
@ -201,8 +202,7 @@ Address::shiftLowOrderBits(int number) const
return (m_address >> number);
}
class Address;
namespace __hash_namespace {
__hash_namespace_begin
template <> struct hash<Address>
{
size_t
@ -211,7 +211,7 @@ template <> struct hash<Address>
return (size_t)s.getAddress();
}
};
} // namespace __hash_namespace
__hash_namespace_end
namespace std {
template <> struct equal_to<Address>

View file

@ -26,6 +26,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <algorithm>
#include "mem/ruby/common/NetDest.hh"
NetDest::NetDest()

View file

@ -37,11 +37,8 @@
* Proceedings of the 48th Design Automation Conference (DAC'11)
*/
// C includes
#include <assert.h>
#include <stdio.h>
// C++ includes
#include <cassert>
#include <fstream>
#include <iostream>
#include <vector>
@ -50,6 +47,8 @@
#include "FaultModel.hh"
#include "base/misc.hh"
using namespace std;
#define MAX(a,b) ((a > b) ? (a) : (b))

View file

@ -47,7 +47,6 @@
// C++ includes
#include <string>
using namespace std;
// GEM5 includes
#include "params/FaultModel.hh"
@ -112,7 +111,7 @@ class FaultModel : public SimObject
int number_of_buff_per_data_vc,
int number_of_buff_per_ctrl_vc);
string fault_type_to_string(int fault_type_index);
std::string fault_type_to_string(int fault_type_index);
// the following 2 functions are called at runtime, to get the probability
// of each fault type (fault_vector) or the aggregate fault probability
@ -134,9 +133,9 @@ class FaultModel : public SimObject
void print(void);
private:
vector <system_conf> configurations;
vector <system_conf> routers;
vector <int> temperature_weights;
std::vector <system_conf> configurations;
std::vector <system_conf> routers;
std::vector <int> temperature_weights;
};
#endif // __MEM_RUBY_NETWORK_FAULT_MODEL_HH__

View file

@ -33,6 +33,8 @@
#include "mem/ruby/network/Topology.hh"
#include "mem/ruby/network/garnet/BaseGarnetNetwork.hh"
using namespace std;
BaseGarnetNetwork::BaseGarnetNetwork(const Params *p)
: Network(p)
{

View file

@ -37,8 +37,6 @@
#include "mem/ruby/network/orion/Type.hh"
using namespace std;
class TechParameter;
class OrionConfig
@ -56,12 +54,12 @@ class OrionConfig
void set_in_buf_num_set(uint32_t in_buf_num_set_);
void set_flit_width(uint32_t flit_width_);
void read_file(const string& filename_);
void print_config(ostream& out_);
void read_file(const std::string& filename_);
void print_config(std::ostream& out_);
public:
template<class T>
T get(const string& key_) const;
T get(const std::string& key_) const;
const TechParameter* get_tech_param_ptr() const { return m_tech_param_ptr; }
uint32_t get_num_in_port() const { return m_num_in_port; }
uint32_t get_num_out_port() const { return m_num_out_port; }
@ -71,7 +69,7 @@ class OrionConfig
uint32_t get_flit_width() const { return m_flit_width; }
private:
map<string, string> m_params_map;
std::map<std::string, std::string> m_params_map;
TechParameter* m_tech_param_ptr;
uint32_t m_num_in_port;
@ -84,28 +82,28 @@ class OrionConfig
protected:
struct key_not_found
{
string m_key;
key_not_found(const string& key_ = string()) : m_key(key_)
std::string m_key;
key_not_found(const std::string& key_ = string()) : m_key(key_)
{}
};
template<class T>
static T string_as_T(const string& str_);
static T string_as_T(const std::string& str_);
template<class T>
static string T_as_string(const T& t_);
static std::string T_as_string(const T& t_);
private:
static string ms_param_name[];
static std::string ms_param_name[];
};
template<class T>
T OrionConfig::get(const string& key_) const
{
map<string, string>::const_iterator it;
std::map<std::string, std::string>::const_iterator it;
it = m_params_map.find(key_);
if (it == m_params_map.end())
{
cerr << key_ << " NOT FOUND!" << endl;
std::cerr << key_ << " NOT FOUND!" << std::endl;
throw key_not_found(key_);
}
return string_as_T<T>(it->second);
@ -140,7 +138,8 @@ inline bool OrionConfig::string_as_T<bool>(const string& str_)
}
else
{
cerr << "Invalid bool value: '" << str_ << "'. Treated as FALSE." << endl;
std::cerr << "Invalid bool value: '" << str_ <<
"'. Treated as FALSE." << std::endl;
ret = false;
}
return ret;

View file

@ -43,6 +43,8 @@
#include "mem/ruby/network/orion/OrionConfig.hh"
#include "OrionRouter.hh"
using namespace std;
OrionRouter::OrionRouter(
uint32_t num_in_port_,
uint32_t num_out_port_,

View file

@ -40,8 +40,6 @@
#include "mem/ruby/network/orion/Type.hh"
using namespace std;
class OrionConfig;
class TechParameter

View file

@ -45,6 +45,8 @@
// Allows use of times() library call, which determines virtual runtime
#include <sys/resource.h>
#include <sys/times.h>
#include <sys/types.h>
#include <unistd.h>
#include <algorithm>
#include <fstream>

View file

@ -188,7 +188,6 @@ PerfectCacheMemory<ENTRY>::changePermission(const Address& address,
Address line_address = address;
line_address.makeLineAddress();
PerfectCacheLineState<ENTRY>& line_state = m_map[line_address];
AccessPermission old_perm = line_state.m_permission;
line_state.m_permission = new_perm;
}

View file

@ -408,6 +408,9 @@ void unset_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr);
* Created by slicc definition of Module "${{self.short}}"
*/
#include <sys/types.h>
#include <unistd.h>
#include <cassert>
#include <sstream>
#include <string>
@ -990,6 +993,9 @@ $c_ident::${{action.ident}}(const Address& addr)
// Auto generated C++ code started by $__file__:$__line__
// ${ident}: ${{self.short}}
#include <sys/types.h>
#include <unistd.h>
#include <cassert>
#include "base/misc.hh"

View file

@ -113,7 +113,7 @@ initSignals()
EmbeddedPython *EmbeddedPython::importer = NULL;
PyObject *EmbeddedPython::importerModule = NULL;
EmbeddedPython::EmbeddedPython(const char *filename, const char *abspath,
const char *modpath, const char *code, int zlen, int len)
const char *modpath, const unsigned char *code, int zlen, int len)
: filename(filename), abspath(abspath), modpath(modpath), code(code),
zlen(zlen), len(len)
{

View file

@ -36,6 +36,8 @@
*/
#include <list>
#include <inttypes.h>
#ifndef PyObject_HEAD
struct _object;
typedef _object PyObject;
@ -46,12 +48,12 @@ struct EmbeddedPython
const char *filename;
const char *abspath;
const char *modpath;
const char *code;
const uint8_t *code;
int zlen;
int len;
EmbeddedPython(const char *filename, const char *abspath,
const char *modpath, const char *code, int zlen, int len);
const char *modpath, const uint8_t *code, int zlen, int len);
PyObject *getCode() const;
bool addModule() const;