aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-07-31 15:45:02 +0000
committerDouglas Gregor <dgregor@apple.com>2009-07-31 15:45:02 +0000
commit4a3f780f4f74a80f9b4bc42e38ad60170d5ebd0c (patch)
tree6b2b8cfc06e2a2b7f6146e14d3343e59b2672dd6 /lib
parent7b90be7981f41d7e4791622962f2e08a1dab8ca8 (diff)
Canonicalize function parameters
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/StmtProfile.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/AST/StmtProfile.cpp b/lib/AST/StmtProfile.cpp
index 5714c682a2..791c4398fb 100644
--- a/lib/AST/StmtProfile.cpp
+++ b/lib/AST/StmtProfile.cpp
@@ -602,6 +602,8 @@ void StmtProfiler::VisitObjCIsaExpr(ObjCIsaExpr *S) {
}
void StmtProfiler::VisitDecl(Decl *D) {
+ ID.AddInteger(D? D->getKind() : 0);
+
if (Canonical && D) {
if (NonTypeTemplateParmDecl *NTTP = dyn_cast<NonTypeTemplateParmDecl>(D)) {
ID.AddInteger(NTTP->getDepth());
@@ -610,6 +612,16 @@ void StmtProfiler::VisitDecl(Decl *D) {
return;
}
+ if (ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) {
+ // The Itanium C++ ABI uses the type of a parameter when mangling
+ // expressions that involve function parameters, so we will use the
+ // parameter's type for establishing function parameter identity. That
+ // way, our definition of "equivalent" (per C++ [temp.over.link])
+ // matches the definition of "equivalent" used for name mangling.
+ VisitType(Parm->getType());
+ return;
+ }
+
// FIXME: Template template parameters?
if (OverloadedFunctionDecl *Ovl = dyn_cast<OverloadedFunctionDecl>(D)) {