aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-06 23:10:54 +0000
committerChris Lattner <sabre@nondot.org>2008-04-06 23:10:54 +0000
commit8bcfc5bef434d7052e28d0ce45182855659ebd3d (patch)
tree86ccc63440112462219db0baa574467f9e1f7da6 /lib/Sema/SemaDecl.cpp
parentd8bdba5d3534b87cae606d559933bc62752e8828 (diff)
remove the Decl::getCanonicalType() method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49295 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 9498fb2c9e..0f464a0bc7 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -280,8 +280,8 @@ FunctionDecl *Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
MergeAttributes(New, Old);
- QualType OldQType = Old->getType().getCanonicalType();
- QualType NewQType = New->getType().getCanonicalType();
+ QualType OldQType = Context.getCanonicalType(Old->getType());
+ QualType NewQType = Context.getCanonicalType(New->getType());
// Function types need to be compatible, not identical. This handles
// duplicate function decls like "void f(int); void f(enum X);" properly.
@@ -357,8 +357,9 @@ VarDecl *Sema::MergeVarDecl(VarDecl *New, Decl *OldD) {
MergeAttributes(New, Old);
// Verify the types match.
- if (Old->getCanonicalType() != New->getCanonicalType() &&
- !areEquivalentArrayTypes(New->getCanonicalType(), Old->getCanonicalType())) {
+ QualType OldCType = Context.getCanonicalType(Old->getType());
+ QualType NewCType = Context.getCanonicalType(New->getType());
+ if (OldCType != NewCType && !areEquivalentArrayTypes(NewCType, OldCType)) {
Diag(New->getLocation(), diag::err_redefinition, New->getName());
Diag(Old->getLocation(), diag::err_previous_definition);
return New;