diff options
| author | Duncan Sands <baldrick@free.fr> | 2008-01-06 18:27:01 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2008-01-06 18:27:01 +0000 |
| commit | 404eb05247e442d105accb2a7d17a2d4e6f2462f (patch) | |
| tree | d557b2a5411e1906825abbf79e42104583637fa4 /llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp | |
| parent | 55e5090fe8d14903d508159edbc25376878ec71f (diff) | |
| download | bcm5719-llvm-404eb05247e442d105accb2a7d17a2d4e6f2462f.tar.gz bcm5719-llvm-404eb05247e442d105accb2a7d17a2d4e6f2462f.zip | |
The transform that tries to turn calls to bitcast functions into
direct calls bails out unless caller and callee have essentially
equivalent parameter attributes. This is illogical - the callee's
attributes should be of no relevance here. Rework the logic, which
incidentally fixes a crash when removed arguments have attributes.
llvm-svn: 45658
Diffstat (limited to 'llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp')
| -rw-r--r-- | llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp index 94ae404107b..8e6a3b91c1f 100644 --- a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -505,7 +505,7 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) { const Type *RetTy = FTy->getReturnType(); if (DeadRetVal.count(F)) { RetTy = Type::VoidTy; - RAttrs &= ~ParamAttr::VoidTypeIncompatible; + RAttrs &= ~ParamAttr::incompatibleWithType(RetTy, RAttrs); DeadRetVal.erase(F); } @@ -561,8 +561,7 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) { // The call return attributes. uint16_t RAttrs = PAL ? PAL->getParamAttrs(0) : 0; // Adjust in case the function was changed to return void. - if (NF->getReturnType() == Type::VoidTy) - RAttrs &= ~ParamAttr::VoidTypeIncompatible; + RAttrs &= ~ParamAttr::incompatibleWithType(NF->getReturnType(), RAttrs); if (RAttrs) ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, RAttrs)); |

