summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-10-17 18:09:15 +0000
committerJohn McCall <rjmccall@apple.com>2011-10-17 18:09:15 +0000
commit8a6b59ad97a1ed84daac9d14605521ba36ccd8dd (patch)
tree044c58f41c1960215163f83755823effcd45c7f5 /clang/lib
parent73081309c3a219ba091bc261bf5f83d86b4aeacd (diff)
downloadbcm5719-llvm-8a6b59ad97a1ed84daac9d14605521ba36ccd8dd.tar.gz
bcm5719-llvm-8a6b59ad97a1ed84daac9d14605521ba36ccd8dd.zip
Add a new placeholder type to represent "unbridged"
casts in ARC. No semantic analysis yet. llvm-svn: 142208
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTContext.cpp3
-rw-r--r--clang/lib/AST/ASTImporter.cpp2
-rw-r--r--clang/lib/AST/ItaniumMangle.cpp1
-rw-r--r--clang/lib/AST/MicrosoftMangle.cpp1
-rw-r--r--clang/lib/AST/Type.cpp1
-rw-r--r--clang/lib/AST/TypeLoc.cpp1
-rw-r--r--clang/lib/Analysis/PrintfFormatString.cpp1
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp2
-rw-r--r--clang/lib/CodeGen/CGRTTI.cpp1
-rw-r--r--clang/lib/CodeGen/CodeGenTypes.cpp1
-rw-r--r--clang/lib/Serialization/ASTCommon.cpp2
-rw-r--r--clang/lib/Serialization/ASTReader.cpp5
12 files changed, 21 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 462428086dd..4fbb5408dc0 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index af66b04c3ad..ae2b8903f24 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/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/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
index acedf70f29c..f7af57ef661 100644
--- a/clang/lib/AST/ItaniumMangle.cpp
+++ b/clang/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/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index 1515db49fe3..98fc2d52cb5 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/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/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 44eeec004f5..5b7daadd986 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/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/clang/lib/AST/TypeLoc.cpp b/clang/lib/AST/TypeLoc.cpp
index 8e8b227e1f0..2724e8c46ad 100644
--- a/clang/lib/AST/TypeLoc.cpp
+++ b/clang/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/clang/lib/Analysis/PrintfFormatString.cpp b/clang/lib/Analysis/PrintfFormatString.cpp
index 46ece65a42e..0c0e3433314 100644
--- a/clang/lib/Analysis/PrintfFormatString.cpp
+++ b/clang/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/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index c7a9b407d26..b894326bd88 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/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/clang/lib/CodeGen/CGRTTI.cpp b/clang/lib/CodeGen/CGRTTI.cpp
index fbdb2984830..c4526fc4cf7 100644
--- a/clang/lib/CodeGen/CGRTTI.cpp
+++ b/clang/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/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp
index e0d92189658..3bb5d8a90fd 100644
--- a/clang/lib/CodeGen/CodeGenTypes.cpp
+++ b/clang/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/clang/lib/Serialization/ASTCommon.cpp b/clang/lib/Serialization/ASTCommon.cpp
index 445e750834e..1103dc0aff2 100644
--- a/clang/lib/Serialization/ASTCommon.cpp
+++ b/clang/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/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index dc7829f3e94..3a8e5036a8d 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/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");
OpenPOWER on IntegriCloud