]> granicus.if.org Git - clang/commitdiff
Fix the FloatingLiteral API to take the isexact flag by value instead of
authorChris Lattner <sabre@nondot.org>
Mon, 29 Jun 2009 17:34:55 +0000 (17:34 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 29 Jun 2009 17:34:55 +0000 (17:34 +0000)
by pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74432 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Expr.h
lib/AST/Expr.cpp
lib/Sema/SemaExpr.cpp

index 2ed91124758d5218a93059cdc5ba7615764ab177..43da7a16b6134466593d8b90562f1298e522a3d6 100644 (file)
@@ -467,9 +467,9 @@ class FloatingLiteral : public Expr {
   bool IsExact : 1;
   SourceLocation Loc;
 public:
-  FloatingLiteral(const llvm::APFloat &V, bool* isexact, 
+  FloatingLiteral(const llvm::APFloat &V, bool isexact, 
                   QualType Type, SourceLocation L)
-    : Expr(FloatingLiteralClass, Type), Value(V), IsExact(*isexact), Loc(L) {} 
+    : Expr(FloatingLiteralClass, Type), Value(V), IsExact(isexact), Loc(L) {} 
 
   /// \brief Construct an empty floating-point literal.
   explicit FloatingLiteral(EmptyShell Empty) 
index fce88cc0da28c7f31c4ffbfeed2307ad945924d4..4d90c7a9564e0592e22ebee47d7f4939ae1ffa79 100644 (file)
@@ -41,8 +41,7 @@ CharacterLiteral* CharacterLiteral::Clone(ASTContext &C) const {
 }
 
 FloatingLiteral* FloatingLiteral::Clone(ASTContext &C) const {
-  bool exact = IsExact;
-  return new (C) FloatingLiteral(Value, &exact, getType(), Loc);
+  return new (C) FloatingLiteral(Value, IsExact, getType(), Loc);
 }
 
 ImaginaryLiteral* ImaginaryLiteral::Clone(ASTContext &C) const {
index fe284f73b0d58c8aa5709edb29695ff974f518f4..4be49a0b4a51ade6191daf248f0bfa87b7bf2304 100644 (file)
@@ -1310,8 +1310,8 @@ Action::OwningExprResult Sema::ActOnNumericConstant(const Token &Tok) {
 
     // isExact will be set by GetFloatValue().
     bool isExact = false;
-    Res = new (Context) FloatingLiteral(Literal.GetFloatValue(Format, &isExact),
-                                        &isExact, Ty, Tok.getLocation());
+    llvm::APFloat Val = Literal.GetFloatValue(Format, &isExact);
+    Res = new (Context) FloatingLiteral(Val, isExact, Ty, Tok.getLocation());
 
   } else if (!Literal.isIntegerLiteral()) {
     return ExprError();