diff --git lib/CodeGen/CGCall.cpp lib/CodeGen/CGCall.cpp
index 37a9a5e..06c18f3 100644
--- lib/CodeGen/CGCall.cpp
+++ lib/CodeGen/CGCall.cpp
@@ -117,10 +117,13 @@ static void adjustCXXMethodInfo(CodeGenTypes &CGT,
 /// not a C++ or ObjC instance method) of the given type.
 static const CGFunctionInfo &arrangeCXXMethodType(CodeGenTypes &CGT,
                                       SmallVectorImpl<CanQualType> &prefix,
-                                            CanQual<FunctionProtoType> FTP) {
+                                            const FunctionProtoType *FTP) {
   FunctionType::ExtInfo extInfo = FTP->getExtInfo();
   adjustCXXMethodInfo(CGT, extInfo, FTP->isVariadic());
-  return arrangeLLVMFunctionInfo(CGT, prefix, FTP, extInfo);
+  return arrangeLLVMFunctionInfo(CGT, prefix,
+                                 FTP->getCanonicalTypeUnqualified()
+                                   .getAs<FunctionProtoType>(),
+                                 extInfo);
 }
 
 /// Arrange the argument and result information for a value of the
@@ -163,8 +166,7 @@ CodeGenTypes::arrangeCXXMethodType(const CXXRecordDecl *RD,
   // Add the 'this' pointer.
   argTypes.push_back(GetThisType(Context, RD));
 
-  return ::arrangeCXXMethodType(*this, argTypes,
-              FTP->getCanonicalTypeUnqualified().getAs<FunctionProtoType>());
+  return ::arrangeCXXMethodType(*this, argTypes, FTP);
 }
 
 /// Arrange the argument and result information for a declaration or
@@ -176,14 +178,12 @@ CodeGenTypes::arrangeCXXMethodDeclaration(const CXXMethodDecl *MD) {
   assert(!isa<CXXConstructorDecl>(MD) && "wrong method for contructors!");
   assert(!isa<CXXDestructorDecl>(MD) && "wrong method for destructors!");
 
-  CanQual<FunctionProtoType> prototype = GetFormalType(MD);
-
   if (MD->isInstance()) {
     // The abstract case is perfectly fine.
-    return arrangeCXXMethodType(MD->getParent(), prototype.getTypePtr());
+    return arrangeCXXMethodType(MD->getParent(), MD->getType()->castAs<FunctionProtoType>());
   }
 
-  return arrangeFreeFunctionType(prototype);
+  return arrangeFreeFunctionType(GetFormalType(MD));
 }
 
 /// Arrange the argument and result information for a declaration
diff --git test/CodeGenCXX/microsoft-abi-methods.cpp test/CodeGenCXX/microsoft-abi-methods.cpp
index f8ba51d..6b7f004 100644
--- test/CodeGenCXX/microsoft-abi-methods.cpp
+++ test/CodeGenCXX/microsoft-abi-methods.cpp
@@ -34,7 +34,7 @@ void call_cdecl_method() {
 // CHECK: ret
 
 // Make sure that the definition uses the right calling convention:
-// FIXME: define linkonce_odr void @"\01?cdecl_method@C@@QAAXXZ"
+// CHECK: define linkonce_odr void @"\01?cdecl_method@C@@QAAXXZ"
 // CHECK: ret
 }
 
