# HG changeset patch
# User Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
# Date 1399227483 -32400
# Node ID 9e74acfe8c427699a3a17abde6437e0a6a6ebe05
# Parent  90677c4a880afe012beef9a6747797a8066adf47
fix bug. compiler does not emit unnecessary warning no more.

diff -r 90677c4a880a -r 9e74acfe8c42 lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp	Sun May 04 02:24:57 2014 +0900
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp	Mon May 05 03:18:03 2014 +0900
@@ -5448,6 +5448,24 @@
   TargetLowering::
   CallLoweringInfo CLI(getRoot(), RetTy, FTy, isTailCall, Callee, Args, DAG,
                        getCurSDLoc(), CS);
+#ifndef noCbC
+  // variable arguments check.
+  if (CLI.RetTy->is__CodeTy() && CS.getCaller()->getReturnType()->is__CodeTy() && CLI.IsVarArg) {
+    CLI.CallConv = CallingConv::C;
+    errs().changeColor(raw_ostream::MAGENTA, true);
+    if (CS.getCalledFunction()) {// if this codesegment call is a direct access; ex)  goto codesegment();