r174809 - libclang: use CXCursor getters to simplify code

Dmitri Gribenko gribozavr at gmail.com
Sat Feb 9 06:12:09 PST 2013


Author: gribozavr
Date: Sat Feb  9 08:12:09 2013
New Revision: 174809

URL: http://llvm.org/viewvc/llvm-project?rev=174809&view=rev
Log:
libclang: use CXCursor getters to simplify code

Modified:
    cfe/trunk/tools/libclang/CXType.cpp

Modified: cfe/trunk/tools/libclang/CXType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXType.cpp?rev=174809&r1=174808&r2=174809&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXType.cpp (original)
+++ cfe/trunk/tools/libclang/CXType.cpp Sat Feb  9 08:12:09 2013
@@ -638,9 +638,8 @@ CXString clang_getDeclObjCTypeEncoding(C
   if (!clang_isDeclaration(C.kind))
     return cxstring::createEmpty();
 
-  const Decl *D = static_cast<const Decl*>(C.data[0]);
-  ASTUnit *AU = cxcursor::getCursorASTUnit(C);
-  ASTContext &Ctx = AU->getASTContext();
+  const Decl *D = cxcursor::getCursorDecl(C);
+  ASTContext &Ctx = cxcursor::getCursorContext(C);
   std::string encoding;
 
   if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D))  {





More information about the cfe-commits mailing list