aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-06-21 17:43:06 +0200
committerNikita Popov <nikita.ppv@gmail.com>2021-06-21 18:36:32 +0200
commit9f779195d311c983031271d0243d6e6af988ce55 (patch)
treeaf38df7672a56ef20c7e3df270c27ef474602834 /llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
parent0a2d4f3f24a377dc7d3cbed16d30603dc27554a8 (diff)
downloadllvm-9f779195d311c983031271d0243d6e6af988ce55.zip
llvm-9f779195d311c983031271d0243d6e6af988ce55.tar.gz
llvm-9f779195d311c983031271d0243d6e6af988ce55.tar.bz2
[OpaquePtr] Return opaque pointer from opaque pointer GEP
For a GEP on an opaque pointer, also return an opaque pointer (or vector of opaque pointer) result. This requires explicitly enumerating the GEP source element type, because it is now no longer implicitly enumerated as part of either the source or result pointer types. Differential Revision: https://reviews.llvm.org/D104652
Diffstat (limited to 'llvm/lib/Bitcode/Writer/ValueEnumerator.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/ValueEnumerator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
index 80c230d..abfdcd6 100644
--- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -463,6 +463,8 @@ ValueEnumerator::ValueEnumerator(const Module &M,
}
if (auto *SVI = dyn_cast<ShuffleVectorInst>(&I))
EnumerateType(SVI->getShuffleMaskForBitcode()->getType());
+ if (auto *GEP = dyn_cast<GetElementPtrInst>(&I))
+ EnumerateType(GEP->getSourceElementType());
EnumerateType(I.getType());
if (const auto *Call = dyn_cast<CallBase>(&I))
EnumerateAttributes(Call->getAttributes());