From: Anders Carlsson Date: Tue, 22 Jun 2010 16:00:14 +0000 (+0000) Subject: Add GlobalDecl::getCanonicalDecl. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc5daec0d30959bf081544f72d378f6f96cf9b1a;p=clang Add GlobalDecl::getCanonicalDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106546 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/GlobalDecl.h b/lib/CodeGen/GlobalDecl.h index b8a98d7c03..26dea402f4 100644 --- a/lib/CodeGen/GlobalDecl.h +++ b/lib/CodeGen/GlobalDecl.h @@ -36,7 +36,7 @@ class GlobalDecl { Value.setPointer(D); } - + public: GlobalDecl() {} @@ -50,6 +50,14 @@ public: GlobalDecl(const CXXDestructorDecl *D, CXXDtorType Type) : Value(D, Type) {} + GlobalDecl getCanonicalDecl() const { + GlobalDecl CanonGD; + CanonGD.Value.setPointer(Value.getPointer()->getCanonicalDecl()); + CanonGD.Value.setInt(Value.getInt()); + + return CanonGD; + } + const Decl *getDecl() const { return Value.getPointer(); } CXXCtorType getCtorType() const {