From f435e200b1e5c6f7426b34f2fede8dd5b4e95b46 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 15 Jul 2001 00:17:18 +0000 Subject: [PATCH] Add support to the bytecode reader to recognize floating point constants llvm-svn: 189 --- llvm/lib/Bytecode/Reader/ConstantReader.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/llvm/lib/Bytecode/Reader/ConstantReader.cpp b/llvm/lib/Bytecode/Reader/ConstantReader.cpp index dd47d1c2cfb6..2994128f7d6d 100644 --- a/llvm/lib/Bytecode/Reader/ConstantReader.cpp +++ b/llvm/lib/Bytecode/Reader/ConstantReader.cpp @@ -139,6 +139,20 @@ bool BytecodeParser::parseConstPoolValue(const uchar *&Buf, break; } + case Type::FloatTyID: { + float F; + if (input_data(Buf, EndBuf, &F, &F+1)) return true; + V = new ConstPoolFP(Ty, F); + break; + } + + case Type::DoubleTyID: { + double Val; + if (input_data(Buf, EndBuf, &Val, &Val+1)) return true; + V = new ConstPoolFP(Ty, Val); + break; + } + case Type::TypeTyID: if (parseTypeConstant(Buf, EndBuf, V)) return true; break;