summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTiago Muck <tiago.muck@arm.com>2019-01-24 15:40:46 -0600
committerTiago Mück <tiago.muck@arm.com>2019-05-28 16:13:47 +0000
commitcdc03f96a70b659ba3067c2dae1901aac5cda9df (patch)
tree22c71214eec9af6d441c924839a0c47ec52008d9 /src
parentf318dfec10cc8a027a2365acce377a55cb9de5e8 (diff)
downloadgem5-cdc03f96a70b659ba3067c2dae1901aac5cda9df.tar.xz
base: Add warn_if_once macro
Change-Id: Ie68f3b07a35ed2e6b0eee20b3b34050542fcdc6c Signed-off-by: Tiago Muck <tiago.muck@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18420 Reviewed-by: Brandon Potter <Brandon.Potter@amd.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/base/logging.hh8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/base/logging.hh b/src/base/logging.hh
index 1c504d22e..70400374d 100644
--- a/src/base/logging.hh
+++ b/src/base/logging.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2017 ARM Limited
+ * Copyright (c) 2014, 2017, 2019 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -231,6 +231,12 @@ class Logger
warn(__VA_ARGS__); \
} while (0)
+#define warn_if_once(cond, ...) \
+ do { \
+ if ((cond)) \
+ warn_once(__VA_ARGS__); \
+ } while (0)
+
/**
* The chatty assert macro will function like a normal assert, but will allow
* the specification of additional, helpful material to aid debugging why the