diff options
author | John McCall <rjmccall@apple.com> | 2010-06-09 07:26:17 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-06-09 07:26:17 +0000 |
commit | a5dd326ca540afe484755d3b0397652178281805 (patch) | |
tree | e55de01c2d67991e30f4faab33710d3d118e5be8 /clang/lib/CodeGen/Mangle.cpp | |
parent | e8b582256be50453b3996ed45002df03941051a1 (diff) | |
download | bcm5719-llvm-a5dd326ca540afe484755d3b0397652178281805.tar.gz bcm5719-llvm-a5dd326ca540afe484755d3b0397652178281805.zip |
Correctly handle > 257 substitutions in a single mangling, and don't introduce
a spurious substitution for an unscoped dependent template-id after introducing
a substitution for the scoped template-id.
llvm-svn: 105699
Diffstat (limited to 'clang/lib/CodeGen/Mangle.cpp')
-rw-r--r-- | clang/lib/CodeGen/Mangle.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp index faa9a9e4535..d8f1ca0b909 100644 --- a/clang/lib/CodeGen/Mangle.cpp +++ b/clang/lib/CodeGen/Mangle.cpp @@ -1374,16 +1374,14 @@ void CXXNameMangler::mangleType(const DependentNameType *T) { mangleSourceName(T->getIdentifier()); } else { const TemplateSpecializationType *TST = T->getTemplateId(); - if (!mangleSubstitution(QualType(TST, 0))) { - mangleTemplatePrefix(TST->getTemplateName()); + + mangleTemplatePrefix(TST->getTemplateName()); - // FIXME: GCC does not appear to mangle the template arguments when - // the template in question is a dependent template name. Should we - // emulate that badness? - mangleTemplateArgs(TST->getTemplateName(), TST->getArgs(), - TST->getNumArgs()); - addSubstitution(QualType(TST, 0)); - } + // FIXME: GCC does not appear to mangle the template arguments when + // the template in question is a dependent template name. Should we + // emulate that badness? + mangleTemplateArgs(TST->getTemplateName(), TST->getArgs(), + TST->getNumArgs()); } Out << 'E'; @@ -1950,7 +1948,7 @@ bool CXXNameMangler::mangleSubstitution(uintptr_t Ptr) { while (SeqID) { assert(BufferPtr > Buffer && "Buffer overflow!"); - unsigned char c = static_cast<unsigned char>(SeqID) % 36; + char c = static_cast<char>(SeqID % 36); *--BufferPtr = (c < 10 ? '0' + c : 'A' + c - 10); SeqID /= 36; |