summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-10-20 18:56:54 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-10-20 18:56:54 +0000
commit1a83db4f5e4888cea667f34a436569a39de84679 (patch)
treee6c364d7ea352c0b1241516809d2e375a557f6b1 /clang/lib/CodeGen/CGDebugInfo.cpp
parent35e678c7e0ba85242b530047a78216c91f88d249 (diff)
downloadbcm5719-llvm-1a83db4f5e4888cea667f34a436569a39de84679.tar.gz
bcm5719-llvm-1a83db4f5e4888cea667f34a436569a39de84679.zip
PR21312: Fix a regression in non-type template parameters of function type that are static member functions.
llvm-svn: 220221
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index cb3d45babc2..723da71eddb 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1258,14 +1258,15 @@ CollectTemplateParams(const TemplateParameterList *TPList,
QualType T = TA.getParamTypeForDecl().getDesugaredType(CGM.getContext());
llvm::DIType TTy = getOrCreateType(T, Unit);
llvm::Value *V = nullptr;
+ const CXXMethodDecl *MD;
// Variable pointer template parameters have a value that is the address
// of the variable.
if (const auto *VD = dyn_cast<VarDecl>(D))
V = CGM.GetAddrOfGlobalVar(VD);
// Member function pointers have special support for building them, though
// this is currently unsupported in LLVM CodeGen.
- else if (const auto *method = dyn_cast<CXXMethodDecl>(D))
- V = CGM.getCXXABI().EmitMemberPointer(method);
+ else if ((MD = dyn_cast<CXXMethodDecl>(D)) && MD->isInstance())
+ V = CGM.getCXXABI().EmitMemberPointer(MD);
else if (const auto *FD = dyn_cast<FunctionDecl>(D))
V = CGM.GetAddrOfFunction(FD);
// Member data pointers have special handling too to compute the fixed
OpenPOWER on IntegriCloud