about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Module/KInstruction.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Module/KInstruction.cpp b/lib/Module/KInstruction.cpp
index a32745b8..d1e6c470 100644
--- a/lib/Module/KInstruction.cpp
+++ b/lib/Module/KInstruction.cpp
@@ -8,6 +8,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "klee/Internal/Module/KInstruction.h"
+#include "llvm/Support/raw_ostream.h"
+#include <string>
 
 using namespace llvm;
 using namespace klee;
@@ -18,9 +20,15 @@ KInstruction::~KInstruction() {
   delete[] operands;
 }
 
-void KInstruction::printFileLine(llvm::raw_ostream &debugFile) {
+void KInstruction::printFileLine(llvm::raw_ostream &debugFile) const {
   if (info->file != "")
     debugFile << info->file << ":" << info->line;
-  else
-    debugFile << "[no debug info]";
+  else debugFile << "[no debug info]";
+}
+
+std::string KInstruction::printFileLine() const {
+  std::string str;
+  llvm::raw_string_ostream oss(str);
+  printFileLine(oss);
+  return oss.str();
 }