[Lldb-commits] [lldb] r184886 - Fixed a bug in ClangASTSource where we would return

Sean Callanan scallanan at apple.com
Tue Jun 25 15:36:17 PDT 2013


Author: spyffe
Date: Tue Jun 25 17:36:17 2013
New Revision: 184886

URL: http://llvm.org/viewvc/llvm-project?rev=184886&view=rev
Log:
Fixed a bug in ClangASTSource where we would return
the target of a typedef when asked for a typedef.

Modified:
    lldb/trunk/source/Expression/ClangASTSource.cpp

Modified: lldb/trunk/source/Expression/ClangASTSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangASTSource.cpp?rev=184886&r1=184885&r2=184886&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangASTSource.cpp (original)
+++ lldb/trunk/source/Expression/ClangASTSource.cpp Tue Jun 25 17:36:17 2013
@@ -1818,7 +1818,15 @@ NameSearchContext::AddTypeDecl(void *typ
     {
         QualType qual_type = QualType::getFromOpaquePtr(type);
 
-        if (const TagType *tag_type = qual_type->getAs<TagType>())
+        if (const TypedefType *typedef_type = llvm::dyn_cast<TypedefType>(qual_type))
+        {
+            TypedefNameDecl *typedef_name_decl = typedef_type->getDecl();
+            
+            m_decls.push_back(typedef_name_decl);
+            
+            return (NamedDecl*)typedef_name_decl;
+        }
+        else if (const TagType *tag_type = qual_type->getAs<TagType>())
         {
             TagDecl *tag_decl = tag_type->getDecl();
             
@@ -1834,14 +1842,6 @@ NameSearchContext::AddTypeDecl(void *typ
             
             return (NamedDecl*)interface_decl;
         }
-        else if (const TypedefType *typedef_type = qual_type->getAs<TypedefType>())
-        {
-            TypedefNameDecl *typedef_name_decl = typedef_type->getDecl();
-            
-            m_decls.push_back(typedef_name_decl);
-            
-            return (NamedDecl*)typedef_name_decl;
-        }
     }
     return NULL;
 }





More information about the lldb-commits mailing list