read a whole stream to a string
| 42 | |
| 43 | // read a whole stream to a string |
| 44 | std::string read_all(std::istream& i, Result& res) { |
| 45 | std::string one; |
| 46 | std::string ret; |
| 47 | try { |
| 48 | while (std::getline(i, one).good()) { |
| 49 | ret += one; |
| 50 | ret += "\n"; |
| 51 | } |
| 52 | } catch (std::exception& e) { |
| 53 | res.addEntry("EUKN", "Failed to read from output stream", {{"Error Message", e.what()}}); |
| 54 | return ""; |
| 55 | } |
| 56 | ret += one; |
| 57 | return ret; |
| 58 | } |
| 59 | |
| 60 | // Compile C code to a llvm::Module |
| 61 | std::unique_ptr<llvm::Module> compileCCode(const char* execPath, boost::string_view code, |
no test coverage detected