diff options
| author | Nate Begeman <natebegeman@mac.com> | 2008-04-18 05:41:31 +0000 |
|---|---|---|
| committer | Nate Begeman <natebegeman@mac.com> | 2008-04-18 05:41:31 +0000 |
| commit | 26ed25253e91d02160d0851d9df76f386bad126a (patch) | |
| tree | 8c695af871bc6330d1226d91db9dfc0e515956d3 /clang/lib/CodeGen | |
| parent | 71c41d95618b0f7ccb9cdf008801a88eeffe6e14 (diff) | |
| download | bcm5719-llvm-26ed25253e91d02160d0851d9df76f386bad126a.tar.gz bcm5719-llvm-26ed25253e91d02160d0851d9df76f386bad126a.zip | |
Allow targets to override double size, alignment, and semantics, and tie this
information into the IR type codegen. This allows a target to codegen the C
'double' type as either double or float.
llvm-svn: 49898
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenTypes.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp index d594cbc7355..2fcdb1530f8 100644 --- a/clang/lib/CodeGen/CodeGenTypes.cpp +++ b/clang/lib/CodeGen/CodeGenTypes.cpp @@ -215,7 +215,9 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { static_cast<unsigned>(Context.getTypeSize(T))); case BuiltinType::Float: return llvm::Type::FloatTy; - case BuiltinType::Double: return llvm::Type::DoubleTy; + case BuiltinType::Double: + return (Context.Target.getDoubleFormat() == &llvm::APFloat::IEEEdouble) ? + llvm::Type::DoubleTy : llvm::Type::FloatTy; case BuiltinType::LongDouble: // FIXME: mapping long double onto double. return llvm::Type::DoubleTy; |

