Skip to content
Merged
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
12 changes: 8 additions & 4 deletions cpp2rust/converter/translation_rule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,18 @@ void LoadIrSrc(ExprRules &exprs, TypeRules &types,
auto val = entry_val.getAsString();
if (name[0] == 'f') {
auto it = exprs.find(name);
if (it != exprs.end()) {
it->second.src = val->str();
if (it == exprs.end()) {
llvm::errs() << name << '\n';
assert(0 && "ir_src.json expr entry has no matching IR target rule");
}
it->second.src = val->str();
} else if (name[0] == 't') {
auto it = types.find(name);
if (it != types.end()) {
it->second.src = val->str();
if (it == types.end()) {
llvm::errs() << name << '\n';
assert(0 && "ir_src.json type entry has no matching IR target rule");
}
it->second.src = val->str();
}
}
}
Expand Down
Loading