Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/40952 )

Change subject: scons: More narrowly target -Wno-self-assign.
......................................................................

scons: More narrowly target -Wno-self-assign.

This flag was necessary because of self assignments in the ISA parser
where self assignments are often hints to the parser itself, and in one
case because a pybind-ism used to attach the -= operator looked like a
self assignment.

This change narrows the scope of the flag that disables this warning to
only files generated by the ISA parser, and the single file in the
systemc code which uses that operator overload.

Change-Id: Ib64fc72e46f894cba9064afcdbdcc5859c30e745
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40952
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M SConstruct
M src/arch/SConscript
M src/systemc/core/SConscript
3 files changed, 10 insertions(+), 6 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/SConstruct b/SConstruct
index 55ca0ef..9167acc 100755
--- a/SConstruct
+++ b/SConstruct
@@ -375,10 +375,8 @@
               'Installed version:', main['CXXVERSION'])

     # clang has a few additional warnings that we disable, extraneous
-    # parantheses are allowed due to Ruby's printing of the AST,
-    # finally self assignments are allowed as the generated CPU code
-    # is relying on this
-    main.Append(CCFLAGS=['-Wno-parentheses', '-Wno-self-assign'])
+    # parantheses are allowed due to Ruby's printing of the AST.
+    main.Append(CCFLAGS=['-Wno-parentheses'])
     conf.CheckCxxFlag('-Wno-c99-designator')
     conf.CheckCxxFlag('-Wno-defaulted-function-deleted')

diff --git a/src/arch/SConscript b/src/arch/SConscript
index 3c7d6cf..73c6afb 100644
--- a/src/arch/SConscript
+++ b/src/arch/SConscript
@@ -191,7 +191,10 @@
     # These generated files are also top level sources.
     def source_gen(name):
         add_gen(name)
-        Source(gen_file(name))
+        append = {}
+        if env['CLANG']:
+            append['CCFLAGS'] = ['-Wno-self-assign']
+        Source(gen_file(name), append=append)

     source_gen('decoder.cc')

diff --git a/src/systemc/core/SConscript b/src/systemc/core/SConscript
index 0373046..b5d0ea9 100644
--- a/src/systemc/core/SConscript
+++ b/src/systemc/core/SConscript
@@ -62,4 +62,7 @@
     if env['USE_PYTHON']:
         Source('python.cc')
         Source('sc_main_python.cc')
-        Source('sc_time_python.cc')
+        append = {}
+        if env['CLANG']:
+            append['CCFLAGS'] = '-Wno-self-assign-overloaded'
+        Source('sc_time_python.cc', append=append)



13 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40952
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: Ib64fc72e46f894cba9064afcdbdcc5859c30e745
Gerrit-Change-Number: 40952
Gerrit-PatchSet: 15
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to