aboutsummaryrefslogtreecommitdiff
path: root/Basic/TargetInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-09-22 18:29:59 +0000
committerChris Lattner <sabre@nondot.org>2007-09-22 18:29:59 +0000
commit525a05093a4816af961fe2bc6b8a81c17e2e26c2 (patch)
treecaaeddc5564a164cf14e4a04fe106de33f6c3862 /Basic/TargetInfo.cpp
parentb27c156688ca557cb277ecdfea6dccc1dac5b49f (diff)
Use APFloat for the representation of FP immediates, ask the target
for *which* apfloat to use for a particular type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Basic/TargetInfo.cpp')
-rw-r--r--Basic/TargetInfo.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/Basic/TargetInfo.cpp b/Basic/TargetInfo.cpp
index 1b780108e5..2b0af7ed24 100644
--- a/Basic/TargetInfo.cpp
+++ b/Basic/TargetInfo.cpp
@@ -15,12 +15,40 @@
#include "clang/Basic/Diagnostic.h"
#include "clang/AST/Builtins.h"
#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/APFloat.h"
#include <set>
using namespace clang;
void TargetInfoImpl::ANCHOR() {} // out-of-line virtual method for class.
+//===----------------------------------------------------------------------===//
+// FIXME: These are temporary hacks, they should revector into the
+// TargetInfoImpl.
+
+void TargetInfo::getFloatInfo(uint64_t &Size, unsigned &Align,
+ const llvm::fltSemantics *&Format,
+ SourceLocation Loc) {
+ Align = 32; // FIXME: implement correctly.
+ Size = 32;
+ Format = &llvm::APFloat::IEEEsingle;
+}
+void TargetInfo::getDoubleInfo(uint64_t &Size, unsigned &Align,
+ const llvm::fltSemantics *&Format,
+ SourceLocation Loc) {
+ Size = Align = 64; // FIXME: implement correctly.
+ Format = &llvm::APFloat::IEEEdouble;
+}
+void TargetInfo::getLongDoubleInfo(uint64_t &Size, unsigned &Align,
+ const llvm::fltSemantics *&Format,
+ SourceLocation Loc) {
+ Size = 80; Align = 32; // FIXME: implement correctly.
+ Format = &llvm::APFloat::x87DoubleExtended;
+}
+
+
+//===----------------------------------------------------------------------===//
+
/// DiagnoseNonPortability - When a use of a non-portable target feature is
/// used, this method emits the diagnostic and marks the translation unit as
/// non-portable.