Mercurial > hg > CbC > CbC_llvm
changeset 180:680fa57a2f20
fix compile errors.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 30 May 2020 17:44:06 +0900 |
parents | 591ddb4e7ef1 |
children | df311c476dd5 |
files | clang/lib/Parse/ParseCbC.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp |
diffstat | 2 files changed, 5 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/clang/lib/Parse/ParseCbC.cpp Sat May 30 14:40:11 2020 +0900 +++ b/clang/lib/Parse/ParseCbC.cpp Sat May 30 17:44:06 2020 +0900 @@ -346,7 +346,7 @@ (D.isFunctionDeclaratorAFunctionDeclaration() ? Scope::FunctionDeclarationScope : 0)); bool HasProto = false; SmallVector<DeclaratorChunk::ParamInfo, 16> ParamInfo; - SourceLocation EllipsisLoc, RefQualifierLoc, ConstQualifierLoc, VolatileQualifierLoc, RestrictQualifierLoc; + SourceLocation EllipsisLoc, RefQualifierLoc; DeclSpec FPDS(AttrFactory); bool RefQualifierIsLValueRef = true; ExceptionSpecificationType ESpecType = EST_None; @@ -487,7 +487,6 @@ ParseScope InnerScope(this, Scope::DeclScope,false); - SourceLocation InnerStatementTrailingElseLoc; StmtResult StmtRes; ParseScope CompoundScope(this, Scope::DeclScope); @@ -678,7 +677,7 @@ bool IsAmbiguous = false; bool HasProto = true; SmallVector<DeclaratorChunk::ParamInfo, 16> ParamInfo; - SourceLocation EllipsisLoc, RefQualifierLoc, ConstQualifierLoc, VolatileQualifierLoc, RestrictQualifierLoc; + SourceLocation EllipsisLoc, RefQualifierLoc; DeclSpec FDS(AttrFactory); bool RefQualifierIsLValueRef = true; ExceptionSpecificationType ESpecType = EST_None;
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Sat May 30 14:40:11 2020 +0900 +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Sat May 30 17:44:06 2020 +0900 @@ -7161,31 +7161,10 @@ .setIsPreallocated( CB.countOperandBundlesOfType(LLVMContext::OB_preallocated) != 0); #ifndef noCbC - // variable arguments check. - if (CLI.RetTy->is__CodeTy() && CB.getCaller()->getReturnType()->is__CodeTy() && CLI.IsVarArg) { - CLI.CallConv = CallingConv::C; - errs().changeColor(raw_ostream::MAGENTA, true); - if (CB.getCalledFunction()) {// if this codesegment call is a direct access; ex) goto codesegment(); - errs() << "warning: "; - errs().resetColor(); - errs() << CB.getCaller()->getName() + " : Tail call elimination was failed on goto" - + CB.getCalledFunction()->getName() + ". Write a exactly prototype declaration.\n"; - } - else if (CB.getCalledValue()->getType()->isPointerTy()) {// if it is a pointer access; ex) goto codesegmentPointer; - errs() << "warning: "; - errs().resetColor(); - errs() << CB.getCaller()->getName() + " : Tail call elimination was failed on pointer accessed goto. Write a exactly prototype declaration.\n"; - } - } // if code segment's tail call flag was changed false , we report it on error. - if (CLI.RetTy->is__CodeTy() && CB.getCaller()->getReturnType()->is__CodeTy() && !isTailCall && !CLI.IsVarArg) { - if (CB.getCalledFunction()) { // if this codesegment call is a direct access; ex) goto codesegment(); - errs() << "warning: " + CB.getCaller()->getName() + " : Tail call elimination was failed on goto " + - CB.getCalledFunction()->getName() + " !"; - } else if (CB.getCalledValue()->getType()->isPointerTy()) { // if it is a pointer access; ex) goto codesegmentPointer; - errs() << "warning: " + CB.getCaller()->getName() + - " : Tail call elimination was failed on codesegment which is accessed by pointer!"; // we can't get name from Type... - } + if (RetTy->is__CodeTy() && !isTailCall ) { + LLVMContext &Ctx = *DAG.getContext(); + Ctx.emitError(&CB, "tail call failed on __code"); } #endif std::pair<SDValue, SDValue> Result = lowerInvokable(CLI, EHPadBB);