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

Greg Clayton gclayton at apple.com
Wed Aug 4 18:57:25 PDT 2010


Author: gclayton
Date: Wed Aug  4 20:57:25 2010
New Revision: 110299

URL: http://llvm.org/viewvc/llvm-project?rev=110299&view=rev
Log:
More missing files from my previous checkin.


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

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=110299&r1=110298&r2=110299&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Wed Aug  4 20:57:25 2010
@@ -30,22 +30,6 @@
 class ClangASTContext
 {
 public:
-    // Define access values that can be used for all functions in this
-    // class since Clang uses different values for all of the different
-    // access values (C++ AccessSpecifier enums differ from ObjC AccessControl).
-    // The SymbolFile classes that use these methods to created types
-    // will then be able to use one enumeration for all access and we can
-    // translate them correctly into the correct Clang versions depending on
-    // what the access is applied to.
-    enum AccessType
-    {
-        eAccessNone,
-        eAccessPublic,
-        eAccessPrivate,
-        eAccessProtected,
-        eAccessPackage
-    };
-    
     //------------------------------------------------------------------
     // Constructors and Destructors
     //------------------------------------------------------------------
@@ -173,7 +157,7 @@
     AddFieldToRecordType (void * record_qual_type,
                           const char *name,
                           void * field_type,
-                          AccessType access,
+                          lldb::AccessType access,
                           uint32_t bitfield_bit_size);
     
     bool
@@ -204,7 +188,7 @@
     AddObjCClassIVar (void *class_opaque_type, 
                       const char *name, 
                       void *ivar_opaque_type, 
-                      AccessType access, 
+                      lldb::AccessType access, 
                       uint32_t bitfield_bit_size, 
                       bool isSynthesized);
 
@@ -289,7 +273,7 @@
 
     clang::CXXBaseSpecifier *
     CreateBaseClassSpecifier (void * base_class_type,
-                              AccessType access,
+                              lldb::AccessType access,
                               bool is_virtual,
                               bool base_of_class);
     

Modified: lldb/trunk/include/lldb/Symbol/ClangASTType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTType.h?rev=110299&r1=110298&r2=110299&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTType.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTType.h Wed Aug  4 20:57:25 2010
@@ -227,6 +227,12 @@
                    lldb::AddressType address_type,
                    StreamString &new_value);
 
+    void *
+    GetPointeeType ();
+
+    static void *
+    GetPointeeType (void *opaque_clang_qual_type);
+
 private:
     void               *m_type;
     clang::ASTContext  *m_ast;

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=110299&r1=110298&r2=110299&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Wed Aug  4 20:57:25 2010
@@ -34,35 +34,36 @@
 
 #include <stdio.h>
 
+using namespace lldb;
 using namespace lldb_private;
 using namespace llvm;
 using namespace clang;
 
 static AccessSpecifier
-ConvertAccessTypeToAccessSpecifier (ClangASTContext::AccessType access)
+ConvertAccessTypeToAccessSpecifier (AccessType access)
 {
     switch (access)
     {
-    default:                                break;
-    case ClangASTContext::eAccessNone:      return AS_none;
-    case ClangASTContext::eAccessPublic:    return AS_public;
-    case ClangASTContext::eAccessPrivate:   return AS_private;
-    case ClangASTContext::eAccessProtected: return AS_protected;
+    default:               break;
+    case eAccessNone:      return AS_none;
+    case eAccessPublic:    return AS_public;
+    case eAccessPrivate:   return AS_private;
+    case eAccessProtected: return AS_protected;
     }
     return AS_none;
 }
 
 static ObjCIvarDecl::AccessControl
-ConvertAccessTypeToObjCIvarAccessControl (ClangASTContext::AccessType access)
+ConvertAccessTypeToObjCIvarAccessControl (AccessType access)
 {
     switch (access)
     {
-    default:                                break;
-    case ClangASTContext::eAccessNone:      return ObjCIvarDecl::None;
-    case ClangASTContext::eAccessPublic:    return ObjCIvarDecl::Public;
-    case ClangASTContext::eAccessPrivate:   return ObjCIvarDecl::Private;
-    case ClangASTContext::eAccessProtected: return ObjCIvarDecl::Protected;
-    case ClangASTContext::eAccessPackage:   return ObjCIvarDecl::Package;
+    default:               break;
+    case eAccessNone:      return ObjCIvarDecl::None;
+    case eAccessPublic:    return ObjCIvarDecl::Public;
+    case eAccessPrivate:   return ObjCIvarDecl::Private;
+    case eAccessProtected: return ObjCIvarDecl::Protected;
+    case eAccessPackage:   return ObjCIvarDecl::Package;
     }
     return ObjCIvarDecl::None;
 }
