aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-02-14 02:45:45 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-02-14 02:45:45 +0000
commit3327f6ead9362e5689674a4aaab5b7f23ea0dea3 (patch)
tree10e18800489334530f5dd63e8a24597d41486302 /lib/CodeGen/CGCall.cpp
parent644f4c3fe4130c7be75d6191340ba8d857ba0730 (diff)
x86_64 ABI: Need to use canonical types when comparing against
ASTContext types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64533 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r--lib/CodeGen/CGCall.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index debf131903..708c7171da 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -542,7 +542,7 @@ void X86_64ABIInfo::classify(QualType Ty,
Hi = SSEUp;
}
} else if (const ComplexType *CT = Ty->getAsComplexType()) {
- QualType ET = CT->getElementType();
+ QualType ET = Context.getCanonicalType(CT->getElementType());
uint64_t Size = Context.getTypeSize(Ty);
if (ET->isIntegerType()) {
@@ -670,8 +670,12 @@ ABIArgInfo X86_64ABIInfo::getCoerceResult(QualType Ty,
if (Ty->isIntegerType() || Ty->isPointerType())
return ABIArgInfo::getDirect();
} else if (CoerceTo == llvm::Type::DoubleTy) {
+ // FIXME: It would probably be better to make CGFunctionInfo only
+ // map using canonical types than to canonize here.
+ QualType CTy = Context.getCanonicalType(Ty);
+
// Float and double end up in a single SSE reg.
- if (Ty == Context.FloatTy || Ty == Context.DoubleTy)
+ if (CTy == Context.FloatTy || CTy == Context.DoubleTy)
return ABIArgInfo::getDirect();
}