| 137 | } |
| 138 | |
| 139 | void emitCommandLine(ostream *out) { |
| 140 | #ifdef __linux__ |
| 141 | ifstream cmd_args("/proc/self/cmdline"); |
| 142 | if (!cmd_args.is_open()) { |
| 143 | return; |
| 144 | } |
| 145 | *out << "Command line:"; |
| 146 | std::string arg; |
| 147 | while (std::getline(cmd_args, arg, '\0')) |
| 148 | *out << " '" << arg << "'"; |
| 149 | *out << "\n"; |
| 150 | #endif |
| 151 | } |
| 152 | |
| 153 | struct TVLegacyPass final : public llvm::ModulePass { |
| 154 | static char ID; |