Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/50333 )

Change subject: scons: Make debug flags respect tags.
......................................................................

scons: Make debug flags respect tags.

Debug flags can have their own tags which will apply to the .cc file
they create.

Change-Id: I16911252176a5a8df0e56c0e37a3c11b4cf1dd7b
---
M src/SConscript
1 file changed, 11 insertions(+), 12 deletions(-)



diff --git a/src/SConscript b/src/SConscript
index 4036d7e..ef4869e 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -653,25 +653,25 @@
 #
 # Debug Flags
 #
-debug_flags = {}
-def DebugFlag(name, desc=None, fmt=False):
+debug_flags = set()
+def DebugFlag(name, desc=None, fmt=False, tags=None, add_tags=None):
     if name == "All":
         raise AttributeError('The "All" flag name is reserved')
     if name in debug_flags:
         raise AttributeError('Flag {} already specified'.format(name))
-    debug_flags[name] = (name, (), desc, fmt)
+    debug_flags.add((name, (), desc, fmt, tags, add_tags))

-def CompoundFlag(name, flags, desc=None):
+def CompoundFlag(name, flags, desc=None, tags=None, add_tags=None):
     if name == "All":
         raise AttributeError('The "All" flag name is reserved')
     if name in debug_flags:
         raise AttributeError('Flag {} already specified'.format(name))

     compound = tuple(flags)
-    debug_flags[name] = (name, compound, desc, False)
+    debug_flags.add((name, compound, desc, False, tags, add_tags))

-def DebugFormatFlag(name, desc=None):
-    DebugFlag(name, desc, True)
+def DebugFormatFlag(name, desc=None, tags=None, add_tags=None):
+    DebugFlag(name, desc, True, tags=tags, add_tags=add_tags)

 Export('DebugFlag')
 Export('CompoundFlag')
@@ -1106,7 +1106,7 @@
     assert(len(target) == 2 and len(source) == 1)

     val = eval(source[0].get_contents())
-    name, compound, desc, fmt = val
+    name, compound, desc, fmt, tags, add_tags = val

     code = code_formatter()

@@ -1178,15 +1178,14 @@
     code.write(str(target[1]))

 # Generate the files for the debug and debug-format flags
-for name,flag in sorted(debug_flags.items()):
-    n, compound, desc, fmt = flag
-    assert n == name
+for flag in sorted(debug_flags, key=lambda flag: flag[0]):
+    name, compound, desc, fmt, tags, add_tags = flag

     hh_file = 'debug/%s.hh' % name
     cc_file = 'debug/%s.cc' % name
     env.Command([hh_file, cc_file], Value(flag),
                 MakeAction(makeDebugFlag, Transform("TRACING", 0)))
-    Source(cc_file)
+    Source(cc_file, tags=tags, add_tags=add_tags)

 # version tags
 tags = \

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50333
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: I16911252176a5a8df0e56c0e37a3c11b4cf1dd7b
Gerrit-Change-Number: 50333
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
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