forked from OSchip/llvm-project
PR10337 reminds me that calls return values, lets handle them just
like arguments. Thanks PR10337! :) llvm-svn: 135030
This commit is contained in:
parent
f47c069162
commit
3517f14219
|
@ -1742,8 +1742,8 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
|
||||||
|
|
||||||
case ABIArgInfo::Extend:
|
case ABIArgInfo::Extend:
|
||||||
case ABIArgInfo::Direct: {
|
case ABIArgInfo::Direct: {
|
||||||
if (RetAI.getCoerceToType() == ConvertType(RetTy) &&
|
llvm::Type *RetIRTy = ConvertType(RetTy);
|
||||||
RetAI.getDirectOffset() == 0) {
|
if (RetAI.getCoerceToType() == RetIRTy && RetAI.getDirectOffset() == 0) {
|
||||||
if (RetTy->isAnyComplexType()) {
|
if (RetTy->isAnyComplexType()) {
|
||||||
llvm::Value *Real = Builder.CreateExtractValue(CI, 0);
|
llvm::Value *Real = Builder.CreateExtractValue(CI, 0);
|
||||||
llvm::Value *Imag = Builder.CreateExtractValue(CI, 1);
|
llvm::Value *Imag = Builder.CreateExtractValue(CI, 1);
|
||||||
|
@ -1760,7 +1760,13 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
|
||||||
BuildAggStore(*this, CI, DestPtr, DestIsVolatile, false);
|
BuildAggStore(*this, CI, DestPtr, DestIsVolatile, false);
|
||||||
return RValue::getAggregate(DestPtr);
|
return RValue::getAggregate(DestPtr);
|
||||||
}
|
}
|
||||||
return RValue::get(CI);
|
|
||||||
|
// If the argument doesn't match, perform a bitcast to coerce it. This
|
||||||
|
// can happen due to trivial type mismatches.
|
||||||
|
llvm::Value *V = CI;
|
||||||
|
if (V->getType() != RetIRTy)
|
||||||
|
V = Builder.CreateBitCast(V, RetIRTy);
|
||||||
|
return RValue::get(V);
|
||||||
}
|
}
|
||||||
|
|
||||||
llvm::Value *DestPtr = ReturnValue.getValue();
|
llvm::Value *DestPtr = ReturnValue.getValue();
|
||||||
|
|
|
@ -21,3 +21,19 @@ void Interpret() {
|
||||||
// CHECK: call void ({{.*}}, ...)* @JS_ReportErrorNumber({{.*}}@js_GetErrorMessage
|
// CHECK: call void ({{.*}}, ...)* @JS_ReportErrorNumber({{.*}}@js_GetErrorMessage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// PR10337
|
||||||
|
struct sigaction { int (*_sa_handler)(int); };
|
||||||
|
typedef int SigHandler ();
|
||||||
|
typedef struct sigaction sighandler_cxt;
|
||||||
|
SigHandler *rl_set_sighandler(ohandler)
|
||||||
|
sighandler_cxt *ohandler; {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void rl_set_signals() {
|
||||||
|
SigHandler *oh;
|
||||||
|
oh = rl_set_sighandler(0);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue