Add support for assembly printing fp constants
authorChris Lattner <sabre@nondot.org>
Sun, 15 Jul 2001 00:18:39 +0000 (00:18 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 15 Jul 2001 00:18:39 +0000 (00:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/ConstantPool.cpp
lib/VMCore/iMemory.cpp

index 7f2f30a6064ca39e67de0e320cf9a6423271834c..bb61b33f5e6f5565741bc8a5dd945b7c44d1568b 100644 (file)
@@ -296,8 +296,7 @@ string ConstPoolUInt::getStrValue() const {
 }
 
 string ConstPoolFP::getStrValue() const {
-  assert(0 && "FP Constants Not implemented yet!!!!!!!!!!!");
-  return "% FP Constants NI!" /* + dtostr(Val)*/;
+  return ftostr(Val);
 }
 
 string ConstPoolType::getStrValue() const {
@@ -429,8 +428,8 @@ bool ConstPoolFP::isValueValidForType(const Type *Ty, double Val) {
     return false;         // These can't be represented as floating point!
 
     // TODO: Figure out how to test if a double can be cast to a float!
-    /*
   case Type::FloatTyID:
+    /*
     return (Val <= UINT8_MAX);
     */
   case Type::DoubleTyID:
index a003e89a10523f407a6c3f02d0a0f2e80a699c12..2f2c6c115ffd82315c7105be5ee94c5faecd4ef3 100644 (file)
@@ -86,7 +86,9 @@ StoreInst::StoreInst(Value *Val, Value *Ptr, const vector<ConstPoolVal*> &Idx,
 GetElementPtrInst::GetElementPtrInst(Value *Ptr, 
                                     const vector<ConstPoolVal*> &Idx,
                                     const string &Name = "")
-  : MemAccessInst(PointerType::getPointerType(getIndexedType(Ptr->getType(), Idx, true)), GetElementPtr, Name) {
+  : MemAccessInst(PointerType::getPointerType(getIndexedType(Ptr->getType(),
+                                                            Idx, true)),
+                 GetElementPtr, Name) {
   assert(getIndexedType(Ptr->getType(), Idx, true) && "gep operands invalid!");
   Operands.reserve(1+Idx.size());
   Operands.push_back(Use(Ptr, this));