summaryrefslogtreecommitdiffstats
path: root/clang/Basic
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
commitec0a6d9be5f2f287b7e926984d8e674b2471a5d7 (patch)
tree2c69714096edf668d33916b8fd77fee1e612ae40 /clang/Basic
parent20e469e99b595e0dedd740478862ad99c4ca2b5c (diff)
downloadbcm5719-llvm-ec0a6d9be5f2f287b7e926984d8e674b2471a5d7.tar.gz
bcm5719-llvm-ec0a6d9be5f2f287b7e926984d8e674b2471a5d7.zip
Use APFloat for the representation of FP immediates, ask the target
for *which* apfloat to use for a particular type. llvm-svn: 42234
Diffstat (limited to 'clang/Basic')
-rw-r--r--clang/Basic/TargetInfo.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/clang/Basic/TargetInfo.cpp b/clang/Basic/TargetInfo.cpp
index 1b780108e5e..2b0af7ed24c 100644
--- a/clang/Basic/TargetInfo.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud