[ScopInfo] Use MemoryAccess::getScopArrayInfo() interface to access Array [NFC]

By using the public interface MemoryAccess::getScopArrayInfo() we avoid the
direct access to the ScopArrayInfoMap and as a result also do not need to
use the BasePtr as key. This change makes the code cleaner.

The const-cast we introduce is a little ugly. We may consider to drop const
correctness for getScopArrayInfo() at some point.

This change removes unnecessary uses of MemoryAddress::getBaseAddr() in
preparation for https://reviews.llvm.org/D28518.

llvm-svn: 294655
This commit is contained in:
Tobias Grosser 2017-02-09 23:24:57 +00:00
parent 9c7d181c92
commit e24b7b929d
1 changed files with 2 additions and 3 deletions

View File

@ -3332,9 +3332,8 @@ void Scop::updateAccessDimensionality() {
if (!Access->isArrayKind())
continue;
ScopArrayInfo *Array =
ScopArrayInfoMap[std::make_pair(Access->getBaseAddr(),
MemoryKind::Array)]
.get();
const_cast<ScopArrayInfo *>(Access->getScopArrayInfo());
if (Array->getNumberOfDimensions() != 1)
continue;
unsigned DivisibleSize = Array->getElemSizeInBytes();