[llvm-commits] CVS: llvm/lib/AsmParser/Lexer.l
Chris Lattner
sabre at nondot.org
Mon May 21 23:47:31 PDT 2007
Changes in directory llvm/lib/AsmParser:
Lexer.l updated: 1.108 -> 1.109
---
Log message:
simplify code
---
Diffs of the changes: (+2 -11)
Lexer.l | 13 ++-----------
1 files changed, 2 insertions(+), 11 deletions(-)
Index: llvm/lib/AsmParser/Lexer.l
diff -u llvm/lib/AsmParser/Lexer.l:1.108 llvm/lib/AsmParser/Lexer.l:1.109
--- llvm/lib/AsmParser/Lexer.l:1.108 Sat May 19 02:21:26 2007
+++ llvm/lib/AsmParser/Lexer.l Tue May 22 01:47:11 2007
@@ -27,6 +27,7 @@
%{
#include "ParserInternals.h"
#include "llvm/Module.h"
+#include "llvm/Support/MathExtras.h"
#include <list>
#include "llvmAsmParser.h"
#include <cctype>
@@ -95,17 +96,7 @@
// point representation of it.
//
static double HexToFP(const char *Buffer) {
- // Behave nicely in the face of C TBAA rules... see:
- // http://www.nullstone.com/htmls/category/aliastyp.htm
- union {
- uint64_t UI;
- double FP;
- } UIntToFP;
- UIntToFP.UI = HexIntToVal(Buffer);
-
- assert(sizeof(double) == sizeof(uint64_t) &&
- "Data sizes incompatible on this target!");
- return UIntToFP.FP; // Cast Hex constant to double
+ return BitsToDouble(HexIntToVal(Buffer)); // Cast Hex constant to double
}
More information about the llvm-commits
mailing list