From 433d1374409a8eeaa4b0975fa187a542d5e40c23 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 7 Nov 2009 04:26:04 +0000 Subject: 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 --- lib/CodeGen/Mangle.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/CodeGen/Mangle.cpp') 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(ND->getCanonicalDecl()); + addSubstitution(reinterpret_cast(ND)); } void addSubstitution(QualType T); @@ -1174,6 +1176,7 @@ bool CXXNameMangler::mangleSubstitution(const NamedDecl *ND) { if (mangleStandardSubstitution(ND)) return true; + ND = cast(ND->getCanonicalDecl()); return mangleSubstitution(reinterpret_cast(ND)); } -- cgit v1.2.3