[cfe-commits] r84947 - /cfe/trunk/lib/CodeGen/CGExpr.cpp
John McCall
rjmccall at apple.com
Fri Oct 23 01:22:43 PDT 2009
Author: rjmccall
Date: Fri Oct 23 03:22:42 2009
New Revision: 84947
URL: http://llvm.org/viewvc/llvm-project?rev=84947&view=rev
Log:
Emit calls using the canonical prototype of the called function.
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=84947&r1=84946&r2=84947&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Fri Oct 23 03:22:42 2009
@@ -1547,11 +1547,13 @@
assert(CalleeType->isFunctionPointerType() &&
"Call must have function pointer type!");
- QualType FnType = CalleeType->getAs<PointerType>()->getPointeeType();
- QualType ResultType = FnType->getAs<FunctionType>()->getResultType();
+ CalleeType = getContext().getCanonicalType(CalleeType);
+
+ QualType FnType = cast<PointerType>(CalleeType)->getPointeeType();
+ QualType ResultType = cast<FunctionType>(FnType)->getResultType();
CallArgList Args;
- EmitCallArgs(Args, FnType->getAs<FunctionProtoType>(), ArgBeg, ArgEnd);
+ EmitCallArgs(Args, dyn_cast<FunctionProtoType>(FnType), ArgBeg, ArgEnd);
// FIXME: We should not need to do this, it should be part of the function
// type.
More information about the cfe-commits
mailing list