[Lldb-commits] [lldb] r108467 - in /lldb/trunk: include/lldb/Symbol/ClangASTContext.h source/Symbol/ClangASTContext.cpp

Sean Callanan scallanan at apple.com
Thu Jul 15 15:30:52 PDT 2010


Author: spyffe
Date: Thu Jul 15 17:30:52 2010
New Revision: 108467

URL: http://llvm.org/viewvc/llvm-project?rev=108467&view=rev
Log:
Added a function to test whether two types are
the same.

Modified:
    lldb/trunk/include/lldb/Symbol/ClangASTContext.h
    lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=108467&r1=108466&r2=108467&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Thu Jul 15 17:30:52 2010
@@ -109,6 +109,18 @@
              clang::ASTContext *source_context,
              void * clang_type);
     
+    static bool
+    AreTypesSame(clang::ASTContext *ast_context,
+                 void *type1,
+                 void *type2);
+    
+    bool
+    AreTypesSame(void *type1,
+                 void *type2)
+    {
+        return ClangASTContext::AreTypesSame(m_ast_context_ap.get(), type1, type2);
+    }
+    
     //------------------------------------------------------------------
     // CVR modifiers
     //------------------------------------------------------------------

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=108467&r1=108466&r2=108467&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu Jul 15 17:30:52 2010
@@ -672,6 +672,15 @@
     return ret.getAsOpaquePtr();
 }
 
+static bool
+AreTypesSame(clang::ASTContext *ast_context,
+             void *type1,
+             void *type2)
+{
+    return ast_context->hasSameType(QualType::getFromOpaquePtr(type1),
+                                    QualType::getFromOpaquePtr(type2));
+}
+
 #pragma mark CVR modifiers
 
 void *





More information about the lldb-commits mailing list