systemc: Fix clang9 linker error
authorJason Lowe-Power <jason@lowepower.com>
Sat, 23 May 2020 02:13:46 +0000 (19:13 -0700)
committerBobby R. Bruce <bbruce@ucdavis.edu>
Sat, 23 May 2020 05:27:23 +0000 (05:27 +0000)
Likely a compiler bug, but if this function is allowed to be inlined,
clang9 throws a linker error. Fix this error by making sure the function
isn't inlined.

Change-Id: I4bfade889796915e7bb4b224eafa6e72d4ec59da
Issue-on: https://gem5.atlassian.net/projects/GEM5/issues/GEM5-597
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29394
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
src/systemc/core/scheduler.cc
src/systemc/core/scheduler.hh

index 179bd5523dc033f889af3f0c91e6cbc2c864eaee..f94c2049941e12cc05cf625e30fa8201f7b185ee 100644 (file)
@@ -479,6 +479,13 @@ Scheduler::scheduleStop(bool finish_delta)
     schedule(&stopEvent);
 }
 
+void
+Scheduler::scheduleTimeAdvancesEvent()
+{
+    if (!traceFiles.empty() && !timeAdvancesEvent.scheduled())
+        schedule(&timeAdvancesEvent);
+}
+
 void
 Scheduler::trace(bool delta)
 {
index c9ca161cf17fe5a44f145f49fbbefdec17127ace..e7c7290e30999c37671ebcb79c2b658bc340b941 100644 (file)
@@ -459,12 +459,7 @@ class Scheduler
 
     void timeAdvances() { trace(false); }
     EventWrapper<Scheduler, &Scheduler::timeAdvances> timeAdvancesEvent;
-    void
-    scheduleTimeAdvancesEvent()
-    {
-        if (!traceFiles.empty() && !timeAdvancesEvent.scheduled())
-            schedule(&timeAdvancesEvent);
-    }
+    void scheduleTimeAdvancesEvent();
 
     uint64_t _numCycles;
     uint64_t _changeStamp;