| 82 | } |
| 83 | |
| 84 | bool TargetLibAnalyzer::dump(std::string OutputFilePath) const { |
| 85 | if (!AnalyzedTargetLib) |
| 86 | return false; |
| 87 | |
| 88 | Json::Value Root = AnalyzedTargetLib->toJson(); |
| 89 | |
| 90 | for (auto &Report : Reports) { |
| 91 | if (!Report) |
| 92 | continue; |
| 93 | |
| 94 | auto ReportJson = Report->toJson(); |
| 95 | for (auto MemberName : ReportJson.getMemberNames()) |
| 96 | Root[MemberName] = ReportJson[MemberName]; |
| 97 | } |
| 98 | |
| 99 | Json::StreamWriterBuilder Writer; |
| 100 | std::ofstream Ofs(OutputFilePath); |
| 101 | Ofs << Json::writeString(Writer, Root); |
| 102 | Ofs.close(); |
| 103 | return true; |
| 104 | } |
| 105 | |
| 106 | const SourceCollection *TargetLibAnalyzer::getSourceCollection() const { |
| 107 | return SC.get(); |
nothing calls this directly
no test coverage detected