Andreas Sandberg has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/34116 )
Change subject: scons: Simplify arch enum generation
......................................................................
scons: Simplify arch enum generation
C++ allows a trailing comma after the last item in an enum, so there
is no need for a special case.
Change-Id: I6ead36b4a8562b4a7a5aec88e4f6390182eedf56
Signed-off-by: Andreas Sandberg <andreas.sandb...@arm.com>
---
M src/SConscript
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/src/SConscript b/src/SConscript
index 4b6db44..9f82bdc 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -645,11 +645,8 @@
# create an enum for any run-time determination of the ISA, we
# reuse the same name as the namespaces
code('enum class Arch {')
- for i,isa in enumerate(isas):
- if i + 1 == len(isas):
- code(' $0 = $1', namespace(isa), define(isa))
- else:
- code(' $0 = $1,', namespace(isa), define(isa))
+ for isa in isas:
+ code(' $0 = $1,', namespace(isa), define(isa))
code('};')
code('''
@@ -690,11 +687,8 @@
# create an enum for any run-time determination of the ISA, we
# reuse the same name as the namespaces
code('enum class GPUArch {')
- for i,isa in enumerate(isas):
- if i + 1 == len(isas):
- code(' $0 = $1', namespace(isa), define(isa))
- else:
- code(' $0 = $1,', namespace(isa), define(isa))
+ for isa in isas:
+ code(' $0 = $1,', namespace(isa), define(isa))
code('};')
code('''
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/34116
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I6ead36b4a8562b4a7a5aec88e4f6390182eedf56
Gerrit-Change-Number: 34116
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s