aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-28 22:05:49 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-28 22:05:49 +0000
commit4b2ccfc302d7eebe9380211e6e2d4f7b4a6d0eba (patch)
tree72ff8c0853480658ff243890f25fc50150acc71f /lib/CodeGen/Mangle.cpp
parent5ed1bc351f36ca1086d7836baee546c39ce90dd7 (diff)
Improve name mangling for dependently-scoped declaration references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97422 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r--lib/CodeGen/Mangle.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 55185cb92d..fd9a1bab7f 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -1369,7 +1369,18 @@ void CXXNameMangler::mangleExpression(const Expr *E) {
case Expr::DependentScopeDeclRefExprClass: {
const DependentScopeDeclRefExpr *DRE = cast<DependentScopeDeclRefExpr>(E);
- const Type *QTy = DRE->getQualifier()->getAsType();
+ NestedNameSpecifier *NNS = DRE->getQualifier();
+ const Type *QTy = NNS->getAsType();
+
+ // When we're dealing with a nested-name-specifier that has just a
+ // dependent identifier in it, mangle that as a typename. FIXME:
+ // It isn't clear that we ever actually want to have such a
+ // nested-name-specifier; why not just represent it as a typename type?
+ if (!QTy && NNS->getAsIdentifier() && NNS->getPrefix()) {
+ QTy = getASTContext().getTypenameType(NNS->getPrefix(),
+ NNS->getAsIdentifier())
+ .getTypePtr();
+ }
assert(QTy && "Qualifier was not type!");
// ::= sr <type> <unqualified-name> # dependent name