From 8050a49737e1c4d01586aded1f470ae6e8fcc705 Mon Sep 17 00:00:00 2001 From: Manuel Jacob Date: Mon, 21 Dec 2015 01:26:46 +0000 Subject: [PATCH] [RS4GC] Add an assert which fails if there is a (yet unsupported) addrspacecast. The slightly strange indentation comes from clang-format. llvm-svn: 256132 --- llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 16ee5bbaecbc..049a7fc54597 100644 --- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -454,6 +454,11 @@ static BaseDefiningValueResult findBaseDefiningValue(Value *I) { if (CastInst *CI = dyn_cast(I)) { Value *Def = CI->stripPointerCasts(); + // If stripping pointer casts changes the address space there is an + // addrspacecast in between. + assert(cast(Def->getType())->getAddressSpace() == + cast(CI->getType())->getAddressSpace() && + "unsupported addrspacecast"); // If we find a cast instruction here, it means we've found a cast which is // not simply a pointer cast (i.e. an inttoptr). We don't know how to // handle int->ptr conversion.