Ted Kremenek | 1b6869a | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 1 | //===- CIndexUSR.cpp - Clang-C Source Indexing Library --------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the generation and use of USRs from CXEntities. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "CIndexer.h" |
Ted Kremenek | cf84aa4 | 2010-01-18 20:23:29 +0000 | [diff] [blame] | 15 | #include "CXCursor.h" |
Benjamin Kramer | 9895c6a | 2010-01-12 11:32:40 +0000 | [diff] [blame] | 16 | #include "clang/AST/DeclVisitor.h" |
Benjamin Kramer | b846deb | 2010-04-12 19:45:50 +0000 | [diff] [blame] | 17 | #include "clang/Lex/PreprocessingRecord.h" |
Ted Kremenek | 8776382 | 2010-01-12 02:07:58 +0000 | [diff] [blame] | 18 | #include "llvm/ADT/SmallString.h" |
Benjamin Kramer | 9895c6a | 2010-01-12 11:32:40 +0000 | [diff] [blame] | 19 | #include "llvm/Support/raw_ostream.h" |
Benjamin Kramer | b846deb | 2010-04-12 19:45:50 +0000 | [diff] [blame] | 20 | using namespace clang; |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 21 | using namespace clang::cxstring; |
| 22 | |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 23 | //===----------------------------------------------------------------------===// |
| 24 | // USR generation. |
| 25 | //===----------------------------------------------------------------------===// |
| 26 | |
| 27 | namespace { |
Ted Kremenek | 2fee4e6 | 2010-01-14 01:50:21 +0000 | [diff] [blame] | 28 | class USRGenerator : public DeclVisitor<USRGenerator> { |
| 29 | llvm::raw_ostream &Out; |
Ted Kremenek | 3adca6d | 2010-01-18 22:02:49 +0000 | [diff] [blame] | 30 | bool IgnoreResults; |
Ted Kremenek | 2fee4e6 | 2010-01-14 01:50:21 +0000 | [diff] [blame] | 31 | public: |
Ted Kremenek | 3adca6d | 2010-01-18 22:02:49 +0000 | [diff] [blame] | 32 | USRGenerator(llvm::raw_ostream &out) : Out(out), IgnoreResults(false) {} |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 33 | |
Ted Kremenek | 3adca6d | 2010-01-18 22:02:49 +0000 | [diff] [blame] | 34 | bool ignoreResults() const { return IgnoreResults; } |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 35 | |
| 36 | // Visitation methods from generating USRs from AST elements. |
Ted Kremenek | 2fee4e6 | 2010-01-14 01:50:21 +0000 | [diff] [blame] | 37 | void VisitBlockDecl(BlockDecl *D); |
| 38 | void VisitDeclContext(DeclContext *D); |
Ted Kremenek | 3adca6d | 2010-01-18 22:02:49 +0000 | [diff] [blame] | 39 | void VisitFieldDecl(FieldDecl *D); |
Ted Kremenek | 2fee4e6 | 2010-01-14 01:50:21 +0000 | [diff] [blame] | 40 | void VisitFunctionDecl(FunctionDecl *D); |
| 41 | void VisitNamedDecl(NamedDecl *D); |
| 42 | void VisitNamespaceDecl(NamespaceDecl *D); |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 43 | void VisitObjCContainerDecl(ObjCContainerDecl *CD); |
Ted Kremenek | 2fee4e6 | 2010-01-14 01:50:21 +0000 | [diff] [blame] | 44 | void VisitObjCMethodDecl(ObjCMethodDecl *MD); |
| 45 | void VisitObjCPropertyDecl(ObjCPropertyDecl *D); |
Ted Kremenek | b82b3be | 2010-01-18 22:42:20 +0000 | [diff] [blame] | 46 | void VisitTagDecl(TagDecl *D); |
Ted Kremenek | 2fee4e6 | 2010-01-14 01:50:21 +0000 | [diff] [blame] | 47 | void VisitTypedefDecl(TypedefDecl *D); |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 48 | |
| 49 | |
| 50 | /// String generation methods used both by the visitation methods |
| 51 | /// and from other clients that want to directly generate USRs. These |
| 52 | /// methods do not construct complete USRs (which incorporate the parents |
| 53 | /// of an AST element), but only the fragments concerning the AST element |
| 54 | /// itself. |
| 55 | |
| 56 | /// Generate a USR fragment for a named declaration. This does |
| 57 | /// not include the USR component for the parent. |
| 58 | void GenNamedDecl(llvm::StringRef name); |
| 59 | |
| 60 | /// Generate a USR for an Objective-C class. |
| 61 | void GenObjCClass(llvm::StringRef cls); |
| 62 | /// Generate a USR for an Objective-C class category. |
| 63 | void GenObjCCategory(llvm::StringRef cls, llvm::StringRef cat); |
| 64 | /// Generate a USR fragment for an Objective-C instance variable. The |
| 65 | /// complete USR can be created by concatenating the USR for the |
| 66 | /// encompassing class with this USR fragment. |
| 67 | void GenObjCIvar(llvm::StringRef ivar); |
| 68 | /// Generate a USR fragment for an Objective-C method. |
| 69 | void GenObjCMethod(llvm::StringRef sel, bool isInstanceMethod); |
| 70 | /// Generate a USR fragment for an Objective-C property. |
| 71 | void GenObjCProperty(llvm::StringRef prop); |
| 72 | /// Generate a USR for an Objective-C protocol. |
| 73 | void GenObjCProtocol(llvm::StringRef prot); |
Ted Kremenek | 2fee4e6 | 2010-01-14 01:50:21 +0000 | [diff] [blame] | 74 | }; |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 75 | |
| 76 | class StringUSRGenerator { |
| 77 | private: |
| 78 | llvm::SmallString<1024> StrBuf; |
| 79 | llvm::raw_svector_ostream Out; |
| 80 | USRGenerator UG; |
| 81 | public: |
| 82 | StringUSRGenerator() |
Ted Kremenek | 0c0fb41 | 2010-03-25 02:00:36 +0000 | [diff] [blame] | 83 | : Out(StrBuf), UG(Out) { |
| 84 | // Add the USR space prefix. |
| 85 | Out << "c:"; |
| 86 | } |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 87 | |
| 88 | llvm::StringRef str() { |
| 89 | return Out.str(); |
| 90 | } |
| 91 | |
| 92 | USRGenerator* operator->() { return &UG; } |
| 93 | |
| 94 | template <typename T> |
| 95 | llvm::raw_svector_ostream &operator<<(const T &x) { |
| 96 | Out << x; |
| 97 | return Out; |
| 98 | } |
| 99 | }; |
| 100 | |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 101 | } // end anonymous namespace |
| 102 | |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 103 | //===----------------------------------------------------------------------===// |
| 104 | // Generating USRs from ASTS. |
| 105 | //===----------------------------------------------------------------------===// |
| 106 | |
Ted Kremenek | 2fee4e6 | 2010-01-14 01:50:21 +0000 | [diff] [blame] | 107 | void USRGenerator::VisitBlockDecl(BlockDecl *D) { |
| 108 | VisitDeclContext(D->getDeclContext()); |
| 109 | // FIXME: Better support for anonymous blocks. |
| 110 | Out << "@B^anon"; |
| 111 | } |
| 112 | |
| 113 | void USRGenerator::VisitDeclContext(DeclContext *DC) { |
| 114 | if (NamedDecl *D = dyn_cast<NamedDecl>(DC)) |
| 115 | Visit(D); |
| 116 | } |
| 117 | |
Ted Kremenek | 3adca6d | 2010-01-18 22:02:49 +0000 | [diff] [blame] | 118 | void USRGenerator::VisitFieldDecl(FieldDecl *D) { |
| 119 | const std::string &s = D->getNameAsString(); |
| 120 | if (s.empty()) { |
| 121 | // Bit fields can be anonymous. |
| 122 | IgnoreResults = true; |
| 123 | return; |
| 124 | } |
| 125 | VisitDeclContext(D->getDeclContext()); |
| 126 | Out << "@^FI^" << s; |
| 127 | } |
| 128 | |
Ted Kremenek | 2fee4e6 | 2010-01-14 01:50:21 +0000 | [diff] [blame] | 129 | void USRGenerator::VisitFunctionDecl(FunctionDecl *D) { |
| 130 | VisitDeclContext(D->getDeclContext()); |
| 131 | Out << "@F^" << D->getNameAsString(); |
| 132 | } |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 133 | |
| 134 | void USRGenerator::VisitNamedDecl(NamedDecl *D) { |
Ted Kremenek | 2fee4e6 | 2010-01-14 01:50:21 +0000 | [diff] [blame] | 135 | VisitDeclContext(D->getDeclContext()); |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 136 | const std::string &s = D->getNameAsString(); |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 137 | // assert(!s.empty()); |
| 138 | GenNamedDecl(s); |
Ted Kremenek | 2fee4e6 | 2010-01-14 01:50:21 +0000 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | void USRGenerator::VisitNamespaceDecl(NamespaceDecl *D) { |
| 142 | VisitDeclContext(D->getDeclContext()); |
| 143 | Out << "@N^" << D->getNameAsString(); |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 144 | } |
| 145 | |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 146 | void USRGenerator::VisitObjCMethodDecl(ObjCMethodDecl *D) { |
| 147 | Visit(cast<Decl>(D->getDeclContext())); |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 148 | GenObjCMethod(DeclarationName(D->getSelector()).getAsString(), |
| 149 | D->isInstanceMethod()); |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | void USRGenerator::VisitObjCContainerDecl(ObjCContainerDecl *D) { |
| 153 | switch (D->getKind()) { |
| 154 | default: |
| 155 | assert(false && "Invalid ObjC container."); |
| 156 | case Decl::ObjCInterface: |
| 157 | case Decl::ObjCImplementation: |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 158 | GenObjCClass(D->getName()); |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 159 | break; |
| 160 | case Decl::ObjCCategory: { |
| 161 | ObjCCategoryDecl *CD = cast<ObjCCategoryDecl>(D); |
Ted Kremenek | ebfa339 | 2010-03-19 20:39:03 +0000 | [diff] [blame] | 162 | ObjCInterfaceDecl *ID = CD->getClassInterface(); |
| 163 | if (!ID) { |
| 164 | // Handle invalid code where the @interface might not |
| 165 | // have been specified. |
| 166 | // FIXME: We should be able to generate this USR even if the |
| 167 | // @interface isn't available. |
| 168 | IgnoreResults = true; |
| 169 | return; |
| 170 | } |
| 171 | GenObjCCategory(ID->getName(), CD->getName()); |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 172 | break; |
| 173 | } |
| 174 | case Decl::ObjCCategoryImpl: { |
| 175 | ObjCCategoryImplDecl *CD = cast<ObjCCategoryImplDecl>(D); |
Ted Kremenek | ebfa339 | 2010-03-19 20:39:03 +0000 | [diff] [blame] | 176 | ObjCInterfaceDecl *ID = CD->getClassInterface(); |
| 177 | if (!ID) { |
| 178 | // Handle invalid code where the @interface might not |
| 179 | // have been specified. |
| 180 | // FIXME: We should be able to generate this USR even if the |
| 181 | // @interface isn't available. |
| 182 | IgnoreResults = true; |
| 183 | return; |
| 184 | } |
| 185 | GenObjCCategory(ID->getName(), CD->getName()); |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 186 | break; |
| 187 | } |
| 188 | case Decl::ObjCProtocol: |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 189 | GenObjCProtocol(cast<ObjCProtocolDecl>(D)->getName()); |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 190 | break; |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | void USRGenerator::VisitObjCPropertyDecl(ObjCPropertyDecl *D) { |
| 195 | Visit(cast<Decl>(D->getDeclContext())); |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 196 | GenObjCProperty(D->getName()); |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 197 | } |
| 198 | |
Ted Kremenek | b82b3be | 2010-01-18 22:42:20 +0000 | [diff] [blame] | 199 | void USRGenerator::VisitTagDecl(TagDecl *D) { |
| 200 | VisitDeclContext(D->getDeclContext()); |
| 201 | switch (D->getTagKind()) { |
| 202 | case TagDecl::TK_struct: Out << "@S^"; break; |
| 203 | case TagDecl::TK_class: Out << "@C^"; break; |
| 204 | case TagDecl::TK_union: Out << "@U^"; break; |
| 205 | case TagDecl::TK_enum: Out << "@E^"; break; |
| 206 | } |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 207 | |
Ted Kremenek | c5b48b3 | 2010-01-15 23:34:31 +0000 | [diff] [blame] | 208 | // FIXME: Better support for anonymous structures and enums. |
| 209 | const std::string &s = D->getNameAsString(); |
| 210 | if (s.empty()) { |
| 211 | if (TypedefDecl *TD = D->getTypedefForAnonDecl()) |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 212 | Out << "^anontd^" << TD->getNameAsString(); |
Ted Kremenek | c5b48b3 | 2010-01-15 23:34:31 +0000 | [diff] [blame] | 213 | else |
| 214 | Out << "^anon"; |
| 215 | } |
| 216 | else |
| 217 | Out << s; |
| 218 | } |
| 219 | |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 220 | void USRGenerator::VisitTypedefDecl(TypedefDecl *D) { |
| 221 | DeclContext *DC = D->getDeclContext(); |
| 222 | if (NamedDecl *DCN = dyn_cast<NamedDecl>(DC)) |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 223 | Visit(DCN); |
Ted Kremenek | c50277f | 2010-01-12 23:33:42 +0000 | [diff] [blame] | 224 | Out << "typedef@" << D->getName(); |
| 225 | } |
| 226 | |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 227 | //===----------------------------------------------------------------------===// |
| 228 | // General purpose USR generation methods. |
| 229 | //===----------------------------------------------------------------------===// |
Ted Kremenek | cf84aa4 | 2010-01-18 20:23:29 +0000 | [diff] [blame] | 230 | |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 231 | void USRGenerator::GenNamedDecl(llvm::StringRef name) { |
| 232 | Out << "@^" << name; |
| 233 | } |
| 234 | |
| 235 | void USRGenerator::GenObjCClass(llvm::StringRef cls) { |
| 236 | Out << "objc(cs)" << cls; |
| 237 | } |
| 238 | |
| 239 | void USRGenerator::GenObjCCategory(llvm::StringRef cls, llvm::StringRef cat) { |
| 240 | Out << "objc(cy)" << cls << '^' << cat; |
| 241 | } |
| 242 | |
| 243 | void USRGenerator::GenObjCIvar(llvm::StringRef ivar) { |
| 244 | GenNamedDecl(ivar); |
| 245 | } |
| 246 | |
| 247 | void USRGenerator::GenObjCMethod(llvm::StringRef meth, bool isInstanceMethod) { |
| 248 | Out << (isInstanceMethod ? "(im)" : "(cm)") << meth; |
| 249 | } |
| 250 | |
| 251 | void USRGenerator::GenObjCProperty(llvm::StringRef prop) { |
| 252 | Out << "(py)" << prop; |
| 253 | } |
| 254 | |
| 255 | void USRGenerator::GenObjCProtocol(llvm::StringRef prot) { |
| 256 | Out << "objc(pl)" << prot; |
| 257 | } |
| 258 | |
| 259 | //===----------------------------------------------------------------------===// |
| 260 | // API hooks. |
| 261 | //===----------------------------------------------------------------------===// |
Ted Kremenek | cf84aa4 | 2010-01-18 20:23:29 +0000 | [diff] [blame] | 262 | |
Benjamin Kramer | cfb51b6 | 2010-04-08 15:54:07 +0000 | [diff] [blame] | 263 | static inline llvm::StringRef extractUSRSuffix(llvm::StringRef s) { |
| 264 | return s.startswith("c:") ? s.substr(2) : ""; |
| 265 | } |
| 266 | |
Ted Kremenek | c3ef91d | 2010-04-11 22:20:26 +0000 | [diff] [blame] | 267 | static CXString getDeclCursorUSR(const CXCursor &C) { |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 268 | Decl *D = cxcursor::getCursorDecl(C); |
| 269 | if (!D) |
| 270 | return createCXString(NULL); |
| 271 | |
| 272 | StringUSRGenerator SUG; |
Ted Kremenek | c3ef91d | 2010-04-11 22:20:26 +0000 | [diff] [blame] | 273 | SUG->Visit(D); |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 274 | |
Ted Kremenek | 0c0fb41 | 2010-03-25 02:00:36 +0000 | [diff] [blame] | 275 | if (SUG->ignoreResults()) |
Ted Kremenek | ebfa339 | 2010-03-19 20:39:03 +0000 | [diff] [blame] | 276 | return createCXString(""); |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 277 | |
Ted Kremenek | c3ef91d | 2010-04-11 22:20:26 +0000 | [diff] [blame] | 278 | // Return a copy of the string that must be disposed by the caller. |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 279 | return createCXString(SUG.str(), true); |
| 280 | } |
| 281 | |
Ted Kremenek | c3ef91d | 2010-04-11 22:20:26 +0000 | [diff] [blame] | 282 | extern "C" { |
| 283 | |
| 284 | CXString clang_getCursorUSR(CXCursor C) { |
Ted Kremenek | fa8231d | 2010-04-11 22:20:34 +0000 | [diff] [blame] | 285 | const CXCursorKind &K = clang_getCursorKind(C); |
| 286 | |
| 287 | if (clang_isDeclaration(K)) |
Ted Kremenek | c3ef91d | 2010-04-11 22:20:26 +0000 | [diff] [blame] | 288 | return getDeclCursorUSR(C); |
Ted Kremenek | fa8231d | 2010-04-11 22:20:34 +0000 | [diff] [blame] | 289 | |
| 290 | if (K == CXCursor_MacroDefinition) { |
| 291 | StringUSRGenerator SUG; |
| 292 | SUG << "macro@" |
| 293 | << cxcursor::getCursorMacroDefinition(C)->getName()->getNameStart(); |
| 294 | return createCXString(SUG.str(), true); |
| 295 | } |
| 296 | |
Ted Kremenek | c3ef91d | 2010-04-11 22:20:26 +0000 | [diff] [blame] | 297 | return createCXString(""); |
| 298 | } |
| 299 | |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 300 | CXString clang_constructUSR_ObjCIvar(const char *name, CXString classUSR) { |
| 301 | StringUSRGenerator SUG; |
Ted Kremenek | 0c0fb41 | 2010-03-25 02:00:36 +0000 | [diff] [blame] | 302 | SUG << extractUSRSuffix(clang_getCString(classUSR)); |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 303 | SUG->GenObjCIvar(name); |
| 304 | return createCXString(SUG.str(), true); |
| 305 | } |
| 306 | |
| 307 | CXString clang_constructUSR_ObjCMethod(const char *name, |
| 308 | unsigned isInstanceMethod, |
| 309 | CXString classUSR) { |
| 310 | StringUSRGenerator SUG; |
Ted Kremenek | 0c0fb41 | 2010-03-25 02:00:36 +0000 | [diff] [blame] | 311 | SUG << extractUSRSuffix(clang_getCString(classUSR)); |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 312 | SUG->GenObjCMethod(name, isInstanceMethod); |
| 313 | return createCXString(SUG.str(), true); |
| 314 | } |
| 315 | |
| 316 | CXString clang_constructUSR_ObjCClass(const char *name) { |
| 317 | StringUSRGenerator SUG; |
| 318 | SUG->GenObjCClass(name); |
| 319 | return createCXString(SUG.str(), true); |
| 320 | } |
| 321 | |
| 322 | CXString clang_constructUSR_ObjCProtocol(const char *name) { |
| 323 | StringUSRGenerator SUG; |
| 324 | SUG->GenObjCProtocol(name); |
| 325 | return createCXString(SUG.str(), true); |
| 326 | } |
| 327 | |
Ted Kremenek | 66ccaec | 2010-03-15 17:38:58 +0000 | [diff] [blame] | 328 | CXString clang_constructUSR_ObjCCategory(const char *class_name, |
Ted Kremenek | 0c0fb41 | 2010-03-25 02:00:36 +0000 | [diff] [blame] | 329 | const char *category_name) { |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 330 | StringUSRGenerator SUG; |
| 331 | SUG->GenObjCCategory(class_name, category_name); |
| 332 | return createCXString(SUG.str(), true); |
| 333 | } |
| 334 | |
| 335 | CXString clang_constructUSR_ObjCProperty(const char *property, |
| 336 | CXString classUSR) { |
| 337 | StringUSRGenerator SUG; |
Ted Kremenek | 0c0fb41 | 2010-03-25 02:00:36 +0000 | [diff] [blame] | 338 | SUG << extractUSRSuffix(clang_getCString(classUSR)); |
Ted Kremenek | 896b70f | 2010-03-13 02:50:34 +0000 | [diff] [blame] | 339 | SUG->GenObjCProperty(property); |
| 340 | return createCXString(SUG.str(), true); |
Ted Kremenek | cf84aa4 | 2010-01-18 20:23:29 +0000 | [diff] [blame] | 341 | } |
Ted Kremenek | 1b6869a | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 342 | |
Ted Kremenek | 1b6869a | 2010-01-05 22:06:45 +0000 | [diff] [blame] | 343 | } // end extern "C" |