aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-09-16 03:45:21 +0000
committerJim Grosbach <grosbach@apple.com>2010-09-16 03:45:21 +0000
commita8e47b3319db56675f8e80f4bb015c163110b902 (patch)
tree7c7cb8aed315b557095d15dc17c76f6af6fe4529 /include
parentf969868271f25df126047d0844f45b5e3b844b6d (diff)
downloadexternal_llvm-a8e47b3319db56675f8e80f4bb015c163110b902.zip
external_llvm-a8e47b3319db56675f8e80f4bb015c163110b902.tar.gz
external_llvm-a8e47b3319db56675f8e80f4bb015c163110b902.tar.bz2
store MC FP immediates as a double instead of as an APFloat, thus avoiding an
unnecessary dtor for MCOperand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCInst.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/llvm/MC/MCInst.h b/include/llvm/MC/MCInst.h
index f008b20..2966f0d 100644
--- a/include/llvm/MC/MCInst.h
+++ b/include/llvm/MC/MCInst.h
@@ -16,7 +16,6 @@
#ifndef LLVM_MC_MCINST_H
#define LLVM_MC_MCINST_H
-#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/System/DataTypes.h"
@@ -42,11 +41,9 @@ class MCOperand {
union {
unsigned RegVal;
int64_t ImmVal;
+ double FPImmVal;
const MCExpr *ExprVal;
};
- // This can't go in the union due to the non-trivial copy constructor
- // of APFloat. It's still only valid for Kind == kFPImmediate, though.
- APFloat FPImmVal;
public:
MCOperand() : Kind(kInvalid), FPImmVal(0.0) {}
@@ -78,12 +75,12 @@ public:
ImmVal = Val;
}
- const APFloat &getFPImm() const {
+ const double &getFPImm() const {
assert(isFPImm() && "This is not an FP immediate");
return FPImmVal;
}
- void setFPImm(const APFloat &Val) {
+ void setFPImm(double Val) {
assert(isFPImm() && "This is not an FP immediate");
FPImmVal = Val;
}
@@ -109,7 +106,7 @@ public:
Op.ImmVal = Val;
return Op;
}
- static MCOperand CreateFPImm(const APFloat &Val) {
+ static MCOperand CreateFPImm(double Val) {
MCOperand Op;
Op.Kind = kFPImmediate;
Op.FPImmVal = Val;