[polly] r249545 - IRBuilder: Use Map.lookup instead of Map.find [NFC]
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 7 06:35:21 PDT 2015
Author: grosser
Date: Wed Oct 7 08:35:20 2015
New Revision: 249545
URL: http://llvm.org/viewvc/llvm-project?rev=249545&view=rev
Log:
IRBuilder: Use Map.lookup instead of Map.find [NFC]
This simplifies the code.
Suggested-by: Johannes Doerfert
Modified:
polly/trunk/lib/CodeGen/IRBuilder.cpp
Modified: polly/trunk/lib/CodeGen/IRBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IRBuilder.cpp?rev=249545&r1=249544&r2=249545&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/IRBuilder.cpp (original)
+++ polly/trunk/lib/CodeGen/IRBuilder.cpp Wed Oct 7 08:35:20 2015
@@ -146,20 +146,18 @@ void ScopAnnotator::annotate(Instruction
if (!BasePtr)
return;
- auto AliasScopeIterator = AliasScopeMap.find(BasePtr);
+ auto AliasScope = AliasScopeMap.lookup(BasePtr);
- if (AliasScopeIterator == AliasScopeMap.end()) {
- auto I = AlternativeAliasBases.find(BasePtr);
- if (I == AlternativeAliasBases.end())
+ if (!AliasScope) {
+ BasePtr = AlternativeAliasBases.lookup(BasePtr);
+ if (!BasePtr)
return;
- BasePtr = I->second;
- AliasScopeIterator = AliasScopeMap.find(BasePtr);
- if (AliasScopeIterator == AliasScopeMap.end())
+ AliasScope = AliasScopeMap.lookup(BasePtr);
+ if (!AliasScope)
return;
}
- auto AliasScope = AliasScopeIterator->second;
assert(OtherAliasScopeListMap.count(BasePtr) &&
"BasePtr either expected in AliasScopeMap and OtherAlias...Map");
auto *OtherAliasScopeList = OtherAliasScopeListMap[BasePtr];
More information about the llvm-commits
mailing list