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

Method loadExternals

lib/target_analysis/TargetLibAnalyzer.cpp:131–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void 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
159void TargetLibAnalyzer::prepareLLVMAnalysis(llvm::Module &M) {
160 llvm::PassBuilder PB;

Callers

nothing calls this directly

Calls 6

readDirectoryFunction · 0.85
readFileFunction · 0.85
strToJsonFunction · 0.85
parseFromStreamFunction · 0.85
emptyMethod · 0.80
fromJsonMethod · 0.45

Tested by

no test coverage detected