[llvm] r282327 - [RegisterBankInfo] Constify the member of the XXXMapping maps.
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 23 21:54:04 PDT 2016
Author: qcolombet
Date: Fri Sep 23 23:54:03 2016
New Revision: 282327
URL: http://llvm.org/viewvc/llvm-project?rev=282327&view=rev
Log:
[RegisterBankInfo] Constify the member of the XXXMapping maps.
This makes it obvious that items in those maps behave like statically
created objects.
Modified:
llvm/trunk/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h
llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp
Modified: llvm/trunk/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h?rev=282327&r1=282326&r2=282327&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h (original)
+++ llvm/trunk/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h Fri Sep 23 23:54:03 2016
@@ -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.
Modified: llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp?rev=282327&r1=282326&r2=282327&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp Fri Sep 23 23:54:03 2016
@@ -344,7 +344,7 @@ RegisterBankInfo::getPartialMapping(unsi
++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
++NumValueMappingsCreated;
- ValueMapping *&ValMapping = MapOfValueMappings[Hash];
+ const ValueMapping *&ValMapping = MapOfValueMappings[Hash];
ValMapping = new ValueMapping{BreakDown, NumBreakDowns};
return *ValMapping;
}
More information about the llvm-commits
mailing list