Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Jonas Rickert <Scientific Computing>
Sebastian Kreutzer <Scientific Computing>
Tim Heldmann <Scientific Computing>
Marek Beckmann <Scientific Computing>

Silas Martens <Scientific Computing>

External Contributors
Jan-Patrick Lehr <AMD>
7 changes: 5 additions & 2 deletions cgcollector/lib/src/JSONManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,11 @@ nlohmann::json buildFromJSONv2(FuncMapT& functionMap, const std::string& filenam
auto ps = it.value()["callers"].get<std::set<std::string>>();
fi.parents.insert(ps.begin(), ps.end());

readNumStmts(it.value(), fi);
readFileOrigin(it.value(), fi);
if(!it.value()["meta"].is_null()) {
readNumStmts(it.value(), fi);
readFileOrigin(it.value(), fi);
}

}

// Now the functions map holds all the information
Expand Down
14 changes: 9 additions & 5 deletions cgcollector/tools/CGMerge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ nlohmann::json mergeFileFormatTwo(const std::string& wholeCGFilename, const std:
} else {
auto& c = wholeCG[it.key()];
auto& v = it.value();
if (v["meta"].is_null()) {
doMerge(c, v); // skip merging metadata

// TODO multiple bodies possible, if the body is in header?
// TODO separate merge of meta information
if (v["hasBody"].get<bool>() && c["hasBody"].get<bool>()) {
} else if (v["hasBody"].get<bool>() && c["hasBody"].get<bool>()) {
// std::cout << "WARNING: merge of " << it.key()
// << " has detected multiple bodies (equal number of statements would be good.)" << std::endl;
// TODO check for equal values
Expand Down Expand Up @@ -105,10 +108,11 @@ nlohmann::json mergeFileFormatTwo(const std::string& wholeCGFilename, const std:
// callees, isVirtual, doesOverride and overriddenFunctions unchanged
// hasBody unchanged
// numStatements unchanged
} else {
// nothing special
}
if (!c["meta"].contains("estimateCallCount") && v["meta"].contains("estimateCallCount")) {
}

if (c["meta"].is_null()) {
// Metadata is null, nothing to merge
} else if (!c["meta"].contains("estimateCallCount") && v["meta"].contains("estimateCallCount")) {
c["meta"]["estimateCallCount"] = v["meta"]["estimateCallCount"];
} else if (c["meta"].contains("estimateCallCount") && v["meta"].contains("estimateCallCount")) {
auto& ccalls = c["meta"]["estimateCallCount"]["calls"];
Expand Down