Mercurial > hg > Members > tobaru > cbc > CbC_llvm
changeset 18:5abb684876c4
report error when code segment's tail call flag was changed false
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 06 Oct 2013 00:17:31 +0900 |
parents | 5e1f5bc27634 |
children | 29d31faaa39e |
files | lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Sat Oct 05 22:04:18 2013 +0900 +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Sun Oct 06 00:17:31 2013 +0900 @@ -5296,6 +5296,12 @@ "Non-null chain expected with non-tail call!"); assert((Result.second.getNode() || !Result.first.getNode()) && "Null value expected with tail call!"); +#ifndef noCbC + // if code segment's tail call flag was changed false , we report it on error. + if (CLI.RetTy->is__CodeTy() && CS.getCaller()->getReturnType()->is__CodeTy() && !isTailCall) + DAG.getContext()->emitError(CS.getInstruction(),CS.getCalledFunction()->getName() + + " is code segment which called by code segment but its tail call flag was changed false!"); +#endif if (Result.first.getNode()) { setValue(CS.getInstruction(), Result.first); } else if (!CanLowerReturn && Result.second.getNode()) {