summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-11-07 04:26:04 +0000
committerAnders Carlsson <andersca@mac.com>2009-11-07 04:26:04 +0000
commit433d1374409a8eeaa4b0975fa187a542d5e40c23 (patch)
tree52631b6041b44b22fcd1a95bf31365dcbf4411d6 /lib/CodeGen
parent63c8b77334f90472260d2f48df2742ed5067261e (diff)
downloadclang-433d1374409a8eeaa4b0975fa187a542d5e40c23.tar.gz
clang-433d1374409a8eeaa4b0975fa187a542d5e40c23.tar.bz2
clang-433d1374409a8eeaa4b0975fa187a542d5e40c23.tar.xz
When looking up and adding substitutions to the substitution table, make sure to always use the canonical declaration. With tihs change, FileCheck compiles and links but crashes during startup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86339 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/Mangle.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 11bbaae018..081156cb6e 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -65,6 +65,8 @@ namespace {
bool mangleStandardSubstitution(const NamedDecl *ND);
void addSubstitution(const NamedDecl *ND) {
+ ND = cast<NamedDecl>(ND->getCanonicalDecl());
+
addSubstitution(reinterpret_cast<uintptr_t>(ND));
}
void addSubstitution(QualType T);
@@ -1174,6 +1176,7 @@ bool CXXNameMangler::mangleSubstitution(const NamedDecl *ND) {
if (mangleStandardSubstitution(ND))
return true;
+ ND = cast<NamedDecl>(ND->getCanonicalDecl());
return mangleSubstitution(reinterpret_cast<uintptr_t>(ND));
}