diff options
author | Torok Edwin <edwintorok@gmail.com> | 2009-05-22 07:12:05 +0000 |
---|---|---|
committer | Torok Edwin <edwintorok@gmail.com> | 2009-05-22 07:12:05 +0000 |
commit | 382cb2189a69d169e3ac8b63498ee838022710b2 (patch) | |
tree | 26f9bc41b74f28039dcf0b9543f96f8e78acf826 /lib/VMCore | |
parent | 9107c546939d02455283214818359c17b3875051 (diff) | |
download | external_llvm-382cb2189a69d169e3ac8b63498ee838022710b2.zip external_llvm-382cb2189a69d169e3ac8b63498ee838022710b2.tar.gz external_llvm-382cb2189a69d169e3ac8b63498ee838022710b2.tar.bz2 |
Revert this. There's no way to verifiy indirect calls, and an optimizer can turn
indirect call into direct call, thus the verifier would reject something it
previously accepted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72249 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 65d0a82..fc4cfcf 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1024,31 +1024,6 @@ void Verifier::VerifyCallSite(CallSite CS) { "Call parameter type does not match function signature!", CS.getArgument(i), FTy->getParamType(i), I); - Assert2(CS.getType() == FTy->getReturnType(), - "Call return type does not match function signature!", - CS.getInstruction(), FTy->getReturnType()); - - // Verify calling convention for direct calls - Value *CalledF = CS.getCalledValue()->stripPointerCasts(); - if (Function *F = dyn_cast<Function>(CalledF)) { - unsigned CC1 = CS.getCallingConv(); - unsigned CC2 = F->getCallingConv(); - if(CC1 != CC2) { - // tolerate some mismatch among C prototype and LLVM-specific calling conv - if (CC2 >= CallingConv::FirstTargetCC || - CC1 >= CallingConv::FirstTargetCC) { - Instruction *I = CS.getInstruction()->clone(); - if (CallInst *CI = dyn_cast<CallInst>(I)) { - CI->setCallingConv(F->getCallingConv()); - } else - cast<InvokeInst>(I)->setCallingConv(F->getCallingConv()); - Assert2(0,"Calling convention does not match function signature!", - CS.getInstruction(), I); - delete I; - } - } - } - if (CS.getCalledValue()->getNameLen() < 5 || strncmp(CS.getCalledValue()->getNameStart(), "llvm.", 5) != 0) { // Verify that none of the arguments are metadata... |