summaryrefslogtreecommitdiff
path: root/lib/VMCore/ConstantsContext.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-07-17 06:13:52 +0000
committerChris Lattner <sabre@nondot.org>2010-07-17 06:13:52 +0000
commit93604b6de20f6a2ce160bfa65ef5d99cc8e577f3 (patch)
treeca33dd09f707f3552c13d2ec1a52bb7555cb277e /lib/VMCore/ConstantsContext.h
parent21444efae03be297faf5bdb8f16567765307fa9d (diff)
downloadllvm-93604b6de20f6a2ce160bfa65ef5d99cc8e577f3.tar.gz
llvm-93604b6de20f6a2ce160bfa65ef5d99cc8e577f3.tar.bz2
llvm-93604b6de20f6a2ce160bfa65ef5d99cc8e577f3.tar.xz
Fix PR7658, a problem where type refinement can trigger
constant replacement which was botching its handling of types. Use of getType() instead of getRawType() was causing the type map in constant folding to be updated wrong. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantsContext.h')
-rw-r--r--lib/VMCore/ConstantsContext.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/VMCore/ConstantsContext.h b/lib/VMCore/ConstantsContext.h
index 2f2fac53f0..b86ea60ede 100644
--- a/lib/VMCore/ConstantsContext.h
+++ b/lib/VMCore/ConstantsContext.h
@@ -757,9 +757,13 @@ public:
// If this constant is the representative element for its abstract type,
// update the AbstractTypeMap so that the representative element is I.
- if (C->getType()->isAbstract()) {
+ //
+ // This must use getRawType() because if the type is under refinement, we
+ // will get the refineAbstractType callback below, and we don't want to
+ // kick union find in on the constant.
+ if (C->getRawType()->isAbstract()) {
typename AbstractTypeMapTy::iterator ATI =
- AbstractTypeMap.find(C->getType());
+ AbstractTypeMap.find(cast<DerivedType>(C->getRawType()));
assert(ATI != AbstractTypeMap.end() &&
"Abstract type not in AbstractTypeMap?");
if (ATI->second == OldI)