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

Sean Callanan scallanan at apple.com
Thu Sep 16 19:24:29 PDT 2010


Author: spyffe
Date: Thu Sep 16 21:24:29 2010
New Revision: 114152

URL: http://llvm.org/viewvc/llvm-project?rev=114152&view=rev
Log:
Added a static function to get the void type for
an ASTContext; also added a function to get the
Clang-style CVR qualifiers for a type as an
unsigned int.

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=114152&r1=114151&r2=114152&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Thu Sep 16 21:24:29 2010
@@ -92,8 +92,14 @@
         uint32_t dw_ate,
         uint32_t bit_size);
 
+    static void *
+    GetBuiltInType_void(clang::ASTContext *ast_context);
+    
     void *
-    GetBuiltInType_void();
+    GetBuiltInType_void()
+    {
+        return GetBuiltInType_void(getASTContext());
+    }
 
     void *
     GetBuiltInType_objc_id();
@@ -127,7 +133,7 @@
     AreTypesSame(void *type1,
                  void *type2)
     {
-        return ClangASTContext::AreTypesSame(m_ast_context_ap.get(), type1, type2);
+        return ClangASTContext::AreTypesSame(getASTContext(), type1, type2);
     }
     
     //------------------------------------------------------------------
@@ -168,7 +174,7 @@
                           lldb::AccessType access,
                           uint32_t bitfield_bit_size)
     {
-        return ClangASTContext::AddFieldToRecordType(m_ast_context_ap.get(),
+        return ClangASTContext::AddFieldToRecordType(getASTContext(),
                                                      record_qual_type,
                                                      name,
                                                      field_type,
@@ -217,7 +223,7 @@
                       uint32_t bitfield_bit_size, 
                       bool isSynthesized)
     {
-        return ClangASTContext::AddObjCClassIVar (m_ast_context_ap.get(),
+        return ClangASTContext::AddObjCClassIVar (getASTContext(),
                                                   class_opaque_type,
                                                   name,
                                                   ivar_opaque_type,
@@ -361,7 +367,7 @@
                         bool is_variadic,
                         unsigned type_quals)
     {
-        return ClangASTContext::CreateFunctionType(m_ast_context_ap.get(),
+        return ClangASTContext::CreateFunctionType(getASTContext(),
                                                    result_type,
                                                    args,
                                                    num_args,
@@ -480,6 +486,11 @@
                                uint8_t *dst, 
                                size_t dst_size);
     
+    //------------------------------------------------------------------
+    // Qualifiers
+    //------------------------------------------------------------------
+    static unsigned
+    GetTypeQualifiers(void *clang_type);
 protected:
     //------------------------------------------------------------------
     // Classes that inherit from ClangASTContext can see and modify these

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=114152&r1=114151&r2=114152&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu Sep 16 21:24:29 2010
@@ -658,9 +658,9 @@
 }
 
 void *
-ClangASTContext::GetBuiltInType_void()
+ClangASTContext::GetBuiltInType_void(clang::ASTContext *ast_context)
 {
-    return getASTContext()->VoidTy.getAsOpaquePtr();
+    return ast_context->VoidTy.getAsOpaquePtr();
 }
 
 void *
@@ -3144,3 +3144,13 @@
     }
     return 0;
 }
+
+unsigned
+ClangASTContext::GetTypeQualifiers(void *clang_type)
+{
+    assert (clang_type);
+    
+    QualType qual_type (QualType::getFromOpaquePtr(clang_type));
+    
+    return qual_type.getQualifiers().getCVRQualifiers();
+}





More information about the lldb-commits mailing list