forked from OSchip/llvm-project
Pass a value for the isSigned parameter of CreateIntCast, rather than
passing the name (an exotic way of specifying that the result is signed!). llvm-svn: 88909
This commit is contained in:
parent
e5de4a9ad6
commit
7876dad8e7
|
@ -121,7 +121,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
|
|||
const llvm::Type *ResultType = ConvertType(E->getType());
|
||||
Value *Result = Builder.CreateCall(F, ArgValue, "tmp");
|
||||
if (Result->getType() != ResultType)
|
||||
Result = Builder.CreateIntCast(Result, ResultType, "cast");
|
||||
Result = Builder.CreateIntCast(Result, ResultType, /*isSigned*/true,
|
||||
"cast");
|
||||
return RValue::get(Result);
|
||||
}
|
||||
case Builtin::BI__builtin_clz:
|
||||
|
@ -135,7 +136,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
|
|||
const llvm::Type *ResultType = ConvertType(E->getType());
|
||||
Value *Result = Builder.CreateCall(F, ArgValue, "tmp");
|
||||
if (Result->getType() != ResultType)
|
||||
Result = Builder.CreateIntCast(Result, ResultType, "cast");
|
||||
Result = Builder.CreateIntCast(Result, ResultType, /*isSigned*/true,
|
||||
"cast");
|
||||
return RValue::get(Result);
|
||||
}
|
||||
case Builtin::BI__builtin_ffs:
|
||||
|
@ -154,7 +156,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
|
|||
Value *IsZero = Builder.CreateICmpEQ(ArgValue, Zero, "iszero");
|
||||
Value *Result = Builder.CreateSelect(IsZero, Zero, Tmp, "ffs");
|
||||
if (Result->getType() != ResultType)
|
||||
Result = Builder.CreateIntCast(Result, ResultType, "cast");
|
||||
Result = Builder.CreateIntCast(Result, ResultType, /*isSigned*/true,
|
||||
"cast");
|
||||
return RValue::get(Result);
|
||||
}
|
||||
case Builtin::BI__builtin_parity:
|
||||
|
@ -171,7 +174,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
|
|||
Value *Result = Builder.CreateAnd(Tmp, llvm::ConstantInt::get(ArgType, 1),
|
||||
"tmp");
|
||||
if (Result->getType() != ResultType)
|
||||
Result = Builder.CreateIntCast(Result, ResultType, "cast");
|
||||
Result = Builder.CreateIntCast(Result, ResultType, /*isSigned*/true,
|
||||
"cast");
|
||||
return RValue::get(Result);
|
||||
}
|
||||
case Builtin::BI__builtin_popcount:
|
||||
|
@ -185,7 +189,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
|
|||
const llvm::Type *ResultType = ConvertType(E->getType());
|
||||
Value *Result = Builder.CreateCall(F, ArgValue, "tmp");
|
||||
if (Result->getType() != ResultType)
|
||||
Result = Builder.CreateIntCast(Result, ResultType, "cast");
|
||||
Result = Builder.CreateIntCast(Result, ResultType, /*isSigned*/true,
|
||||
"cast");
|
||||
return RValue::get(Result);
|
||||
}
|
||||
case Builtin::BI__builtin_expect:
|
||||
|
|
Loading…
Reference in New Issue