From 3d5fa3f4d2b271e72235478b492a471536269547 Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Sat, 24 Sep 2016 04:54:03 +0000 Subject: [PATCH] [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 --- include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h | 4 ++-- lib/CodeGen/GlobalISel/RegisterBankInfo.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h b/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h index 0d9df7a6f55..757c4c44365 100644 --- a/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h +++ b/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h @@ -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 MapOfPartialMappings; + mutable DenseMap MapOfPartialMappings; /// Keep dynamically allocated ValueMapping in a separate map. /// This shouldn't be needed when everything gets TableGen'ed. - mutable DenseMap MapOfValueMappings; + mutable DenseMap MapOfValueMappings; /// Create a RegisterBankInfo that can accomodate up to \p NumRegBanks /// RegisterBank instances. diff --git a/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp b/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp index 52963caa8bf..bac9ba860bf 100644 --- a/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp +++ b/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp @@ -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; }