r247678 - Run clang-format to unify the switch statement style as suggest here: http://reviews.llvm.org/D12855#246073.
Alexey Bader via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 15 05:18:29 PDT 2015
Author: bader
Date: Tue Sep 15 07:18:29 2015
New Revision: 247678
URL: http://llvm.org/viewvc/llvm-project?rev=247678&view=rev
Log:
Run clang-format to unify the switch statement style as suggest here: http://reviews.llvm.org/D12855#246073.
NFC.
Modified:
cfe/trunk/lib/AST/ItaniumMangle.cpp
cfe/trunk/lib/AST/MicrosoftMangle.cpp
cfe/trunk/lib/AST/Type.cpp
cfe/trunk/lib/Serialization/ASTCommon.cpp
cfe/trunk/lib/Serialization/ASTReader.cpp
Modified: cfe/trunk/lib/AST/ItaniumMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumMangle.cpp?rev=247678&r1=247677&r2=247678&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumMangle.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumMangle.cpp Tue Sep 15 07:18:29 2015
@@ -1985,34 +1985,79 @@ void CXXNameMangler::mangleType(const Bu
// ::= Dn # std::nullptr_t (i.e., decltype(nullptr))
// ::= u <source-name> # vendor extended type
switch (T->getKind()) {
- case BuiltinType::Void: Out << 'v'; break;
- case BuiltinType::Bool: Out << 'b'; break;
- case BuiltinType::Char_U: case BuiltinType::Char_S: Out << 'c'; break;
- case BuiltinType::UChar: Out << 'h'; break;
- case BuiltinType::UShort: Out << 't'; break;
- case BuiltinType::UInt: Out << 'j'; break;
- case BuiltinType::ULong: Out << 'm'; break;
- case BuiltinType::ULongLong: Out << 'y'; break;
- case BuiltinType::UInt128: Out << 'o'; break;
- case BuiltinType::SChar: Out << 'a'; break;
+ case BuiltinType::Void:
+ Out << 'v';
+ break;
+ case BuiltinType::Bool:
+ Out << 'b';
+ break;
+ case BuiltinType::Char_U:
+ case BuiltinType::Char_S:
+ Out << 'c';
+ break;
+ case BuiltinType::UChar:
+ Out << 'h';
+ break;
+ case BuiltinType::UShort:
+ Out << 't';
+ break;
+ case BuiltinType::UInt:
+ Out << 'j';
+ break;
+ case BuiltinType::ULong:
+ Out << 'm';
+ break;
+ case BuiltinType::ULongLong:
+ Out << 'y';
+ break;
+ case BuiltinType::UInt128:
+ Out << 'o';
+ break;
+ case BuiltinType::SChar:
+ Out << 'a';
+ break;
case BuiltinType::WChar_S:
- case BuiltinType::WChar_U: Out << 'w'; break;
- case BuiltinType::Char16: Out << "Ds"; break;
- case BuiltinType::Char32: Out << "Di"; break;
- case BuiltinType::Short: Out << 's'; break;
- case BuiltinType::Int: Out << 'i'; break;
- case BuiltinType::Long: Out << 'l'; break;
- case BuiltinType::LongLong: Out << 'x'; break;
- case BuiltinType::Int128: Out << 'n'; break;
- case BuiltinType::Half: Out << "Dh"; break;
- case BuiltinType::Float: Out << 'f'; break;
- case BuiltinType::Double: Out << 'd'; break;
+ case BuiltinType::WChar_U:
+ Out << 'w';
+ break;
+ case BuiltinType::Char16:
+ Out << "Ds";
+ break;
+ case BuiltinType::Char32:
+ Out << "Di";
+ break;
+ case BuiltinType::Short:
+ Out << 's';
+ break;
+ case BuiltinType::Int:
+ Out << 'i';
+ break;
+ case BuiltinType::Long:
+ Out << 'l';
+ break;
+ case BuiltinType::LongLong:
+ Out << 'x';
+ break;
+ case BuiltinType::Int128:
+ Out << 'n';
+ break;
+ case BuiltinType::Half:
+ Out << "Dh";
+ break;
+ case BuiltinType::Float:
+ Out << 'f';
+ break;
+ case BuiltinType::Double:
+ Out << 'd';
+ break;
case BuiltinType::LongDouble:
Out << (getASTContext().getTargetInfo().useFloat128ManglingForLongDouble()
? 'g'
: 'e');
break;
- case BuiltinType::NullPtr: Out << "Dn"; break;
+ case BuiltinType::NullPtr:
+ Out << "Dn";
+ break;
#define BUILTIN_TYPE(Id, SingletonId)
#define PLACEHOLDER_TYPE(Id, SingletonId) \
@@ -2020,14 +2065,30 @@ void CXXNameMangler::mangleType(const Bu
#include "clang/AST/BuiltinTypes.def"
case BuiltinType::Dependent:
llvm_unreachable("mangling a placeholder type");
- case BuiltinType::ObjCId: Out << "11objc_object"; break;
- case BuiltinType::ObjCClass: Out << "10objc_class"; break;
- case BuiltinType::ObjCSel: Out << "13objc_selector"; break;
- case BuiltinType::OCLImage1d: Out << "11ocl_image1d"; break;
- case BuiltinType::OCLImage1dArray: Out << "16ocl_image1darray"; break;
- case BuiltinType::OCLImage1dBuffer: Out << "17ocl_image1dbuffer"; break;
- case BuiltinType::OCLImage2d: Out << "11ocl_image2d"; break;
- case BuiltinType::OCLImage2dArray: Out << "16ocl_image2darray"; break;
+ case BuiltinType::ObjCId:
+ Out << "11objc_object";
+ break;
+ case BuiltinType::ObjCClass:
+ Out << "10objc_class";
+ break;
+ case BuiltinType::ObjCSel:
+ Out << "13objc_selector";
+ break;
+ case BuiltinType::OCLImage1d:
+ Out << "11ocl_image1d";
+ break;
+ case BuiltinType::OCLImage1dArray:
+ Out << "16ocl_image1darray";
+ break;
+ case BuiltinType::OCLImage1dBuffer:
+ Out << "17ocl_image1dbuffer";
+ break;
+ case BuiltinType::OCLImage2d:
+ Out << "11ocl_image2d";
+ break;
+ case BuiltinType::OCLImage2dArray:
+ Out << "16ocl_image2darray";
+ break;
case BuiltinType::OCLImage2dDepth:
Out << "16ocl_image2ddepth";
break;
@@ -2046,9 +2107,15 @@ void CXXNameMangler::mangleType(const Bu
case BuiltinType::OCLImage2dArrayMSAADepth:
Out << "35ocl_image2darraymsaadepth";
break;
- case BuiltinType::OCLImage3d: Out << "11ocl_image3d"; break;
- case BuiltinType::OCLSampler: Out << "11ocl_sampler"; break;
- case BuiltinType::OCLEvent: Out << "9ocl_event"; break;
+ case BuiltinType::OCLImage3d:
+ Out << "11ocl_image3d";
+ break;
+ case BuiltinType::OCLSampler:
+ Out << "11ocl_sampler";
+ break;
+ case BuiltinType::OCLEvent:
+ Out << "9ocl_event";
+ break;
case BuiltinType::OCLClkEvent:
Out << "12ocl_clkevent";
break;
Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=247678&r1=247677&r2=247678&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Tue Sep 15 07:18:29 2015
@@ -1553,29 +1553,72 @@ void MicrosoftCXXNameMangler::mangleType
// ::= _W # wchar_t
// ::= _Z # __float80 (Digital Mars)
switch (T->getKind()) {
- case BuiltinType::Void: Out << 'X'; break;
- case BuiltinType::SChar: Out << 'C'; break;
- case BuiltinType::Char_U: case BuiltinType::Char_S: Out << 'D'; break;
- case BuiltinType::UChar: Out << 'E'; break;
- case BuiltinType::Short: Out << 'F'; break;
- case BuiltinType::UShort: Out << 'G'; break;
- case BuiltinType::Int: Out << 'H'; break;
- case BuiltinType::UInt: Out << 'I'; break;
- case BuiltinType::Long: Out << 'J'; break;
- case BuiltinType::ULong: Out << 'K'; break;
- case BuiltinType::Float: Out << 'M'; break;
- case BuiltinType::Double: Out << 'N'; break;
+ case BuiltinType::Void:
+ Out << 'X';
+ break;
+ case BuiltinType::SChar:
+ Out << 'C';
+ break;
+ case BuiltinType::Char_U:
+ case BuiltinType::Char_S:
+ Out << 'D';
+ break;
+ case BuiltinType::UChar:
+ Out << 'E';
+ break;
+ case BuiltinType::Short:
+ Out << 'F';
+ break;
+ case BuiltinType::UShort:
+ Out << 'G';
+ break;
+ case BuiltinType::Int:
+ Out << 'H';
+ break;
+ case BuiltinType::UInt:
+ Out << 'I';
+ break;
+ case BuiltinType::Long:
+ Out << 'J';
+ break;
+ case BuiltinType::ULong:
+ Out << 'K';
+ break;
+ case BuiltinType::Float:
+ Out << 'M';
+ break;
+ case BuiltinType::Double:
+ Out << 'N';
+ break;
// TODO: Determine size and mangle accordingly
- case BuiltinType::LongDouble: Out << 'O'; break;
- case BuiltinType::LongLong: Out << "_J"; break;
- case BuiltinType::ULongLong: Out << "_K"; break;
- case BuiltinType::Int128: Out << "_L"; break;
- case BuiltinType::UInt128: Out << "_M"; break;
- case BuiltinType::Bool: Out << "_N"; break;
- case BuiltinType::Char16: Out << "_S"; break;
- case BuiltinType::Char32: Out << "_U"; break;
+ case BuiltinType::LongDouble:
+ Out << 'O';
+ break;
+ case BuiltinType::LongLong:
+ Out << "_J";
+ break;
+ case BuiltinType::ULongLong:
+ Out << "_K";
+ break;
+ case BuiltinType::Int128:
+ Out << "_L";
+ break;
+ case BuiltinType::UInt128:
+ Out << "_M";
+ break;
+ case BuiltinType::Bool:
+ Out << "_N";
+ break;
+ case BuiltinType::Char16:
+ Out << "_S";
+ break;
+ case BuiltinType::Char32:
+ Out << "_U";
+ break;
case BuiltinType::WChar_S:
- case BuiltinType::WChar_U: Out << "_W"; break;
+ case BuiltinType::WChar_U:
+ Out << "_W";
+ break;
#define BUILTIN_TYPE(Id, SingletonId)
#define PLACEHOLDER_TYPE(Id, SingletonId) \
@@ -1584,15 +1627,31 @@ void MicrosoftCXXNameMangler::mangleType
case BuiltinType::Dependent:
llvm_unreachable("placeholder types shouldn't get to name mangling");
- case BuiltinType::ObjCId: Out << "PAUobjc_object@@"; break;
- case BuiltinType::ObjCClass: Out << "PAUobjc_class@@"; break;
- case BuiltinType::ObjCSel: Out << "PAUobjc_selector@@"; break;
+ case BuiltinType::ObjCId:
+ Out << "PAUobjc_object@@";
+ break;
+ case BuiltinType::ObjCClass:
+ Out << "PAUobjc_class@@";
+ break;
+ case BuiltinType::ObjCSel:
+ Out << "PAUobjc_selector@@";
+ break;
- case BuiltinType::OCLImage1d: Out << "PAUocl_image1d@@"; break;
- case BuiltinType::OCLImage1dArray: Out << "PAUocl_image1darray@@"; break;
- case BuiltinType::OCLImage1dBuffer: Out << "PAUocl_image1dbuffer@@"; break;
- case BuiltinType::OCLImage2d: Out << "PAUocl_image2d@@"; break;
- case BuiltinType::OCLImage2dArray: Out << "PAUocl_image2darray@@"; break;
+ case BuiltinType::OCLImage1d:
+ Out << "PAUocl_image1d@@";
+ break;
+ case BuiltinType::OCLImage1dArray:
+ Out << "PAUocl_image1darray@@";
+ break;
+ case BuiltinType::OCLImage1dBuffer:
+ Out << "PAUocl_image1dbuffer@@";
+ break;
+ case BuiltinType::OCLImage2d:
+ Out << "PAUocl_image2d@@";
+ break;
+ case BuiltinType::OCLImage2dArray:
+ Out << "PAUocl_image2darray@@";
+ break;
case BuiltinType::OCLImage2dDepth:
Out << "PAUocl_image2ddepth@@";
break;
@@ -1611,9 +1670,15 @@ void MicrosoftCXXNameMangler::mangleType
case BuiltinType::OCLImage2dArrayMSAADepth:
Out << "PAUocl_image2darraymsaadepth@@";
break;
- case BuiltinType::OCLImage3d: Out << "PAUocl_image3d@@"; break;
- case BuiltinType::OCLSampler: Out << "PAUocl_sampler@@"; break;
- case BuiltinType::OCLEvent: Out << "PAUocl_event@@"; break;
+ case BuiltinType::OCLImage3d:
+ Out << "PAUocl_image3d@@";
+ break;
+ case BuiltinType::OCLSampler:
+ Out << "PAUocl_sampler@@";
+ break;
+ case BuiltinType::OCLEvent:
+ Out << "PAUocl_event@@";
+ break;
case BuiltinType::OCLClkEvent:
Out << "PAUocl_clkevent@@";
break;
@@ -1627,15 +1692,16 @@ void MicrosoftCXXNameMangler::mangleType
Out << "PAUocl_reserveid@@";
break;
- case BuiltinType::NullPtr: Out << "$$T"; break;
+ case BuiltinType::NullPtr:
+ Out << "$$T";
+ break;
case BuiltinType::Half: {
DiagnosticsEngine &Diags = Context.getDiags();
- unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,
- "cannot mangle this built-in %0 type yet");
+ unsigned DiagID = Diags.getCustomDiagID(
+ DiagnosticsEngine::Error, "cannot mangle this built-in %0 type yet");
Diags.Report(Range.getBegin(), DiagID)
- << T->getName(Context.getASTContext().getPrintingPolicy())
- << Range;
+ << T->getName(Context.getASTContext().getPrintingPolicy()) << Range;
break;
}
}
Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=247678&r1=247677&r2=247678&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Tue Sep 15 07:18:29 2015
@@ -2490,46 +2490,85 @@ const char *Type::getTypeClassName() con
StringRef BuiltinType::getName(const PrintingPolicy &Policy) const {
switch (getKind()) {
- case Void: return "void";
- case Bool: return Policy.Bool ? "bool" : "_Bool";
- case Char_S: return "char";
- case Char_U: return "char";
- case SChar: return "signed char";
- case Short: return "short";
- case Int: return "int";
- case Long: return "long";
- case LongLong: return "long long";
- case Int128: return "__int128";
- case UChar: return "unsigned char";
- case UShort: return "unsigned short";
- case UInt: return "unsigned int";
- case ULong: return "unsigned long";
- case ULongLong: return "unsigned long long";
- case UInt128: return "unsigned __int128";
- case Half: return Policy.Half ? "half" : "__fp16";
- case Float: return "float";
- case Double: return "double";
- case LongDouble: return "long double";
+ case Void:
+ return "void";
+ case Bool:
+ return Policy.Bool ? "bool" : "_Bool";
+ case Char_S:
+ return "char";
+ case Char_U:
+ return "char";
+ case SChar:
+ return "signed char";
+ case Short:
+ return "short";
+ case Int:
+ return "int";
+ case Long:
+ return "long";
+ case LongLong:
+ return "long long";
+ case Int128:
+ return "__int128";
+ case UChar:
+ return "unsigned char";
+ case UShort:
+ return "unsigned short";
+ case UInt:
+ return "unsigned int";
+ case ULong:
+ return "unsigned long";
+ case ULongLong:
+ return "unsigned long long";
+ case UInt128:
+ return "unsigned __int128";
+ case Half:
+ return Policy.Half ? "half" : "__fp16";
+ case Float:
+ return "float";
+ case Double:
+ return "double";
+ case LongDouble:
+ return "long double";
case WChar_S:
- case WChar_U: return Policy.MSWChar ? "__wchar_t" : "wchar_t";
- case Char16: return "char16_t";
- case Char32: return "char32_t";
- case NullPtr: return "nullptr_t";
- case Overload: return "<overloaded function type>";
- case BoundMember: return "<bound member function type>";
- case PseudoObject: return "<pseudo-object type>";
- case Dependent: return "<dependent type>";
- case UnknownAny: return "<unknown type>";
- case ARCUnbridgedCast: return "<ARC unbridged cast type>";
- case BuiltinFn: return "<builtin fn type>";
- case ObjCId: return "id";
- case ObjCClass: return "Class";
- case ObjCSel: return "SEL";
- case OCLImage1d: return "image1d_t";
- case OCLImage1dArray: return "image1d_array_t";
- case OCLImage1dBuffer: return "image1d_buffer_t";
- case OCLImage2d: return "image2d_t";
- case OCLImage2dArray: return "image2d_array_t";
+ case WChar_U:
+ return Policy.MSWChar ? "__wchar_t" : "wchar_t";
+ case Char16:
+ return "char16_t";
+ case Char32:
+ return "char32_t";
+ case NullPtr:
+ return "nullptr_t";
+ case Overload:
+ return "<overloaded function type>";
+ case BoundMember:
+ return "<bound member function type>";
+ case PseudoObject:
+ return "<pseudo-object type>";
+ case Dependent:
+ return "<dependent type>";
+ case UnknownAny:
+ return "<unknown type>";
+ case ARCUnbridgedCast:
+ return "<ARC unbridged cast type>";
+ case BuiltinFn:
+ return "<builtin fn type>";
+ case ObjCId:
+ return "id";
+ case ObjCClass:
+ return "Class";
+ case ObjCSel:
+ return "SEL";
+ case OCLImage1d:
+ return "image1d_t";
+ case OCLImage1dArray:
+ return "image1d_array_t";
+ case OCLImage1dBuffer:
+ return "image1d_buffer_t";
+ case OCLImage2d:
+ return "image2d_t";
+ case OCLImage2dArray:
+ return "image2d_array_t";
case OCLImage2dDepth:
return "image2d_depth_t";
case OCLImage2dArrayDepth:
@@ -2542,9 +2581,12 @@ StringRef BuiltinType::getName(const Pri
return "image2d_msaa_depth_t";
case OCLImage2dArrayMSAADepth:
return "image2d_array_msaa_depth_t";
- case OCLImage3d: return "image3d_t";
- case OCLSampler: return "sampler_t";
- case OCLEvent: return "event_t";
+ case OCLImage3d:
+ return "image3d_t";
+ case OCLSampler:
+ return "sampler_t";
+ case OCLEvent:
+ return "event_t";
case OCLClkEvent:
return "clk_event_t";
case OCLQueue:
@@ -2553,9 +2595,10 @@ StringRef BuiltinType::getName(const Pri
return "event_t";
case OCLReserveID:
return "reserve_id_t";
- case OMPArraySection: return "<OpenMP array section type>";
+ case OMPArraySection:
+ return "<OpenMP array section type>";
}
-
+
llvm_unreachable("Invalid builtin type.");
}
Modified: cfe/trunk/lib/Serialization/ASTCommon.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTCommon.cpp?rev=247678&r1=247677&r2=247678&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTCommon.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTCommon.cpp Tue Sep 15 07:18:29 2015
@@ -27,46 +27,121 @@ serialization::TypeIdx
serialization::TypeIdxFromBuiltin(const BuiltinType *BT) {
unsigned ID = 0;
switch (BT->getKind()) {
- case BuiltinType::Void: ID = PREDEF_TYPE_VOID_ID; break;
- case BuiltinType::Bool: ID = PREDEF_TYPE_BOOL_ID; break;
- case BuiltinType::Char_U: ID = PREDEF_TYPE_CHAR_U_ID; break;
- case BuiltinType::UChar: ID = PREDEF_TYPE_UCHAR_ID; break;
- case BuiltinType::UShort: ID = PREDEF_TYPE_USHORT_ID; break;
- case BuiltinType::UInt: ID = PREDEF_TYPE_UINT_ID; break;
- case BuiltinType::ULong: ID = PREDEF_TYPE_ULONG_ID; break;
- case BuiltinType::ULongLong: ID = PREDEF_TYPE_ULONGLONG_ID; break;
- case BuiltinType::UInt128: ID = PREDEF_TYPE_UINT128_ID; break;
- case BuiltinType::Char_S: ID = PREDEF_TYPE_CHAR_S_ID; break;
- case BuiltinType::SChar: ID = PREDEF_TYPE_SCHAR_ID; break;
+ case BuiltinType::Void:
+ ID = PREDEF_TYPE_VOID_ID;
+ break;
+ case BuiltinType::Bool:
+ ID = PREDEF_TYPE_BOOL_ID;
+ break;
+ case BuiltinType::Char_U:
+ ID = PREDEF_TYPE_CHAR_U_ID;
+ break;
+ case BuiltinType::UChar:
+ ID = PREDEF_TYPE_UCHAR_ID;
+ break;
+ case BuiltinType::UShort:
+ ID = PREDEF_TYPE_USHORT_ID;
+ break;
+ case BuiltinType::UInt:
+ ID = PREDEF_TYPE_UINT_ID;
+ break;
+ case BuiltinType::ULong:
+ ID = PREDEF_TYPE_ULONG_ID;
+ break;
+ case BuiltinType::ULongLong:
+ ID = PREDEF_TYPE_ULONGLONG_ID;
+ break;
+ case BuiltinType::UInt128:
+ ID = PREDEF_TYPE_UINT128_ID;
+ break;
+ case BuiltinType::Char_S:
+ ID = PREDEF_TYPE_CHAR_S_ID;
+ break;
+ case BuiltinType::SChar:
+ ID = PREDEF_TYPE_SCHAR_ID;
+ break;
case BuiltinType::WChar_S:
- case BuiltinType::WChar_U: ID = PREDEF_TYPE_WCHAR_ID; break;
- case BuiltinType::Short: ID = PREDEF_TYPE_SHORT_ID; break;
- case BuiltinType::Int: ID = PREDEF_TYPE_INT_ID; break;
- case BuiltinType::Long: ID = PREDEF_TYPE_LONG_ID; break;
- case BuiltinType::LongLong: ID = PREDEF_TYPE_LONGLONG_ID; break;
- case BuiltinType::Int128: ID = PREDEF_TYPE_INT128_ID; break;
- case BuiltinType::Half: ID = PREDEF_TYPE_HALF_ID; break;
- case BuiltinType::Float: ID = PREDEF_TYPE_FLOAT_ID; break;
- case BuiltinType::Double: ID = PREDEF_TYPE_DOUBLE_ID; break;
- case BuiltinType::LongDouble: ID = PREDEF_TYPE_LONGDOUBLE_ID; break;
- case BuiltinType::NullPtr: ID = PREDEF_TYPE_NULLPTR_ID; break;
- case BuiltinType::Char16: ID = PREDEF_TYPE_CHAR16_ID; break;
- case BuiltinType::Char32: ID = PREDEF_TYPE_CHAR32_ID; break;
- case BuiltinType::Overload: ID = PREDEF_TYPE_OVERLOAD_ID; break;
- case BuiltinType::BoundMember:ID = PREDEF_TYPE_BOUND_MEMBER; break;
- case BuiltinType::PseudoObject:ID = PREDEF_TYPE_PSEUDO_OBJECT;break;
- case BuiltinType::Dependent: ID = PREDEF_TYPE_DEPENDENT_ID; break;
- case BuiltinType::UnknownAny: ID = PREDEF_TYPE_UNKNOWN_ANY; break;
+ case BuiltinType::WChar_U:
+ ID = PREDEF_TYPE_WCHAR_ID;
+ break;
+ case BuiltinType::Short:
+ ID = PREDEF_TYPE_SHORT_ID;
+ break;
+ case BuiltinType::Int:
+ ID = PREDEF_TYPE_INT_ID;
+ break;
+ case BuiltinType::Long:
+ ID = PREDEF_TYPE_LONG_ID;
+ break;
+ case BuiltinType::LongLong:
+ ID = PREDEF_TYPE_LONGLONG_ID;
+ break;
+ case BuiltinType::Int128:
+ ID = PREDEF_TYPE_INT128_ID;
+ break;
+ case BuiltinType::Half:
+ ID = PREDEF_TYPE_HALF_ID;
+ break;
+ case BuiltinType::Float:
+ ID = PREDEF_TYPE_FLOAT_ID;
+ break;
+ case BuiltinType::Double:
+ ID = PREDEF_TYPE_DOUBLE_ID;
+ break;
+ case BuiltinType::LongDouble:
+ ID = PREDEF_TYPE_LONGDOUBLE_ID;
+ break;
+ case BuiltinType::NullPtr:
+ ID = PREDEF_TYPE_NULLPTR_ID;
+ break;
+ case BuiltinType::Char16:
+ ID = PREDEF_TYPE_CHAR16_ID;
+ break;
+ case BuiltinType::Char32:
+ ID = PREDEF_TYPE_CHAR32_ID;
+ break;
+ case BuiltinType::Overload:
+ ID = PREDEF_TYPE_OVERLOAD_ID;
+ break;
+ case BuiltinType::BoundMember:
+ ID = PREDEF_TYPE_BOUND_MEMBER;
+ break;
+ case BuiltinType::PseudoObject:
+ ID = PREDEF_TYPE_PSEUDO_OBJECT;
+ break;
+ case BuiltinType::Dependent:
+ ID = PREDEF_TYPE_DEPENDENT_ID;
+ break;
+ case BuiltinType::UnknownAny:
+ ID = PREDEF_TYPE_UNKNOWN_ANY;
+ break;
case BuiltinType::ARCUnbridgedCast:
- ID = PREDEF_TYPE_ARC_UNBRIDGED_CAST; break;
- case BuiltinType::ObjCId: ID = PREDEF_TYPE_OBJC_ID; break;
- case BuiltinType::ObjCClass: ID = PREDEF_TYPE_OBJC_CLASS; break;
- case BuiltinType::ObjCSel: ID = PREDEF_TYPE_OBJC_SEL; break;
- case BuiltinType::OCLImage1d: ID = PREDEF_TYPE_IMAGE1D_ID; break;
- case BuiltinType::OCLImage1dArray: ID = PREDEF_TYPE_IMAGE1D_ARR_ID; break;
- case BuiltinType::OCLImage1dBuffer: ID = PREDEF_TYPE_IMAGE1D_BUFF_ID; break;
- case BuiltinType::OCLImage2d: ID = PREDEF_TYPE_IMAGE2D_ID; break;
- case BuiltinType::OCLImage2dArray: ID = PREDEF_TYPE_IMAGE2D_ARR_ID; break;
+ ID = PREDEF_TYPE_ARC_UNBRIDGED_CAST;
+ break;
+ case BuiltinType::ObjCId:
+ ID = PREDEF_TYPE_OBJC_ID;
+ break;
+ case BuiltinType::ObjCClass:
+ ID = PREDEF_TYPE_OBJC_CLASS;
+ break;
+ case BuiltinType::ObjCSel:
+ ID = PREDEF_TYPE_OBJC_SEL;
+ break;
+ case BuiltinType::OCLImage1d:
+ ID = PREDEF_TYPE_IMAGE1D_ID;
+ break;
+ case BuiltinType::OCLImage1dArray:
+ ID = PREDEF_TYPE_IMAGE1D_ARR_ID;
+ break;
+ case BuiltinType::OCLImage1dBuffer:
+ ID = PREDEF_TYPE_IMAGE1D_BUFF_ID;
+ break;
+ case BuiltinType::OCLImage2d:
+ ID = PREDEF_TYPE_IMAGE2D_ID;
+ break;
+ case BuiltinType::OCLImage2dArray:
+ ID = PREDEF_TYPE_IMAGE2D_ARR_ID;
+ break;
case BuiltinType::OCLImage2dDepth:
ID = PREDEF_TYPE_IMAGE2D_DEP_ID;
break;
@@ -85,9 +160,15 @@ serialization::TypeIdxFromBuiltin(const
case BuiltinType::OCLImage2dArrayMSAADepth:
ID = PREDEF_TYPE_IMAGE2D_ARR_MSAA_DEPTH_ID;
break;
- case BuiltinType::OCLImage3d: ID = PREDEF_TYPE_IMAGE3D_ID; break;
- case BuiltinType::OCLSampler: ID = PREDEF_TYPE_SAMPLER_ID; break;
- case BuiltinType::OCLEvent: ID = PREDEF_TYPE_EVENT_ID; break;
+ case BuiltinType::OCLImage3d:
+ ID = PREDEF_TYPE_IMAGE3D_ID;
+ break;
+ case BuiltinType::OCLSampler:
+ ID = PREDEF_TYPE_SAMPLER_ID;
+ break;
+ case BuiltinType::OCLEvent:
+ ID = PREDEF_TYPE_EVENT_ID;
+ break;
case BuiltinType::OCLClkEvent:
ID = PREDEF_TYPE_CLK_EVENT_ID;
break;
@@ -101,9 +182,11 @@ serialization::TypeIdxFromBuiltin(const
ID = PREDEF_TYPE_RESERVE_ID_ID;
break;
case BuiltinType::BuiltinFn:
- ID = PREDEF_TYPE_BUILTIN_FN; break;
- case BuiltinType::OMPArraySection: ID = PREDEF_TYPE_OMP_ARRAY_SECTION; break;
-
+ ID = PREDEF_TYPE_BUILTIN_FN;
+ break;
+ case BuiltinType::OMPArraySection:
+ ID = PREDEF_TYPE_OMP_ARRAY_SECTION;
+ break;
}
return TypeIdx(ID);
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=247678&r1=247677&r2=247678&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Tue Sep 15 07:18:29 2015
@@ -5781,9 +5781,14 @@ QualType ASTReader::GetType(TypeID ID) {
if (Index < NUM_PREDEF_TYPE_IDS) {
QualType T;
switch ((PredefinedTypeIDs)Index) {
- case PREDEF_TYPE_NULL_ID: return QualType();
- case PREDEF_TYPE_VOID_ID: T = Context.VoidTy; break;
- case PREDEF_TYPE_BOOL_ID: T = Context.BoolTy; break;
+ case PREDEF_TYPE_NULL_ID:
+ return QualType();
+ case PREDEF_TYPE_VOID_ID:
+ T = Context.VoidTy;
+ break;
+ case PREDEF_TYPE_BOOL_ID:
+ T = Context.BoolTy;
+ break;
case PREDEF_TYPE_CHAR_U_ID:
case PREDEF_TYPE_CHAR_S_ID:
@@ -5791,39 +5796,105 @@ QualType ASTReader::GetType(TypeID ID) {
T = Context.CharTy;
break;
- case PREDEF_TYPE_UCHAR_ID: T = Context.UnsignedCharTy; break;
- case PREDEF_TYPE_USHORT_ID: T = Context.UnsignedShortTy; break;
- case PREDEF_TYPE_UINT_ID: T = Context.UnsignedIntTy; break;
- case PREDEF_TYPE_ULONG_ID: T = Context.UnsignedLongTy; break;
- case PREDEF_TYPE_ULONGLONG_ID: T = Context.UnsignedLongLongTy; break;
- case PREDEF_TYPE_UINT128_ID: T = Context.UnsignedInt128Ty; break;
- case PREDEF_TYPE_SCHAR_ID: T = Context.SignedCharTy; break;
- case PREDEF_TYPE_WCHAR_ID: T = Context.WCharTy; break;
- case PREDEF_TYPE_SHORT_ID: T = Context.ShortTy; break;
- case PREDEF_TYPE_INT_ID: T = Context.IntTy; break;
- case PREDEF_TYPE_LONG_ID: T = Context.LongTy; break;
- case PREDEF_TYPE_LONGLONG_ID: T = Context.LongLongTy; break;
- case PREDEF_TYPE_INT128_ID: T = Context.Int128Ty; break;
- case PREDEF_TYPE_HALF_ID: T = Context.HalfTy; break;
- case PREDEF_TYPE_FLOAT_ID: T = Context.FloatTy; break;
- case PREDEF_TYPE_DOUBLE_ID: T = Context.DoubleTy; break;
- case PREDEF_TYPE_LONGDOUBLE_ID: T = Context.LongDoubleTy; break;
- case PREDEF_TYPE_OVERLOAD_ID: T = Context.OverloadTy; break;
- case PREDEF_TYPE_BOUND_MEMBER: T = Context.BoundMemberTy; break;
- case PREDEF_TYPE_PSEUDO_OBJECT: T = Context.PseudoObjectTy; break;
- case PREDEF_TYPE_DEPENDENT_ID: T = Context.DependentTy; break;
- case PREDEF_TYPE_UNKNOWN_ANY: T = Context.UnknownAnyTy; break;
- case PREDEF_TYPE_NULLPTR_ID: T = Context.NullPtrTy; break;
- case PREDEF_TYPE_CHAR16_ID: T = Context.Char16Ty; break;
- case PREDEF_TYPE_CHAR32_ID: T = Context.Char32Ty; break;
- case PREDEF_TYPE_OBJC_ID: T = Context.ObjCBuiltinIdTy; break;
- case PREDEF_TYPE_OBJC_CLASS: T = Context.ObjCBuiltinClassTy; break;
- case PREDEF_TYPE_OBJC_SEL: T = Context.ObjCBuiltinSelTy; break;
- case PREDEF_TYPE_IMAGE1D_ID: T = Context.OCLImage1dTy; break;
- case PREDEF_TYPE_IMAGE1D_ARR_ID: T = Context.OCLImage1dArrayTy; break;
- case PREDEF_TYPE_IMAGE1D_BUFF_ID: T = Context.OCLImage1dBufferTy; break;
- case PREDEF_TYPE_IMAGE2D_ID: T = Context.OCLImage2dTy; break;
- case PREDEF_TYPE_IMAGE2D_ARR_ID: T = Context.OCLImage2dArrayTy; break;
+ case PREDEF_TYPE_UCHAR_ID:
+ T = Context.UnsignedCharTy;
+ break;
+ case PREDEF_TYPE_USHORT_ID:
+ T = Context.UnsignedShortTy;
+ break;
+ case PREDEF_TYPE_UINT_ID:
+ T = Context.UnsignedIntTy;
+ break;
+ case PREDEF_TYPE_ULONG_ID:
+ T = Context.UnsignedLongTy;
+ break;
+ case PREDEF_TYPE_ULONGLONG_ID:
+ T = Context.UnsignedLongLongTy;
+ break;
+ case PREDEF_TYPE_UINT128_ID:
+ T = Context.UnsignedInt128Ty;
+ break;
+ case PREDEF_TYPE_SCHAR_ID:
+ T = Context.SignedCharTy;
+ break;
+ case PREDEF_TYPE_WCHAR_ID:
+ T = Context.WCharTy;
+ break;
+ case PREDEF_TYPE_SHORT_ID:
+ T = Context.ShortTy;
+ break;
+ case PREDEF_TYPE_INT_ID:
+ T = Context.IntTy;
+ break;
+ case PREDEF_TYPE_LONG_ID:
+ T = Context.LongTy;
+ break;
+ case PREDEF_TYPE_LONGLONG_ID:
+ T = Context.LongLongTy;
+ break;
+ case PREDEF_TYPE_INT128_ID:
+ T = Context.Int128Ty;
+ break;
+ case PREDEF_TYPE_HALF_ID:
+ T = Context.HalfTy;
+ break;
+ case PREDEF_TYPE_FLOAT_ID:
+ T = Context.FloatTy;
+ break;
+ case PREDEF_TYPE_DOUBLE_ID:
+ T = Context.DoubleTy;
+ break;
+ case PREDEF_TYPE_LONGDOUBLE_ID:
+ T = Context.LongDoubleTy;
+ break;
+ case PREDEF_TYPE_OVERLOAD_ID:
+ T = Context.OverloadTy;
+ break;
+ case PREDEF_TYPE_BOUND_MEMBER:
+ T = Context.BoundMemberTy;
+ break;
+ case PREDEF_TYPE_PSEUDO_OBJECT:
+ T = Context.PseudoObjectTy;
+ break;
+ case PREDEF_TYPE_DEPENDENT_ID:
+ T = Context.DependentTy;
+ break;
+ case PREDEF_TYPE_UNKNOWN_ANY:
+ T = Context.UnknownAnyTy;
+ break;
+ case PREDEF_TYPE_NULLPTR_ID:
+ T = Context.NullPtrTy;
+ break;
+ case PREDEF_TYPE_CHAR16_ID:
+ T = Context.Char16Ty;
+ break;
+ case PREDEF_TYPE_CHAR32_ID:
+ T = Context.Char32Ty;
+ break;
+ case PREDEF_TYPE_OBJC_ID:
+ T = Context.ObjCBuiltinIdTy;
+ break;
+ case PREDEF_TYPE_OBJC_CLASS:
+ T = Context.ObjCBuiltinClassTy;
+ break;
+ case PREDEF_TYPE_OBJC_SEL:
+ T = Context.ObjCBuiltinSelTy;
+ break;
+ case PREDEF_TYPE_IMAGE1D_ID:
+ T = Context.OCLImage1dTy;
+ break;
+ case PREDEF_TYPE_IMAGE1D_ARR_ID:
+ T = Context.OCLImage1dArrayTy;
+ break;
+ case PREDEF_TYPE_IMAGE1D_BUFF_ID:
+ T = Context.OCLImage1dBufferTy;
+ break;
+ case PREDEF_TYPE_IMAGE2D_ID:
+ T = Context.OCLImage2dTy;
+ break;
+ case PREDEF_TYPE_IMAGE2D_ARR_ID:
+ T = Context.OCLImage2dArrayTy;
+ break;
case PREDEF_TYPE_IMAGE2D_DEP_ID:
T = Context.OCLImage2dDepthTy;
break;
@@ -5842,9 +5913,15 @@ QualType ASTReader::GetType(TypeID ID) {
case PREDEF_TYPE_IMAGE2D_ARR_MSAA_DEPTH_ID:
T = Context.OCLImage2dArrayMSAADepthTy;
break;
- case PREDEF_TYPE_IMAGE3D_ID: T = Context.OCLImage3dTy; break;
- case PREDEF_TYPE_SAMPLER_ID: T = Context.OCLSamplerTy; break;
- case PREDEF_TYPE_EVENT_ID: T = Context.OCLEventTy; break;
+ case PREDEF_TYPE_IMAGE3D_ID:
+ T = Context.OCLImage3dTy;
+ break;
+ case PREDEF_TYPE_SAMPLER_ID:
+ T = Context.OCLSamplerTy;
+ break;
+ case PREDEF_TYPE_EVENT_ID:
+ T = Context.OCLEventTy;
+ break;
case PREDEF_TYPE_CLK_EVENT_ID:
T = Context.OCLClkEventTy;
break;
@@ -5857,10 +5934,12 @@ QualType ASTReader::GetType(TypeID ID) {
case PREDEF_TYPE_RESERVE_ID_ID:
T = Context.OCLReserveIDTy;
break;
- case PREDEF_TYPE_AUTO_DEDUCT: T = Context.getAutoDeductType(); break;
-
- case PREDEF_TYPE_AUTO_RREF_DEDUCT:
- T = Context.getAutoRRefDeductType();
+ case PREDEF_TYPE_AUTO_DEDUCT:
+ T = Context.getAutoDeductType();
+ break;
+
+ case PREDEF_TYPE_AUTO_RREF_DEDUCT:
+ T = Context.getAutoRRefDeductType();
break;
case PREDEF_TYPE_ARC_UNBRIDGED_CAST:
More information about the cfe-commits
mailing list