r223629 - [libclang] Reflect in USR generation that 'signed char' and 'unsigned char' can overload a 'char' in C++, by giving them distinct encodings.
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Dec 8 00:48:17 PST 2014
Author: akirtzidis
Date: Mon Dec 8 02:48:17 2014
New Revision: 223629
URL: http://llvm.org/viewvc/llvm-project?rev=223629&view=rev
Log:
[libclang] Reflect in USR generation that 'signed char' and 'unsigned char' can overload a 'char' in C++, by giving them distinct encodings.
Modified:
cfe/trunk/lib/Index/USRGeneration.cpp
cfe/trunk/test/Index/usrs.cpp
Modified: cfe/trunk/lib/Index/USRGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/USRGeneration.cpp?rev=223629&r1=223628&r2=223629&view=diff
==============================================================================
--- cfe/trunk/lib/Index/USRGeneration.cpp (original)
+++ cfe/trunk/lib/Index/USRGeneration.cpp Mon Dec 8 02:48:17 2014
@@ -569,8 +569,9 @@ void USRGenerator::VisitType(QualType T)
case BuiltinType::UInt128:
c = 'j'; break;
case BuiltinType::Char_S:
- case BuiltinType::SChar:
c = 'C'; break;
+ case BuiltinType::SChar:
+ c = 'r'; break;
case BuiltinType::WChar_S:
case BuiltinType::WChar_U:
c = 'W'; break;
Modified: cfe/trunk/test/Index/usrs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/usrs.cpp?rev=223629&r1=223628&r2=223629&view=diff
==============================================================================
--- cfe/trunk/test/Index/usrs.cpp (original)
+++ cfe/trunk/test/Index/usrs.cpp Mon Dec 8 02:48:17 2014
@@ -83,6 +83,10 @@ template <class T> typename T::A someTem
template <class T> typename T::B someTemplFn() {}
template <class T> int someTemplFn() {}
+void funWithChar(char c) {}
+void funWithChar(unsigned char c) {}
+void funWithChar(signed char c) {}
+
// RUN: c-index-test -test-load-source-usrs all %s | FileCheck %s
// CHECK: usrs.cpp c:@N at foo Extent=[1:1 - 4:2]
// CHECK: usrs.cpp c:@N at foo@x Extent=[2:3 - 2:8]
@@ -147,6 +151,11 @@ template <class T> int someTemplFn() {}
// CHECK: usrs.cpp c:usrs.cpp at aN@C at RDar9371763_Foo@F at bar# Extent=[75:1 - 75:31]
// CHECK: usrs.cpp c:@F at rdar9371763# Extent=[77:1 - 80:2]
// CHECK: usrs.cpp c:usrs.cpp at 1204@F at rdar9371763#@foo Extent=[78:3 - 78:22]
+
// CHECK: usrs.cpp c:@FT@>1#TsomeTemplFn#^type-parameter-0-0:::A# Extent=[82:1 - 82:50]
// CHECK: usrs.cpp c:@FT@>1#TsomeTemplFn#^type-parameter-0-0:::B# Extent=[83:1 - 83:50]
// CHECK: usrs.cpp c:@FT@>1#TsomeTemplFn#I# Extent=[84:1 - 84:40]
+
+// CHECK: usrs.cpp c:@F at funWithChar#C# Extent=[86:1 - 86:28]
+// CHECK: usrs.cpp c:@F at funWithChar#c# Extent=[87:1 - 87:37]
+// CHECK: usrs.cpp c:@F at funWithChar#r# Extent=[88:1 - 88:35]
More information about the cfe-commits
mailing list