summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiacomo Gabrielli <giacomo.gabrielli@arm.com>2018-10-23 13:34:05 +0100
committerGiacomo Gabrielli <giacomo.gabrielli@arm.com>2019-05-30 15:56:17 +0000
commite12da9b084c67c5f66359273ac3a9ec427953108 (patch)
tree22ccc23f398ae654bf3588620284fb75a6b9dd78
parentfc61172dbe4e3a93f941227a1f36b7f07e97ab68 (diff)
downloadgem5-e12da9b084c67c5f66359273ac3a9ec427953108.tar.xz
arch: Add include guards to auto-gen. decode header
Change-Id: I03bfc9035b82bc1a42e799cf645d43cb5dafb4cb Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18911 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
-rwxr-xr-xsrc/arch/isa_parser.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py
index 48bc23fa3..7f09b1665 100755
--- a/src/arch/isa_parser.py
+++ b/src/arch/isa_parser.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, 2016, 2019 ARM Limited
+# Copyright (c) 2014, 2016, 2018-2019 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
@@ -1652,6 +1652,9 @@ class ISAParser(Grammar):
# decoder header - everything depends on this
file = 'decoder.hh'
with self.open(file) as f:
+ f.write('#ifndef __ARCH_%(isa)s_GENERATED_DECODER_HH__\n'
+ '#define __ARCH_%(isa)s_GENERATED_DECODER_HH__\n\n' %
+ {'isa': self.isa_name.upper()})
fn = 'decoder-g.hh.inc'
assert(fn in self.files)
f.write('#include "%s"\n' % fn)
@@ -1660,6 +1663,8 @@ class ISAParser(Grammar):
assert(fn in self.files)
f.write('namespace %s {\n#include "%s"\n}\n'
% (self.namespace, fn))
+ f.write('\n#endif // __ARCH_%s_GENERATED_DECODER_HH__\n' %
+ self.isa_name.upper())
# decoder method - cannot be split
file = 'decoder.cc'