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

Sean Callanan scallanan at apple.com
Thu Sep 16 13:01:08 PDT 2010


Author: spyffe
Date: Thu Sep 16 15:01:08 2010
New Revision: 114110

URL: http://llvm.org/viewvc/llvm-project?rev=114110&view=rev
Log:
Made AddFieldToRecordType a static method on
ClangASTContext.

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=114110&r1=114109&r2=114110&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Thu Sep 16 15:01:08 2010
@@ -153,14 +153,30 @@
                       clang::DeclContext *decl_ctx,
                       lldb::LanguageType language);
 
-    bool
-    AddFieldToRecordType (void * record_qual_type,
+    static bool
+    AddFieldToRecordType (clang::ASTContext *ast_context,
+                          void *record_qual_type,
                           const char *name,
-                          void * field_type,
+                          void *field_type,
                           lldb::AccessType access,
                           uint32_t bitfield_bit_size);
     
     bool
+    AddFieldToRecordType (void *record_qual_type,
+                          const char *name,
+                          void *field_type,
+                          lldb::AccessType access,
+                          uint32_t bitfield_bit_size)
+    {
+        return ClangASTContext::AddFieldToRecordType(m_ast_context_ap.get(),
+                                                     record_qual_type,
+                                                     name,
+                                                     field_type,
+                                                     access,
+                                                     bitfield_bit_size);
+    }
+    
+    bool
     FieldIsBitfield (clang::FieldDecl* field,
                      uint32_t& bitfield_bit_size);
 
@@ -184,13 +200,31 @@
                      bool isForwardDecl, 
                      bool isInternal);
     
+    static bool
+    AddObjCClassIVar (clang::ASTContext *ast_context,
+                      void *class_opaque_type, 
+                      const char *name, 
+                      void *ivar_opaque_type, 
+                      lldb::AccessType access, 
+                      uint32_t bitfield_bit_size, 
+                      bool isSynthesized);
+    
     bool
     AddObjCClassIVar (void *class_opaque_type, 
                       const char *name, 
                       void *ivar_opaque_type, 
                       lldb::AccessType access, 
                       uint32_t bitfield_bit_size, 
-                      bool isSynthesized);
+                      bool isSynthesized)
+    {
+        return ClangASTContext::AddObjCClassIVar (m_ast_context_ap.get(),
+                                                  class_opaque_type,
+                                                  name,
+                                                  ivar_opaque_type,
+                                                  access,
+                                                  bitfield_bit_size,
+                                                  isSynthesized);
+    }
 
     bool
     SetObjCSuperClass (void *class_clang_type,

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=114110&r1=114109&r2=114110&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu Sep 16 15:01:08 2010
@@ -806,6 +806,7 @@
 bool
 ClangASTContext::AddFieldToRecordType 
 (
+    clang::ASTContext *ast_context,
     void *record_clang_type, 
     const char *name, 
     void *field_type, 
@@ -816,8 +817,7 @@
     if (record_clang_type == NULL || field_type == NULL)
         return false;
 
-    ASTContext *ast_context = getASTContext();
-    IdentifierTable *identifier_table = getIdentifierTable();
+    IdentifierTable *identifier_table = &ast_context->Idents;
 
     assert (ast_context != NULL);
     assert (identifier_table != NULL);
@@ -866,7 +866,8 @@
             if (objc_class_type)
             {
                 bool isSynthesized = false;
-                ClangASTContext::AddObjCClassIVar (record_clang_type,
+                ClangASTContext::AddObjCClassIVar (ast_context,
+                                                   record_clang_type,
                                                    name,
                                                    field_type,
                                                    access,
@@ -1080,6 +1081,7 @@
 bool
 ClangASTContext::AddObjCClassIVar 
 (
+    clang::ASTContext *ast_context,
     void *class_opaque_type, 
     const char *name, 
     void *ivar_opaque_type, 
@@ -1091,8 +1093,7 @@
     if (class_opaque_type == NULL || ivar_opaque_type == NULL)
         return false;
 
-    ASTContext *ast_context = getASTContext();
-    IdentifierTable *identifier_table = getIdentifierTable();
+    IdentifierTable *identifier_table = &ast_context->Idents;
 
     assert (ast_context != NULL);
     assert (identifier_table != NULL);





More information about the lldb-commits mailing list