Skip to content

Commit

Permalink
Couple quick changes from getIndexedType() back to *gi using the brid…
Browse files Browse the repository at this point in the history
…gedIterator
  • Loading branch information
jcarlson23 committed May 7, 2017
1 parent 31cffc2 commit 9ef3981
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/MemoryModel/LocMemModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ bool LocSymTableInfo::computeGepOffset(const llvm::User *V, LocationSet& ls) {
// Handling pointer types
// These GEP instructions are simply making address computations from the base pointer address
// e.g. idx1 = (char*) &MyVar + 4, at this case gep only one offset index (idx)
if (const PointerType* pty = dyn_cast<PointerType>(gi.getIndexedType())) {
if (const PointerType* pty = dyn_cast<PointerType>(*gi)) {
const Type* et = pty->getElementType();
Size_t sz = getTypeSizeInBytes(et);
ls.offset += idx * sz;
}
// Calculate the size of the array element
else if(const ArrayType* at = dyn_cast<ArrayType>(gi.getIndexedType())) {
else if(const ArrayType* at = dyn_cast<ArrayType>(*gi)) {
const Type* et = at->getElementType();
Size_t sz = getTypeSizeInBytes(et);
ls.offset += idx * sz;
Expand Down

0 comments on commit 9ef3981

Please sign in to comment.