summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2010-07-15 22:30:52 +0000
committerSean Callanan <scallanan@apple.com>2010-07-15 22:30:52 +0000
commit4dcca262f4a4d108df476d5ec14adad3c901d7a3 (patch)
tree59065a37e9c403ef0b35bd35b52faf905a39c117
parent55f0c6b9fc7e97429897191d3ab170281cd39fdf (diff)
downloadbcm5719-llvm-4dcca262f4a4d108df476d5ec14adad3c901d7a3.tar.gz
bcm5719-llvm-4dcca262f4a4d108df476d5ec14adad3c901d7a3.zip
Added a function to test whether two types are
the same. llvm-svn: 108467
-rw-r--r--lldb/include/lldb/Symbol/ClangASTContext.h12
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp9
2 files changed, 21 insertions, 0 deletions
diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h
index 1a6d924e9e8..4476e49fd7a 100644
--- a/lldb/include/lldb/Symbol/ClangASTContext.h
+++ b/lldb/include/lldb/Symbol/ClangASTContext.h
@@ -109,6 +109,18 @@ public:
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
//------------------------------------------------------------------
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 153ae818165..ab288fd2555 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -672,6 +672,15 @@ ClangASTContext::CopyType(clang::ASTContext *dest_context,
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 *
OpenPOWER on IntegriCloud