summaryrefslogtreecommitdiff
path: root/gnu/llvm/tools
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2018-04-06 14:26:30 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2018-04-06 14:26:30 +0000
commit5396a6f6d7c8a226aeb2f8a2da9423fdb91049e4 (patch)
tree84c1d18203f00ab5f6859414cf0591d3a669b7dc /gnu/llvm/tools
parent22e59d8c3f58e0adbcb4561abc9a5e0c79760cb8 (diff)
Import LLVM 6.0.1 release including clang, lld and lldb.
"where is the kaboom?" deraadt@
Diffstat (limited to 'gnu/llvm/tools')
-rw-r--r--gnu/llvm/tools/clang/lib/Basic/Targets/Mips.h41
1 files changed, 14 insertions, 27 deletions
diff --git a/gnu/llvm/tools/clang/lib/Basic/Targets/Mips.h b/gnu/llvm/tools/clang/lib/Basic/Targets/Mips.h
index d49f49888b0..28900f21f86 100644
--- a/gnu/llvm/tools/clang/lib/Basic/Targets/Mips.h
+++ b/gnu/llvm/tools/clang/lib/Basic/Targets/Mips.h
@@ -54,10 +54,9 @@ class LLVM_LIBRARY_VISIBILITY MipsTargetInfo : public TargetInfo {
enum DspRevEnum { NoDSP, DSP1, DSP2 } DspRev;
bool HasMSA;
bool DisableMadd4;
- bool UseIndirectJumpHazard;
protected:
- enum FPModeEnum { FPXX, FP32, FP64 } FPMode;
+ bool HasFP64;
std::string ABI;
public:
@@ -65,21 +64,18 @@ public:
: TargetInfo(Triple), IsMips16(false), IsMicromips(false),
IsNan2008(false), IsAbs2008(false), IsSingleFloat(false),
IsNoABICalls(false), CanUseBSDABICalls(false), FloatABI(HardFloat),
- DspRev(NoDSP), HasMSA(false), DisableMadd4(false),
- UseIndirectJumpHazard(false), FPMode(FPXX) {
+ DspRev(NoDSP), HasMSA(false), DisableMadd4(false), HasFP64(false) {
TheCXXABI.set(TargetCXXABI::GenericMIPS);
- if (Triple.isMIPS32())
- setABI("o32");
- else if (Triple.getEnvironment() == llvm::Triple::GNUABIN32)
- setABI("n32");
- else
- setABI("n64");
+ setABI((getTriple().getArch() == llvm::Triple::mips ||
+ getTriple().getArch() == llvm::Triple::mipsel)
+ ? "o32"
+ : "n64");
CPU = ABI == "o32" ? "mips32r2" : "mips64r2";
- CanUseBSDABICalls = Triple.isOSFreeBSD() ||
- Triple.isOSOpenBSD();
+ CanUseBSDABICalls = Triple.getOS() == llvm::Triple::FreeBSD ||
+ Triple.getOS() == llvm::Triple::OpenBSD;
}
bool isIEEE754_2008Default() const {
@@ -132,7 +128,7 @@ public:
void setN32N64ABITypes() {
LongDoubleWidth = LongDoubleAlign = 128;
LongDoubleFormat = &llvm::APFloat::IEEEquad();
- if (getTriple().isOSFreeBSD()) {
+ if (getTriple().getOS() == llvm::Triple::FreeBSD) {
LongDoubleWidth = LongDoubleAlign = 64;
LongDoubleFormat = &llvm::APFloat::IEEEdouble();
}
@@ -142,7 +138,7 @@ public:
void setN64ABITypes() {
setN32N64ABITypes();
- if (getTriple().isOSOpenBSD()) {
+ if (getTriple().getOS() == llvm::Triple::OpenBSD) {
Int64Type = SignedLongLong;
} else {
Int64Type = SignedLong;
@@ -165,7 +161,6 @@ public:
}
bool isValidCPUName(StringRef Name) const override;
- void fillValidCPUList(SmallVectorImpl<StringRef> &Values) const override;
bool setCPU(const std::string &Name) override {
CPU = Name;
@@ -186,8 +181,6 @@ public:
return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec);
}
- unsigned getISARev() const;
-
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override;
@@ -312,7 +305,7 @@ public:
IsSingleFloat = false;
FloatABI = HardFloat;
DspRev = NoDSP;
- FPMode = isFP64Default() ? FP64 : FPXX;
+ HasFP64 = isFP64Default();
for (const auto &Feature : Features) {
if (Feature == "+single-float")
@@ -332,11 +325,9 @@ public:
else if (Feature == "+nomadd4")
DisableMadd4 = true;
else if (Feature == "+fp64")
- FPMode = FP64;
+ HasFP64 = true;
else if (Feature == "-fp64")
- FPMode = FP32;
- else if (Feature == "+fpxx")
- FPMode = FPXX;
+ HasFP64 = false;
else if (Feature == "+nan2008")
IsNan2008 = true;
else if (Feature == "-nan2008")
@@ -347,8 +338,6 @@ public:
IsAbs2008 = false;
else if (Feature == "+noabicalls")
IsNoABICalls = true;
- else if (Feature == "+use-indirect-jump-hazard")
- UseIndirectJumpHazard = true;
}
setDataLayout();
@@ -398,9 +387,7 @@ public:
return llvm::makeArrayRef(NewABIRegAliases);
}
- bool hasInt128Type() const override {
- return (ABI == "n32" || ABI == "n64") || getTargetOpts().ForceEnableInt128;
- }
+ bool hasInt128Type() const override { return ABI == "n32" || ABI == "n64"; }
bool validateTarget(DiagnosticsEngine &Diags) const override;
};