mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-14 07:09:08 +00:00
Fix map insertion that is elided in release build.
The assert() macro doesn't actually execute its body in Release builds, so using it to check cache invariants requires that the insertion be outside of the assert() statement. This change does that, and also makes sure to return the actual map contents. llvm-svn: 284898
This commit is contained in:
parent
0a8e85fca2
commit
664039935e
@ -558,10 +558,10 @@ namespace llvm {
|
|||||||
auto It = RewriteResults.find(S);
|
auto It = RewriteResults.find(S);
|
||||||
if (It != RewriteResults.end())
|
if (It != RewriteResults.end())
|
||||||
return It->second;
|
return It->second;
|
||||||
auto *Result = SCEVVisitor<SC, const SCEV *>::visit(S);
|
auto* Visited = SCEVVisitor<SC, const SCEV *>::visit(S);
|
||||||
assert(RewriteResults.insert({S, Result}).second &&
|
auto Result = RewriteResults.try_emplace(S, Visited);
|
||||||
"Should insert a new entry");
|
assert(Result.second && "Should insert a new entry");
|
||||||
return Result;
|
return Result.first->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SCEV *visitConstant(const SCEVConstant *Constant) {
|
const SCEV *visitConstant(const SCEVConstant *Constant) {
|
||||||
|
Loading…
Reference in New Issue
Block a user