[cfe-commits] r74432 - in /cfe/trunk: include/clang/AST/Expr.h lib/AST/Expr.cpp lib/Sema/SemaExpr.cpp

Chris Lattner sabre at nondot.org
Mon Jun 29 10:35:00 PDT 2009


Author: lattner
Date: Mon Jun 29 12:34:55 2009
New Revision: 74432

URL: http://llvm.org/viewvc/llvm-project?rev=74432&view=rev
Log:
Fix the FloatingLiteral API to take the isexact flag by value instead of
by pointer.

Modified:
    cfe/trunk/include/clang/AST/Expr.h
    cfe/trunk/lib/AST/Expr.cpp
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=74432&r1=74431&r2=74432&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Mon Jun 29 12:34:55 2009
@@ -467,9 +467,9 @@
   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) 

Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=74432&r1=74431&r2=74432&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Mon Jun 29 12:34:55 2009
@@ -41,8 +41,7 @@
 }
 
 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 {

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=74432&r1=74431&r2=74432&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Jun 29 12:34:55 2009
@@ -1310,8 +1310,8 @@
 
     // 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();





More information about the cfe-commits mailing list