diff options
author | John McCall <rjmccall@apple.com> | 2011-05-10 23:39:47 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-05-10 23:39:47 +0000 |
commit | 4da89c87b2b6ca31f1015ec19aae65a02971ea9a (patch) | |
tree | 67ce88ccbd8d6b0b93c88a7eecc6ad678c32b703 /lib/Sema/SemaStmt.cpp | |
parent | e6c28039c63d829577a2e37170e06a1dbdf89748 (diff) |
Use a heralded conversion to bool in inline-asm constraints.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131170 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index a60fcb7097..60fcb10d53 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -2016,7 +2016,9 @@ StmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc, bool IsSimple, if (InputDomain == AD_Int && OutputDomain == AD_Int && !isOperandMentioned(InputOpNo, Pieces) && InputExpr->isEvaluatable(Context)) { - InputExpr = ImpCastExprToType(InputExpr, OutTy, CK_IntegralCast).take(); + CastKind castKind = + (OutTy->isBooleanType() ? CK_IntegralToBoolean : CK_IntegralCast); + InputExpr = ImpCastExprToType(InputExpr, OutTy, castKind).take(); Exprs[InputOpNo] = InputExpr; NS->setInputExpr(i, InputExpr); continue; |