Use the power of types to track down another canonicalization bug in
the ABI-computation interface.  Fixes <rdar://problem/7691046>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97197 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CodeGenTypes.h b/lib/CodeGen/CodeGenTypes.h
index f2e12ca..b2912ef 100644
--- a/lib/CodeGen/CodeGenTypes.h
+++ b/lib/CodeGen/CodeGenTypes.h
@@ -35,6 +35,7 @@
 namespace clang {
   class ABIInfo;
   class ASTContext;
+  template <typename> class CanQual;
   class CXXConstructorDecl;
   class CXXDestructorDecl;
   class CXXMethodDecl;
@@ -48,6 +49,7 @@
   class TagDecl;
   class TargetInfo;
   class Type;
+  typedef CanQual<Type> CanQualType;
 
 namespace CodeGen {
   class CodeGenTypes;
@@ -202,8 +204,8 @@
     return getFunctionInfo(Ty->getResultType(), Args,
                            Ty->getCallConv(), Ty->getNoReturnAttr());
   }
-  const CGFunctionInfo &getFunctionInfo(const FunctionProtoType *Ty);
-  const CGFunctionInfo &getFunctionInfo(const FunctionNoProtoType *Ty);
+  const CGFunctionInfo &getFunctionInfo(CanQual<FunctionProtoType> Ty);
+  const CGFunctionInfo &getFunctionInfo(CanQual<FunctionNoProtoType> Ty);
 
   // getFunctionInfo - Get the function info for a member function.
   const CGFunctionInfo &getFunctionInfo(const CXXRecordDecl *RD,
@@ -220,8 +222,12 @@
                                         const FunctionArgList &Args,
                                         CallingConv CC,
                                         bool NoReturn);
-  const CGFunctionInfo &getFunctionInfo(QualType RetTy,
-                                  const llvm::SmallVectorImpl<QualType> &ArgTys,
+
+  /// Retrieves the ABI information for the given function signature.
+  /// 
+  /// \param ArgTys - must all actually be canonical as params
+  const CGFunctionInfo &getFunctionInfo(CanQualType RetTy,
+                               const llvm::SmallVectorImpl<CanQualType> &ArgTys,
                                         CallingConv CC,
                                         bool NoReturn);