diff options
-rw-r--r-- | include/clang/AST/ASTContext.h | 1 | ||||
-rw-r--r-- | include/clang/AST/Type.h | 7 | ||||
-rw-r--r-- | include/clang/Serialization/ASTBitCodes.h | 4 | ||||
-rw-r--r-- | lib/AST/ASTContext.cpp | 3 | ||||
-rw-r--r-- | lib/AST/ASTImporter.cpp | 2 | ||||
-rw-r--r-- | lib/AST/ItaniumMangle.cpp | 1 | ||||
-rw-r--r-- | lib/AST/MicrosoftMangle.cpp | 1 | ||||
-rw-r--r-- | lib/AST/Type.cpp | 1 | ||||
-rw-r--r-- | lib/AST/TypeLoc.cpp | 1 | ||||
-rw-r--r-- | lib/Analysis/PrintfFormatString.cpp | 1 | ||||
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/CGRTTI.cpp | 1 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenTypes.cpp | 1 | ||||
-rw-r--r-- | lib/Serialization/ASTCommon.cpp | 2 | ||||
-rw-r--r-- | lib/Serialization/ASTReader.cpp | 5 | ||||
-rw-r--r-- | tools/libclang/CIndex.cpp | 1 | ||||
-rw-r--r-- | tools/libclang/CIndexUSRs.cpp | 1 |
17 files changed, 33 insertions, 2 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index c4ffac5341..fff1ddc96d 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -497,6 +497,7 @@ public: CanQualType FloatComplexTy, DoubleComplexTy, LongDoubleComplexTy; CanQualType VoidPtrTy, NullPtrTy; CanQualType DependentTy, OverloadTy, BoundMemberTy, UnknownAnyTy; + CanQualType ARCUnbridgedCastTy; CanQualType ObjCBuiltinIdTy, ObjCBuiltinClassTy, ObjCBuiltinSelTy; // Types for deductions in C++0x [stmt.ranged]'s desugaring. Built on demand. diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 5a1200c477..80686a5785 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -1751,7 +1751,12 @@ public: /// like debuggers that don't know what type to give something. /// Only a small number of operations are valid on expressions of /// unknown type, most notably explicit casts. - UnknownAny + UnknownAny, + + /// The type of a cast which, in ARC, would normally require a + /// __bridge, but which might be okay depending on the immediate + /// context. + ARCUnbridgedCast }; public: diff --git a/include/clang/Serialization/ASTBitCodes.h b/include/clang/Serialization/ASTBitCodes.h index dc4d05c6f3..e7f126514b 100644 --- a/include/clang/Serialization/ASTBitCodes.h +++ b/include/clang/Serialization/ASTBitCodes.h @@ -554,7 +554,9 @@ namespace clang { /// \brief The "auto &&" deduction type. PREDEF_TYPE_AUTO_RREF_DEDUCT = 32, /// \brief The OpenCL 'half' / ARM NEON __fp16 type. - PREDEF_TYPE_HALF_ID = 33 + PREDEF_TYPE_HALF_ID = 33, + /// \brief ARC's unbridged-cast placeholder type. + PREDEF_TYPE_ARC_UNBRIDGED_CAST = 34 }; /// \brief The number of predefined type IDs that are reserved for diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 462428086d..4fbb5408dc 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -464,6 +464,9 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target) { // "any" type; useful for debugger-like clients. InitBuiltinType(UnknownAnyTy, BuiltinType::UnknownAny); + // Placeholder type for unbridged ARC casts. + InitBuiltinType(ARCUnbridgedCastTy, BuiltinType::ARCUnbridgedCast); + // C99 6.2.5p11. FloatComplexTy = getComplexType(FloatTy); DoubleComplexTy = getComplexType(DoubleTy); diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index af66b04c3a..ae2b8903f2 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -1387,6 +1387,8 @@ QualType ASTNodeImporter::VisitBuiltinType(const BuiltinType *T) { case BuiltinType::Dependent: return Importer.getToContext().DependentTy; case BuiltinType::UnknownAny: return Importer.getToContext().UnknownAnyTy; case BuiltinType::BoundMember: return Importer.getToContext().BoundMemberTy; + case BuiltinType::ARCUnbridgedCast: + return Importer.getToContext().ARCUnbridgedCastTy; case BuiltinType::ObjCId: // FIXME: Make sure that the "to" context supports Objective-C! diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index acedf70f29..f7af57ef66 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -1739,6 +1739,7 @@ void CXXNameMangler::mangleType(const BuiltinType *T) { case BuiltinType::Dependent: case BuiltinType::BoundMember: case BuiltinType::UnknownAny: + case BuiltinType::ARCUnbridgedCast: llvm_unreachable("mangling a placeholder type"); break; case BuiltinType::ObjCId: Out << "11objc_object"; break; diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index 1515db49fe..98fc2d52cb 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -705,6 +705,7 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T) { case BuiltinType::Dependent: case BuiltinType::UnknownAny: case BuiltinType::BoundMember: + case BuiltinType::ARCUnbridgedCast: llvm_unreachable( "Overloaded and dependent types shouldn't get to name mangling"); case BuiltinType::ObjCId: Out << "PAUobjc_object@@"; break; diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 44eeec004f..5b7daadd98 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -1495,6 +1495,7 @@ const char *BuiltinType::getName(const PrintingPolicy &Policy) const { case BoundMember: return "<bound member function type>"; case Dependent: return "<dependent type>"; case UnknownAny: return "<unknown type>"; + case ARCUnbridgedCast: return "<ARC unbridged cast type>"; case ObjCId: return "id"; case ObjCClass: return "Class"; case ObjCSel: return "SEL"; diff --git a/lib/AST/TypeLoc.cpp b/lib/AST/TypeLoc.cpp index 8e8b227e1f..2724e8c46a 100644 --- a/lib/AST/TypeLoc.cpp +++ b/lib/AST/TypeLoc.cpp @@ -237,6 +237,7 @@ TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const { case BuiltinType::Dependent: case BuiltinType::BoundMember: case BuiltinType::UnknownAny: + case BuiltinType::ARCUnbridgedCast: case BuiltinType::ObjCId: case BuiltinType::ObjCClass: case BuiltinType::ObjCSel: diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp index 46ece65a42..0c0e343331 100644 --- a/lib/Analysis/PrintfFormatString.cpp +++ b/lib/Analysis/PrintfFormatString.cpp @@ -400,6 +400,7 @@ bool PrintfSpecifier::fixType(QualType QT) { case BuiltinType::Overload: case BuiltinType::BoundMember: case BuiltinType::UnknownAny: + case BuiltinType::ARCUnbridgedCast: // Misc other stuff which doesn't make sense here. return false; diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index c7a9b407d2..b894326bd8 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -329,6 +329,8 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) { llvm_unreachable("Unexpected builtin type BoundMember"); case BuiltinType::UnknownAny: llvm_unreachable("Unexpected builtin type UnknownAny"); + case BuiltinType::ARCUnbridgedCast: + llvm_unreachable("Unexpected builtin type ARCUnbridgedCast"); case BuiltinType::NullPtr: return DBuilder. createNullPtrType(BT->getName(CGM.getContext().getLangOptions())); diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp index fbdb298483..c4526fc4cf 100644 --- a/lib/CodeGen/CGRTTI.cpp +++ b/lib/CodeGen/CGRTTI.cpp @@ -199,6 +199,7 @@ static bool TypeInfoIsInStandardLibrary(const BuiltinType *Ty) { case BuiltinType::Dependent: case BuiltinType::BoundMember: case BuiltinType::UnknownAny: + case BuiltinType::ARCUnbridgedCast: llvm_unreachable("asking for RRTI for a placeholder type!"); case BuiltinType::ObjCId: diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index e0d9218965..3bb5d8a90f 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -372,6 +372,7 @@ llvm::Type *CodeGenTypes::ConvertType(QualType T) { case BuiltinType::Dependent: case BuiltinType::BoundMember: case BuiltinType::UnknownAny: + case BuiltinType::ARCUnbridgedCast: llvm_unreachable("Unexpected placeholder builtin type!"); break; } diff --git a/lib/Serialization/ASTCommon.cpp b/lib/Serialization/ASTCommon.cpp index 445e750834..1103dc0aff 100644 --- a/lib/Serialization/ASTCommon.cpp +++ b/lib/Serialization/ASTCommon.cpp @@ -54,6 +54,8 @@ serialization::TypeIdxFromBuiltin(const BuiltinType *BT) { case BuiltinType::BoundMember:ID = PREDEF_TYPE_BOUND_MEMBER; 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; diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index dc7829f3e9..3a8e5036a8 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -3839,6 +3839,11 @@ QualType ASTReader::GetType(TypeID ID) { case PREDEF_TYPE_AUTO_RREF_DEDUCT: T = Context.getAutoRRefDeductType(); break; + + case PREDEF_TYPE_ARC_UNBRIDGED_CAST: + T = Context.ARCUnbridgedCastTy; + break; + } assert(!T.isNull() && "Unknown predefined type"); diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 46ba3d5534..bb232eb567 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -1368,6 +1368,7 @@ bool CursorVisitor::VisitBuiltinTypeLoc(BuiltinTypeLoc TL) { case BuiltinType::BoundMember: case BuiltinType::Dependent: case BuiltinType::UnknownAny: + case BuiltinType::ARCUnbridgedCast: break; case BuiltinType::ObjCId: diff --git a/tools/libclang/CIndexUSRs.cpp b/tools/libclang/CIndexUSRs.cpp index 121d67d1d2..91ceb7c78b 100644 --- a/tools/libclang/CIndexUSRs.cpp +++ b/tools/libclang/CIndexUSRs.cpp @@ -584,6 +584,7 @@ void USRGenerator::VisitType(QualType T) { case BuiltinType::BoundMember: case BuiltinType::Dependent: case BuiltinType::UnknownAny: + case BuiltinType::ARCUnbridgedCast: IgnoreResults = true; return; case BuiltinType::ObjCId: |