| 132 | }; |
| 133 | |
| 134 | std::vector<const char *> readCompilerArgumentsFromFile(const std::string &path) { |
| 135 | auto mbOrErr = MemoryBuffer::getFile(path); |
| 136 | if (!mbOrErr) |
| 137 | return {}; |
| 138 | std::vector<const char *> args; |
| 139 | for (line_iterator i(*mbOrErr.get(), true, '#'), e; i != e; ++i) { |
| 140 | std::string line(*i); |
| 141 | doPathMapping(line); |
| 142 | args.push_back(intern(line)); |
| 143 | } |
| 144 | return args; |
| 145 | } |
| 146 | |
| 147 | bool appendToCDB(const std::vector<const char *> &args) { |
| 148 | return args.size() && StringRef("%compile_commands.json") == args[0]; |
no test coverage detected