summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index/USRGeneration.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2016-07-15 22:18:19 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2016-07-15 22:18:19 +0000
commitd9849a972b2303c53c3724a3f1f69410417f4e9f (patch)
tree399379a452fe2da7751077622deb00e3dcfd9cc9 /clang/lib/Index/USRGeneration.cpp
parentb927e02e1b4034eacfe2222ab6a951853ff12513 (diff)
downloadbcm5719-llvm-d9849a972b2303c53c3724a3f1f69410417f4e9f.tar.gz
bcm5719-llvm-d9849a972b2303c53c3724a3f1f69410417f4e9f.zip
[index] Create different USR if a property is a class property.
Avoids USR conflicts between class & instance properties of the same name. llvm-svn: 275630
Diffstat (limited to 'clang/lib/Index/USRGeneration.cpp')
-rw-r--r--clang/lib/Index/USRGeneration.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/Index/USRGeneration.cpp b/clang/lib/Index/USRGeneration.cpp
index 11ee8731898..30f1add249b 100644
--- a/clang/lib/Index/USRGeneration.cpp
+++ b/clang/lib/Index/USRGeneration.cpp
@@ -138,8 +138,8 @@ public:
}
/// Generate a USR fragment for an Objective-C property.
- void GenObjCProperty(StringRef prop) {
- generateUSRForObjCProperty(prop, Out);
+ void GenObjCProperty(StringRef prop, bool isClassProp) {
+ generateUSRForObjCProperty(prop, isClassProp, Out);
}
/// Generate a USR for an Objective-C protocol.
@@ -411,7 +411,7 @@ void USRGenerator::VisitObjCPropertyDecl(const ObjCPropertyDecl *D) {
Visit(ID);
else
Visit(cast<Decl>(D->getDeclContext()));
- GenObjCProperty(D->getName());
+ GenObjCProperty(D->getName(), D->isClassProperty());
}
void USRGenerator::VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D) {
@@ -864,8 +864,9 @@ void clang::index::generateUSRForObjCMethod(StringRef Sel,
OS << (IsInstanceMethod ? "(im)" : "(cm)") << Sel;
}
-void clang::index::generateUSRForObjCProperty(StringRef Prop, raw_ostream &OS) {
- OS << "(py)" << Prop;
+void clang::index::generateUSRForObjCProperty(StringRef Prop, bool isClassProp,
+ raw_ostream &OS) {
+ OS << (isClassProp ? "(cpy)" : "(py)") << Prop;
}
void clang::index::generateUSRForObjCProtocol(StringRef Prot, raw_ostream &OS) {
OpenPOWER on IntegriCloud