| 129 | } |
| 130 | |
| 131 | void TargetLibAnalyzer::loadExternals(const std::string &ExternLibDir) { |
| 132 | if (!fs::is_directory(ExternLibDir)) |
| 133 | return; |
| 134 | |
| 135 | std::unique_ptr<TargetLib> TL = std::make_unique<TargetLib>(); |
| 136 | for (auto &ExternFilePath : util::readDirectory(ExternLibDir)) { |
| 137 | auto ExternJsonStr = util::readFile(ExternFilePath.c_str()); |
| 138 | if (ExternJsonStr.empty()) |
| 139 | continue; |
| 140 | |
| 141 | TL->fromJson(util::strToJson(ExternJsonStr)); |
| 142 | |
| 143 | std::istringstream Iss(ExternJsonStr); |
| 144 | Json::CharReaderBuilder Reader; |
| 145 | Json::Value JsonValue; |
| 146 | Json::parseFromStream(Reader, Iss, &JsonValue, nullptr); |
| 147 | AllocSizeReport.fromJson(JsonValue); |
| 148 | ArrayReport.fromJson(JsonValue); |
| 149 | ConstReport.fromJson(JsonValue); |
| 150 | DirectionReport.fromJson(JsonValue); |
| 151 | FilePathReport.fromJson(JsonValue); |
| 152 | LoopReport.fromJson(JsonValue); |
| 153 | ParamNumberReport.fromJson(JsonValue); |
| 154 | TargetReport.fromJson(JsonValue); |
| 155 | } |
| 156 | MergedExternLib = std::move(TL); |
| 157 | } |
| 158 | |
| 159 | void TargetLibAnalyzer::prepareLLVMAnalysis(llvm::Module &M) { |
| 160 | llvm::PassBuilder PB; |
nothing calls this directly
no test coverage detected