1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

[RegisterBankInfo] Constify the member of the XXXMapping maps.

This makes it obvious that items in those maps behave like statically
created objects.

llvm-svn: 282327
This commit is contained in:
Quentin Colombet 2016-09-24 04:54:03 +00:00
parent c04a3667f5
commit 3d5fa3f4d2
2 changed files with 4 additions and 4 deletions

View File

@ -361,11 +361,11 @@ protected:
/// Keep dynamically allocated PartialMapping in a separate map.
/// This shouldn't be needed when everything gets TableGen'ed.
mutable DenseMap<unsigned, PartialMapping *> MapOfPartialMappings;
mutable DenseMap<unsigned, const PartialMapping *> MapOfPartialMappings;
/// Keep dynamically allocated ValueMapping in a separate map.
/// This shouldn't be needed when everything gets TableGen'ed.
mutable DenseMap<unsigned, ValueMapping *> MapOfValueMappings;
mutable DenseMap<unsigned, const ValueMapping *> MapOfValueMappings;
/// Create a RegisterBankInfo that can accomodate up to \p NumRegBanks
/// RegisterBank instances.

View File

@ -344,7 +344,7 @@ RegisterBankInfo::getPartialMapping(unsigned StartIdx, unsigned Length,
++NumPartialMappingsCreated;
PartialMapping *&PartMapping = MapOfPartialMappings[Hash];
const PartialMapping *&PartMapping = MapOfPartialMappings[Hash];
PartMapping = new PartialMapping{StartIdx, Length, RegBank};
return *PartMapping;
}
@ -376,7 +376,7 @@ RegisterBankInfo::getValueMapping(const PartialMapping *BreakDown,
++NumValueMappingsCreated;
ValueMapping *&ValMapping = MapOfValueMappings[Hash];
const ValueMapping *&ValMapping = MapOfValueMappings[Hash];
ValMapping = new ValueMapping{BreakDown, NumBreakDowns};
return *ValMapping;
}