diff options
| author | Chris Lattner <sabre@nondot.org> | 2001-07-15 00:17:23 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2001-07-15 00:17:23 +0000 | 
| commit | ff5eccef96fa0344b0b6035da543640c2e885b75 (patch) | |
| tree | 2fab47e056bab15f11a23bbb2973f4bd7b08fcb0 /lib/Bytecode/Writer/ConstantWriter.cpp | |
| parent | a1375303415f645af6900d0a7141411e8ffbd430 (diff) | |
Add support to the bytecode writer to recognize floating point constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Writer/ConstantWriter.cpp')
| -rw-r--r-- | lib/Bytecode/Writer/ConstantWriter.cpp | 14 | 
1 files changed, 10 insertions, 4 deletions
| diff --git a/lib/Bytecode/Writer/ConstantWriter.cpp b/lib/Bytecode/Writer/ConstantWriter.cpp index 5ca0fca0d1..7e2c9307b9 100644 --- a/lib/Bytecode/Writer/ConstantWriter.cpp +++ b/lib/Bytecode/Writer/ConstantWriter.cpp @@ -138,10 +138,16 @@ bool BytecodeWriter::outputConstant(const ConstPoolVal *CPV) {      break;    } -  case Type::FloatTyID:    // Floating point types... -  case Type::DoubleTyID: -    // TODO: Floating point type serialization - +  case Type::FloatTyID: {   // Floating point types... +    float Tmp = (float)((const ConstPoolFP*)CPV)->getValue(); +    output_data(&Tmp, &Tmp+1, Out); +    break; +  } +  case Type::DoubleTyID: { +    double Tmp = ((const ConstPoolFP*)CPV)->getValue(); +    output_data(&Tmp, &Tmp+1, Out); +    break; +  }    case Type::VoidTyID:     case Type::LabelTyID: | 
