MCPcopy Create free account
hub / github.com/Samsung/UTopia / UTLoader

Method UTLoader

lib/utanalysis/UTLoader.cpp:14–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12namespace fs = std::experimental::filesystem;
13
14UTLoader::UTLoader(std::shared_ptr<SourceLoader> SrcLoader,
15 std::shared_ptr<APILoader> APILoader,
16 std::vector<std::string> ReportPaths) {
17 if (SrcLoader)
18 Source = SrcLoader->load();
19
20 if (APILoader)
21 APIs = APILoader->load();
22
23 for (auto &Path : ReportPaths) {
24 if (!fs::is_directory(Path))
25 continue;
26
27 for (auto &ReportFile : util::readDirectory(Path)) {
28 auto JsonValue = util::parseJsonFileToJsonValue(ReportFile.c_str());
29 AllocSizeReport.fromJson(JsonValue);
30 ArrayReport.fromJson(JsonValue);
31 ConstReport.fromJson(JsonValue);
32 DirectionReport.fromJson(JsonValue);
33 FilePathReport.fromJson(JsonValue);
34 LoopReport.fromJson(JsonValue);
35 TypeReport.fromJson(JsonValue);
36 }
37 }
38
39 if (Source) {
40 AllocSizeAnalyzer AAnalyzer(Source->getLLVMModule(), &AllocSizeReport);
41 AllocSizeReport = AAnalyzer.result();
42 }
43}
44
45const std::set<std::string> &UTLoader::getAPIs() const { return APIs; }
46

Callers

nothing calls this directly

Calls 5

readDirectoryFunction · 0.85
parseJsonFileToJsonValueFunction · 0.85
getLLVMModuleMethod · 0.80
loadMethod · 0.45
fromJsonMethod · 0.45

Tested by

no test coverage detected