From e0aff85c24c039606d82d209617a1334a9ed21e2 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Tue, 8 May 2018 11:30:58 +0100 Subject: Remove the option for truncating lines in assembly.ll The behaviour couldn't be triggered for a kcachegrind from 2012. --- lib/Module/KModule.cpp | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp index 0f0d8fed..75e71c0a 100644 --- a/lib/Module/KModule.cpp +++ b/lib/Module/KModule.cpp @@ -54,10 +54,6 @@ namespace { eSwitchTypeLLVM, eSwitchTypeInternal }; - - cl::opt - NoTruncateSourceLines("no-truncate-source-lines", - cl::desc("Don't truncate long lines in the output source")); cl::opt OutputSource("output-source", @@ -273,42 +269,10 @@ void KModule::prepare(const Interpreter::ModuleOptions &opts, klee_error("Unexpected instruction operand types detected"); } - // Write out the .ll assembly file. We truncate long lines to work - // around a kcachegrind parsing bug (it puts them on new lines), so - // that source browsing works. if (OutputSource) { - llvm::raw_fd_ostream *os = ih->openOutputFile("assembly.ll"); + std::unique_ptr os(ih->openOutputFile("assembly.ll")); assert(os && !os->has_error() && "unable to open source output"); - - // We have an option for this in case the user wants a .ll they - // can compile. - if (NoTruncateSourceLines) { - *os << *module; - } else { - std::string string; - llvm::raw_string_ostream rss(string); - rss << *module; - rss.flush(); - const char *position = string.c_str(); - - for (;;) { - const char *end = index(position, '\n'); - if (!end) { - *os << position; - break; - } else { - unsigned count = (end - position) + 1; - if (count<255) { - os->write(position, count); - } else { - os->write(position, 254); - *os << "\n"; - } - position = end+1; - } - } - } - delete os; + *os << *module; } if (OutputModule) { -- cgit 1.4.1