From 89048e6d1702b7ffc9fa176a46ed02b3600435c0 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Mon, 13 Aug 2018 15:05:04 +0000 Subject: [PATCH] Function-pointer remvoval: print human-friendly debug messages --- src/goto-programs/remove_const_function_pointers.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/goto-programs/remove_const_function_pointers.cpp b/src/goto-programs/remove_const_function_pointers.cpp index 2c2a0144583..531a9bbc51a 100644 --- a/src/goto-programs/remove_const_function_pointers.cpp +++ b/src/goto-programs/remove_const_function_pointers.cpp @@ -12,6 +12,7 @@ Author: Thomas Kiley, thomas.kiley@diffblue.com #include "remove_const_function_pointers.h" #include +#include #include #include #include @@ -19,8 +20,11 @@ Author: Thomas Kiley, thomas.kiley@diffblue.com #include "goto_functions.h" #define LOG(message, irep) \ - debug() << "Case " << __LINE__ << " : " << message << "\n" \ - << irep.pretty() << eom; + do { \ + debug().source_location = irep.source_location(); \ + debug() << message << ": " << format(irep) << eom; \ + } \ + while(0) /// To take a function call on a function pointer, and if possible resolve it to /// a small collection of possible values.