diff options
author | Duncan Sands <baldrick@free.fr> | 2007-11-27 13:23:08 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2007-11-27 13:23:08 +0000 |
commit | dc024674ff96820d6020757b48d47f46d4c07db2 (patch) | |
tree | 843dfcaeb8f6c99de930a32020148b563005c2fd /lib/VMCore/AutoUpgrade.cpp | |
parent | f19341dec7361451f100a882a023b14583454d7e (diff) | |
download | external_llvm-dc024674ff96820d6020757b48d47f46d4c07db2.tar.gz external_llvm-dc024674ff96820d6020757b48d47f46d4c07db2.tar.bz2 external_llvm-dc024674ff96820d6020757b48d47f46d4c07db2.zip |
Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls. This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully
a bitcode guru (who might that be? :) ) will fix it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AutoUpgrade.cpp')
-rw-r--r-- | lib/VMCore/AutoUpgrade.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp index b56fe70235..40c431c279 100644 --- a/lib/VMCore/AutoUpgrade.cpp +++ b/lib/VMCore/AutoUpgrade.cpp @@ -127,9 +127,6 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { Function *F = CI->getCalledFunction(); assert(F && "CallInst has no function associated with it."); - - const FunctionType *FTy = F->getFunctionType(); - const FunctionType *NewFnTy = NewFn->getFunctionType(); switch(NewFn->getIntrinsicID()) { default: assert(0 && "Unknown function for CallInst upgrade."); @@ -149,10 +146,10 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { // Handle any uses of the old CallInst. if (!CI->use_empty()) { // Check for sign extend parameter attributes on the return values. - bool SrcSExt = NewFnTy->getParamAttrs() && - NewFnTy->getParamAttrs()->paramHasAttr(0,ParamAttr::SExt); - bool DestSExt = FTy->getParamAttrs() && - FTy->getParamAttrs()->paramHasAttr(0,ParamAttr::SExt); + bool SrcSExt = NewFn->getParamAttrs() && + NewFn->getParamAttrs()->paramHasAttr(0,ParamAttr::SExt); + bool DestSExt = F->getParamAttrs() && + F->getParamAttrs()->paramHasAttr(0,ParamAttr::SExt); // Construct an appropriate cast from the new return type to the old. CastInst *RetCast = CastInst::create( |