diff options
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 3 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 19 |
2 files changed, 8 insertions, 14 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 9008884909..b328b2fbb3 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -46,9 +46,8 @@ Sema::CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCallRaw) { return true; return TheCall.take(); case Builtin::BI__builtin_va_start: - if (SemaBuiltinVAStart(TheCall.get())) { + if (SemaBuiltinVAStart(TheCall.get())) return true; - } return TheCall.take(); case Builtin::BI__builtin_isgreater: case Builtin::BI__builtin_isgreaterequal: diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 8ef9486459..32d7a6086d 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -214,23 +214,18 @@ Action::ExprResult Sema::ActOnNumericConstant(const Token &Tok) { if (Literal.isFloatingLiteral()) { QualType Ty; - const llvm::fltSemantics *Format; - - if (Literal.isFloat) { + if (Literal.isFloat) Ty = Context.FloatTy; - Format = Context.Target.getFloatFormat(); - } else if (!Literal.isLong) { + else if (!Literal.isLong) Ty = Context.DoubleTy; - Format = Context.Target.getDoubleFormat(); - } else { + else Ty = Context.LongDoubleTy; - Format = Context.Target.getLongDoubleFormat(); - } - + + const llvm::fltSemantics &Format = Context.getFloatTypeSemantics(Ty); + // isExact will be set by GetFloatValue(). bool isExact = false; - - Res = new FloatingLiteral(Literal.GetFloatValue(*Format,&isExact), &isExact, + Res = new FloatingLiteral(Literal.GetFloatValue(Format, &isExact), &isExact, Ty, Tok.getLocation()); } else if (!Literal.isIntegerLiteral()) { |