summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-26 03:24:57 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-26 03:24:57 +0000
commit9f8e3d1929c373d2fe8fef136507c402f9215996 (patch)
tree5df86877bf14a942ef702229bab443f948d2f4ce
parent6a3bdd872c616fe19932cd5be63a1181f032e21d (diff)
downloadbcm5719-llvm-9f8e3d1929c373d2fe8fef136507c402f9215996.tar.gz
bcm5719-llvm-9f8e3d1929c373d2fe8fef136507c402f9215996.zip
Change isTemplate to return the actual template declaration.
llvm-svn: 82839
-rw-r--r--clang/lib/CodeGen/Mangle.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp
index 9766e585ff1..f03f029198d 100644
--- a/clang/lib/CodeGen/Mangle.cpp
+++ b/clang/lib/CodeGen/Mangle.cpp
@@ -252,13 +252,13 @@ static bool isStdNamespace(const DeclContext *DC) {
return NS->getOriginalNamespace()->getIdentifier()->isStr("std");
}
-static const NamedDecl *isTemplate(const NamedDecl *ND,
- const TemplateArgumentList *&TemplateArgs) {
+static const TemplateDecl *
+isTemplate(const NamedDecl *ND, const TemplateArgumentList *&TemplateArgs) {
// Check if we have a function template.
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(ND)){
- if (FD->getPrimaryTemplate()) {
+ if (const TemplateDecl *TD = FD->getPrimaryTemplate()) {
TemplateArgs = FD->getTemplateSpecializationArgs();
- return FD;
+ return TD;
}
}
@@ -266,7 +266,7 @@ static const NamedDecl *isTemplate(const NamedDecl *ND,
if (const ClassTemplateSpecializationDecl *Spec =
dyn_cast<ClassTemplateSpecializationDecl>(ND)) {
TemplateArgs = &Spec->getTemplateArgs();
- return Spec;
+ return Spec->getSpecializedTemplate();
}
return 0;
OpenPOWER on IntegriCloud