[cfe-commits] r64533 - /cfe/trunk/lib/CodeGen/CGCall.cpp
Douglas Gregor
dgregor at apple.com
Sat Feb 14 12:52:38 PST 2009
On Feb 14, 2009, at 10:08 AM, Mike Stump wrote:
> On Feb 13, 2009, at 6:45 PM, Daniel Dunbar wrote:
>> x86_64 ABI: Need to use canonical types when comparing against
>> ASTContext types.
>
> [ thinking out loud ] Does it make sense to encode this into the type
> system so that we get compilation errors when people get it wrong?
> I've not thought about it yet, but... we could even have a
> conversion operator that can canonicalize a type, if it needed to be
> canonical.
We could certainly take away QualType::operator==/!= and instead force
everyone to use ASTContext::hasSameType . It would probably simplify a
bit of code, and eliminate some not-yet-uncovered bugs that would show
up with gratuitous typedef'ing.
I've also considered doing the same thing with
QualType::getCVRQualifiers, since this doesn't give you all of the cvr-
qualifiers unless you already have the canonical type. I've come
across a few places where we've made this mistake.
There *might* be a performance cost, since getting at the canonical
type isn't entirely free, but it'd be worth a try.
- Doug
More information about the cfe-commits
mailing list