diff options
author | Manuel Jacob <me@manueljacob.de> | 2015-12-21 01:26:46 +0000 |
---|---|---|
committer | Manuel Jacob <me@manueljacob.de> | 2015-12-21 01:26:46 +0000 |
commit | 65021c4392dfc543699cf217e8d8f5458666c6e4 (patch) | |
tree | 2de7c5298f57dfe762ec9acc00400fe517cc94c7 | |
parent | cc004e57d120de1713fd1f41799f7b9c617717aa (diff) |
[RS4GC] Add an assert which fails if there is a (yet unsupported) addrspacecast.
The slightly strange indentation comes from clang-format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256132 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 16ee5bbaecb..049a7fc5459 100644 --- a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -454,6 +454,11 @@ static BaseDefiningValueResult findBaseDefiningValue(Value *I) { if (CastInst *CI = dyn_cast<CastInst>(I)) { Value *Def = CI->stripPointerCasts(); + // If stripping pointer casts changes the address space there is an + // addrspacecast in between. + assert(cast<PointerType>(Def->getType())->getAddressSpace() == + cast<PointerType>(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. |