about summary refs log tree commit diff homepage
path: root/lib/Module/KModule.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2014-09-13 11:29:19 -0700
committerDaniel Dunbar <daniel@zuster.org>2014-09-13 11:29:32 -0700
commit2ce22af434e383cf0c2c65e4da829de630b6cd9d (patch)
treec49e4a0461ffa7c95adfa0fefd15bbc10b654c1f /lib/Module/KModule.cpp
parent91eab8b92526a8215ebc9ed50da5b1d405533ac7 (diff)
downloadklee-2ce22af434e383cf0c2c65e4da829de630b6cd9d.tar.gz
Add KLEE specific DEBUG macros.
 - This allows us to build in +Asserts mode even when LLVM isn't (by disabling
   the checks in that mode).

 - Eventually it would be nice to just move off of LLVM's DEBUG infrastructure
   entirely and just have our own copy, but this works for now.

 - Fixes #150.
Diffstat (limited to 'lib/Module/KModule.cpp')
-rw-r--r--lib/Module/KModule.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp
index 697b6ea9..57e0c4fe 100644
--- a/lib/Module/KModule.cpp
+++ b/lib/Module/KModule.cpp
@@ -19,6 +19,7 @@
 #include "klee/Internal/Module/Cell.h"
 #include "klee/Internal/Module/KInstruction.h"
 #include "klee/Internal/Module/InstructionInfoTable.h"
+#include "klee/Internal/Support/Debug.h"
 #include "klee/Internal/Support/ModuleUtil.h"
 
 #include "llvm/Bitcode/ReaderWriter.h"
@@ -51,7 +52,6 @@
 
 #include <llvm/Transforms/Utils/Cloning.h>
 #include <llvm/Support/InstIterator.h>
-#include <llvm/Support/Debug.h>
 
 #include <sstream>
 
@@ -234,7 +234,8 @@ static void inlineChecks(Module *module, const char * functionName) {
     Function* runtimeCheckCall = module->getFunction(functionName);
     if (runtimeCheckCall == 0)
     {
-      DEBUG( klee_warning("Failed to inline %s because no calls were made to it in module", functionName) );
+      KLEE_DEBUG(klee_warning("Failed to inline %s because no calls were made "
+                              "to it in module", functionName));
       return;
     }
 
@@ -264,17 +265,19 @@ static void inlineChecks(Module *module, const char * functionName) {
       }
     }
 
-    DEBUG( klee_message("Tried to inline calls to %s. %u successes, %u failures",functionName, successCount, failCount) );
+    KLEE_DEBUG(klee_message("Tried to inline calls to %s. %u successes, "
+                            "%u failures", functionName, successCount,
+                            failCount));
 }
 
 void KModule::addInternalFunction(const char* functionName){
   Function* internalFunction = module->getFunction(functionName);
   if (!internalFunction) {
-    DEBUG_WITH_TYPE("KModule", klee_warning(
+    KLEE_DEBUG_WITH_TYPE("KModule", klee_warning(
         "Failed to add internal function %s. Not found.", functionName));
     return ;
   }
-  DEBUG( klee_message("Added function %s.",functionName));
+  KLEE_DEBUG(klee_message("Added function %s.",functionName));
   internalFunctions.insert(internalFunction);
 }