diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp
index 2bcf07e..bf1551a 100644
--- a/lib/AST/ASTImporter.cpp
+++ b/lib/AST/ASTImporter.cpp
@@ -2244,12 +2244,14 @@
   if (ResultTy.isNull())
     return 0;
 
+  TypeSourceInfo *ResultTInfo = Importer.Import(D->getResultTypeSourceInfo());
+
   ObjCMethodDecl *ToMethod
     = ObjCMethodDecl::Create(Importer.getToContext(),
                              Loc,
                              Importer.Import(D->getLocEnd()),
                              Name.getObjCSelector(),
-                             ResultTy, DC,
+                             ResultTy, ResultTInfo, DC,
                              D->isInstanceMethod(),
                              D->isVariadic(),
                              D->isSynthesized(),
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index 8decafa..67b71a0 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -304,15 +304,16 @@
                                        SourceLocation beginLoc,
                                        SourceLocation endLoc,
                                        Selector SelInfo, QualType T,
+                                       TypeSourceInfo *ResultTInfo,
                                        DeclContext *contextDecl,
                                        bool isInstance,
                                        bool isVariadic,
                                        bool isSynthesized,
                                        ImplementationControl impControl) {
   return new (C) ObjCMethodDecl(beginLoc, endLoc,
-                                  SelInfo, T, contextDecl,
-                                  isInstance,
-                                  isVariadic, isSynthesized, impControl);
+                                SelInfo, T, ResultTInfo, contextDecl,
+                                isInstance,
+                                isVariadic, isSynthesized, impControl);
 }
 
 void ObjCMethodDecl::Destroy(ASTContext &C) {
diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp
index 356bd07..a3f5eac 100644
--- a/lib/Frontend/PCHReaderDecl.cpp
+++ b/lib/Frontend/PCHReaderDecl.cpp
@@ -211,6 +211,7 @@
   MD->setDeclImplementation((ObjCMethodDecl::ImplementationControl)Record[Idx++]);
   MD->setObjCDeclQualifier((Decl::ObjCDeclQualifier)Record[Idx++]);
   MD->setResultType(Reader.GetType(Record[Idx++]));
+  MD->setResultTypeSourceInfo(Reader.GetTypeSourceInfo(Record, Idx));
   MD->setEndLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
   unsigned NumParams = Record[Idx++];
   llvm::SmallVector<ParmVarDecl *, 16> Params;
@@ -690,7 +691,7 @@
     break;
   case pch::DECL_OBJC_METHOD:
     D = ObjCMethodDecl::Create(*Context, SourceLocation(), SourceLocation(),
-                               Selector(), QualType(), 0);
+                               Selector(), QualType(), 0, 0);
     break;
   case pch::DECL_OBJC_INTERFACE:
     D = ObjCInterfaceDecl::Create(*Context, 0, SourceLocation(), 0);
diff --git a/lib/Frontend/PCHWriterDecl.cpp b/lib/Frontend/PCHWriterDecl.cpp
index e776d32..0774797 100644
--- a/lib/Frontend/PCHWriterDecl.cpp
+++ b/lib/Frontend/PCHWriterDecl.cpp
@@ -210,6 +210,7 @@
   // FIXME: stable encoding for in/out/inout/bycopy/byref/oneway
   Record.push_back(D->getObjCDeclQualifier());
   Writer.AddTypeRef(D->getResultType(), Record);
+  Writer.AddTypeSourceInfo(D->getResultTypeSourceInfo(), Record);
   Writer.AddSourceLocation(D->getLocEnd(), Record);
   Record.push_back(D->param_size());
   for (ObjCMethodDecl::param_iterator P = D->param_begin(),
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 149fe15..762ef38 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1681,7 +1681,7 @@
     // for this class.
     GetterMethod = ObjCMethodDecl::Create(Context, property->getLocation(),
                              property->getLocation(), property->getGetterName(),
-                             property->getType(), CD, true, false, true,
+                             property->getType(), 0, CD, true, false, true,
                              (property->getPropertyImplementation() ==
                               ObjCPropertyDecl::Optional) ?
                              ObjCMethodDecl::Optional :
@@ -1703,7 +1703,7 @@
       SetterMethod = ObjCMethodDecl::Create(Context, property->getLocation(),
                                property->getLocation(),
                                property->getSetterName(),
-                               Context.VoidTy, CD, true, false, true,
+                               Context.VoidTy, 0, CD, true, false, true,
                                (property->getPropertyImplementation() ==
                                 ObjCPropertyDecl::Optional) ?
                                ObjCMethodDecl::Optional :
@@ -1992,8 +1992,9 @@
   }
   QualType resultDeclType;
 
+  TypeSourceInfo *ResultTInfo = 0;
   if (ReturnType) {
-    resultDeclType = GetTypeFromParser(ReturnType);
+    resultDeclType = GetTypeFromParser(ReturnType, &ResultTInfo);
 
     // Methods cannot return interface types. All ObjC objects are
     // passed by reference.
@@ -2007,6 +2008,7 @@
 
   ObjCMethodDecl* ObjCMethod =
     ObjCMethodDecl::Create(Context, MethodLoc, EndLoc, Sel, resultDeclType,
+                           ResultTInfo,
                            cast<DeclContext>(ClassDecl),
                            MethodType == tok::minus, isVariadic,
                            false,
