From: Stephan Bergmann Date: Wed, 14 Dec 2016 11:57:17 +0000 (+0000) Subject: Replace APFloatBase static fltSemantics data members with getter functions X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ed04dd935e98ad1a79bf9a2444a84db3858783d;p=clang Replace APFloatBase static fltSemantics data members with getter functions At least the plugin used by the LibreOffice build () indirectly uses those members (through inline functions in LLVM/Clang include files in turn using them), but they are not exported by utils/extract_symbols.py on Windows, and accessing data across DLL/EXE boundaries on Windows is generally problematic. Differential Revision: https://reviews.llvm.org/D26671 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289647 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/ASTMatchers/ASTMatchersInternal.h b/include/clang/ASTMatchers/ASTMatchersInternal.h index 547e6bc486..bc75e807ce 100644 --- a/include/clang/ASTMatchers/ASTMatchersInternal.h +++ b/include/clang/ASTMatchers/ASTMatchersInternal.h @@ -1421,18 +1421,18 @@ private: template <> inline bool ValueEqualsMatcher::matchesNode( const FloatingLiteral &Node) const { - if ((&Node.getSemantics()) == &llvm::APFloat::IEEEsingle) + if ((&Node.getSemantics()) == &llvm::APFloat::IEEEsingle()) return Node.getValue().convertToFloat() == ExpectedValue; - if ((&Node.getSemantics()) == &llvm::APFloat::IEEEdouble) + if ((&Node.getSemantics()) == &llvm::APFloat::IEEEdouble()) return Node.getValue().convertToDouble() == ExpectedValue; return false; } template <> inline bool ValueEqualsMatcher::matchesNode( const FloatingLiteral &Node) const { - if ((&Node.getSemantics()) == &llvm::APFloat::IEEEsingle) + if ((&Node.getSemantics()) == &llvm::APFloat::IEEEsingle()) return Node.getValue().convertToFloat() == ExpectedValue; - if ((&Node.getSemantics()) == &llvm::APFloat::IEEEdouble) + if ((&Node.getSemantics()) == &llvm::APFloat::IEEEdouble()) return Node.getValue().convertToDouble() == ExpectedValue; return false; } diff --git a/lib/AST/APValue.cpp b/lib/AST/APValue.cpp index 8ee71e2fb2..488ad3373c 100644 --- a/lib/AST/APValue.cpp +++ b/lib/AST/APValue.cpp @@ -263,7 +263,7 @@ LLVM_DUMP_METHOD void APValue::dump() const { static double GetApproxValue(const llvm::APFloat &F) { llvm::APFloat V = F; bool ignored; - V.convert(llvm::APFloat::IEEEdouble, llvm::APFloat::rmNearestTiesToEven, + V.convert(llvm::APFloat::IEEEdouble(), llvm::APFloat::rmNearestTiesToEven, &ignored); return V.convertToDouble(); } diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 0307648fa8..6a75955058 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -782,33 +782,33 @@ FloatingLiteral::Create(const ASTContext &C, EmptyShell Empty) { const llvm::fltSemantics &FloatingLiteral::getSemantics() const { switch(FloatingLiteralBits.Semantics) { case IEEEhalf: - return llvm::APFloat::IEEEhalf; + return llvm::APFloat::IEEEhalf(); case IEEEsingle: - return llvm::APFloat::IEEEsingle; + return llvm::APFloat::IEEEsingle(); case IEEEdouble: - return llvm::APFloat::IEEEdouble; + return llvm::APFloat::IEEEdouble(); case x87DoubleExtended: - return llvm::APFloat::x87DoubleExtended; + return llvm::APFloat::x87DoubleExtended(); case IEEEquad: - return llvm::APFloat::IEEEquad; + return llvm::APFloat::IEEEquad(); case PPCDoubleDouble: - return llvm::APFloat::PPCDoubleDouble; + return llvm::APFloat::PPCDoubleDouble(); } llvm_unreachable("Unrecognised floating semantics"); } void FloatingLiteral::setSemantics(const llvm::fltSemantics &Sem) { - if (&Sem == &llvm::APFloat::IEEEhalf) + if (&Sem == &llvm::APFloat::IEEEhalf()) FloatingLiteralBits.Semantics = IEEEhalf; - else if (&Sem == &llvm::APFloat::IEEEsingle) + else if (&Sem == &llvm::APFloat::IEEEsingle()) FloatingLiteralBits.Semantics = IEEEsingle; - else if (&Sem == &llvm::APFloat::IEEEdouble) + else if (&Sem == &llvm::APFloat::IEEEdouble()) FloatingLiteralBits.Semantics = IEEEdouble; - else if (&Sem == &llvm::APFloat::x87DoubleExtended) + else if (&Sem == &llvm::APFloat::x87DoubleExtended()) FloatingLiteralBits.Semantics = x87DoubleExtended; - else if (&Sem == &llvm::APFloat::IEEEquad) + else if (&Sem == &llvm::APFloat::IEEEquad()) FloatingLiteralBits.Semantics = IEEEquad; - else if (&Sem == &llvm::APFloat::PPCDoubleDouble) + else if (&Sem == &llvm::APFloat::PPCDoubleDouble()) FloatingLiteralBits.Semantics = PPCDoubleDouble; else llvm_unreachable("Unknown floating semantics"); @@ -820,7 +820,7 @@ void FloatingLiteral::setSemantics(const llvm::fltSemantics &Sem) { double FloatingLiteral::getValueAsApproximateDouble() const { llvm::APFloat V = getValue(); bool ignored; - V.convert(llvm::APFloat::IEEEdouble, llvm::APFloat::rmNearestTiesToEven, + V.convert(llvm::APFloat::IEEEdouble(), llvm::APFloat::rmNearestTiesToEven, &ignored); return V.convertToDouble(); } diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index e18caffc5a..c57b782632 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -1050,7 +1050,7 @@ namespace { APSInt IntReal, IntImag; APFloat FloatReal, FloatImag; - ComplexValue() : FloatReal(APFloat::Bogus), FloatImag(APFloat::Bogus) {} + ComplexValue() : FloatReal(APFloat::Bogus()), FloatImag(APFloat::Bogus()) {} void makeComplexFloat() { IsInt = false; } bool isComplexFloat() const { return !IsInt; } @@ -6068,7 +6068,7 @@ bool VectorExprEvaluator::VisitCastExpr(const CastExpr *E) { if (EltTy->isRealFloatingType()) { const llvm::fltSemantics &Sem = Info.Ctx.getFloatTypeSemantics(EltTy); unsigned FloatEltSize = EltSize; - if (&Sem == &APFloat::x87DoubleExtended) + if (&Sem == &APFloat::x87DoubleExtended()) FloatEltSize = 80; for (unsigned i = 0; i < NElts; i++) { llvm::APInt Elt; diff --git a/lib/Basic/TargetInfo.cpp b/lib/Basic/TargetInfo.cpp index 19cab14cbf..e37f13a05b 100644 --- a/lib/Basic/TargetInfo.cpp +++ b/lib/Basic/TargetInfo.cpp @@ -77,11 +77,11 @@ TargetInfo::TargetInfo(const llvm::Triple &T) : TargetOpts(), Triple(T) { UseZeroLengthBitfieldAlignment = false; UseExplicitBitFieldAlignment = true; ZeroLengthBitfieldBoundary = 0; - HalfFormat = &llvm::APFloat::IEEEhalf; - FloatFormat = &llvm::APFloat::IEEEsingle; - DoubleFormat = &llvm::APFloat::IEEEdouble; - LongDoubleFormat = &llvm::APFloat::IEEEdouble; - Float128Format = &llvm::APFloat::IEEEquad; + HalfFormat = &llvm::APFloat::IEEEhalf(); + FloatFormat = &llvm::APFloat::IEEEsingle(); + DoubleFormat = &llvm::APFloat::IEEEdouble(); + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); + Float128Format = &llvm::APFloat::IEEEquad(); MCountName = "mcount"; RegParmMax = 0; SSERegParmMax = 0; @@ -227,12 +227,12 @@ TargetInfo::RealType TargetInfo::getRealTypeByWidth(unsigned BitWidth) const { switch (BitWidth) { case 96: - if (&getLongDoubleFormat() == &llvm::APFloat::x87DoubleExtended) + if (&getLongDoubleFormat() == &llvm::APFloat::x87DoubleExtended()) return LongDouble; break; case 128: - if (&getLongDoubleFormat() == &llvm::APFloat::PPCDoubleDouble || - &getLongDoubleFormat() == &llvm::APFloat::IEEEquad) + if (&getLongDoubleFormat() == &llvm::APFloat::PPCDoubleDouble() || + &getLongDoubleFormat() == &llvm::APFloat::IEEEquad()) return LongDouble; if (hasFloat128Type()) return Float128; @@ -309,7 +309,7 @@ void TargetInfo::adjust(const LangOptions &Opts) { // to generating illegal code that uses 64bit doubles. if (DoubleWidth != FloatWidth) { DoubleWidth = DoubleAlign = 64; - DoubleFormat = &llvm::APFloat::IEEEdouble; + DoubleFormat = &llvm::APFloat::IEEEdouble(); } LongDoubleWidth = LongDoubleAlign = 128; @@ -323,9 +323,9 @@ void TargetInfo::adjust(const LangOptions &Opts) { IntMaxType = SignedLongLong; Int64Type = SignedLong; - HalfFormat = &llvm::APFloat::IEEEhalf; - FloatFormat = &llvm::APFloat::IEEEsingle; - LongDoubleFormat = &llvm::APFloat::IEEEquad; + HalfFormat = &llvm::APFloat::IEEEhalf(); + FloatFormat = &llvm::APFloat::IEEEsingle(); + LongDoubleFormat = &llvm::APFloat::IEEEquad(); } if (Opts.NewAlignOverride) diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index d80412a1e4..ee84089835 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -809,7 +809,7 @@ public: this->PtrDiffType = TargetInfo::SignedInt; this->IntPtrType = TargetInfo::SignedInt; // RegParmMax is inherited from the underlying architecture. - this->LongDoubleFormat = &llvm::APFloat::IEEEdouble; + this->LongDoubleFormat = &llvm::APFloat::IEEEdouble(); if (Triple.getArch() == llvm::Triple::arm) { // Handled in ARM's setABI(). } else if (Triple.getArch() == llvm::Triple::x86) { @@ -906,7 +906,7 @@ public: HasBPERMD(false), HasExtDiv(false), HasP9Vector(false) { SimdDefaultAlign = 128; LongDoubleWidth = LongDoubleAlign = 128; - LongDoubleFormat = &llvm::APFloat::PPCDoubleDouble; + LongDoubleFormat = &llvm::APFloat::PPCDoubleDouble(); } /// \brief Flags for architecture specific defines. @@ -1146,7 +1146,7 @@ public: bool useFloat128ManglingForLongDouble() const override { return LongDoubleWidth == 128 && - LongDoubleFormat == &llvm::APFloat::PPCDoubleDouble && + LongDoubleFormat == &llvm::APFloat::PPCDoubleDouble() && getTriple().isOSBinFormatELF(); } }; @@ -1650,7 +1650,7 @@ public: if (getTriple().getOS() == llvm::Triple::FreeBSD) { LongDoubleWidth = LongDoubleAlign = 64; - LongDoubleFormat = &llvm::APFloat::IEEEdouble; + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); } // PPC32 supports atomics up to 4 bytes. @@ -1684,7 +1684,7 @@ public: switch (getTriple().getOS()) { case llvm::Triple::FreeBSD: LongDoubleWidth = LongDoubleAlign = 64; - LongDoubleFormat = &llvm::APFloat::IEEEdouble; + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); break; case llvm::Triple::NetBSD: IntMaxType = SignedLongLong; @@ -2746,7 +2746,7 @@ class X86TargetInfo : public TargetInfo { public: X86TargetInfo(const llvm::Triple &Triple, const TargetOptions &) : TargetInfo(Triple) { - LongDoubleFormat = &llvm::APFloat::x87DoubleExtended; + LongDoubleFormat = &llvm::APFloat::x87DoubleExtended(); } unsigned getFloatEvalMethod() const override { // X87 evaluates with 80 bits "long double" precision. @@ -4297,7 +4297,7 @@ public: const TargetOptions &Opts) : WindowsX86_32TargetInfo(Triple, Opts) { LongDoubleWidth = LongDoubleAlign = 64; - LongDoubleFormat = &llvm::APFloat::IEEEdouble; + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { @@ -4396,7 +4396,7 @@ public: MCUX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) : X86_32TargetInfo(Triple, Opts) { LongDoubleWidth = 64; - LongDoubleFormat = &llvm::APFloat::IEEEdouble; + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); resetDataLayout("e-m:e-p:32:32-i64:32-f64:32-f128:32-n8:16:32-a:0:32-S32"); WIntType = UnsignedInt; } @@ -4616,7 +4616,7 @@ public: const TargetOptions &Opts) : WindowsX86_64TargetInfo(Triple, Opts) { LongDoubleWidth = LongDoubleAlign = 64; - LongDoubleFormat = &llvm::APFloat::IEEEdouble; + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); } void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { @@ -4635,7 +4635,7 @@ public: // Mingw64 rounds long double size and alignment up to 16 bytes, but sticks // with x86 FP ops. Weird. LongDoubleWidth = LongDoubleAlign = 128; - LongDoubleFormat = &llvm::APFloat::x87DoubleExtended; + LongDoubleFormat = &llvm::APFloat::x87DoubleExtended(); } void getTargetDefines(const LangOptions &Opts, @@ -5858,7 +5858,7 @@ public: MaxAtomicPromoteWidth = 128; LongDoubleWidth = LongDoubleAlign = SuitableAlign = 128; - LongDoubleFormat = &llvm::APFloat::IEEEquad; + LongDoubleFormat = &llvm::APFloat::IEEEquad(); // {} in inline assembly are neon specifiers, not assembly variant // specifiers. @@ -6217,7 +6217,7 @@ public: UseSignedCharForObjCBool = false; LongDoubleWidth = LongDoubleAlign = SuitableAlign = 64; - LongDoubleFormat = &llvm::APFloat::IEEEdouble; + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); TheCXXABI.set(TargetCXXABI::iOS64); } @@ -6895,7 +6895,7 @@ public: // aligned. The SPARCv9 SCD 2.4.1 says 16-byte aligned. LongDoubleWidth = 128; LongDoubleAlign = 128; - LongDoubleFormat = &llvm::APFloat::IEEEquad; + LongDoubleFormat = &llvm::APFloat::IEEEquad(); MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; } @@ -6938,7 +6938,7 @@ public: PointerWidth = PointerAlign = 64; LongDoubleWidth = 128; LongDoubleAlign = 64; - LongDoubleFormat = &llvm::APFloat::IEEEquad; + LongDoubleFormat = &llvm::APFloat::IEEEquad(); DefaultAlignForAttributeAligned = 64; MinGlobalAlign = 16; resetDataLayout("E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64"); @@ -7214,9 +7214,9 @@ public: DoubleAlign = 32; LongDoubleWidth = 32; LongDoubleAlign = 32; - FloatFormat = &llvm::APFloat::IEEEsingle; - DoubleFormat = &llvm::APFloat::IEEEsingle; - LongDoubleFormat = &llvm::APFloat::IEEEsingle; + FloatFormat = &llvm::APFloat::IEEEsingle(); + DoubleFormat = &llvm::APFloat::IEEEsingle(); + LongDoubleFormat = &llvm::APFloat::IEEEsingle(); resetDataLayout("E-p:32:32:32-i1:8:8-i8:8:32-" "i16:16:32-i32:32:32-i64:32:32-" "f32:32:32-f64:32:32-v64:32:32-" @@ -7426,7 +7426,7 @@ public: void setO32ABITypes() { Int64Type = SignedLongLong; IntMaxType = Int64Type; - LongDoubleFormat = &llvm::APFloat::IEEEdouble; + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); LongDoubleWidth = LongDoubleAlign = 64; LongWidth = LongAlign = 32; MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32; @@ -7438,10 +7438,10 @@ public: void setN32N64ABITypes() { LongDoubleWidth = LongDoubleAlign = 128; - LongDoubleFormat = &llvm::APFloat::IEEEquad; + LongDoubleFormat = &llvm::APFloat::IEEEquad(); if (getTriple().getOS() == llvm::Triple::FreeBSD) { LongDoubleWidth = LongDoubleAlign = 64; - LongDoubleFormat = &llvm::APFloat::IEEEdouble; + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); } MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; SuitableAlign = 128; @@ -7987,7 +7987,7 @@ public: SimdDefaultAlign = 128; SigAtomicType = SignedLong; LongDoubleWidth = LongDoubleAlign = 128; - LongDoubleFormat = &llvm::APFloat::IEEEquad; + LongDoubleFormat = &llvm::APFloat::IEEEquad(); SizeType = UnsignedInt; PtrDiffType = SignedInt; IntPtrType = SignedInt; @@ -8294,7 +8294,7 @@ public: : LinuxTargetInfo(Triple, Opts) { SuitableAlign = 32; LongDoubleWidth = 64; - LongDoubleFormat = &llvm::APFloat::IEEEdouble; + LongDoubleFormat = &llvm::APFloat::IEEEdouble(); } }; @@ -8303,7 +8303,7 @@ class AndroidX86_64TargetInfo : public LinuxTargetInfo { public: AndroidX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) : LinuxTargetInfo(Triple, Opts) { - LongDoubleFormat = &llvm::APFloat::IEEEquad; + LongDoubleFormat = &llvm::APFloat::IEEEquad(); } bool useFloat128ManglingForLongDouble() const override { diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 106170fe6d..752f419f64 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -1365,7 +1365,7 @@ llvm::Constant *CodeGenModule::EmitConstantValue(const APValue &Value, } case APValue::Float: { const llvm::APFloat &Init = Value.getFloat(); - if (&Init.getSemantics() == &llvm::APFloat::IEEEhalf && + if (&Init.getSemantics() == &llvm::APFloat::IEEEhalf() && !Context.getLangOpts().NativeHalfType && !Context.getLangOpts().HalfArgsAndReturns) return llvm::ConstantInt::get(VMContext, Init.bitcastToAPInt()); diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index fe103f47af..357bff27a3 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -286,21 +286,21 @@ void CodeGenTypes::RefreshTypeCacheForClass(const CXXRecordDecl *RD) { static llvm::Type *getTypeForFormat(llvm::LLVMContext &VMContext, const llvm::fltSemantics &format, bool UseNativeHalf = false) { - if (&format == &llvm::APFloat::IEEEhalf) { + if (&format == &llvm::APFloat::IEEEhalf()) { if (UseNativeHalf) return llvm::Type::getHalfTy(VMContext); else return llvm::Type::getInt16Ty(VMContext); } - if (&format == &llvm::APFloat::IEEEsingle) + if (&format == &llvm::APFloat::IEEEsingle()) return llvm::Type::getFloatTy(VMContext); - if (&format == &llvm::APFloat::IEEEdouble) + if (&format == &llvm::APFloat::IEEEdouble()) return llvm::Type::getDoubleTy(VMContext); - if (&format == &llvm::APFloat::IEEEquad) + if (&format == &llvm::APFloat::IEEEquad()) return llvm::Type::getFP128Ty(VMContext); - if (&format == &llvm::APFloat::PPCDoubleDouble) + if (&format == &llvm::APFloat::PPCDoubleDouble()) return llvm::Type::getPPC_FP128Ty(VMContext); - if (&format == &llvm::APFloat::x87DoubleExtended) + if (&format == &llvm::APFloat::x87DoubleExtended()) return llvm::Type::getX86_FP80Ty(VMContext); llvm_unreachable("Unknown float format!"); } diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index f70c6cb5de..391eb53d25 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -2385,13 +2385,13 @@ void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase, Current = SSE; } else if (k == BuiltinType::LongDouble) { const llvm::fltSemantics *LDF = &getTarget().getLongDoubleFormat(); - if (LDF == &llvm::APFloat::IEEEquad) { + if (LDF == &llvm::APFloat::IEEEquad()) { Lo = SSE; Hi = SSEUp; - } else if (LDF == &llvm::APFloat::x87DoubleExtended) { + } else if (LDF == &llvm::APFloat::x87DoubleExtended()) { Lo = X87; Hi = X87Up; - } else if (LDF == &llvm::APFloat::IEEEdouble) { + } else if (LDF == &llvm::APFloat::IEEEdouble()) { Current = SSE; } else llvm_unreachable("unexpected long double representation!"); @@ -2510,11 +2510,11 @@ void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase, Lo = Hi = SSE; } else if (ET == getContext().LongDoubleTy) { const llvm::fltSemantics *LDF = &getTarget().getLongDoubleFormat(); - if (LDF == &llvm::APFloat::IEEEquad) + if (LDF == &llvm::APFloat::IEEEquad()) Current = Memory; - else if (LDF == &llvm::APFloat::x87DoubleExtended) + else if (LDF == &llvm::APFloat::x87DoubleExtended()) Current = ComplexX87; - else if (LDF == &llvm::APFloat::IEEEdouble) + else if (LDF == &llvm::APFloat::IEEEdouble()) Lo = Hi = SSE; else llvm_unreachable("unexpected long double representation!"); @@ -3747,7 +3747,7 @@ ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty, unsigned &FreeSSERegs, // passes them indirectly through memory. if (IsMingw64 && BT && BT->getKind() == BuiltinType::LongDouble) { const llvm::fltSemantics *LDF = &getTarget().getLongDoubleFormat(); - if (LDF == &llvm::APFloat::x87DoubleExtended) + if (LDF == &llvm::APFloat::x87DoubleExtended()) return ABIArgInfo::getIndirect(Align, /*ByVal=*/false); } diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index b95741b320..31340e0af0 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -112,15 +112,15 @@ template static T PickFP(const llvm::fltSemantics *Sem, T IEEESingleVal, T IEEEDoubleVal, T X87DoubleExtendedVal, T PPCDoubleDoubleVal, T IEEEQuadVal) { - if (Sem == (const llvm::fltSemantics*)&llvm::APFloat::IEEEsingle) + if (Sem == (const llvm::fltSemantics*)&llvm::APFloat::IEEEsingle()) return IEEESingleVal; - if (Sem == (const llvm::fltSemantics*)&llvm::APFloat::IEEEdouble) + if (Sem == (const llvm::fltSemantics*)&llvm::APFloat::IEEEdouble()) return IEEEDoubleVal; - if (Sem == (const llvm::fltSemantics*)&llvm::APFloat::x87DoubleExtended) + if (Sem == (const llvm::fltSemantics*)&llvm::APFloat::x87DoubleExtended()) return X87DoubleExtendedVal; - if (Sem == (const llvm::fltSemantics*)&llvm::APFloat::PPCDoubleDouble) + if (Sem == (const llvm::fltSemantics*)&llvm::APFloat::PPCDoubleDouble()) return PPCDoubleDoubleVal; - assert(Sem == (const llvm::fltSemantics*)&llvm::APFloat::IEEEquad); + assert(Sem == (const llvm::fltSemantics*)&llvm::APFloat::IEEEquad()); return IEEEQuadVal; } diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 4290965300..c81d805283 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1194,7 +1194,7 @@ static bool unsupportedTypeConversion(const Sema &S, QualType LHSType, */ return Float128AndLongDouble && (&S.Context.getFloatTypeSemantics(S.Context.LongDoubleTy) != - &llvm::APFloat::IEEEdouble); + &llvm::APFloat::IEEEdouble()); } typedef ExprResult PerformCastFn(Sema &S, Expr *operand, QualType toType); diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 23ad715e55..1cf685091e 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -1727,7 +1727,7 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType, ToType == S.Context.Float128Ty)); if (Float128AndLongDouble && (&S.Context.getFloatTypeSemantics(S.Context.LongDoubleTy) != - &llvm::APFloat::IEEEdouble)) + &llvm::APFloat::IEEEdouble())) return false; } // Floating point conversions (C++ 4.8). diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 04f812d840..df61a5783b 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -3630,7 +3630,7 @@ static const ExprEvalResult* evaluateExpr(Expr *expr, CXCursor C) { result->EvalType = CXEval_Float; bool ignored; llvm::APFloat apFloat = ER.Val.getFloat(); - apFloat.convert(llvm::APFloat::IEEEdouble, + apFloat.convert(llvm::APFloat::IEEEdouble(), llvm::APFloat::rmNearestTiesToEven, &ignored); result->EvalData.floatVal = apFloat.convertToDouble(); return result.release();