diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-05-11 18:49:34 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-05-11 18:49:34 +0000 |
commit | 89c5491a72d2eda952f8314e6700e8657e13ffb6 (patch) | |
tree | 1ce36270d68aca3464a611392fb1247731002b0b /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 539175428883f84c4c8c8e6cc051a5d5b02fde88 (diff) | |
download | llvm-89c5491a72d2eda952f8314e6700e8657e13ffb6.zip llvm-89c5491a72d2eda952f8314e6700e8657e13ffb6.tar.gz llvm-89c5491a72d2eda952f8314e6700e8657e13ffb6.tar.bz2 |
[RewriteStatepointsForGC] Fix a bug on creating gc_relocate for pointer to vector of pointers
Summary:
In RewriteStatepointsForGC pass, we create a gc_relocate intrinsic for
each relocated pointer, and the gc_relocate has the same type with the
pointer. During the creation of gc_relocate intrinsic, llvm requires to
mangle its type. However, llvm does not support mangling of all possible
types. RewriteStatepointsForGC will hit an assertion failure when it
tries to create a gc_relocate for pointer to vector of pointers because
mangling for vector of pointers is not supported.
This patch changes the way RewriteStatepointsForGC pass creates
gc_relocate. For each relocated pointer, we erase the type of pointers
and create an unified gc_relocate of type i8 addrspace(1)*. Then a
bitcast is inserted to convert the gc_relocate to the correct type. In
this way, gc_relocate does not need to deal with different types of
pointers and the unsupported type mangling is no longer a problem. This
change would also ease further merge when LLVM erases types of pointers
and introduces an unified pointer type.
Some minor changes are also introduced to gc_relocate related part in
InstCombineCalls, CodeGenPrepare, and Verifier accordingly.
Patch by Chen Li!
Reviewers: reames, AndyAyers, sanjoy
Reviewed By: sanjoy
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9592
llvm-svn: 237009
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions