]> granicus.if.org Git - clang/commitdiff
Add GlobalDecl::getCanonicalDecl.
authorAnders Carlsson <andersca@mac.com>
Tue, 22 Jun 2010 16:00:14 +0000 (16:00 +0000)
committerAnders Carlsson <andersca@mac.com>
Tue, 22 Jun 2010 16:00:14 +0000 (16:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106546 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/GlobalDecl.h

index b8a98d7c03b63bc62e67250a62e89c9180719c24..26dea402f4b65df0ffdb1c224e22addb0edb70c0 100644 (file)
@@ -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 {