@@ -398,7 +399,7 @@
 }
 
 void *
-ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (lldb::Encoding encoding, uint32_t bit_size)
+ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (Encoding encoding, uint32_t bit_size)
 {
     ASTContext *ast_context = getASTContext();
 
@@ -408,19 +409,19 @@
 }
 
 void *
-ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (clang::ASTContext *ast_context, lldb::Encoding encoding, uint32_t bit_size)
+ClangASTContext::GetBuiltinTypeForEncodingAndBitSize (clang::ASTContext *ast_context, Encoding encoding, uint32_t bit_size)
 {
     if (!ast_context)
         return NULL;
     
     switch (encoding)
     {
-    case lldb::eEncodingInvalid:
+    case eEncodingInvalid:
         if (QualTypeMatchesBitSize (bit_size, ast_context, ast_context->VoidPtrTy))
             return ast_context->VoidPtrTy.getAsOpaquePtr();
         break;
         
-    case lldb::eEncodingUint:
+    case eEncodingUint:
         if (QualTypeMatchesBitSize (bit_size, ast_context, ast_context->UnsignedCharTy))
             return ast_context->UnsignedCharTy.getAsOpaquePtr();
         if (QualTypeMatchesBitSize (bit_size, ast_context, ast_context->UnsignedShortTy))
@@ -435,7 +436,7 @@
             return ast_context->UnsignedInt128Ty.getAsOpaquePtr();
         break;
         
-    case lldb::eEncodingSint:
+    case eEncodingSint:
         if (QualTypeMatchesBitSize (bit_size, ast_context, ast_context->CharTy))
             return ast_context->CharTy.getAsOpaquePtr();
         if (QualTypeMatchesBitSize (bit_size, ast_context, ast_context->ShortTy))
@@ -450,7 +451,7 @@
             return ast_context->Int128Ty.getAsOpaquePtr();
         break;
         
-    case lldb::eEncodingIEEE754:
+    case eEncodingIEEE754:
         if (QualTypeMatchesBitSize (bit_size, ast_context, ast_context->FloatTy))
             return ast_context->FloatTy.getAsOpaquePtr();
         if (QualTypeMatchesBitSize (bit_size, ast_context, ast_context->DoubleTy))
@@ -459,7 +460,7 @@
             return ast_context->LongDoubleTy.getAsOpaquePtr();
         break;
         
-    case lldb::eEncodingVector:
+    case eEncodingVector:
     default:
         break;
     }
@@ -772,7 +773,7 @@
 #pragma mark Structure, Unions, Classes
 
 void *
-ClangASTContext::CreateRecordType (const char *name, int kind, DeclContext *decl_ctx, lldb::LanguageType language)
+ClangASTContext::CreateRecordType (const char *name, int kind, DeclContext *decl_ctx, LanguageType language)
 {
     ASTContext *ast_context = getASTContext();
     assert (ast_context != NULL);
@@ -781,7 +782,7 @@
         decl_ctx = ast_context->getTranslationUnitDecl();
 
 
-    if (language == lldb::eLanguageTypeObjC)
+    if (language == eLanguageTypeObjC)
     {
         bool isForwardDecl = false;
         bool isInternal = false;

Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=110299&r1=110298&r2=110299&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Wed Aug  4 20:57:25 2010
@@ -79,6 +79,25 @@
     return clang_type_name;
 }
 
+
+void *
+ClangASTType::GetPointeeType ()
+{
+    return GetPointeeType (m_type);
+}
+
+void *
+ClangASTType::GetPointeeType (void *opaque_clang_qual_type)
+{
+    if (opaque_clang_qual_type)
+    {
+        clang::QualType qual_type(clang::QualType::getFromOpaquePtr(opaque_clang_qual_type));
+        
+        return qual_type.getTypePtr()->getPointeeType().getAsOpaquePtr();
+    }
+    return NULL;
+}
+
 lldb::Encoding
 ClangASTType::GetEncoding (uint32_t &count)
 {





More information about the lldb-commits mailing list