Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit c74bb5e

Browse files
committed
Revert 266186 as it breaks anything that includes type_traits on some platforms
Since this patch provided support for the __float128 type but disabled it on all platforms by default, some platforms can't compile type_traits with -std=gnu++11 since there is a specialization with __float128. This reverts the patch until D19125 is approved (i.e. we know which platforms need this support enabled). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266460 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 2785c79 commit c74bb5e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+75
-393
lines changed

bindings/python/clang/cindex.py

-1
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,6 @@ def __repr__(self):
16851685
TypeKind.OBJCID = TypeKind(27)
16861686
TypeKind.OBJCCLASS = TypeKind(28)
16871687
TypeKind.OBJCSEL = TypeKind(29)
1688-
TypeKind.FLOAT128 = TypeKind(30)
16891688
TypeKind.COMPLEX = TypeKind(100)
16901689
TypeKind.POINTER = TypeKind(101)
16911690
TypeKind.BLOCKPOINTER = TypeKind(102)

include/clang-c/Index.h

-1
Original file line numberDiff line numberDiff line change
@@ -2929,7 +2929,6 @@ enum CXTypeKind {
29292929
CXType_ObjCId = 27,
29302930
CXType_ObjCClass = 28,
29312931
CXType_ObjCSel = 29,
2932-
CXType_Float128 = 30,
29332932
CXType_FirstBuiltin = CXType_Void,
29342933
CXType_LastBuiltin = CXType_ObjCSel,
29352934

include/clang/AST/ASTContext.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -893,10 +893,9 @@ class ASTContext : public RefCountedBase<ASTContext> {
893893
CanQualType SignedCharTy, ShortTy, IntTy, LongTy, LongLongTy, Int128Ty;
894894
CanQualType UnsignedCharTy, UnsignedShortTy, UnsignedIntTy, UnsignedLongTy;
895895
CanQualType UnsignedLongLongTy, UnsignedInt128Ty;
896-
CanQualType FloatTy, DoubleTy, LongDoubleTy, Float128Ty;
896+
CanQualType FloatTy, DoubleTy, LongDoubleTy;
897897
CanQualType HalfTy; // [OpenCL 6.1.1.1], ARM NEON
898898
CanQualType FloatComplexTy, DoubleComplexTy, LongDoubleComplexTy;
899-
CanQualType Float128ComplexTy;
900899
CanQualType VoidPtrTy, NullPtrTy;
901900
CanQualType DependentTy, OverloadTy, BoundMemberTy, UnknownAnyTy;
902901
CanQualType BuiltinFnTy;
@@ -969,6 +968,9 @@ class ASTContext : public RefCountedBase<ASTContext> {
969968
/// \brief Retrieve the declaration for the 128-bit unsigned integer type.
970969
TypedefDecl *getUInt128Decl() const;
971970

971+
/// \brief Retrieve the declaration for a 128-bit float stub type.
972+
TypeDecl *getFloat128StubType() const;
973+
972974
//===--------------------------------------------------------------------===//
973975
// Type Constructors
974976
//===--------------------------------------------------------------------===//

include/clang/AST/BuiltinTypes.def

-3
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ FLOATING_TYPE(Double, DoubleTy)
133133
// 'long double'
134134
FLOATING_TYPE(LongDouble, LongDoubleTy)
135135

136-
// '__float128'
137-
FLOATING_TYPE(Float128, Float128Ty)
138-
139136
//===- Language-specific types --------------------------------------------===//
140137

141138
// This is the type of C++0x 'nullptr'.

include/clang/AST/Type.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2051,7 +2051,7 @@ class BuiltinType : public Type {
20512051
}
20522052

20532053
bool isFloatingPoint() const {
2054-
return getKind() >= Half && getKind() <= Float128;
2054+
return getKind() >= Half && getKind() <= LongDouble;
20552055
}
20562056

20572057
/// Determines whether the given kind corresponds to a placeholder type.

include/clang/AST/TypeLoc.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ class BuiltinTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
538538
bool needsExtraLocalData() const {
539539
BuiltinType::Kind bk = getTypePtr()->getKind();
540540
return (bk >= BuiltinType::UShort && bk <= BuiltinType::UInt128)
541-
|| (bk >= BuiltinType::Short && bk <= BuiltinType::Float128)
541+
|| (bk >= BuiltinType::Short && bk <= BuiltinType::LongDouble)
542542
|| bk == BuiltinType::UChar
543543
|| bk == BuiltinType::SChar;
544544
}

include/clang/Basic/DiagnosticSemaKinds.td

+4-2
Original file line numberDiff line numberDiff line change
@@ -5246,6 +5246,8 @@ def err_typecheck_pointer_arith_void_type : Error<
52465246
"arithmetic on%select{ a|}0 pointer%select{|s}0 to void">;
52475247
def err_typecheck_decl_incomplete_type : Error<
52485248
"variable has incomplete type %0">;
5249+
def err_typecheck_decl_incomplete_type___float128 : Error<
5250+
"support for type '__float128' is not yet implemented">;
52495251
def ext_typecheck_decl_incomplete_type : ExtWarn<
52505252
"tentative definition of variable with internal linkage has incomplete non-array type %0">,
52515253
InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
@@ -7599,8 +7601,8 @@ def err_c99_array_usage_cxx : Error<
75997601
"feature, not permitted in C++">;
76007602
def err_type_requires_extension : Error<
76017603
"use of type %0 requires %1 extension to be enabled">;
7602-
def err_type_unsupported : Error<
7603-
"%0 is not supported on this target">;
7604+
def err_int128_unsupported : Error<
7605+
"__int128 is not supported on this target">;
76047606
def err_nsconsumed_attribute_mismatch : Error<
76057607
"overriding method has mismatched ns_consumed attribute on its"
76067608
" parameter">;

include/clang/Basic/Specifiers.h

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ namespace clang {
5454
TST_half, // OpenCL half, ARM NEON __fp16
5555
TST_float,
5656
TST_double,
57-
TST_float128,
5857
TST_bool, // _Bool
5958
TST_decimal32, // _Decimal32
6059
TST_decimal64, // _Decimal64

include/clang/Basic/TargetInfo.h

+3-17
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class TargetInfo : public RefCountedBase<TargetInfo> {
6464
unsigned char HalfWidth, HalfAlign;
6565
unsigned char FloatWidth, FloatAlign;
6666
unsigned char DoubleWidth, DoubleAlign;
67-
unsigned char LongDoubleWidth, LongDoubleAlign, Float128Align;
67+
unsigned char LongDoubleWidth, LongDoubleAlign;
6868
unsigned char LargeArrayMinWidth, LargeArrayAlign;
6969
unsigned char LongWidth, LongAlign;
7070
unsigned char LongLongWidth, LongLongAlign;
@@ -78,7 +78,7 @@ class TargetInfo : public RefCountedBase<TargetInfo> {
7878
std::unique_ptr<llvm::DataLayout> DataLayout;
7979
const char *MCountName;
8080
const llvm::fltSemantics *HalfFormat, *FloatFormat, *DoubleFormat,
81-
*LongDoubleFormat, *Float128Format;
81+
*LongDoubleFormat;
8282
unsigned char RegParmMax, SSERegParmMax;
8383
TargetCXXABI TheCXXABI;
8484
const LangAS::Map *AddrSpaceMap;
@@ -136,8 +136,7 @@ class TargetInfo : public RefCountedBase<TargetInfo> {
136136
NoFloat = 255,
137137
Float = 0,
138138
Double,
139-
LongDouble,
140-
Float128
139+
LongDouble
141140
};
142141

143142
/// \brief The different kinds of __builtin_va_list types defined by
@@ -328,11 +327,6 @@ class TargetInfo : public RefCountedBase<TargetInfo> {
328327
return getPointerWidth(0) >= 64;
329328
} // FIXME
330329

331-
/// \brief Determine whether the __float128 type is supported on this target.
332-
virtual bool hasFloat128Type() const {
333-
return false;
334-
}
335-
336330
/// \brief Return the alignment that is suitable for storing any
337331
/// object with a fundamental alignment requirement.
338332
unsigned getSuitableAlign() const { return SuitableAlign; }
@@ -385,14 +379,6 @@ class TargetInfo : public RefCountedBase<TargetInfo> {
385379
return *LongDoubleFormat;
386380
}
387381

388-
/// getFloat128Width/Align/Format - Return the size/align/format of
389-
/// '__float128'.
390-
unsigned getFloat128Width() const { return 128; }
391-
unsigned getFloat128Align() const { return Float128Align; }
392-
const llvm::fltSemantics &getFloat128Format() const {
393-
return *Float128Format;
394-
}
395-
396382
/// \brief Return true if the 'long double' type should be mangled like
397383
/// __float128.
398384
virtual bool useFloat128ManglingForLongDouble() const { return false; }

include/clang/Basic/TokenKinds.def

-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ KEYWORD(__builtin_offsetof , KEYALL)
380380
TYPE_TRAIT_2(__builtin_types_compatible_p, TypeCompatible, KEYNOCXX)
381381
KEYWORD(__builtin_va_arg , KEYALL)
382382
KEYWORD(__extension__ , KEYALL)
383-
KEYWORD(__float128 , KEYALL)
384383
KEYWORD(__imag , KEYALL)
385384
KEYWORD(__int128 , KEYALL)
386385
KEYWORD(__label__ , KEYALL)

include/clang/Driver/Options.td

-4
Original file line numberDiff line numberDiff line change
@@ -1495,10 +1495,6 @@ def minvariant_function_descriptors :
14951495
def mno_invariant_function_descriptors :
14961496
Flag<["-"], "mno-invariant-function-descriptors">,
14971497
Group<m_ppc_Features_Group>;
1498-
def mfloat128: Flag<["-"], "mfloat128">,
1499-
Group<m_ppc_Features_Group>;
1500-
def mno_float128 : Flag<["-"], "mno-float128">,
1501-
Group<m_ppc_Features_Group>;
15021498

15031499
def faltivec : Flag<["-"], "faltivec">, Group<f_Group>, Flags<[CC1Option]>,
15041500
HelpText<"Enable AltiVec vector initializer syntax">;

include/clang/Lex/LiteralSupport.h

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class NumericLiteralParser {
6464
bool isHalf : 1; // 1.0h
6565
bool isFloat : 1; // 1.0f
6666
bool isImaginary : 1; // 1.0i
67-
bool isFloat128 : 1; // 1.0q
6867
uint8_t MicrosoftInteger; // Microsoft suffix extension i8, i16, i32, or i64.
6968

7069
bool isIntegerLiteral() const {

include/clang/Sema/DeclSpec.h

-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ class DeclSpec {
280280
static const TST TST_half = clang::TST_half;
281281
static const TST TST_float = clang::TST_float;
282282
static const TST TST_double = clang::TST_double;
283-
static const TST TST_float128 = clang::TST_float128;
284283
static const TST TST_bool = clang::TST_bool;
285284
static const TST TST_decimal32 = clang::TST_decimal32;
286285
static const TST TST_decimal64 = clang::TST_decimal64;

include/clang/Serialization/ASTBitCodes.h

-2
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,6 @@ namespace clang {
794794
PREDEF_TYPE_RESERVE_ID_ID = 42,
795795
/// \brief The placeholder type for OpenMP array section.
796796
PREDEF_TYPE_OMP_ARRAY_SECTION = 43,
797-
/// \brief The '__float128' type
798-
PREDEF_TYPE_FLOAT128_ID = 44,
799797
/// \brief OpenCL image types with auto numeration
800798
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
801799
PREDEF_TYPE_##Id##_ID,

lib/AST/ASTContext.cpp

+9-16
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ unsigned ASTContext::NumImplicitDestructors;
5858
unsigned ASTContext::NumImplicitDestructorsDeclared;
5959

6060
enum FloatingRank {
61-
HalfRank, FloatRank, DoubleRank, LongDoubleRank, Float128Rank
61+
HalfRank, FloatRank, DoubleRank, LongDoubleRank
6262
};
6363

6464
RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const {
@@ -967,6 +967,14 @@ TypedefDecl *ASTContext::getUInt128Decl() const {
967967
return UInt128Decl;
968968
}
969969

970+
TypeDecl *ASTContext::getFloat128StubType() const {
971+
assert(LangOpts.CPlusPlus && "should only be called for c++");
972+
if (!Float128StubDecl)
973+
Float128StubDecl = buildImplicitRecord("__float128");
974+
975+
return Float128StubDecl;
976+
}
977+
970978
void ASTContext::InitBuiltinType(CanQualType &R, BuiltinType::Kind K) {
971979
BuiltinType *Ty = new (*this, TypeAlignment) BuiltinType(K);
972980
R = CanQualType::CreateUnsafe(QualType(Ty, 0));
@@ -1015,9 +1023,6 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target,
10151023
InitBuiltinType(DoubleTy, BuiltinType::Double);
10161024
InitBuiltinType(LongDoubleTy, BuiltinType::LongDouble);
10171025

1018-
// GNU extension, __float128 for IEEE quadruple precision
1019-
InitBuiltinType(Float128Ty, BuiltinType::Float128);
1020-
10211026
// GNU extension, 128-bit integers.
10221027
InitBuiltinType(Int128Ty, BuiltinType::Int128);
10231028
InitBuiltinType(UnsignedInt128Ty, BuiltinType::UInt128);
@@ -1079,7 +1084,6 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target,
10791084
FloatComplexTy = getComplexType(FloatTy);
10801085
DoubleComplexTy = getComplexType(DoubleTy);
10811086
LongDoubleComplexTy = getComplexType(LongDoubleTy);
1082-
Float128ComplexTy = getComplexType(Float128Ty);
10831087

10841088
// Builtin types for 'id', 'Class', and 'SEL'.
10851089
InitBuiltinType(ObjCBuiltinIdTy, BuiltinType::ObjCId);
@@ -1337,7 +1341,6 @@ const llvm::fltSemantics &ASTContext::getFloatTypeSemantics(QualType T) const {
13371341
case BuiltinType::Float: return Target->getFloatFormat();
13381342
case BuiltinType::Double: return Target->getDoubleFormat();
13391343
case BuiltinType::LongDouble: return Target->getLongDoubleFormat();
1340-
case BuiltinType::Float128: return Target->getFloat128Format();
13411344
}
13421345
}
13431346

@@ -1648,10 +1651,6 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const {
16481651
Width = Target->getLongDoubleWidth();
16491652
Align = Target->getLongDoubleAlign();
16501653
break;
1651-
case BuiltinType::Float128:
1652-
Width = Target->getFloat128Width();
1653-
Align = Target->getFloat128Align();
1654-
break;
16551654
case BuiltinType::NullPtr:
16561655
Width = Target->getPointerWidth(0); // C++ 3.9.1p11: sizeof(nullptr_t)
16571656
Align = Target->getPointerAlign(0); // == sizeof(void*)
@@ -4636,7 +4635,6 @@ static FloatingRank getFloatingRank(QualType T) {
46364635
case BuiltinType::Float: return FloatRank;
46374636
case BuiltinType::Double: return DoubleRank;
46384637
case BuiltinType::LongDouble: return LongDoubleRank;
4639-
case BuiltinType::Float128: return Float128Rank;
46404638
}
46414639
}
46424640

@@ -4653,7 +4651,6 @@ QualType ASTContext::getFloatingTypeOfSizeWithinDomain(QualType Size,
46534651
case FloatRank: return FloatComplexTy;
46544652
case DoubleRank: return DoubleComplexTy;
46554653
case LongDoubleRank: return LongDoubleComplexTy;
4656-
case Float128Rank: return Float128ComplexTy;
46574654
}
46584655
}
46594656

@@ -4663,7 +4660,6 @@ QualType ASTContext::getFloatingTypeOfSizeWithinDomain(QualType Size,
46634660
case FloatRank: return FloatTy;
46644661
case DoubleRank: return DoubleTy;
46654662
case LongDoubleRank: return LongDoubleTy;
4666-
case Float128Rank: return Float128Ty;
46674663
}
46684664
llvm_unreachable("getFloatingRank(): illegal value for rank");
46694665
}
@@ -5493,7 +5489,6 @@ static char getObjCEncodingForPrimitiveKind(const ASTContext *C,
54935489
case BuiltinType::LongDouble: return 'D';
54945490
case BuiltinType::NullPtr: return '*'; // like char*
54955491

5496-
case BuiltinType::Float128:
54975492
case BuiltinType::Half:
54985493
// FIXME: potentially need @encodes for these!
54995494
return ' ';
@@ -8684,8 +8679,6 @@ QualType ASTContext::getRealTypeForBitwidth(unsigned DestWidth) const {
86848679
return DoubleTy;
86858680
case TargetInfo::LongDouble:
86868681
return LongDoubleTy;
8687-
case TargetInfo::Float128:
8688-
return Float128Ty;
86898682
case TargetInfo::NoFloat:
86908683
return QualType();
86918684
}

lib/AST/ItaniumMangle.cpp

+1-7
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,7 @@ void CXXNameMangler::mangleType(const BuiltinType *T) {
19921992
// ::= f # float
19931993
// ::= d # double
19941994
// ::= e # long double, __float80
1995-
// ::= g # __float128
1995+
// UNSUPPORTED: ::= g # __float128
19961996
// UNSUPPORTED: ::= Dd # IEEE 754r decimal floating point (64 bits)
19971997
// UNSUPPORTED: ::= De # IEEE 754r decimal floating point (128 bits)
19981998
// UNSUPPORTED: ::= Df # IEEE 754r decimal floating point (32 bits)
@@ -2073,12 +2073,6 @@ void CXXNameMangler::mangleType(const BuiltinType *T) {
20732073
? 'g'
20742074
: 'e');
20752075
break;
2076-
case BuiltinType::Float128:
2077-
if (getASTContext().getTargetInfo().useFloat128ManglingForLongDouble())
2078-
Out << "U10__float128"; // Match the GCC mangling
2079-
else
2080-
Out << 'g';
2081-
break;
20822076
case BuiltinType::NullPtr:
20832077
Out << "Dn";
20842078
break;

lib/AST/MicrosoftMangle.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,6 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers,
17511751
Out << "$$T";
17521752
break;
17531753

1754-
case BuiltinType::Float128:
17551754
case BuiltinType::Half: {
17561755
DiagnosticsEngine &Diags = Context.getDiags();
17571756
unsigned DiagID = Diags.getCustomDiagID(

lib/AST/NSAPI.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,6 @@ NSAPI::getNSNumberFactoryMethodKind(QualType T) const {
441441
case BuiltinType::Int128:
442442
case BuiltinType::LongDouble:
443443
case BuiltinType::UInt128:
444-
case BuiltinType::Float128:
445444
case BuiltinType::NullPtr:
446445
case BuiltinType::ObjCClass:
447446
case BuiltinType::ObjCId:

lib/AST/StmtPrinter.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,6 @@ static void PrintFloatingLiteral(raw_ostream &OS, FloatingLiteral *Node,
13101310
case BuiltinType::Double: break; // no suffix.
13111311
case BuiltinType::Float: OS << 'F'; break;
13121312
case BuiltinType::LongDouble: OS << 'L'; break;
1313-
case BuiltinType::Float128: OS << 'Q'; break;
13141313
}
13151314
}
13161315

lib/AST/Type.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,7 @@ bool Type::hasUnsignedIntegerRepresentation() const {
17771777
bool Type::isFloatingType() const {
17781778
if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
17791779
return BT->getKind() >= BuiltinType::Half &&
1780-
BT->getKind() <= BuiltinType::Float128;
1780+
BT->getKind() <= BuiltinType::LongDouble;
17811781
if (const ComplexType *CT = dyn_cast<ComplexType>(CanonicalType))
17821782
return CT->getElementType()->isFloatingType();
17831783
return false;
@@ -1799,7 +1799,7 @@ bool Type::isRealFloatingType() const {
17991799
bool Type::isRealType() const {
18001800
if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
18011801
return BT->getKind() >= BuiltinType::Bool &&
1802-
BT->getKind() <= BuiltinType::Float128;
1802+
BT->getKind() <= BuiltinType::LongDouble;
18031803
if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
18041804
return ET->getDecl()->isComplete() && !ET->getDecl()->isScoped();
18051805
return false;
@@ -1808,7 +1808,7 @@ bool Type::isRealType() const {
18081808
bool Type::isArithmeticType() const {
18091809
if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
18101810
return BT->getKind() >= BuiltinType::Bool &&
1811-
BT->getKind() <= BuiltinType::Float128;
1811+
BT->getKind() <= BuiltinType::LongDouble;
18121812
if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
18131813
// GCC allows forward declaration of enum types (forbid by C99 6.7.2.3p2).
18141814
// If a body isn't seen by the time we get here, return false.
@@ -2552,8 +2552,6 @@ StringRef BuiltinType::getName(const PrintingPolicy &Policy) const {
25522552
return "double";
25532553
case LongDouble:
25542554
return "long double";
2555-
case Float128:
2556-
return "__float128";
25572555
case WChar_S:
25582556
case WChar_U:
25592557
return Policy.MSWChar ? "__wchar_t" : "wchar_t";

lib/AST/TypeLoc.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const {
320320
case BuiltinType::Float:
321321
case BuiltinType::Double:
322322
case BuiltinType::LongDouble:
323-
case BuiltinType::Float128:
324323
llvm_unreachable("Builtin type needs extra local data!");
325324
// Fall through, if the impossible happens.
326325

lib/Analysis/PrintfFormatString.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,6 @@ bool PrintfSpecifier::fixType(QualType QT, const LangOptions &LangOpt,
616616
case BuiltinType::UInt128:
617617
case BuiltinType::Int128:
618618
case BuiltinType::Half:
619-
case BuiltinType::Float128:
620619
// Various types which are non-trivial to correct.
621620
return false;
622621

0 commit comments

Comments
 (0)