]> granicus.if.org Git - llvm/commitdiff
[RegisterBankInfo] Constify the member of the XXXMapping maps.
authorQuentin Colombet <qcolombet@apple.com>
Sat, 24 Sep 2016 04:54:03 +0000 (04:54 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Sat, 24 Sep 2016 04:54:03 +0000 (04:54 +0000)
This makes it obvious that items in those maps behave like statically
created objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282327 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h
lib/CodeGen/GlobalISel/RegisterBankInfo.cpp

index 0d9df7a6f550f8173bf3814990f652d829d87612..757c4c4436512a3cd16a986b5a080baec9af8605 100644 (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.
index 52963caa8bf77f76c4c686f0cfde88d992bea6cc..bac9ba860bf3e62c064874b4f4a7ad62dfb933d8 100644 (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;
 }