r223630 - [libclang] Encode the C++11 method reference qualifier in the USR.

Argyrios Kyrtzidis akyrtzi at gmail.com
Mon Dec 8 00:48:22 PST 2014


Author: akirtzidis
Date: Mon Dec  8 02:48:21 2014
New Revision: 223630

URL: http://llvm.org/viewvc/llvm-project?rev=223630&view=rev
Log:
[libclang] Encode the C++11 method reference qualifier in the USR.

Modified:
    cfe/trunk/lib/Index/USRGeneration.cpp
    cfe/trunk/test/Index/usrs-cxx0x.cpp

Modified: cfe/trunk/lib/Index/USRGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/USRGeneration.cpp?rev=223630&r1=223629&r2=223630&view=diff
==============================================================================
--- cfe/trunk/lib/Index/USRGeneration.cpp (original)
+++ cfe/trunk/lib/Index/USRGeneration.cpp Mon Dec  8 02:48:21 2014
@@ -243,6 +243,11 @@ void USRGenerator::VisitFunctionDecl(con
       Out << 'S';
     if (unsigned quals = MD->getTypeQualifiers())
       Out << (char)('0' + quals);
+    switch (MD->getRefQualifier()) {
+    case RQ_None: break;
+    case RQ_LValue: Out << '&'; break;
+    case RQ_RValue: Out << "&&"; break;
+    }
   }
 }
 

Modified: cfe/trunk/test/Index/usrs-cxx0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/usrs-cxx0x.cpp?rev=223630&r1=223629&r2=223630&view=diff
==============================================================================
--- cfe/trunk/test/Index/usrs-cxx0x.cpp (original)
+++ cfe/trunk/test/Index/usrs-cxx0x.cpp Mon Dec  8 02:48:21 2014
@@ -3,6 +3,14 @@ struct tuple { };
 
 void f(tuple<int, float, double>);
 
+class TestCls {
+  void meth() &;
+  void meth() &&;
+};
+
 // RUN: c-index-test -test-load-source-usrs all -std=c++11 %s | FileCheck %s
 // CHECK: usrs-cxx0x.cpp c:@ST>1#pT at tuple Extent=[1:1 - 2:17]
 // CHECK: usrs-cxx0x.cpp c:@F at f#$@S at tuple>#p3Ifd# Extent=[4:1 - 4:34]
+
+// CHECK: usrs-cxx0x.cpp c:@C at TestCls@F at meth#& Extent=[7:3 - 7:16]
+// CHECK: usrs-cxx0x.cpp c:@C at TestCls@F at meth#&& Extent=[8:3 - 8:17]





More information about the cfe-commits mailing list