aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-04-18 05:41:31 +0000
committerNate Begeman <natebegeman@mac.com>2008-04-18 05:41:31 +0000
commitc8b1227fa8c17d9881815e40c04e19334be536f8 (patch)
tree7ec287cfe0e7cf879e52767b4a4753d69ff9a439 /lib
parentbef5c8bf65bf9a1ae7bf0d6630e17cf3eeae8cc4 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49898 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/CodeGenTypes.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp
index d594cbc735..2fcdb1530f 100644
--- a/lib/CodeGen/CodeGenTypes.cpp
+++ b/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;