diff options
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 3 | ||||
-rw-r--r-- | lib/VMCore/Type.cpp | 4 | ||||
-rw-r--r-- | lib/VMCore/Verifier.cpp | 10 |
3 files changed, 9 insertions, 8 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 24fbb698db..97dc16cdf2 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -956,7 +956,6 @@ void AssemblyWriter::printFunction(const Function *F) { // Print the calling convention. switch (F->getCallingConv()) { case CallingConv::C: break; // default - case CallingConv::CSRet: Out << "csretcc "; break; case CallingConv::Fast: Out << "fastcc "; break; case CallingConv::Cold: Out << "coldcc "; break; case CallingConv::X86_StdCall: Out << "x86_stdcallcc "; break; @@ -1166,7 +1165,6 @@ void AssemblyWriter::printInstruction(const Instruction &I) { // Print the calling convention being used. switch (CI->getCallingConv()) { case CallingConv::C: break; // default - case CallingConv::CSRet: Out << " csretcc"; break; case CallingConv::Fast: Out << " fastcc"; break; case CallingConv::Cold: Out << " coldcc"; break; case CallingConv::X86_StdCall: Out << "x86_stdcallcc "; break; @@ -1209,7 +1207,6 @@ void AssemblyWriter::printInstruction(const Instruction &I) { // Print the calling convention being used. switch (II->getCallingConv()) { case CallingConv::C: break; // default - case CallingConv::CSRet: Out << " csretcc"; break; case CallingConv::Fast: Out << " fastcc"; break; case CallingConv::Cold: Out << " coldcc"; break; case CallingConv::X86_StdCall: Out << "x86_stdcallcc "; break; diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index ec7aee8031..3733d2a7ba 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -1089,6 +1089,10 @@ std::string FunctionType::getParamAttrsText(ParameterAttributes Attr) { Result += "sext "; if (Attr & NoReturnAttribute) Result += "noreturn "; + if (Attr & InRegAttribute) + Result += "inreg "; + if (Attr & StructRetAttribute) + Result += "sret "; return Result; } diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index d1593173f3..4f67889e9d 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -338,17 +338,17 @@ void Verifier::visitFunction(Function &F) { F.getReturnType() == Type::VoidTy, "Functions cannot return aggregate values!", &F); + Assert1(!FT->isStructReturn() || + (FT->getReturnType() == Type::VoidTy && + FT->getNumParams() > 0 && isa<PointerType>(FT->getParamType(0))), + "Invalid struct-return function!", &F); + // Check that this function meets the restrictions on this calling convention. switch (F.getCallingConv()) { default: break; case CallingConv::C: break; - case CallingConv::CSRet: - Assert1(FT->getReturnType() == Type::VoidTy && - FT->getNumParams() > 0 && isa<PointerType>(FT->getParamType(0)), - "Invalid struct-return function!", &F); - break; case CallingConv::Fast: case CallingConv::Cold: case CallingConv::X86_FastCall: |