[Lldb-commits] [lldb] r207041 - Remove the using namespace directives to make it clear where code is scoped.

Greg Clayton gclayton at apple.com
Wed Apr 23 15:20:25 PDT 2014


Author: gclayton
Date: Wed Apr 23 17:20:25 2014
New Revision: 207041

URL: http://llvm.org/viewvc/llvm-project?rev=207041&view=rev
Log:
Remove the using namespace directives to make it clear where code is scoped.


Modified:
    lldb/trunk/source/Symbol/ClangASTType.cpp

Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=207041&r1=207040&r2=207041&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Wed Apr 23 17:20:25 2014
@@ -50,11 +50,9 @@
 
 using namespace lldb;
 using namespace lldb_private;
-using namespace clang;
-using namespace llvm;
 
 static bool
-GetCompleteQualType (ASTContext *ast, QualType qual_type, bool allow_completion = true)
+GetCompleteQualType (clang::ASTContext *ast, clang::QualType qual_type, bool allow_completion = true)
 {
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
@@ -63,7 +61,7 @@ GetCompleteQualType (ASTContext *ast, Qu
         case clang::Type::IncompleteArray:
         case clang::Type::VariableArray:
         {
-            const ArrayType *array_type = dyn_cast<ArrayType>(qual_type.getTypePtr());
+            const clang::ArrayType *array_type =  llvm::dyn_cast<clang::ArrayType>(qual_type.getTypePtr());
             
             if (array_type)
                 return GetCompleteQualType (ast, array_type->getElementType(), allow_completion);
@@ -73,10 +71,10 @@ GetCompleteQualType (ASTContext *ast, Qu
         case clang::Type::Record:
         case clang::Type::Enum:
         {
-            const TagType *tag_type = dyn_cast<TagType>(qual_type.getTypePtr());
+            const clang::TagType *tag_type =  llvm::dyn_cast<clang::TagType>(qual_type.getTypePtr());
             if (tag_type)
             {
-                TagDecl *tag_decl = tag_type->getDecl();
+                clang::TagDecl *tag_decl = tag_type->getDecl();
                 if (tag_decl)
                 {
                     if (tag_decl->isCompleteDefinition())
@@ -89,7 +87,7 @@ GetCompleteQualType (ASTContext *ast, Qu
                     {
                         if (ast)
                         {
-                            ExternalASTSource *external_ast_source = ast->getExternalSource();
+                            clang::ExternalASTSource *external_ast_source = ast->getExternalSource();
                             if (external_ast_source)
                             {
                                 external_ast_source->CompleteType(tag_decl);
@@ -107,10 +105,10 @@ GetCompleteQualType (ASTContext *ast, Qu
         case clang::Type::ObjCObject:
         case clang::Type::ObjCInterface:
         {
-            const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type);
+            const clang::ObjCObjectType *objc_class_type =  llvm::dyn_cast<clang::ObjCObjectType>(qual_type);
             if (objc_class_type)
             {
-                ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+                clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
                 // We currently can't complete objective C types through the newly added ASTContext
                 // because it only supports TagDecl objects right now...
                 if (class_interface_decl)
@@ -125,7 +123,7 @@ GetCompleteQualType (ASTContext *ast, Qu
                     {
                         if (ast)
                         {
-                            ExternalASTSource *external_ast_source = ast->getExternalSource();
+                            clang::ExternalASTSource *external_ast_source = ast->getExternalSource();
                             if (external_ast_source)
                             {
                                 external_ast_source->CompleteType (class_interface_decl);
@@ -140,13 +138,13 @@ GetCompleteQualType (ASTContext *ast, Qu
             break;
             
         case clang::Type::Typedef:
-            return GetCompleteQualType (ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType(), allow_completion);
+            return GetCompleteQualType (ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType(), allow_completion);
             
         case clang::Type::Elaborated:
-            return GetCompleteQualType (ast, cast<ElaboratedType>(qual_type)->getNamedType(), allow_completion);
+            return GetCompleteQualType (ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType(), allow_completion);
             
         case clang::Type::Paren:
-            return GetCompleteQualType (ast, cast<ParenType>(qual_type)->desugar(), allow_completion);
+            return GetCompleteQualType (ast, llvm::cast<clang::ParenType>(qual_type)->desugar(), allow_completion);
             
         default:
             break;
@@ -155,18 +153,18 @@ GetCompleteQualType (ASTContext *ast, Qu
     return true;
 }
 
-static ObjCIvarDecl::AccessControl
+static clang::ObjCIvarDecl::AccessControl
 ConvertAccessTypeToObjCIvarAccessControl (AccessType access)
 {
     switch (access)
     {
-        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;
+        case eAccessNone:      return clang::ObjCIvarDecl::None;
+        case eAccessPublic:    return clang::ObjCIvarDecl::Public;
+        case eAccessPrivate:   return clang::ObjCIvarDecl::Private;
+        case eAccessProtected: return clang::ObjCIvarDecl::Protected;
+        case eAccessPackage:   return clang::ObjCIvarDecl::Package;
     }
-    return ObjCIvarDecl::None;
+    return clang::ObjCIvarDecl::None;
 }
 
 //----------------------------------------------------------------------
@@ -194,7 +192,7 @@ ClangASTType::IsAggregateType () const
     if (!IsValid())
         return false;
     
-    QualType qual_type (GetCanonicalQualType());
+    clang::QualType qual_type (GetCanonicalQualType());
     
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
@@ -209,11 +207,11 @@ ClangASTType::IsAggregateType () const
         case clang::Type::ObjCInterface:
             return true;
         case clang::Type::Elaborated:
-            return ClangASTType(m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).IsAggregateType();
+            return ClangASTType(m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).IsAggregateType();
         case clang::Type::Typedef:
-            return ClangASTType(m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsAggregateType();
+            return ClangASTType(m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsAggregateType();
         case clang::Type::Paren:
-            return ClangASTType(m_ast, cast<ParenType>(qual_type)->desugar()).IsAggregateType();
+            return ClangASTType(m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).IsAggregateType();
         default:
             break;
     }
@@ -228,7 +226,7 @@ ClangASTType::IsArrayType (ClangASTType
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
+        clang::QualType qual_type (GetCanonicalQualType());
         
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         switch (type_class)
@@ -238,14 +236,14 @@ ClangASTType::IsArrayType (ClangASTType
                 
             case clang::Type::ConstantArray:
                 if (element_type_ptr)
-                    element_type_ptr->SetClangType (m_ast, cast<ConstantArrayType>(qual_type)->getElementType());
+                    element_type_ptr->SetClangType (m_ast, llvm::cast<clang::ConstantArrayType>(qual_type)->getElementType());
                 if (size)
-                    *size = cast<ConstantArrayType>(qual_type)->getSize().getLimitedValue(ULLONG_MAX);
+                    *size = llvm::cast<clang::ConstantArrayType>(qual_type)->getSize().getLimitedValue(ULLONG_MAX);
                 return true;
                 
             case clang::Type::IncompleteArray:
                 if (element_type_ptr)
-                    element_type_ptr->SetClangType (m_ast, cast<IncompleteArrayType>(qual_type)->getElementType());
+                    element_type_ptr->SetClangType (m_ast, llvm::cast<clang::IncompleteArrayType>(qual_type)->getElementType());
                 if (size)
                     *size = 0;
                 if (is_incomplete)
@@ -254,28 +252,28 @@ ClangASTType::IsArrayType (ClangASTType
                 
             case clang::Type::VariableArray:
                 if (element_type_ptr)
-                    element_type_ptr->SetClangType (m_ast, cast<VariableArrayType>(qual_type)->getElementType());
+                    element_type_ptr->SetClangType (m_ast, llvm::cast<clang::VariableArrayType>(qual_type)->getElementType());
                 if (size)
                     *size = 0;
                 return true;
                 
             case clang::Type::DependentSizedArray:
                 if (element_type_ptr)
-                    element_type_ptr->SetClangType (m_ast, cast<DependentSizedArrayType>(qual_type)->getElementType());
+                    element_type_ptr->SetClangType (m_ast, llvm::cast<clang::DependentSizedArrayType>(qual_type)->getElementType());
                 if (size)
                     *size = 0;
                 return true;
                 
             case clang::Type::Typedef:
-                return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsArrayType (element_type_ptr,
+                return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsArrayType (element_type_ptr,
                                                                                                                        size,
                                                                                                                        is_incomplete);
             case clang::Type::Elaborated:
-                return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).IsArrayType (element_type_ptr,
+                return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).IsArrayType (element_type_ptr,
                                                                                                           size,
                                                                                                           is_incomplete);
             case clang::Type::Paren:
-                return ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).IsArrayType (element_type_ptr,
+                return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).IsArrayType (element_type_ptr,
                                                                                                        size,
                                                                                                        is_incomplete);
         }
@@ -352,7 +350,7 @@ ClangASTType::IsCStringType (uint32_t &l
             {
                 // We know the size of the array and it could be a C string
                 // since it is an array of characters
-                length = cast<ConstantArrayType>(GetCanonicalQualType().getTypePtr())->getSize().getLimitedValue();
+                length = llvm::cast<clang::ConstantArrayType>(GetCanonicalQualType().getTypePtr())->getSize().getLimitedValue();
             }
             return true;
             
@@ -366,7 +364,7 @@ ClangASTType::IsFunctionType (bool *is_v
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
+        clang::QualType qual_type (GetCanonicalQualType());
         
         if (qual_type->isFunctionType())
         {
@@ -387,16 +385,16 @@ ClangASTType::IsFunctionType (bool *is_v
             default:
                 break;
             case clang::Type::Typedef:
-                return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsFunctionType();
+                return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsFunctionType();
             case clang::Type::Elaborated:
-                return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).IsFunctionType();
+                return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).IsFunctionType();
             case clang::Type::Paren:
-                return ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).IsFunctionType();
+                return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).IsFunctionType();
                 
             case clang::Type::LValueReference:
             case clang::Type::RValueReference:
                 {
-                    const ReferenceType *reference_type = cast<ReferenceType>(qual_type.getTypePtr());
+                    const clang::ReferenceType *reference_type = llvm::cast<clang::ReferenceType>(qual_type.getTypePtr());
                     if (reference_type)
                         return ClangASTType (m_ast, reference_type->getPointeeType()).IsFunctionType();
                 }
@@ -413,35 +411,35 @@ ClangASTType::IsHomogeneousAggregate (Cl
     if (!IsValid())
         return 0;
     
-    QualType qual_type(GetCanonicalQualType());
+    clang::QualType qual_type(GetCanonicalQualType());
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
     {
         case clang::Type::Record:
             if (GetCompleteType ())
             {
-                const CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+                const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
                 if (cxx_record_decl)
                 {
                     if (cxx_record_decl->getNumBases() ||
                         cxx_record_decl->isDynamicClass())
                         return 0;
                 }
-                const RecordType *record_type = cast<RecordType>(qual_type.getTypePtr());
+                const clang::RecordType *record_type = llvm::cast<clang::RecordType>(qual_type.getTypePtr());
                 if (record_type)
                 {
-                    const RecordDecl *record_decl = record_type->getDecl();
+                    const clang::RecordDecl *record_decl = record_type->getDecl();
                     if (record_decl)
                     {
                         // We are looking for a structure that contains only floating point types
-                        RecordDecl::field_iterator field_pos, field_end = record_decl->field_end();
+                        clang::RecordDecl::field_iterator field_pos, field_end = record_decl->field_end();
                         uint32_t num_fields = 0;
                         bool is_hva = false;
                         bool is_hfa = false;
-                        QualType base_qual_type;
+                        clang::QualType base_qual_type;
                         for (field_pos = record_decl->field_begin(); field_pos != field_end; ++field_pos)
                         {
-                            QualType field_qual_type = field_pos->getType();
+                            clang::QualType field_qual_type = field_pos->getType();
                             if (field_qual_type->isFloatingType())
                             {
                                 if (field_qual_type->isComplexType())
@@ -462,7 +460,7 @@ ClangASTType::IsHomogeneousAggregate (Cl
                             }
                             else if (field_qual_type->isVectorType() || field_qual_type->isExtVectorType())
                             {
-                                const VectorType *array = cast<VectorType>(field_qual_type.getTypePtr());
+                                const clang::VectorType *array = llvm::cast<clang::VectorType>(field_qual_type.getTypePtr());
                                 if (array && array->getNumElements() <= 4)
                                 {
                                     if (num_fields == 0)
@@ -492,10 +490,10 @@ ClangASTType::IsHomogeneousAggregate (Cl
             break;
             
         case clang::Type::Typedef:
-            return ClangASTType(m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsHomogeneousAggregate (base_type_ptr);
+            return ClangASTType(m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsHomogeneousAggregate (base_type_ptr);
             
         case clang::Type::Elaborated:
-            return  ClangASTType(m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).IsHomogeneousAggregate (base_type_ptr);
+            return  ClangASTType(m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).IsHomogeneousAggregate (base_type_ptr);
         default:
             break;
     }
@@ -507,8 +505,8 @@ ClangASTType::GetNumberOfFunctionArgumen
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
-        const FunctionProtoType* func = dyn_cast<FunctionProtoType>(qual_type.getTypePtr());
+        clang::QualType qual_type (GetCanonicalQualType());
+        const clang::FunctionProtoType* func =  llvm::dyn_cast<clang::FunctionProtoType>(qual_type.getTypePtr());
         if (func)
             return func->getNumParams();
     }
@@ -520,8 +518,8 @@ ClangASTType::GetFunctionArgumentAtIndex
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
-        const FunctionProtoType* func = dyn_cast<FunctionProtoType>(qual_type.getTypePtr());
+        clang::QualType qual_type (GetCanonicalQualType());
+        const clang::FunctionProtoType* func =  llvm::dyn_cast<clang::FunctionProtoType>(qual_type.getTypePtr());
         if (func)
         {
             if (index < func->getNumParams())
@@ -536,7 +534,7 @@ ClangASTType::IsFunctionPointerType () c
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
+        clang::QualType qual_type (GetCanonicalQualType());
         
         if (qual_type->isFunctionPointerType())
             return true;
@@ -547,16 +545,16 @@ ClangASTType::IsFunctionPointerType () c
         default:
             break;
         case clang::Type::Typedef:
-            return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsFunctionPointerType();
+            return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsFunctionPointerType();
         case clang::Type::Elaborated:
-            return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).IsFunctionPointerType();
+            return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).IsFunctionPointerType();
         case clang::Type::Paren:
-            return ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).IsFunctionPointerType();
+            return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).IsFunctionPointerType();
             
         case clang::Type::LValueReference:
         case clang::Type::RValueReference:
             {
-                const ReferenceType *reference_type = cast<ReferenceType>(qual_type.getTypePtr());
+                const clang::ReferenceType *reference_type = llvm::cast<clang::ReferenceType>(qual_type.getTypePtr());
                 if (reference_type)
                     return ClangASTType (m_ast, reference_type->getPointeeType()).IsFunctionPointerType();
             }
@@ -573,8 +571,8 @@ ClangASTType::IsIntegerType (bool &is_si
     if (!IsValid())
         return false;
     
-    QualType qual_type (GetCanonicalQualType());
-    const BuiltinType *builtin_type = dyn_cast<BuiltinType>(qual_type->getCanonicalTypeInternal());
+    clang::QualType qual_type (GetCanonicalQualType());
+    const clang::BuiltinType *builtin_type =  llvm::dyn_cast<clang::BuiltinType>(qual_type->getCanonicalTypeInternal());
     
     if (builtin_type)
     {
@@ -593,12 +591,12 @@ ClangASTType::IsPointerType (ClangASTTyp
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
+        clang::QualType qual_type (GetCanonicalQualType());
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         switch (type_class)
         {
             case clang::Type::Builtin:
-                switch (cast<clang::BuiltinType>(qual_type)->getKind())
+                switch (llvm::cast<clang::BuiltinType>(qual_type)->getKind())
                 {
                     default:
                         break;
@@ -609,26 +607,26 @@ ClangASTType::IsPointerType (ClangASTTyp
                 return false;
             case clang::Type::ObjCObjectPointer:
                 if (pointee_type)
-                    pointee_type->SetClangType (m_ast, cast<ObjCObjectPointerType>(qual_type)->getPointeeType());
+                    pointee_type->SetClangType (m_ast, llvm::cast<clang::ObjCObjectPointerType>(qual_type)->getPointeeType());
                 return true;
             case clang::Type::BlockPointer:
                 if (pointee_type)
-                    pointee_type->SetClangType (m_ast, cast<BlockPointerType>(qual_type)->getPointeeType());
+                    pointee_type->SetClangType (m_ast, llvm::cast<clang::BlockPointerType>(qual_type)->getPointeeType());
                 return true;
             case clang::Type::Pointer:
                 if (pointee_type)
-                    pointee_type->SetClangType (m_ast, cast<PointerType>(qual_type)->getPointeeType());
+                    pointee_type->SetClangType (m_ast, llvm::cast<clang::PointerType>(qual_type)->getPointeeType());
                 return true;
             case clang::Type::MemberPointer:
                 if (pointee_type)
-                    pointee_type->SetClangType (m_ast, cast<MemberPointerType>(qual_type)->getPointeeType());
+                    pointee_type->SetClangType (m_ast, llvm::cast<clang::MemberPointerType>(qual_type)->getPointeeType());
                 return true;
             case clang::Type::Typedef:
-                return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsPointerType(pointee_type);
+                return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsPointerType(pointee_type);
             case clang::Type::Elaborated:
-                return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).IsPointerType(pointee_type);
+                return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).IsPointerType(pointee_type);
             case clang::Type::Paren:
-                return ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).IsPointerType(pointee_type);
+                return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).IsPointerType(pointee_type);
             default:
                 break;
         }
@@ -644,12 +642,12 @@ ClangASTType::IsPointerOrReferenceType (
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
+        clang::QualType qual_type (GetCanonicalQualType());
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         switch (type_class)
         {
             case clang::Type::Builtin:
-                switch (cast<clang::BuiltinType>(qual_type)->getKind())
+                switch (llvm::cast<clang::BuiltinType>(qual_type)->getKind())
             {
                 default:
                     break;
@@ -660,34 +658,34 @@ ClangASTType::IsPointerOrReferenceType (
                 return false;
             case clang::Type::ObjCObjectPointer:
                 if (pointee_type)
-                    pointee_type->SetClangType(m_ast, cast<ObjCObjectPointerType>(qual_type)->getPointeeType());
+                    pointee_type->SetClangType(m_ast, llvm::cast<clang::ObjCObjectPointerType>(qual_type)->getPointeeType());
                 return true;
             case clang::Type::BlockPointer:
                 if (pointee_type)
-                    pointee_type->SetClangType(m_ast, cast<BlockPointerType>(qual_type)->getPointeeType());
+                    pointee_type->SetClangType(m_ast, llvm::cast<clang::BlockPointerType>(qual_type)->getPointeeType());
                 return true;
             case clang::Type::Pointer:
                 if (pointee_type)
-                    pointee_type->SetClangType(m_ast, cast<PointerType>(qual_type)->getPointeeType());
+                    pointee_type->SetClangType(m_ast, llvm::cast<clang::PointerType>(qual_type)->getPointeeType());
                 return true;
             case clang::Type::MemberPointer:
                 if (pointee_type)
-                    pointee_type->SetClangType(m_ast, cast<MemberPointerType>(qual_type)->getPointeeType());
+                    pointee_type->SetClangType(m_ast, llvm::cast<clang::MemberPointerType>(qual_type)->getPointeeType());
                 return true;
             case clang::Type::LValueReference:
                 if (pointee_type)
-                    pointee_type->SetClangType(m_ast, cast<LValueReferenceType>(qual_type)->desugar());
+                    pointee_type->SetClangType(m_ast, llvm::cast<clang::LValueReferenceType>(qual_type)->desugar());
                 return true;
             case clang::Type::RValueReference:
                 if (pointee_type)
-                    pointee_type->SetClangType(m_ast, cast<RValueReferenceType>(qual_type)->desugar());
+                    pointee_type->SetClangType(m_ast, llvm::cast<clang::RValueReferenceType>(qual_type)->desugar());
                 return true;
             case clang::Type::Typedef:
-                return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsPointerOrReferenceType(pointee_type);
+                return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsPointerOrReferenceType(pointee_type);
             case clang::Type::Elaborated:
-                return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).IsPointerOrReferenceType(pointee_type);
+                return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).IsPointerOrReferenceType(pointee_type);
             case clang::Type::Paren:
-                return ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).IsPointerOrReferenceType(pointee_type);
+                return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).IsPointerOrReferenceType(pointee_type);
             default:
                 break;
         }
@@ -703,29 +701,29 @@ ClangASTType::IsReferenceType (ClangASTT
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
+        clang::QualType qual_type (GetCanonicalQualType());
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         
         switch (type_class)
         {
             case clang::Type::LValueReference:
                 if (pointee_type)
-                    pointee_type->SetClangType(m_ast, cast<LValueReferenceType>(qual_type)->desugar());
+                    pointee_type->SetClangType(m_ast, llvm::cast<clang::LValueReferenceType>(qual_type)->desugar());
                 if (is_rvalue)
                     *is_rvalue = false;
                 return true;
             case clang::Type::RValueReference:
                 if (pointee_type)
-                    pointee_type->SetClangType(m_ast, cast<RValueReferenceType>(qual_type)->desugar());
+                    pointee_type->SetClangType(m_ast, llvm::cast<clang::RValueReferenceType>(qual_type)->desugar());
                 if (is_rvalue)
                     *is_rvalue = true;
                 return true;
             case clang::Type::Typedef:
-                return ClangASTType(m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsReferenceType(pointee_type, is_rvalue);
+                return ClangASTType(m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsReferenceType(pointee_type, is_rvalue);
             case clang::Type::Elaborated:
-                return ClangASTType(m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).IsReferenceType(pointee_type, is_rvalue);
+                return ClangASTType(m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).IsReferenceType(pointee_type, is_rvalue);
             case clang::Type::Paren:
-                return ClangASTType(m_ast, cast<clang::ParenType>(qual_type)->desugar()).IsReferenceType(pointee_type, is_rvalue);
+                return ClangASTType(m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).IsReferenceType(pointee_type, is_rvalue);
                 
             default:
                 break;
@@ -741,19 +739,19 @@ ClangASTType::IsFloatingPointType (uint3
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
+        clang::QualType qual_type (GetCanonicalQualType());
         
-        if (const BuiltinType *BT = dyn_cast<BuiltinType>(qual_type->getCanonicalTypeInternal()))
+        if (const clang::BuiltinType *BT =  llvm::dyn_cast<clang::BuiltinType>(qual_type->getCanonicalTypeInternal()))
         {
             clang::BuiltinType::Kind kind = BT->getKind();
-            if (kind >= BuiltinType::Float && kind <= BuiltinType::LongDouble)
+            if (kind >= clang::BuiltinType::Float && kind <= clang::BuiltinType::LongDouble)
             {
                 count = 1;
                 is_complex = false;
                 return true;
             }
         }
-        else if (const ComplexType *CT = dyn_cast<ComplexType>(qual_type->getCanonicalTypeInternal()))
+        else if (const clang::ComplexType *CT =  llvm::dyn_cast<clang::ComplexType>(qual_type->getCanonicalTypeInternal()))
         {
             if (ClangASTType (m_ast, CT->getElementType()).IsFloatingPointType (count, is_complex))
             {
@@ -762,7 +760,7 @@ ClangASTType::IsFloatingPointType (uint3
                 return true;
             }
         }
-        else if (const VectorType *VT = dyn_cast<VectorType>(qual_type->getCanonicalTypeInternal()))
+        else if (const clang::VectorType *VT =  llvm::dyn_cast<clang::VectorType>(qual_type->getCanonicalTypeInternal()))
         {
             if (ClangASTType (m_ast, VT->getElementType()).IsFloatingPointType (count, is_complex))
             {
@@ -784,21 +782,21 @@ ClangASTType::IsDefined() const
     if (!IsValid())
         return false;
 
-    QualType qual_type(GetQualType());
-    const TagType *tag_type = dyn_cast<TagType>(qual_type.getTypePtr());
+    clang::QualType qual_type(GetQualType());
+    const clang::TagType *tag_type =  llvm::dyn_cast<clang::TagType>(qual_type.getTypePtr());
     if (tag_type)
     {
-        TagDecl *tag_decl = tag_type->getDecl();
+        clang::TagDecl *tag_decl = tag_type->getDecl();
         if (tag_decl)
             return tag_decl->isCompleteDefinition();
         return false;
     }
     else
     {
-        const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type);
+        const clang::ObjCObjectType *objc_class_type =  llvm::dyn_cast<clang::ObjCObjectType>(qual_type);
         if (objc_class_type)
         {
-            ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+            clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
             if (class_interface_decl)
                 return class_interface_decl->getDefinition() != nullptr;
             return false;
@@ -812,9 +810,9 @@ ClangASTType::IsObjCClassType () const
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
+        clang::QualType qual_type (GetCanonicalQualType());
     
-        const ObjCObjectPointerType *obj_pointer_type = dyn_cast<ObjCObjectPointerType>(qual_type);
+        const clang::ObjCObjectPointerType *obj_pointer_type =  llvm::dyn_cast<clang::ObjCObjectPointerType>(qual_type);
 
         if (obj_pointer_type)
             return obj_pointer_type->isObjCClassType();
@@ -835,18 +833,18 @@ ClangASTType::IsPolymorphicClass () cons
 {
     if (IsValid())
     {
-        QualType qual_type(GetCanonicalQualType());
+        clang::QualType qual_type(GetCanonicalQualType());
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         switch (type_class)
         {
             case clang::Type::Record:
                 if (GetCompleteType())
                 {
-                    const RecordType *record_type = cast<RecordType>(qual_type.getTypePtr());
-                    const RecordDecl *record_decl = record_type->getDecl();
+                    const clang::RecordType *record_type = llvm::cast<clang::RecordType>(qual_type.getTypePtr());
+                    const clang::RecordDecl *record_decl = record_type->getDecl();
                     if (record_decl)
                     {
-                        const CXXRecordDecl *cxx_record_decl = dyn_cast<CXXRecordDecl>(record_decl);
+                        const clang::CXXRecordDecl *cxx_record_decl =  llvm::dyn_cast<clang::CXXRecordDecl>(record_decl);
                         if (cxx_record_decl)
                             return cxx_record_decl->isPolymorphic();
                     }
@@ -865,16 +863,16 @@ ClangASTType::IsPossibleDynamicType (Cla
                                      bool check_cplusplus,
                                      bool check_objc) const
 {
-    QualType pointee_qual_type;
+    clang::QualType pointee_qual_type;
     if (m_type)
     {
-        QualType qual_type (GetCanonicalQualType());
+        clang::QualType qual_type (GetCanonicalQualType());
         bool success = false;
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         switch (type_class)
         {
             case clang::Type::Builtin:
-                if (check_objc && cast<BuiltinType>(qual_type)->getKind() == BuiltinType::ObjCId)
+                if (check_objc && llvm::cast<clang::BuiltinType>(qual_type)->getKind() == clang::BuiltinType::ObjCId)
                 {
                     if (dynamic_pointee_type)
                         dynamic_pointee_type->SetClangType(m_ast, m_type);
@@ -886,37 +884,37 @@ ClangASTType::IsPossibleDynamicType (Cla
                 if (check_objc)
                 {
                     if (dynamic_pointee_type)
-                        dynamic_pointee_type->SetClangType(m_ast, cast<ObjCObjectPointerType>(qual_type)->getPointeeType());
+                        dynamic_pointee_type->SetClangType(m_ast, llvm::cast<clang::ObjCObjectPointerType>(qual_type)->getPointeeType());
                     return true;
                 }
                 break;
                 
             case clang::Type::Pointer:
-                pointee_qual_type = cast<PointerType>(qual_type)->getPointeeType();
+                pointee_qual_type = llvm::cast<clang::PointerType>(qual_type)->getPointeeType();
                 success = true;
                 break;
                 
             case clang::Type::LValueReference:
             case clang::Type::RValueReference:
-                pointee_qual_type = cast<ReferenceType>(qual_type)->getPointeeType();
+                pointee_qual_type = llvm::cast<clang::ReferenceType>(qual_type)->getPointeeType();
                 success = true;
                 break;
                 
             case clang::Type::Typedef:
                 return ClangASTType (m_ast,
-                                     cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsPossibleDynamicType (dynamic_pointee_type,
+                                     llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).IsPossibleDynamicType (dynamic_pointee_type,
                                                                                                                           check_cplusplus,
                                                                                                                           check_objc);
                 
             case clang::Type::Elaborated:
                 return ClangASTType (m_ast,
-                                     cast<ElaboratedType>(qual_type)->getNamedType()).IsPossibleDynamicType (dynamic_pointee_type,
+                                     llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).IsPossibleDynamicType (dynamic_pointee_type,
                                                                                                              check_cplusplus,
                                                                                                              check_objc);
                 
             case clang::Type::Paren:
                 return ClangASTType (m_ast,
-                                     cast<ParenType>(qual_type)->desugar()).IsPossibleDynamicType (dynamic_pointee_type,
+                                     llvm::cast<clang::ParenType>(qual_type)->desugar()).IsPossibleDynamicType (dynamic_pointee_type,
                                                                                                    check_cplusplus,
                                                                                                    check_objc);
             default:
@@ -932,55 +930,55 @@ ClangASTType::IsPossibleDynamicType (Cla
             switch (pointee_type_class)
             {
                 case clang::Type::Builtin:
-                    switch (cast<BuiltinType>(pointee_qual_type)->getKind())
+                    switch (llvm::cast<clang::BuiltinType>(pointee_qual_type)->getKind())
                 {
-                    case BuiltinType::UnknownAny:
-                    case BuiltinType::Void:
+                    case clang::BuiltinType::UnknownAny:
+                    case clang::BuiltinType::Void:
                         if (dynamic_pointee_type)
                             dynamic_pointee_type->SetClangType(m_ast, pointee_qual_type);
                         return true;
                         
-                    case BuiltinType::NullPtr:
-                    case BuiltinType::Bool:
-                    case BuiltinType::Char_U:
-                    case BuiltinType::UChar:
-                    case BuiltinType::WChar_U:
-                    case BuiltinType::Char16:
-                    case BuiltinType::Char32:
-                    case BuiltinType::UShort:
-                    case BuiltinType::UInt:
-                    case BuiltinType::ULong:
-                    case BuiltinType::ULongLong:
-                    case BuiltinType::UInt128:
-                    case BuiltinType::Char_S:
-                    case BuiltinType::SChar:
-                    case BuiltinType::WChar_S:
-                    case BuiltinType::Short:
-                    case BuiltinType::Int:
-                    case BuiltinType::Long:
-                    case BuiltinType::LongLong:
-                    case BuiltinType::Int128:
-                    case BuiltinType::Float:
-                    case BuiltinType::Double:
-                    case BuiltinType::LongDouble:
-                    case BuiltinType::Dependent:
-                    case BuiltinType::Overload:
-                    case BuiltinType::ObjCId:
-                    case BuiltinType::ObjCClass:
-                    case BuiltinType::ObjCSel:
-                    case BuiltinType::BoundMember:
-                    case BuiltinType::Half:
-                    case BuiltinType::ARCUnbridgedCast:
-                    case BuiltinType::PseudoObject:
-                    case BuiltinType::BuiltinFn:
-                    case BuiltinType::OCLEvent:
-                    case BuiltinType::OCLImage1d:
-                    case BuiltinType::OCLImage1dArray:
-                    case BuiltinType::OCLImage1dBuffer:
-                    case BuiltinType::OCLImage2d:
-                    case BuiltinType::OCLImage2dArray:
-                    case BuiltinType::OCLImage3d:
-                    case BuiltinType::OCLSampler:
+                    case clang::BuiltinType::NullPtr:
+                    case clang::BuiltinType::Bool:
+                    case clang::BuiltinType::Char_U:
+                    case clang::BuiltinType::UChar:
+                    case clang::BuiltinType::WChar_U:
+                    case clang::BuiltinType::Char16:
+                    case clang::BuiltinType::Char32:
+                    case clang::BuiltinType::UShort:
+                    case clang::BuiltinType::UInt:
+                    case clang::BuiltinType::ULong:
+                    case clang::BuiltinType::ULongLong:
+                    case clang::BuiltinType::UInt128:
+                    case clang::BuiltinType::Char_S:
+                    case clang::BuiltinType::SChar:
+                    case clang::BuiltinType::WChar_S:
+                    case clang::BuiltinType::Short:
+                    case clang::BuiltinType::Int:
+                    case clang::BuiltinType::Long:
+                    case clang::BuiltinType::LongLong:
+                    case clang::BuiltinType::Int128:
+                    case clang::BuiltinType::Float:
+                    case clang::BuiltinType::Double:
+                    case clang::BuiltinType::LongDouble:
+                    case clang::BuiltinType::Dependent:
+                    case clang::BuiltinType::Overload:
+                    case clang::BuiltinType::ObjCId:
+                    case clang::BuiltinType::ObjCClass:
+                    case clang::BuiltinType::ObjCSel:
+                    case clang::BuiltinType::BoundMember:
+                    case clang::BuiltinType::Half:
+                    case clang::BuiltinType::ARCUnbridgedCast:
+                    case clang::BuiltinType::PseudoObject:
+                    case clang::BuiltinType::BuiltinFn:
+                    case clang::BuiltinType::OCLEvent:
+                    case clang::BuiltinType::OCLImage1d:
+                    case clang::BuiltinType::OCLImage1dArray:
+                    case clang::BuiltinType::OCLImage1dBuffer:
+                    case clang::BuiltinType::OCLImage2d:
+                    case clang::BuiltinType::OCLImage2dArray:
+                    case clang::BuiltinType::OCLImage3d:
+                    case clang::BuiltinType::OCLSampler:
                         break;
                 }
                     break;
@@ -988,7 +986,7 @@ ClangASTType::IsPossibleDynamicType (Cla
                 case clang::Type::Record:
                     if (check_cplusplus)
                     {
-                        CXXRecordDecl *cxx_record_decl = pointee_qual_type->getAsCXXRecordDecl();
+                        clang::CXXRecordDecl *cxx_record_decl = pointee_qual_type->getAsCXXRecordDecl();
                         if (cxx_record_decl)
                         {
                             bool is_complete = cxx_record_decl->isCompleteDefinition();
@@ -1090,9 +1088,9 @@ ClangASTType::GetCXXClassName (std::stri
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
+        clang::QualType qual_type (GetCanonicalQualType());
         
-        CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+        clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
         if (cxx_record_decl)
         {
             class_name.assign (cxx_record_decl->getIdentifier()->getNameStart());
@@ -1110,7 +1108,7 @@ ClangASTType::IsCXXClassType () const
     if (!IsValid())
         return false;
     
-    QualType qual_type (GetCanonicalQualType());
+    clang::QualType qual_type (GetCanonicalQualType());
     if (qual_type->getAsCXXRecordDecl() != nullptr)
         return true;
     return false;
@@ -1121,8 +1119,8 @@ ClangASTType::IsBeingDefined () const
 {
     if (!IsValid())
         return false;
-    QualType qual_type (GetCanonicalQualType());
-    const clang::TagType *tag_type = dyn_cast<clang::TagType>(qual_type);
+    clang::QualType qual_type (GetCanonicalQualType());
+    const clang::TagType *tag_type =  llvm::dyn_cast<clang::TagType>(qual_type);
     if (tag_type)
         return tag_type->isBeingDefined();
     return false;
@@ -1134,7 +1132,7 @@ ClangASTType::IsObjCObjectPointerType (C
     if (!IsValid())
         return false;
     
-    QualType qual_type (GetCanonicalQualType());
+    clang::QualType qual_type (GetCanonicalQualType());
 
     if (qual_type->isObjCObjectPointerType())
     {
@@ -1143,11 +1141,11 @@ ClangASTType::IsObjCObjectPointerType (C
             if (!qual_type->isObjCClassType() &&
                 !qual_type->isObjCIdType())
             {
-                const ObjCObjectPointerType *obj_pointer_type = dyn_cast<ObjCObjectPointerType>(qual_type);
+                const clang::ObjCObjectPointerType *obj_pointer_type =  llvm::dyn_cast<clang::ObjCObjectPointerType>(qual_type);
                 if (obj_pointer_type == nullptr)
                     class_type_ptr->Clear();
                 else
-                    class_type_ptr->SetClangType (m_ast, QualType(obj_pointer_type->getInterfaceType(), 0));
+                    class_type_ptr->SetClangType (m_ast, clang::QualType(obj_pointer_type->getInterfaceType(), 0));
             }
         }
         return true;
@@ -1163,12 +1161,12 @@ ClangASTType::GetObjCClassName (std::str
     if (!IsValid())
         return false;
     
-    QualType qual_type (GetCanonicalQualType());
+    clang::QualType qual_type (GetCanonicalQualType());
 
-    const ObjCObjectType *object_type = dyn_cast<ObjCObjectType>(qual_type);
+    const clang::ObjCObjectType *object_type =  llvm::dyn_cast<clang::ObjCObjectType>(qual_type);
     if (object_type)
     {
-        const ObjCInterfaceDecl *interface = object_type->getInterface();
+        const clang::ObjCInterfaceDecl *interface = object_type->getInterface();
         if (interface)
         {
             class_name = interface->getNameAsString();
@@ -1227,14 +1225,14 @@ ClangASTType::GetTypeName () const
     std::string type_name;
     if (IsValid())
     {
-        PrintingPolicy printing_policy (m_ast->getPrintingPolicy());
-        QualType qual_type(GetQualType());
+        clang::PrintingPolicy printing_policy (m_ast->getPrintingPolicy());
+        clang::QualType qual_type(GetQualType());
         printing_policy.SuppressTagKeyword = true;
         printing_policy.LangOpts.WChar = true;
-        const TypedefType *typedef_type = qual_type->getAs<TypedefType>();
+        const clang::TypedefType *typedef_type = qual_type->getAs<clang::TypedefType>();
         if (typedef_type)
         {
-            const TypedefNameDecl *typedef_decl = typedef_type->getDecl();
+            const clang::TypedefNameDecl *typedef_decl = typedef_type->getDecl();
             type_name = typedef_decl->getQualifiedNameAsString();
         }
         else
@@ -1255,14 +1253,14 @@ ClangASTType::GetTypeInfo (ClangASTType
     if (pointee_or_element_clang_type)
         pointee_or_element_clang_type->Clear();
     
-    QualType qual_type (GetQualType());
+    clang::QualType qual_type (GetQualType());
     
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
     {
         case clang::Type::Builtin:
         {
-            const BuiltinType *builtin_type = dyn_cast<BuiltinType>(qual_type->getCanonicalTypeInternal());
+            const clang::BuiltinType *builtin_type =  llvm::dyn_cast<clang::BuiltinType>(qual_type->getCanonicalTypeInternal());
             
             uint32_t builtin_type_flags = eTypeIsBuiltIn | eTypeHasValue;
             switch (builtin_type->getKind())
@@ -1326,10 +1324,10 @@ ClangASTType::GetTypeInfo (ClangASTType
         case clang::Type::Complex:
         {
             uint32_t complex_type_flags = eTypeIsBuiltIn | eTypeHasValue | eTypeIsComplex;
-            const ComplexType *complex_type = dyn_cast<ComplexType>(qual_type->getCanonicalTypeInternal());
+            const clang::ComplexType *complex_type =  llvm::dyn_cast<clang::ComplexType>(qual_type->getCanonicalTypeInternal());
             if (complex_type)
             {
-                QualType complex_element_type (complex_type->getElementType());
+                clang::QualType complex_element_type (complex_type->getElementType());
                 if (complex_element_type->isIntegerType())
                     complex_type_flags |= eTypeIsFloat;
                 else if (complex_element_type->isFloatingType())
@@ -1344,7 +1342,7 @@ ClangASTType::GetTypeInfo (ClangASTType
         case clang::Type::IncompleteArray:
         case clang::Type::VariableArray:
             if (pointee_or_element_clang_type)
-                pointee_or_element_clang_type->SetClangType(m_ast, cast<ArrayType>(qual_type.getTypePtr())->getElementType());
+                pointee_or_element_clang_type->SetClangType(m_ast, llvm::cast<clang::ArrayType>(qual_type.getTypePtr())->getElementType());
             return eTypeHasChildren | eTypeIsArray;
             
         case clang::Type::DependentName:                    return 0;
@@ -1354,13 +1352,13 @@ ClangASTType::GetTypeInfo (ClangASTType
             
         case clang::Type::Enum:
             if (pointee_or_element_clang_type)
-                pointee_or_element_clang_type->SetClangType(m_ast, cast<EnumType>(qual_type)->getDecl()->getIntegerType());
+                pointee_or_element_clang_type->SetClangType(m_ast, llvm::cast<clang::EnumType>(qual_type)->getDecl()->getIntegerType());
             return eTypeIsEnumeration | eTypeHasValue;
             
         case clang::Type::Elaborated:
-            return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetTypeInfo (pointee_or_element_clang_type);
+            return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetTypeInfo (pointee_or_element_clang_type);
         case clang::Type::Paren:
-            return ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).GetTypeInfo (pointee_or_element_clang_type);
+            return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetTypeInfo (pointee_or_element_clang_type);
             
         case clang::Type::FunctionProto:                    return eTypeIsFuncPrototype | eTypeHasValue;
         case clang::Type::FunctionNoProto:                  return eTypeIsFuncPrototype | eTypeHasValue;
@@ -1369,7 +1367,7 @@ ClangASTType::GetTypeInfo (ClangASTType
         case clang::Type::LValueReference:
         case clang::Type::RValueReference:
             if (pointee_or_element_clang_type)
-                pointee_or_element_clang_type->SetClangType(m_ast, cast<ReferenceType>(qual_type.getTypePtr())->getPointeeType());
+                pointee_or_element_clang_type->SetClangType(m_ast, llvm::cast<clang::ReferenceType>(qual_type.getTypePtr())->getPointeeType());
             return eTypeHasChildren | eTypeIsReference | eTypeHasValue;
             
         case clang::Type::MemberPointer:                    return eTypeIsPointer   | eTypeIsMember | eTypeHasValue;
@@ -1398,7 +1396,7 @@ ClangASTType::GetTypeInfo (ClangASTType
         case clang::Type::TemplateSpecialization:           return eTypeIsTemplate;
             
         case clang::Type::Typedef:
-            return eTypeIsTypedef | ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetTypeInfo (pointee_or_element_clang_type);
+            return eTypeIsTypedef | ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetTypeInfo (pointee_or_element_clang_type);
         case clang::Type::TypeOfExpr:                       return 0;
         case clang::Type::TypeOf:                           return 0;
         case clang::Type::UnresolvedUsing:                  return 0;
@@ -1407,7 +1405,7 @@ ClangASTType::GetTypeInfo (ClangASTType
         case clang::Type::Vector:
         {
             uint32_t vector_type_flags = eTypeHasChildren | eTypeIsVector;
-            const VectorType *vector_type = dyn_cast<VectorType>(qual_type->getCanonicalTypeInternal());
+            const clang::VectorType *vector_type =  llvm::dyn_cast<clang::VectorType>(qual_type->getCanonicalTypeInternal());
             if (vector_type)
             {
                 if (vector_type->isIntegerType())
@@ -1431,13 +1429,13 @@ ClangASTType::GetMinimumLanguage ()
         return lldb::eLanguageTypeC;
     
     // If the type is a reference, then resolve it to what it refers to first:
-    QualType qual_type (GetCanonicalQualType().getNonReferenceType());
+    clang::QualType qual_type (GetCanonicalQualType().getNonReferenceType());
     if (qual_type->isAnyPointerType())
     {
         if (qual_type->isObjCObjectPointerType())
             return lldb::eLanguageTypeObjC;
         
-        QualType pointee_type (qual_type->getPointeeType());
+        clang::QualType pointee_type (qual_type->getPointeeType());
         if (pointee_type->getPointeeCXXRecordDecl() != nullptr)
             return lldb::eLanguageTypeC_plus_plus;
         if (pointee_type->isObjCObjectOrInterfaceType())
@@ -1458,51 +1456,51 @@ ClangASTType::GetMinimumLanguage ()
             default:
                 break;
             case clang::Type::Builtin:
-                switch (cast<BuiltinType>(qual_type)->getKind())
+                switch (llvm::cast<clang::BuiltinType>(qual_type)->getKind())
             {
                 default:
-                case BuiltinType::Void:
-                case BuiltinType::Bool:
-                case BuiltinType::Char_U:
-                case BuiltinType::UChar:
-                case BuiltinType::WChar_U:
-                case BuiltinType::Char16:
-                case BuiltinType::Char32:
-                case BuiltinType::UShort:
-                case BuiltinType::UInt:
-                case BuiltinType::ULong:
-                case BuiltinType::ULongLong:
-                case BuiltinType::UInt128:
-                case BuiltinType::Char_S:
-                case BuiltinType::SChar:
-                case BuiltinType::WChar_S:
-                case BuiltinType::Short:
-                case BuiltinType::Int:
-                case BuiltinType::Long:
-                case BuiltinType::LongLong:
-                case BuiltinType::Int128:
-                case BuiltinType::Float:
-                case BuiltinType::Double:
-                case BuiltinType::LongDouble:
+                case clang::BuiltinType::Void:
+                case clang::BuiltinType::Bool:
+                case clang::BuiltinType::Char_U:
+                case clang::BuiltinType::UChar:
+                case clang::BuiltinType::WChar_U:
+                case clang::BuiltinType::Char16:
+                case clang::BuiltinType::Char32:
+                case clang::BuiltinType::UShort:
+                case clang::BuiltinType::UInt:
+                case clang::BuiltinType::ULong:
+                case clang::BuiltinType::ULongLong:
+                case clang::BuiltinType::UInt128:
+                case clang::BuiltinType::Char_S:
+                case clang::BuiltinType::SChar:
+                case clang::BuiltinType::WChar_S:
+                case clang::BuiltinType::Short:
+                case clang::BuiltinType::Int:
+                case clang::BuiltinType::Long:
+                case clang::BuiltinType::LongLong:
+                case clang::BuiltinType::Int128:
+                case clang::BuiltinType::Float:
+                case clang::BuiltinType::Double:
+                case clang::BuiltinType::LongDouble:
                     break;
                     
-                case BuiltinType::NullPtr:
+                case clang::BuiltinType::NullPtr:
                     return eLanguageTypeC_plus_plus;
                     
-                case BuiltinType::ObjCId:
-                case BuiltinType::ObjCClass:
-                case BuiltinType::ObjCSel:
+                case clang::BuiltinType::ObjCId:
+                case clang::BuiltinType::ObjCClass:
+                case clang::BuiltinType::ObjCSel:
                     return eLanguageTypeObjC;
                     
-                case BuiltinType::Dependent:
-                case BuiltinType::Overload:
-                case BuiltinType::BoundMember:
-                case BuiltinType::UnknownAny:
+                case clang::BuiltinType::Dependent:
+                case clang::BuiltinType::Overload:
+                case clang::BuiltinType::BoundMember:
+                case clang::BuiltinType::UnknownAny:
                     break;
             }
                 break;
             case clang::Type::Typedef:
-                return ClangASTType(m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetMinimumLanguage();
+                return ClangASTType(m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetMinimumLanguage();
         }
     }
     return lldb::eLanguageTypeC;
@@ -1514,7 +1512,7 @@ ClangASTType::GetTypeClass () const
     if (!IsValid())
         return lldb::eTypeClassInvalid;
     
-    QualType qual_type(GetQualType());
+    clang::QualType qual_type(GetQualType());
     
     switch (qual_type->getTypeClass())
     {
@@ -1544,8 +1542,8 @@ ClangASTType::GetTypeClass () const
         case clang::Type::ObjCInterface:            return lldb::eTypeClassObjCInterface;
         case clang::Type::Record:
             {
-                const RecordType *record_type = cast<RecordType>(qual_type.getTypePtr());
-                const RecordDecl *record_decl = record_type->getDecl();
+                const clang::RecordType *record_type = llvm::cast<clang::RecordType>(qual_type.getTypePtr());
+                const clang::RecordDecl *record_decl = record_type->getDecl();
                 if (record_decl->isUnion())
                     return lldb::eTypeClassUnion;
                 else if (record_decl->isStruct())
@@ -1558,9 +1556,9 @@ ClangASTType::GetTypeClass () const
         case clang::Type::Typedef:                  return lldb::eTypeClassTypedef;
         case clang::Type::UnresolvedUsing:          break;
         case clang::Type::Paren:
-            return ClangASTType(m_ast, cast<ParenType>(qual_type)->desugar()).GetTypeClass();
+            return ClangASTType(m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetTypeClass();
         case clang::Type::Elaborated:
-            return ClangASTType(m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetTypeClass();
+            return ClangASTType(m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetTypeClass();
             
         case clang::Type::Attributed:               break;
         case clang::Type::TemplateTypeParm:         break;
@@ -1580,6 +1578,7 @@ ClangASTType::GetTypeClass () const
 
         // pointer type decayed from an array or function type.
         case clang::Type::Decayed:                  break;
+        case clang::Type::Adjusted:                 break;
     }
     // We don't know hot to display this type...
     return lldb::eTypeClassOther;
@@ -1610,7 +1609,7 @@ ClangASTType::AddConstModifier () const
 {
     if (m_type)
     {
-        QualType result(GetQualType());
+        clang::QualType result(GetQualType());
         result.addConst();
         return ClangASTType (m_ast, result);
     }
@@ -1622,7 +1621,7 @@ ClangASTType::AddRestrictModifier () con
 {
     if (m_type)
     {
-        QualType result(GetQualType());
+        clang::QualType result(GetQualType());
         result.getQualifiers().setRestrict (true);
         return ClangASTType (m_ast, result);
     }
@@ -1634,7 +1633,7 @@ ClangASTType::AddVolatileModifier () con
 {
     if (m_type)
     {
-        QualType result(GetQualType());
+        clang::QualType result(GetQualType());
         result.getQualifiers().setVolatile (true);
         return ClangASTType (m_ast, result);
     }
@@ -1646,7 +1645,7 @@ ClangASTType::GetArrayElementType (uint6
 {
     if (IsValid())
     {
-        QualType qual_type(GetCanonicalQualType());
+        clang::QualType qual_type(GetCanonicalQualType());
         
         const clang::Type *array_elem_type = qual_type.getTypePtr()->getArrayElementTypeNoTypeQual();
         
@@ -1673,8 +1672,8 @@ ClangASTType::GetCanonicalType () const
     return ClangASTType();
 }
 
-static QualType
-GetFullyUnqualifiedType_Impl (ASTContext *ast, QualType qual_type)
+static clang::QualType
+GetFullyUnqualifiedType_Impl (clang::ASTContext *ast, clang::QualType qual_type)
 {
     if (qual_type->isPointerType())
         qual_type = ast->getPointerType(GetFullyUnqualifiedType_Impl(ast, qual_type->getPointeeType()));
@@ -1700,7 +1699,7 @@ ClangASTType::GetFunctionArgumentCount (
 {
     if (IsValid())
     {
-        const FunctionProtoType* func = dyn_cast<FunctionProtoType>(GetCanonicalQualType());
+        const clang::FunctionProtoType* func =  llvm::dyn_cast<clang::FunctionProtoType>(GetCanonicalQualType());
         if (func)
             return func->getNumParams();
     }
@@ -1712,7 +1711,7 @@ ClangASTType::GetFunctionArgumentTypeAtI
 {
     if (IsValid())
     {
-        const FunctionProtoType* func = dyn_cast<FunctionProtoType>(GetCanonicalQualType());
+        const clang::FunctionProtoType* func =  llvm::dyn_cast<clang::FunctionProtoType>(GetCanonicalQualType());
         if (func)
         {
             const uint32_t num_args = func->getNumParams();
@@ -1728,8 +1727,8 @@ ClangASTType::GetFunctionReturnType () c
 {
     if (IsValid())
     {
-        QualType qual_type(GetCanonicalQualType());
-        const FunctionProtoType* func = dyn_cast<FunctionProtoType>(qual_type.getTypePtr());
+        clang::QualType qual_type(GetCanonicalQualType());
+        const clang::FunctionProtoType* func =  llvm::dyn_cast<clang::FunctionProtoType>(qual_type.getTypePtr());
         if (func)
             return ClangASTType(m_ast, func->getReturnType());
     }
@@ -1771,19 +1770,19 @@ ClangASTType::CreateTypedefType (const c
 {
     if (IsValid() && typedef_name && typedef_name[0])
     {
-        QualType qual_type (GetQualType());
+        clang::QualType qual_type (GetQualType());
         if (decl_ctx == nullptr)
             decl_ctx = m_ast->getTranslationUnitDecl();
-        TypedefDecl *decl = TypedefDecl::Create (*m_ast,
-                                                 decl_ctx,
-                                                 SourceLocation(),
-                                                 SourceLocation(),
-                                                 &m_ast->Idents.get(typedef_name),
-                                                 m_ast->getTrivialTypeSourceInfo(qual_type));
+        clang::TypedefDecl *decl = clang::TypedefDecl::Create (*m_ast,
+                                                               decl_ctx,
+                                                               clang::SourceLocation(),
+                                                               clang::SourceLocation(),
+                                                               &m_ast->Idents.get(typedef_name),
+                                                               m_ast->getTrivialTypeSourceInfo(qual_type));
         
-        decl->setAccess(AS_public); // TODO respect proper access specifier
+        decl->setAccess(clang::AS_public); // TODO respect proper access specifier
         
-        // Get a uniqued QualType for the typedef decl type
+        // Get a uniqued clang::QualType for the typedef decl type
         return ClangASTType (m_ast, m_ast->getTypedefType (decl));
     }
     return ClangASTType();
@@ -1795,7 +1794,7 @@ ClangASTType::GetPointeeType () const
 {
     if (m_type)
     {
-        QualType qual_type(GetQualType());
+        clang::QualType qual_type(GetQualType());
         return ClangASTType (m_ast, qual_type.getTypePtr()->getPointeeType());
     }
     return ClangASTType();
@@ -1806,7 +1805,7 @@ ClangASTType::GetPointerType () const
 {
     if (IsValid())
     {
-        QualType qual_type (GetQualType());
+        clang::QualType qual_type (GetQualType());
         
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         switch (type_class)
@@ -1827,7 +1826,7 @@ ClangASTType::GetTypedefedType () const
 {
     if (IsValid())
     {
-        const TypedefType *typedef_type = dyn_cast<TypedefType>(GetQualType());
+        const clang::TypedefType *typedef_type =  llvm::dyn_cast<clang::TypedefType>(GetQualType());
         if (typedef_type)
             return ClangASTType (m_ast, typedef_type->getDecl()->getUnderlyingType());
     }
@@ -1839,7 +1838,7 @@ ClangASTType::RemoveFastQualifiers () co
 {
     if (m_type)
     {
-        QualType qual_type(GetQualType());
+        clang::QualType qual_type(GetQualType());
         qual_type.getQualifiers().removeFastQualifiers();
         return ClangASTType (m_ast, qual_type);
     }
@@ -1867,7 +1866,7 @@ ClangASTType::GetBitSize () const
 {
     if (GetCompleteType ())
     {
-        QualType qual_type(GetCanonicalQualType());
+        clang::QualType qual_type(GetCanonicalQualType());
         const uint32_t bit_size = m_ast->getTypeSize (qual_type);
         if (bit_size == 0)
         {
@@ -1903,7 +1902,7 @@ ClangASTType::GetEncoding (uint64_t &cou
         return lldb::eEncodingInvalid;
     
     count = 1;
-    QualType qual_type(GetCanonicalQualType());
+    clang::QualType qual_type(GetCanonicalQualType());
     
     switch (qual_type->getTypeClass())
     {
@@ -1927,42 +1926,42 @@ ClangASTType::GetEncoding (uint64_t &cou
             break;
             
         case clang::Type::Builtin:
-            switch (cast<BuiltinType>(qual_type)->getKind())
+            switch (llvm::cast<clang::BuiltinType>(qual_type)->getKind())
         {
             default: assert(0 && "Unknown builtin type!");
-            case BuiltinType::Void:
+            case clang::BuiltinType::Void:
                 break;
                 
-            case BuiltinType::Bool:
-            case BuiltinType::Char_S:
-            case BuiltinType::SChar:
-            case BuiltinType::WChar_S:
-            case BuiltinType::Char16:
-            case BuiltinType::Char32:
-            case BuiltinType::Short:
-            case BuiltinType::Int:
-            case BuiltinType::Long:
-            case BuiltinType::LongLong:
-            case BuiltinType::Int128:        return lldb::eEncodingSint;
-                
-            case BuiltinType::Char_U:
-            case BuiltinType::UChar:
-            case BuiltinType::WChar_U:
-            case BuiltinType::UShort:
-            case BuiltinType::UInt:
-            case BuiltinType::ULong:
-            case BuiltinType::ULongLong:
-            case BuiltinType::UInt128:       return lldb::eEncodingUint;
-                
-            case BuiltinType::Float:
-            case BuiltinType::Double:
-            case BuiltinType::LongDouble:    return lldb::eEncodingIEEE754;
-                
-            case BuiltinType::ObjCClass:
-            case BuiltinType::ObjCId:
-            case BuiltinType::ObjCSel:       return lldb::eEncodingUint;
+            case clang::BuiltinType::Bool:
+            case clang::BuiltinType::Char_S:
+            case clang::BuiltinType::SChar:
+            case clang::BuiltinType::WChar_S:
+            case clang::BuiltinType::Char16:
+            case clang::BuiltinType::Char32:
+            case clang::BuiltinType::Short:
+            case clang::BuiltinType::Int:
+            case clang::BuiltinType::Long:
+            case clang::BuiltinType::LongLong:
+            case clang::BuiltinType::Int128:        return lldb::eEncodingSint;
+                
+            case clang::BuiltinType::Char_U:
+            case clang::BuiltinType::UChar:
+            case clang::BuiltinType::WChar_U:
+            case clang::BuiltinType::UShort:
+            case clang::BuiltinType::UInt:
+            case clang::BuiltinType::ULong:
+            case clang::BuiltinType::ULongLong:
+            case clang::BuiltinType::UInt128:       return lldb::eEncodingUint;
                 
-            case BuiltinType::NullPtr:       return lldb::eEncodingUint;
+            case clang::BuiltinType::Float:
+            case clang::BuiltinType::Double:
+            case clang::BuiltinType::LongDouble:    return lldb::eEncodingIEEE754;
+                
+            case clang::BuiltinType::ObjCClass:
+            case clang::BuiltinType::ObjCId:
+            case clang::BuiltinType::ObjCSel:       return lldb::eEncodingUint;
+                
+            case clang::BuiltinType::NullPtr:       return lldb::eEncodingUint;
         }
             break;
             // All pointer types are represented as unsigned integer encodings.
@@ -1981,7 +1980,7 @@ ClangASTType::GetEncoding (uint64_t &cou
                 encoding = lldb::eEncodingIEEE754;
             else
             {
-                const ComplexType *complex_type = qual_type->getAsComplexIntegerType();
+                const clang::ComplexType *complex_type = qual_type->getAsComplexIntegerType();
                 if (complex_type)
                     encoding = ClangASTType(m_ast, complex_type->getElementType()).GetEncoding(count);
                 else
@@ -1995,13 +1994,13 @@ ClangASTType::GetEncoding (uint64_t &cou
         case clang::Type::Record:                   break;
         case clang::Type::Enum:                     return lldb::eEncodingSint;
         case clang::Type::Typedef:
-            return ClangASTType(m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetEncoding(count);
+            return ClangASTType(m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetEncoding(count);
             
         case clang::Type::Elaborated:
-            return ClangASTType(m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetEncoding(count);
+            return ClangASTType(m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetEncoding(count);
             
         case clang::Type::Paren:
-            return ClangASTType(m_ast, cast<ParenType>(qual_type)->desugar()).GetEncoding(count);
+            return ClangASTType(m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetEncoding(count);
             
         case clang::Type::DependentSizedArray:
         case clang::Type::DependentSizedExtVector:
@@ -2022,6 +2021,7 @@ ClangASTType::GetEncoding (uint64_t &cou
         case clang::Type::Decltype:
         case clang::Type::TemplateSpecialization:
         case clang::Type::Atomic:
+        case clang::Type::Adjusted:
             break;
 
         // pointer type decayed from an array or function type.
@@ -2038,7 +2038,7 @@ ClangASTType::GetFormat () const
     if (!IsValid())
         return lldb::eFormatDefault;
     
-    QualType qual_type(GetCanonicalQualType());
+    clang::QualType qual_type(GetCanonicalQualType());
     
     switch (qual_type->getTypeClass())
     {
@@ -2061,54 +2061,54 @@ ClangASTType::GetFormat () const
             break;
             
         case clang::Type::Builtin:
-            switch (cast<BuiltinType>(qual_type)->getKind())
+            switch (llvm::cast<clang::BuiltinType>(qual_type)->getKind())
         {
                 //default: assert(0 && "Unknown builtin type!");
-            case BuiltinType::UnknownAny:
-            case BuiltinType::Void:
-            case BuiltinType::BoundMember:
+            case clang::BuiltinType::UnknownAny:
+            case clang::BuiltinType::Void:
+            case clang::BuiltinType::BoundMember:
                 break;
                 
-            case BuiltinType::Bool:          return lldb::eFormatBoolean;
-            case BuiltinType::Char_S:
-            case BuiltinType::SChar:
-            case BuiltinType::WChar_S:
-            case BuiltinType::Char_U:
-            case BuiltinType::UChar:
-            case BuiltinType::WChar_U:       return lldb::eFormatChar;
-            case BuiltinType::Char16:        return lldb::eFormatUnicode16;
-            case BuiltinType::Char32:        return lldb::eFormatUnicode32;
-            case BuiltinType::UShort:        return lldb::eFormatUnsigned;
-            case BuiltinType::Short:         return lldb::eFormatDecimal;
-            case BuiltinType::UInt:          return lldb::eFormatUnsigned;
-            case BuiltinType::Int:           return lldb::eFormatDecimal;
-            case BuiltinType::ULong:         return lldb::eFormatUnsigned;
-            case BuiltinType::Long:          return lldb::eFormatDecimal;
-            case BuiltinType::ULongLong:     return lldb::eFormatUnsigned;
-            case BuiltinType::LongLong:      return lldb::eFormatDecimal;
-            case BuiltinType::UInt128:       return lldb::eFormatUnsigned;
-            case BuiltinType::Int128:        return lldb::eFormatDecimal;
-            case BuiltinType::Float:         return lldb::eFormatFloat;
-            case BuiltinType::Double:        return lldb::eFormatFloat;
-            case BuiltinType::LongDouble:    return lldb::eFormatFloat;
-            case BuiltinType::NullPtr:
-            case BuiltinType::Overload:
-            case BuiltinType::Dependent:
-            case BuiltinType::ObjCId:
-            case BuiltinType::ObjCClass:
-            case BuiltinType::ObjCSel:
-            case BuiltinType::Half:
-            case BuiltinType::ARCUnbridgedCast:
-            case BuiltinType::PseudoObject:
-            case BuiltinType::BuiltinFn:
-            case BuiltinType::OCLEvent:
-            case BuiltinType::OCLImage1d:
-            case BuiltinType::OCLImage1dArray:
-            case BuiltinType::OCLImage1dBuffer:
-            case BuiltinType::OCLImage2d:
-            case BuiltinType::OCLImage2dArray:
-            case BuiltinType::OCLImage3d:
-            case BuiltinType::OCLSampler:
+            case clang::BuiltinType::Bool:          return lldb::eFormatBoolean;
+            case clang::BuiltinType::Char_S:
+            case clang::BuiltinType::SChar:
+            case clang::BuiltinType::WChar_S:
+            case clang::BuiltinType::Char_U:
+            case clang::BuiltinType::UChar:
+            case clang::BuiltinType::WChar_U:       return lldb::eFormatChar;
+            case clang::BuiltinType::Char16:        return lldb::eFormatUnicode16;
+            case clang::BuiltinType::Char32:        return lldb::eFormatUnicode32;
+            case clang::BuiltinType::UShort:        return lldb::eFormatUnsigned;
+            case clang::BuiltinType::Short:         return lldb::eFormatDecimal;
+            case clang::BuiltinType::UInt:          return lldb::eFormatUnsigned;
+            case clang::BuiltinType::Int:           return lldb::eFormatDecimal;
+            case clang::BuiltinType::ULong:         return lldb::eFormatUnsigned;
+            case clang::BuiltinType::Long:          return lldb::eFormatDecimal;
+            case clang::BuiltinType::ULongLong:     return lldb::eFormatUnsigned;
+            case clang::BuiltinType::LongLong:      return lldb::eFormatDecimal;
+            case clang::BuiltinType::UInt128:       return lldb::eFormatUnsigned;
+            case clang::BuiltinType::Int128:        return lldb::eFormatDecimal;
+            case clang::BuiltinType::Float:         return lldb::eFormatFloat;
+            case clang::BuiltinType::Double:        return lldb::eFormatFloat;
+            case clang::BuiltinType::LongDouble:    return lldb::eFormatFloat;
+            case clang::BuiltinType::NullPtr:
+            case clang::BuiltinType::Overload:
+            case clang::BuiltinType::Dependent:
+            case clang::BuiltinType::ObjCId:
+            case clang::BuiltinType::ObjCClass:
+            case clang::BuiltinType::ObjCSel:
+            case clang::BuiltinType::Half:
+            case clang::BuiltinType::ARCUnbridgedCast:
+            case clang::BuiltinType::PseudoObject:
+            case clang::BuiltinType::BuiltinFn:
+            case clang::BuiltinType::OCLEvent:
+            case clang::BuiltinType::OCLImage1d:
+            case clang::BuiltinType::OCLImage1dArray:
+            case clang::BuiltinType::OCLImage1dBuffer:
+            case clang::BuiltinType::OCLImage2d:
+            case clang::BuiltinType::OCLImage2dArray:
+            case clang::BuiltinType::OCLImage3d:
+            case clang::BuiltinType::OCLSampler:
                 return lldb::eFormatHex;
         }
             break;
@@ -2129,13 +2129,13 @@ ClangASTType::GetFormat () const
         case clang::Type::Record:                   break;
         case clang::Type::Enum:                     return lldb::eFormatEnum;
         case clang::Type::Typedef:
-            return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetFormat();
+            return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetFormat();
         case clang::Type::Auto:
-            return ClangASTType (m_ast, cast<AutoType>(qual_type)->desugar()).GetFormat();
+            return ClangASTType (m_ast, llvm::cast<clang::AutoType>(qual_type)->desugar()).GetFormat();
         case clang::Type::Paren:
-            return ClangASTType (m_ast, cast<ParenType>(qual_type)->desugar()).GetFormat();
+            return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetFormat();
         case clang::Type::Elaborated:
-            return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetFormat();
+            return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetFormat();
         case clang::Type::DependentSizedArray:
         case clang::Type::DependentSizedExtVector:
         case clang::Type::UnresolvedUsing:
@@ -2154,6 +2154,7 @@ ClangASTType::GetFormat () const
         case clang::Type::Decltype:
         case clang::Type::TemplateSpecialization:
         case clang::Type::Atomic:
+        case clang::Type::Adjusted:
             break;
 
         // pointer type decayed from an array or function type.
@@ -2165,7 +2166,7 @@ ClangASTType::GetFormat () const
 }
 
 static bool
-ObjCDeclHasIVars (ObjCInterfaceDecl *class_interface_decl, bool check_superclass)
+ObjCDeclHasIVars (clang::ObjCInterfaceDecl *class_interface_decl, bool check_superclass)
 {
     while (class_interface_decl)
     {
@@ -2187,15 +2188,15 @@ ClangASTType::GetNumChildren (bool omit_
         return 0;
     
     uint32_t num_children = 0;
-    QualType qual_type(GetQualType());
+    clang::QualType qual_type(GetQualType());
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
     {
         case clang::Type::Builtin:
-            switch (cast<BuiltinType>(qual_type)->getKind())
+            switch (llvm::cast<clang::BuiltinType>(qual_type)->getKind())
         {
-            case BuiltinType::ObjCId:    // child is Class
-            case BuiltinType::ObjCClass: // child is Class
+            case clang::BuiltinType::ObjCId:    // child is Class
+            case clang::BuiltinType::ObjCClass: // child is Class
                 num_children = 1;
                 break;
                 
@@ -2209,10 +2210,10 @@ ClangASTType::GetNumChildren (bool omit_
         case clang::Type::Record:
             if (GetCompleteQualType (m_ast, qual_type))
             {
-                const RecordType *record_type = cast<RecordType>(qual_type.getTypePtr());
-                const RecordDecl *record_decl = record_type->getDecl();
+                const clang::RecordType *record_type = llvm::cast<clang::RecordType>(qual_type.getTypePtr());
+                const clang::RecordDecl *record_decl = record_type->getDecl();
                 assert(record_decl);
-                const CXXRecordDecl *cxx_record_decl = dyn_cast<CXXRecordDecl>(record_decl);
+                const clang::CXXRecordDecl *cxx_record_decl =  llvm::dyn_cast<clang::CXXRecordDecl>(record_decl);
                 if (cxx_record_decl)
                 {
                     if (omit_empty_base_classes)
@@ -2221,12 +2222,12 @@ ClangASTType::GetNumChildren (bool omit_
                         // base classes contain any fields. This can help
                         // limit the noise in variable views by not having to
                         // show base classes that contain no members.
-                        CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
+                        clang::CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
                         for (base_class = cxx_record_decl->bases_begin(), base_class_end = cxx_record_decl->bases_end();
                              base_class != base_class_end;
                              ++base_class)
                         {
-                            const CXXRecordDecl *base_class_decl = cast<CXXRecordDecl>(base_class->getType()->getAs<RecordType>()->getDecl());
+                            const clang::CXXRecordDecl *base_class_decl = llvm::cast<clang::CXXRecordDecl>(base_class->getType()->getAs<clang::RecordType>()->getDecl());
                             
                             // Skip empty base classes
                             if (ClangASTContext::RecordHasFields(base_class_decl) == false)
@@ -2242,7 +2243,7 @@ ClangASTType::GetNumChildren (bool omit_
                     }
                     
                 }
-                RecordDecl::field_iterator field, field_end;
+                clang::RecordDecl::field_iterator field, field_end;
                 for (field = record_decl->field_begin(), field_end = record_decl->field_end(); field != field_end; ++field)
                     ++num_children;
             }
@@ -2252,16 +2253,16 @@ ClangASTType::GetNumChildren (bool omit_
         case clang::Type::ObjCInterface:
             if (GetCompleteQualType (m_ast, qual_type))
             {
-                const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type.getTypePtr());
+                const clang::ObjCObjectType *objc_class_type =  llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr());
                 assert (objc_class_type);
                 if (objc_class_type)
                 {
-                    ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+                    clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
                     
                     if (class_interface_decl)
                     {
                         
-                        ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
+                        clang::ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
                         if (superclass_interface_decl)
                         {
                             if (omit_empty_base_classes)
@@ -2281,8 +2282,8 @@ ClangASTType::GetNumChildren (bool omit_
             
         case clang::Type::ObjCObjectPointer:
         {
-            const ObjCObjectPointerType *pointer_type = cast<ObjCObjectPointerType>(qual_type.getTypePtr());
-            QualType pointee_type = pointer_type->getPointeeType();
+            const clang::ObjCObjectPointerType *pointer_type = llvm::cast<clang::ObjCObjectPointerType>(qual_type.getTypePtr());
+            clang::QualType pointee_type = pointer_type->getPointeeType();
             uint32_t num_pointee_children = ClangASTType (m_ast,pointee_type).GetNumChildren (omit_empty_base_classes);
             // If this type points to a simple type, then it has 1 child
             if (num_pointee_children == 0)
@@ -2294,17 +2295,17 @@ ClangASTType::GetNumChildren (bool omit_
             
         case clang::Type::Vector:
         case clang::Type::ExtVector:
-            num_children = cast<VectorType>(qual_type.getTypePtr())->getNumElements();
+            num_children = llvm::cast<clang::VectorType>(qual_type.getTypePtr())->getNumElements();
             break;
             
         case clang::Type::ConstantArray:
-            num_children = cast<ConstantArrayType>(qual_type.getTypePtr())->getSize().getLimitedValue();
+            num_children = llvm::cast<clang::ConstantArrayType>(qual_type.getTypePtr())->getSize().getLimitedValue();
             break;
             
         case clang::Type::Pointer:
         {
-            const PointerType *pointer_type = cast<PointerType>(qual_type.getTypePtr());
-            QualType pointee_type (pointer_type->getPointeeType());
+            const clang::PointerType *pointer_type = llvm::cast<clang::PointerType>(qual_type.getTypePtr());
+            clang::QualType pointee_type (pointer_type->getPointeeType());
             uint32_t num_pointee_children = ClangASTType (m_ast,pointee_type).GetNumChildren (omit_empty_base_classes);
             if (num_pointee_children == 0)
             {
@@ -2320,8 +2321,8 @@ ClangASTType::GetNumChildren (bool omit_
         case clang::Type::LValueReference:
         case clang::Type::RValueReference:
         {
-            const ReferenceType *reference_type = cast<ReferenceType>(qual_type.getTypePtr());
-            QualType pointee_type = reference_type->getPointeeType();
+            const clang::ReferenceType *reference_type = llvm::cast<clang::ReferenceType>(qual_type.getTypePtr());
+            clang::QualType pointee_type = reference_type->getPointeeType();
             uint32_t num_pointee_children = ClangASTType (m_ast, pointee_type).GetNumChildren (omit_empty_base_classes);
             // If this type points to a simple type, then it has 1 child
             if (num_pointee_children == 0)
@@ -2333,15 +2334,15 @@ ClangASTType::GetNumChildren (bool omit_
             
             
         case clang::Type::Typedef:
-            num_children = ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumChildren (omit_empty_base_classes);
+            num_children = ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumChildren (omit_empty_base_classes);
             break;
             
         case clang::Type::Elaborated:
-            num_children = ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetNumChildren (omit_empty_base_classes);
+            num_children = ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetNumChildren (omit_empty_base_classes);
             break;
             
         case clang::Type::Paren:
-            num_children = ClangASTType (m_ast, cast<ParenType>(qual_type)->desugar()).GetNumChildren (omit_empty_base_classes);
+            num_children = ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetNumChildren (omit_empty_base_classes);
             break;
         default:
             break;
@@ -2354,11 +2355,11 @@ ClangASTType::GetBasicTypeEnumeration ()
 {
     if (IsValid())
     {
-        QualType qual_type(GetQualType());
+        clang::QualType qual_type(GetQualType());
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         if (type_class == clang::Type::Builtin)
         {
-            switch (cast<clang::BuiltinType>(qual_type)->getKind())
+            switch (llvm::cast<clang::BuiltinType>(qual_type)->getKind())
             {
                 case clang::BuiltinType::Void:      return eBasicTypeVoid;
                 case clang::BuiltinType::Bool:      return eBasicTypeBool;
@@ -2422,14 +2423,14 @@ ClangASTType::GetNumDirectBaseClasses ()
         return 0;
     
     uint32_t count = 0;
-    QualType qual_type(GetCanonicalQualType());
+    clang::QualType qual_type(GetCanonicalQualType());
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
     {
         case clang::Type::Record:
             if (GetCompleteType())
             {
-                const CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+                const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
                 if (cxx_record_decl)
                     count = cxx_record_decl->getNumBases();
             }
@@ -2442,10 +2443,10 @@ ClangASTType::GetNumDirectBaseClasses ()
         case clang::Type::ObjCObject:
             if (GetCompleteType())
             {
-                const ObjCObjectType *objc_class_type = qual_type->getAsObjCQualifiedInterfaceType();
+                const clang::ObjCObjectType *objc_class_type = qual_type->getAsObjCQualifiedInterfaceType();
                 if (objc_class_type)
                 {
-                    ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+                    clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
                     
                     if (class_interface_decl && class_interface_decl->getSuperClass())
                         count = 1;
@@ -2455,10 +2456,10 @@ ClangASTType::GetNumDirectBaseClasses ()
         case clang::Type::ObjCInterface:
             if (GetCompleteType())
             {
-                const ObjCInterfaceType *objc_interface_type = qual_type->getAs<ObjCInterfaceType>();
+                const clang::ObjCInterfaceType *objc_interface_type = qual_type->getAs<clang::ObjCInterfaceType>();
                 if (objc_interface_type)
                 {
-                    ObjCInterfaceDecl *class_interface_decl = objc_interface_type->getInterface();
+                    clang::ObjCInterfaceDecl *class_interface_decl = objc_interface_type->getInterface();
                     
                     if (class_interface_decl && class_interface_decl->getSuperClass())
                         count = 1;
@@ -2468,15 +2469,15 @@ ClangASTType::GetNumDirectBaseClasses ()
             
             
         case clang::Type::Typedef:
-            count = ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumDirectBaseClasses ();
+            count = ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumDirectBaseClasses ();
             break;
             
         case clang::Type::Elaborated:
-            count = ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetNumDirectBaseClasses ();
+            count = ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetNumDirectBaseClasses ();
             break;
             
         case clang::Type::Paren:
-            return ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).GetNumDirectBaseClasses ();
+            return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetNumDirectBaseClasses ();
             
         default:
             break;
@@ -2491,29 +2492,29 @@ ClangASTType::GetNumVirtualBaseClasses (
         return 0;
     
     uint32_t count = 0;
-    QualType qual_type(GetCanonicalQualType());
+    clang::QualType qual_type(GetCanonicalQualType());
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
     {
         case clang::Type::Record:
             if (GetCompleteType())
             {
-                const CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+                const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
                 if (cxx_record_decl)
                     count = cxx_record_decl->getNumVBases();
             }
             break;
             
         case clang::Type::Typedef:
-            count = ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumVirtualBaseClasses();
+            count = ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumVirtualBaseClasses();
             break;
             
         case clang::Type::Elaborated:
-            count = ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetNumVirtualBaseClasses();
+            count = ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetNumVirtualBaseClasses();
             break;
             
         case clang::Type::Paren:
-            count = ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).GetNumVirtualBaseClasses();
+            count = ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetNumVirtualBaseClasses();
             break;
             
         default:
@@ -2529,21 +2530,21 @@ ClangASTType::GetNumFields () const
         return 0;
     
     uint32_t count = 0;
-    QualType qual_type(GetCanonicalQualType());
+    clang::QualType qual_type(GetCanonicalQualType());
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
     {
         case clang::Type::Record:
             if (GetCompleteType())
             {
-                const RecordType *record_type = dyn_cast<RecordType>(qual_type.getTypePtr());
+                const clang::RecordType *record_type =  llvm::dyn_cast<clang::RecordType>(qual_type.getTypePtr());
                 if (record_type)
                 {
-                    RecordDecl *record_decl = record_type->getDecl();
+                    clang::RecordDecl *record_decl = record_type->getDecl();
                     if (record_decl)
                     {
                         uint32_t field_idx = 0;
-                        RecordDecl::field_iterator field, field_end;
+                        clang::RecordDecl::field_iterator field, field_end;
                         for (field = record_decl->field_begin(), field_end = record_decl->field_end(); field != field_end; ++field)
                             ++field_idx;
                         count = field_idx;
@@ -2553,24 +2554,24 @@ ClangASTType::GetNumFields () const
             break;
             
         case clang::Type::Typedef:
-            count = ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumFields();
+            count = ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumFields();
             break;
             
         case clang::Type::Elaborated:
-            count = ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetNumFields();
+            count = ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetNumFields();
             break;
             
         case clang::Type::Paren:
-            count = ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).GetNumFields();
+            count = ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetNumFields();
             break;
             
         case clang::Type::ObjCObjectPointer:
             if (GetCompleteType())
             {
-                const ObjCObjectPointerType *objc_class_type = qual_type->getAsObjCInterfacePointerType();
+                const clang::ObjCObjectPointerType *objc_class_type = qual_type->getAsObjCInterfacePointerType();
                 if (objc_class_type)
                 {
-                    ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterfaceDecl();
+                    clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterfaceDecl();
                     
                     if (class_interface_decl)
                         count = class_interface_decl->ivar_size();
@@ -2582,10 +2583,10 @@ ClangASTType::GetNumFields () const
         case clang::Type::ObjCInterface:
             if (GetCompleteType())
             {
-                const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type.getTypePtr());
+                const clang::ObjCObjectType *objc_class_type =  llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr());
                 if (objc_class_type)
                 {
-                    ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+                    clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
                     
                     if (class_interface_decl)
                         count = class_interface_decl->ivar_size();
@@ -2605,18 +2606,18 @@ ClangASTType::GetDirectBaseClassAtIndex
     if (!IsValid())
         return ClangASTType();
     
-    QualType qual_type(GetCanonicalQualType());
+    clang::QualType qual_type(GetCanonicalQualType());
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
     {
         case clang::Type::Record:
             if (GetCompleteType())
             {
-                const CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+                const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
                 if (cxx_record_decl)
                 {
                     uint32_t curr_idx = 0;
-                    CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
+                    clang::CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
                     for (base_class = cxx_record_decl->bases_begin(), base_class_end = cxx_record_decl->bases_end();
                          base_class != base_class_end;
                          ++base_class, ++curr_idx)
@@ -2625,8 +2626,8 @@ ClangASTType::GetDirectBaseClassAtIndex
                         {
                             if (bit_offset_ptr)
                             {
-                                const ASTRecordLayout &record_layout = m_ast->getASTRecordLayout(cxx_record_decl);
-                                const CXXRecordDecl *base_class_decl = cast<CXXRecordDecl>(base_class->getType()->getAs<RecordType>()->getDecl());
+                                const clang::ASTRecordLayout &record_layout = m_ast->getASTRecordLayout(cxx_record_decl);
+                                const clang::CXXRecordDecl *base_class_decl = llvm::cast<clang::CXXRecordDecl>(base_class->getType()->getAs<clang::RecordType>()->getDecl());
                                 if (base_class->isVirtual())
                                     *bit_offset_ptr = record_layout.getVBaseClassOffset(base_class_decl).getQuantity() * 8;
                                 else
@@ -2645,14 +2646,14 @@ ClangASTType::GetDirectBaseClassAtIndex
         case clang::Type::ObjCObject:
             if (idx == 0 && GetCompleteType())
             {
-                const ObjCObjectType *objc_class_type = qual_type->getAsObjCQualifiedInterfaceType();
+                const clang::ObjCObjectType *objc_class_type = qual_type->getAsObjCQualifiedInterfaceType();
                 if (objc_class_type)
                 {
-                    ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+                    clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
                     
                     if (class_interface_decl)
                     {
-                        ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
+                        clang::ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
                         if (superclass_interface_decl)
                         {
                             if (bit_offset_ptr)
@@ -2666,14 +2667,14 @@ ClangASTType::GetDirectBaseClassAtIndex
         case clang::Type::ObjCInterface:
             if (idx == 0 && GetCompleteType())
             {
-                const ObjCObjectType *objc_interface_type = qual_type->getAs<ObjCInterfaceType>();
+                const clang::ObjCObjectType *objc_interface_type = qual_type->getAs<clang::ObjCInterfaceType>();
                 if (objc_interface_type)
                 {
-                    ObjCInterfaceDecl *class_interface_decl = objc_interface_type->getInterface();
+                    clang::ObjCInterfaceDecl *class_interface_decl = objc_interface_type->getInterface();
                     
                     if (class_interface_decl)
                     {
-                        ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
+                        clang::ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
                         if (superclass_interface_decl)
                         {
                             if (bit_offset_ptr)
@@ -2687,13 +2688,13 @@ ClangASTType::GetDirectBaseClassAtIndex
             
             
         case clang::Type::Typedef:
-            return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetDirectBaseClassAtIndex (idx, bit_offset_ptr);
+            return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetDirectBaseClassAtIndex (idx, bit_offset_ptr);
             
         case clang::Type::Elaborated:
-            return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetDirectBaseClassAtIndex (idx, bit_offset_ptr);
+            return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetDirectBaseClassAtIndex (idx, bit_offset_ptr);
             
         case clang::Type::Paren:
-            return ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).GetDirectBaseClassAtIndex (idx, bit_offset_ptr);
+            return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetDirectBaseClassAtIndex (idx, bit_offset_ptr);
             
         default:
             break;
@@ -2707,18 +2708,18 @@ ClangASTType::GetVirtualBaseClassAtIndex
     if (!IsValid())
         return ClangASTType();
     
-    QualType qual_type(GetCanonicalQualType());
+    clang::QualType qual_type(GetCanonicalQualType());
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
     {
         case clang::Type::Record:
             if (GetCompleteType())
             {
-                const CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+                const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
                 if (cxx_record_decl)
                 {
                     uint32_t curr_idx = 0;
-                    CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
+                    clang::CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
                     for (base_class = cxx_record_decl->vbases_begin(), base_class_end = cxx_record_decl->vbases_end();
                          base_class != base_class_end;
                          ++base_class, ++curr_idx)
@@ -2727,8 +2728,8 @@ ClangASTType::GetVirtualBaseClassAtIndex
                         {
                             if (bit_offset_ptr)
                             {
-                                const ASTRecordLayout &record_layout = m_ast->getASTRecordLayout(cxx_record_decl);
-                                const CXXRecordDecl *base_class_decl = cast<CXXRecordDecl>(base_class->getType()->getAs<RecordType>()->getDecl());
+                                const clang::ASTRecordLayout &record_layout = m_ast->getASTRecordLayout(cxx_record_decl);
+                                const clang::CXXRecordDecl *base_class_decl = llvm::cast<clang::CXXRecordDecl>(base_class->getType()->getAs<clang::RecordType>()->getDecl());
                                 *bit_offset_ptr = record_layout.getVBaseClassOffset(base_class_decl).getQuantity() * 8;
                                 
                             }
@@ -2740,13 +2741,13 @@ ClangASTType::GetVirtualBaseClassAtIndex
             break;
             
         case clang::Type::Typedef:
-            return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetVirtualBaseClassAtIndex (idx, bit_offset_ptr);
+            return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetVirtualBaseClassAtIndex (idx, bit_offset_ptr);
             
         case clang::Type::Elaborated:
-            return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetVirtualBaseClassAtIndex (idx, bit_offset_ptr);
+            return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetVirtualBaseClassAtIndex (idx, bit_offset_ptr);
             
         case clang::Type::Paren:
-            return  ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).GetVirtualBaseClassAtIndex (idx, bit_offset_ptr);
+            return  ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetVirtualBaseClassAtIndex (idx, bit_offset_ptr);
             
         default:
             break;
@@ -2756,7 +2757,7 @@ ClangASTType::GetVirtualBaseClassAtIndex
 
 static clang_type_t
 GetObjCFieldAtIndex (clang::ASTContext *ast,
-                     ObjCInterfaceDecl *class_interface_decl,
+                     clang::ObjCInterfaceDecl *class_interface_decl,
                      size_t idx,
                      std::string& name,
                      uint64_t *bit_offset_ptr,
@@ -2767,22 +2768,22 @@ GetObjCFieldAtIndex (clang::ASTContext *
     {
         if (idx < (class_interface_decl->ivar_size()))
         {
-            ObjCInterfaceDecl::ivar_iterator ivar_pos, ivar_end = class_interface_decl->ivar_end();
+            clang::ObjCInterfaceDecl::ivar_iterator ivar_pos, ivar_end = class_interface_decl->ivar_end();
             uint32_t ivar_idx = 0;
             
             for (ivar_pos = class_interface_decl->ivar_begin(); ivar_pos != ivar_end; ++ivar_pos, ++ivar_idx)
             {
                 if (ivar_idx == idx)
                 {
-                    const ObjCIvarDecl* ivar_decl = *ivar_pos;
+                    const clang::ObjCIvarDecl* ivar_decl = *ivar_pos;
                     
-                    QualType ivar_qual_type(ivar_decl->getType());
+                    clang::QualType ivar_qual_type(ivar_decl->getType());
                     
                     name.assign(ivar_decl->getNameAsString());
                     
                     if (bit_offset_ptr)
                     {
-                        const ASTRecordLayout &interface_layout = ast->getASTObjCInterfaceLayout(class_interface_decl);
+                        const clang::ASTRecordLayout &interface_layout = ast->getASTObjCInterfaceLayout(class_interface_decl);
                         *bit_offset_ptr = interface_layout.getFieldOffset (ivar_idx);
                     }
                     
@@ -2794,7 +2795,7 @@ GetObjCFieldAtIndex (clang::ASTContext *
                         
                         if (is_bitfield && ast)
                         {
-                            Expr *bitfield_bit_size_expr = ivar_pos->getBitWidth();
+                            clang::Expr *bitfield_bit_size_expr = ivar_pos->getBitWidth();
                             llvm::APSInt bitfield_apsint;
                             if (bitfield_bit_size_expr && bitfield_bit_size_expr->EvaluateAsInt(bitfield_apsint, *ast))
                             {
@@ -2823,17 +2824,17 @@ ClangASTType::GetFieldAtIndex (size_t id
     if (!IsValid())
         return ClangASTType();
     
-    QualType qual_type(GetCanonicalQualType());
+    clang::QualType qual_type(GetCanonicalQualType());
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
     {
         case clang::Type::Record:
             if (GetCompleteType())
             {
-                const RecordType *record_type = cast<RecordType>(qual_type.getTypePtr());
-                const RecordDecl *record_decl = record_type->getDecl();
+                const clang::RecordType *record_type = llvm::cast<clang::RecordType>(qual_type.getTypePtr());
+                const clang::RecordDecl *record_decl = record_type->getDecl();
                 uint32_t field_idx = 0;
-                RecordDecl::field_iterator field, field_end;
+                clang::RecordDecl::field_iterator field, field_end;
                 for (field = record_decl->field_begin(), field_end = record_decl->field_end(); field != field_end; ++field, ++field_idx)
                 {
                     if (idx == field_idx)
@@ -2846,7 +2847,7 @@ ClangASTType::GetFieldAtIndex (size_t id
                         // alignment (field_type_info.second) from the AST context.
                         if (bit_offset_ptr)
                         {
-                            const ASTRecordLayout &record_layout = m_ast->getASTRecordLayout(record_decl);
+                            const clang::ASTRecordLayout &record_layout = m_ast->getASTRecordLayout(record_decl);
                             *bit_offset_ptr = record_layout.getFieldOffset (field_idx);
                         }
                         
@@ -2858,7 +2859,7 @@ ClangASTType::GetFieldAtIndex (size_t id
                             
                             if (is_bitfield)
                             {
-                                Expr *bitfield_bit_size_expr = field->getBitWidth();
+                                clang::Expr *bitfield_bit_size_expr = field->getBitWidth();
                                 llvm::APSInt bitfield_apsint;
                                 if (bitfield_bit_size_expr && bitfield_bit_size_expr->EvaluateAsInt(bitfield_apsint, *m_ast))
                                 {
@@ -2878,10 +2879,10 @@ ClangASTType::GetFieldAtIndex (size_t id
         case clang::Type::ObjCObjectPointer:
             if (GetCompleteType())
             {
-                const ObjCObjectPointerType *objc_class_type = qual_type->getAsObjCInterfacePointerType();
+                const clang::ObjCObjectPointerType *objc_class_type = qual_type->getAsObjCInterfacePointerType();
                 if (objc_class_type)
                 {
-                    ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterfaceDecl();
+                    clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterfaceDecl();
                     return ClangASTType (m_ast, GetObjCFieldAtIndex(m_ast, class_interface_decl, idx, name, bit_offset_ptr, bitfield_bit_size_ptr, is_bitfield_ptr));
                 }
             }
@@ -2891,11 +2892,11 @@ ClangASTType::GetFieldAtIndex (size_t id
         case clang::Type::ObjCInterface:
             if (GetCompleteType())
             {
-                const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type.getTypePtr());
+                const clang::ObjCObjectType *objc_class_type =  llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr());
                 assert (objc_class_type);
                 if (objc_class_type)
                 {
-                    ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+                    clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
                     return ClangASTType (m_ast, GetObjCFieldAtIndex(m_ast, class_interface_decl, idx, name, bit_offset_ptr, bitfield_bit_size_ptr, is_bitfield_ptr));
                 }
             }
@@ -2903,7 +2904,7 @@ ClangASTType::GetFieldAtIndex (size_t id
             
             
         case clang::Type::Typedef:
-            return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).
+            return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).
                         GetFieldAtIndex (idx,
                                          name,
                                          bit_offset_ptr,
@@ -2911,7 +2912,7 @@ ClangASTType::GetFieldAtIndex (size_t id
                                          is_bitfield_ptr);
             
         case clang::Type::Elaborated:
-            return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).
+            return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).
                         GetFieldAtIndex (idx,
                                          name,
                                          bit_offset_ptr,
@@ -2919,7 +2920,7 @@ ClangASTType::GetFieldAtIndex (size_t id
                                          is_bitfield_ptr);
             
         case clang::Type::Paren:
-            return ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).
+            return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).
                         GetFieldAtIndex (idx,
                                          name,
                                          bit_offset_ptr,
@@ -2965,12 +2966,12 @@ ClangASTType::GetNumPointeeChildren () c
     if (!IsValid())
         return 0;
     
-    QualType qual_type(GetCanonicalQualType());
+    clang::QualType qual_type(GetCanonicalQualType());
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
     {
         case clang::Type::Builtin:
-            switch (cast<clang::BuiltinType>(qual_type)->getKind())
+            switch (llvm::cast<clang::BuiltinType>(qual_type)->getKind())
         {
             case clang::BuiltinType::UnknownAny:
             case clang::BuiltinType::Void:
@@ -3036,9 +3037,9 @@ ClangASTType::GetNumPointeeChildren () c
         case clang::Type::FunctionProto:            return 0;   // When we function pointers, they have no children...
         case clang::Type::FunctionNoProto:          return 0;   // When we function pointers, they have no children...
         case clang::Type::UnresolvedUsing:          return 0;
-        case clang::Type::Paren:                    return ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).GetNumPointeeChildren ();
-        case clang::Type::Typedef:                  return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumPointeeChildren ();
-        case clang::Type::Elaborated:               return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetNumPointeeChildren ();
+        case clang::Type::Paren:                    return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetNumPointeeChildren ();
+        case clang::Type::Typedef:                  return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumPointeeChildren ();
+        case clang::Type::Elaborated:               return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetNumPointeeChildren ();
         case clang::Type::TypeOfExpr:               return 0;
         case clang::Type::TypeOf:                   return 0;
         case clang::Type::Decltype:                 return 0;
@@ -3078,7 +3079,7 @@ ClangASTType::GetChildClangTypeAtIndex (
     if (!IsValid())
         return ClangASTType();
     
-    QualType parent_qual_type(GetCanonicalQualType());
+    clang::QualType parent_qual_type(GetCanonicalQualType());
     const clang::Type::TypeClass parent_type_class = parent_qual_type->getTypeClass();
     child_bitfield_bit_size = 0;
     child_bitfield_bit_offset = 0;
@@ -3091,7 +3092,7 @@ ClangASTType::GetChildClangTypeAtIndex (
         case clang::Type::Builtin:
             if (idx_is_valid)
             {
-                switch (cast<clang::BuiltinType>(parent_qual_type)->getKind())
+                switch (llvm::cast<clang::BuiltinType>(parent_qual_type)->getKind())
                 {
                     case clang::BuiltinType::ObjCId:
                     case clang::BuiltinType::ObjCClass:
@@ -3108,27 +3109,27 @@ ClangASTType::GetChildClangTypeAtIndex (
         case clang::Type::Record:
             if (idx_is_valid && GetCompleteType())
             {
-                const RecordType *record_type = cast<RecordType>(parent_qual_type.getTypePtr());
-                const RecordDecl *record_decl = record_type->getDecl();
+                const clang::RecordType *record_type = llvm::cast<clang::RecordType>(parent_qual_type.getTypePtr());
+                const clang::RecordDecl *record_decl = record_type->getDecl();
                 assert(record_decl);
-                const ASTRecordLayout &record_layout = m_ast->getASTRecordLayout(record_decl);
+                const clang::ASTRecordLayout &record_layout = m_ast->getASTRecordLayout(record_decl);
                 uint32_t child_idx = 0;
                 
-                const CXXRecordDecl *cxx_record_decl = dyn_cast<CXXRecordDecl>(record_decl);
+                const clang::CXXRecordDecl *cxx_record_decl =  llvm::dyn_cast<clang::CXXRecordDecl>(record_decl);
                 if (cxx_record_decl)
                 {
                     // We might have base classes to print out first
-                    CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
+                    clang::CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
                     for (base_class = cxx_record_decl->bases_begin(), base_class_end = cxx_record_decl->bases_end();
                          base_class != base_class_end;
                          ++base_class)
                     {
-                        const CXXRecordDecl *base_class_decl = nullptr;
+                        const clang::CXXRecordDecl *base_class_decl = nullptr;
                         
                         // Skip empty base classes
                         if (omit_empty_base_classes)
                         {
-                            base_class_decl = cast<CXXRecordDecl>(base_class->getType()->getAs<RecordType>()->getDecl());
+                            base_class_decl = llvm::cast<clang::CXXRecordDecl>(base_class->getType()->getAs<clang::RecordType>()->getDecl());
                             if (ClangASTContext::RecordHasFields(base_class_decl) == false)
                                 continue;
                         }
@@ -3136,7 +3137,7 @@ ClangASTType::GetChildClangTypeAtIndex (
                         if (idx == child_idx)
                         {
                             if (base_class_decl == nullptr)
-                                base_class_decl = cast<CXXRecordDecl>(base_class->getType()->getAs<RecordType>()->getDecl());
+                                base_class_decl = llvm::cast<clang::CXXRecordDecl>(base_class->getType()->getAs<clang::RecordType>()->getDecl());
                             
                             
                             if (base_class->isVirtual())
@@ -3163,7 +3164,7 @@ ClangASTType::GetChildClangTypeAtIndex (
                 }
                 // Make sure index is in range...
                 uint32_t field_idx = 0;
-                RecordDecl::field_iterator field, field_end;
+                clang::RecordDecl::field_iterator field, field_end;
                 for (field = record_decl->field_begin(), field_end = record_decl->field_end(); field != field_end; ++field, ++field_idx, ++child_idx)
                 {
                     if (idx == child_idx)
@@ -3194,18 +3195,18 @@ ClangASTType::GetChildClangTypeAtIndex (
         case clang::Type::ObjCInterface:
             if (idx_is_valid && GetCompleteType())
             {
-                const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(parent_qual_type.getTypePtr());
+                const clang::ObjCObjectType *objc_class_type =  llvm::dyn_cast<clang::ObjCObjectType>(parent_qual_type.getTypePtr());
                 assert (objc_class_type);
                 if (objc_class_type)
                 {
                     uint32_t child_idx = 0;
-                    ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+                    clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
                     
                     if (class_interface_decl)
                     {
                         
-                        const ASTRecordLayout &interface_layout = m_ast->getASTObjCInterfaceLayout(class_interface_decl);
-                        ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
+                        const clang::ASTRecordLayout &interface_layout = m_ast->getASTObjCInterfaceLayout(class_interface_decl);
+                        clang::ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
                         if (superclass_interface_decl)
                         {
                             if (omit_empty_base_classes)
@@ -3215,7 +3216,7 @@ ClangASTType::GetChildClangTypeAtIndex (
                                 {
                                     if (idx == 0)
                                     {
-                                        QualType ivar_qual_type(m_ast->getObjCInterfaceType(superclass_interface_decl));
+                                        clang::QualType ivar_qual_type(m_ast->getObjCInterfaceType(superclass_interface_decl));
                                         
                                         
                                         child_name.assign(superclass_interface_decl->getNameAsString().c_str());
@@ -3240,15 +3241,15 @@ ClangASTType::GetChildClangTypeAtIndex (
                         
                         if (idx < (child_idx + class_interface_decl->ivar_size()))
                         {
-                            ObjCInterfaceDecl::ivar_iterator ivar_pos, ivar_end = class_interface_decl->ivar_end();
+                            clang::ObjCInterfaceDecl::ivar_iterator ivar_pos, ivar_end = class_interface_decl->ivar_end();
                             
                             for (ivar_pos = class_interface_decl->ivar_begin(); ivar_pos != ivar_end; ++ivar_pos)
                             {
                                 if (child_idx == idx)
                                 {
-                                    ObjCIvarDecl* ivar_decl = *ivar_pos;
+                                    clang::ObjCIvarDecl* ivar_decl = *ivar_pos;
                                     
-                                    QualType ivar_qual_type(ivar_decl->getType());
+                                    clang::QualType ivar_qual_type(ivar_decl->getType());
                                     
                                     child_name.assign(ivar_decl->getNameAsString().c_str());
                                     
@@ -3352,7 +3353,7 @@ ClangASTType::GetChildClangTypeAtIndex (
         case clang::Type::ExtVector:
             if (idx_is_valid)
             {
-                const VectorType *array = cast<VectorType>(parent_qual_type.getTypePtr());
+                const clang::VectorType *array = llvm::cast<clang::VectorType>(parent_qual_type.getTypePtr());
                 if (array)
                 {
                     ClangASTType element_type (m_ast, array->getElementType());
@@ -3373,7 +3374,7 @@ ClangASTType::GetChildClangTypeAtIndex (
         case clang::Type::IncompleteArray:
             if (ignore_array_bounds || idx_is_valid)
             {
-                const ArrayType *array = cast<ArrayType>(parent_qual_type.getTypePtr());
+                const clang::ArrayType *array = llvm::cast<clang::ArrayType>(parent_qual_type.getTypePtr());
                 if (array)
                 {
                     ClangASTType element_type (m_ast, array->getElementType());
@@ -3443,7 +3444,7 @@ ClangASTType::GetChildClangTypeAtIndex (
         case clang::Type::RValueReference:
             if (idx_is_valid)
             {
-                const ReferenceType *reference_type = cast<ReferenceType>(parent_qual_type.getTypePtr());
+                const clang::ReferenceType *reference_type = llvm::cast<clang::ReferenceType>(parent_qual_type.getTypePtr());
                 ClangASTType pointee_clang_type (m_ast, reference_type->getPointeeType());
                 if (transparent_pointers && pointee_clang_type.IsAggregateType ())
                 {
@@ -3484,7 +3485,7 @@ ClangASTType::GetChildClangTypeAtIndex (
             
         case clang::Type::Typedef:
             {
-                ClangASTType typedefed_clang_type (m_ast, cast<TypedefType>(parent_qual_type)->getDecl()->getUnderlyingType());
+                ClangASTType typedefed_clang_type (m_ast, llvm::cast<clang::TypedefType>(parent_qual_type)->getDecl()->getUnderlyingType());
                 return typedefed_clang_type.GetChildClangTypeAtIndex (exe_ctx,
                                                                       parent_name,
                                                                       idx,
@@ -3503,7 +3504,7 @@ ClangASTType::GetChildClangTypeAtIndex (
             
         case clang::Type::Elaborated:
             {
-                ClangASTType elaborated_clang_type (m_ast, cast<ElaboratedType>(parent_qual_type)->getNamedType());
+                ClangASTType elaborated_clang_type (m_ast, llvm::cast<clang::ElaboratedType>(parent_qual_type)->getNamedType());
                 return elaborated_clang_type.GetChildClangTypeAtIndex (exe_ctx,
                                                                        parent_name,
                                                                        idx,
@@ -3545,7 +3546,7 @@ ClangASTType::GetChildClangTypeAtIndex (
 }
 
 static inline bool
-BaseSpecifierIsEmpty (const CXXBaseSpecifier *b)
+BaseSpecifierIsEmpty (const clang::CXXBaseSpecifier *b)
 {
     return ClangASTContext::RecordHasFields(b->getType()->getAsCXXRecordDecl()) == false;
 }
@@ -3553,22 +3554,22 @@ BaseSpecifierIsEmpty (const CXXBaseSpeci
 static uint32_t
 GetIndexForRecordBase
 (
- const RecordDecl *record_decl,
- const CXXBaseSpecifier *base_spec,
+ const clang::RecordDecl *record_decl,
+ const clang::CXXBaseSpecifier *base_spec,
  bool omit_empty_base_classes
  )
 {
     uint32_t child_idx = 0;
     
-    const CXXRecordDecl *cxx_record_decl = dyn_cast<CXXRecordDecl>(record_decl);
+    const clang::CXXRecordDecl *cxx_record_decl =  llvm::dyn_cast<clang::CXXRecordDecl>(record_decl);
     
     //    const char *super_name = record_decl->getNameAsCString();
-    //    const char *base_name = base_spec->getType()->getAs<RecordType>()->getDecl()->getNameAsCString();
+    //    const char *base_name = base_spec->getType()->getAs<clang::RecordType>()->getDecl()->getNameAsCString();
     //    printf ("GetIndexForRecordChild (%s, %s)\n", super_name, base_name);
     //
     if (cxx_record_decl)
     {
-        CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
+        clang::CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
         for (base_class = cxx_record_decl->bases_begin(), base_class_end = cxx_record_decl->bases_end();
              base_class != base_class_end;
              ++base_class)
@@ -3581,7 +3582,7 @@ GetIndexForRecordBase
             
             //            printf ("GetIndexForRecordChild (%s, %s) base[%u] = %s\n", super_name, base_name,
             //                    child_idx,
-            //                    base_class->getType()->getAs<RecordType>()->getDecl()->getNameAsCString());
+            //                    base_class->getType()->getAs<clang::RecordType>()->getDecl()->getNameAsCString());
             //
             //
             if (base_class == base_spec)
@@ -3595,14 +3596,14 @@ GetIndexForRecordBase
 
 
 static uint32_t
-GetIndexForRecordChild (const RecordDecl *record_decl,
-                        NamedDecl *canonical_decl,
+GetIndexForRecordChild (const clang::RecordDecl *record_decl,
+                        clang::NamedDecl *canonical_decl,
                         bool omit_empty_base_classes)
 {
-    uint32_t child_idx = ClangASTContext::GetNumBaseClasses (dyn_cast<CXXRecordDecl>(record_decl),
+    uint32_t child_idx = ClangASTContext::GetNumBaseClasses (llvm::dyn_cast<clang::CXXRecordDecl>(record_decl),
                                                              omit_empty_base_classes);
     
-    RecordDecl::field_iterator field, field_end;
+    clang::RecordDecl::field_iterator field, field_end;
     for (field = record_decl->field_begin(), field_end = record_decl->field_end();
          field != field_end;
          ++field, ++child_idx)
@@ -3655,24 +3656,24 @@ ClangASTType::GetIndexOfChildMemberWithN
 {
     if (IsValid() && name && name[0])
     {
-        QualType qual_type(GetCanonicalQualType());
+        clang::QualType qual_type(GetCanonicalQualType());
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         switch (type_class)
         {
             case clang::Type::Record:
                 if (GetCompleteType ())
                 {
-                    const RecordType *record_type = cast<RecordType>(qual_type.getTypePtr());
-                    const RecordDecl *record_decl = record_type->getDecl();
+                    const clang::RecordType *record_type = llvm::cast<clang::RecordType>(qual_type.getTypePtr());
+                    const clang::RecordDecl *record_decl = record_type->getDecl();
                     
                     assert(record_decl);
                     uint32_t child_idx = 0;
                     
-                    const CXXRecordDecl *cxx_record_decl = dyn_cast<CXXRecordDecl>(record_decl);
+                    const clang::CXXRecordDecl *cxx_record_decl =  llvm::dyn_cast<clang::CXXRecordDecl>(record_decl);
                     
                     // Try and find a field that matches NAME
-                    RecordDecl::field_iterator field, field_end;
-                    StringRef name_sref(name);
+                    clang::RecordDecl::field_iterator field, field_end;
+                    llvm::StringRef name_sref(name);
                     for (field = record_decl->field_begin(), field_end = record_decl->field_end();
                          field != field_end;
                          ++field, ++child_idx)
@@ -3697,27 +3698,27 @@ ClangASTType::GetIndexOfChildMemberWithN
                     
                     if (cxx_record_decl)
                     {
-                        const RecordDecl *parent_record_decl = cxx_record_decl;
+                        const clang::RecordDecl *parent_record_decl = cxx_record_decl;
                         
                         //printf ("parent = %s\n", parent_record_decl->getNameAsCString());
                         
                         //const Decl *root_cdecl = cxx_record_decl->getCanonicalDecl();
                         // Didn't find things easily, lets let clang do its thang...
-                        IdentifierInfo & ident_ref = m_ast->Idents.get(name_sref);
-                        DeclarationName decl_name(&ident_ref);
+                        clang::IdentifierInfo & ident_ref = m_ast->Idents.get(name_sref);
+                        clang::DeclarationName decl_name(&ident_ref);
                         
-                        CXXBasePaths paths;
-                        if (cxx_record_decl->lookupInBases(CXXRecordDecl::FindOrdinaryMember,
+                        clang::CXXBasePaths paths;
+                        if (cxx_record_decl->lookupInBases(clang::CXXRecordDecl::FindOrdinaryMember,
                                                            decl_name.getAsOpaquePtr(),
                                                            paths))
                         {
-                            CXXBasePaths::const_paths_iterator path, path_end = paths.end();
+                            clang::CXXBasePaths::const_paths_iterator path, path_end = paths.end();
                             for (path = paths.begin(); path != path_end; ++path)
                             {
                                 const size_t num_path_elements = path->size();
                                 for (size_t e=0; e<num_path_elements; ++e)
                                 {
-                                    CXXBasePathElement elem = (*path)[e];
+                                    clang::CXXBasePathElement elem = (*path)[e];
                                     
                                     child_idx = GetIndexForRecordBase (parent_record_decl, elem.Base, omit_empty_base_classes);
                                     if (child_idx == UINT32_MAX)
@@ -3728,10 +3729,10 @@ ClangASTType::GetIndexOfChildMemberWithN
                                     else
                                     {
                                         child_indexes.push_back (child_idx);
-                                        parent_record_decl = cast<RecordDecl>(elem.Base->getType()->getAs<RecordType>()->getDecl());
+                                        parent_record_decl = llvm::cast<clang::RecordDecl>(elem.Base->getType()->getAs<clang::RecordType>()->getDecl());
                                     }
                                 }
-                                for (NamedDecl *path_decl : path->Decls)
+                                for (clang::NamedDecl *path_decl : path->Decls)
                                 {
                                     child_idx = GetIndexForRecordChild (parent_record_decl, path_decl, omit_empty_base_classes);
                                     if (child_idx == UINT32_MAX)
@@ -3756,22 +3757,22 @@ ClangASTType::GetIndexOfChildMemberWithN
             case clang::Type::ObjCInterface:
                 if (GetCompleteType ())
                 {
-                    StringRef name_sref(name);
-                    const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type.getTypePtr());
+                    llvm::StringRef name_sref(name);
+                    const clang::ObjCObjectType *objc_class_type =  llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr());
                     assert (objc_class_type);
                     if (objc_class_type)
                     {
                         uint32_t child_idx = 0;
-                        ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+                        clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
                         
                         if (class_interface_decl)
                         {
-                            ObjCInterfaceDecl::ivar_iterator ivar_pos, ivar_end = class_interface_decl->ivar_end();
-                            ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
+                            clang::ObjCInterfaceDecl::ivar_iterator ivar_pos, ivar_end = class_interface_decl->ivar_end();
+                            clang::ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
                             
                             for (ivar_pos = class_interface_decl->ivar_begin(); ivar_pos != ivar_end; ++ivar_pos, ++child_idx)
                             {
-                                const ObjCIvarDecl* ivar_decl = *ivar_pos;
+                                const clang::ObjCIvarDecl* ivar_decl = *ivar_pos;
                                 
                                 if (ivar_decl->getName().equals (name_sref))
                                 {
@@ -3813,7 +3814,7 @@ ClangASTType::GetIndexOfChildMemberWithN
                 
             case clang::Type::ObjCObjectPointer:
                 {
-                    ClangASTType objc_object_clang_type (m_ast, cast<ObjCObjectPointerType>(qual_type.getTypePtr())->getPointeeType());
+                    ClangASTType objc_object_clang_type (m_ast, llvm::cast<clang::ObjCObjectPointerType>(qual_type.getTypePtr())->getPointeeType());
                     return objc_object_clang_type.GetIndexOfChildMemberWithName (name,
                                                                                  omit_empty_base_classes,
                                                                                  child_indexes);
@@ -3823,7 +3824,7 @@ ClangASTType::GetIndexOfChildMemberWithN
                 
             case clang::Type::ConstantArray:
             {
-                //                const ConstantArrayType *array = cast<ConstantArrayType>(parent_qual_type.getTypePtr());
+                //                const clang::ConstantArrayType *array = llvm::cast<clang::ConstantArrayType>(parent_qual_type.getTypePtr());
                 //                const uint64_t element_count = array->getSize().getLimitedValue();
                 //
                 //                if (idx < element_count)
@@ -3844,8 +3845,8 @@ ClangASTType::GetIndexOfChildMemberWithN
                 
                 //        case clang::Type::MemberPointerType:
                 //            {
-                //                MemberPointerType *mem_ptr_type = cast<MemberPointerType>(qual_type.getTypePtr());
-                //                QualType pointee_type = mem_ptr_type->getPointeeType();
+                //                MemberPointerType *mem_ptr_type = llvm::cast<MemberPointerType>(qual_type.getTypePtr());
+                //                clang::QualType pointee_type = mem_ptr_type->getPointeeType();
                 //
                 //                if (ClangASTContext::IsAggregateType (pointee_type.getAsOpaquePtr()))
                 //                {
@@ -3859,8 +3860,8 @@ ClangASTType::GetIndexOfChildMemberWithN
             case clang::Type::LValueReference:
             case clang::Type::RValueReference:
                 {
-                    const ReferenceType *reference_type = cast<ReferenceType>(qual_type.getTypePtr());
-                    QualType pointee_type(reference_type->getPointeeType());
+                    const clang::ReferenceType *reference_type = llvm::cast<clang::ReferenceType>(qual_type.getTypePtr());
+                    clang::QualType pointee_type(reference_type->getPointeeType());
                     ClangASTType pointee_clang_type (m_ast, pointee_type);
                     
                     if (pointee_clang_type.IsAggregateType ())
@@ -3886,17 +3887,17 @@ ClangASTType::GetIndexOfChildMemberWithN
                 break;
                 
             case clang::Type::Typedef:
-                return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetIndexOfChildMemberWithName (name,
+                return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetIndexOfChildMemberWithName (name,
                                                                                                                                          omit_empty_base_classes,
                                                                                                                                          child_indexes);
                 
             case clang::Type::Elaborated:
-                return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetIndexOfChildMemberWithName (name,
+                return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetIndexOfChildMemberWithName (name,
                                                                                                                             omit_empty_base_classes,
                                                                                                                             child_indexes);
                 
             case clang::Type::Paren:
-                return ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).GetIndexOfChildMemberWithName (name,
+                return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetIndexOfChildMemberWithName (name,
                                                                                                                          omit_empty_base_classes,
                                                                                                                          child_indexes);
                 
@@ -3917,7 +3918,7 @@ ClangASTType::GetIndexOfChildWithName (c
 {
     if (IsValid() && name && name[0])
     {
-        QualType qual_type(GetCanonicalQualType());
+        clang::QualType qual_type(GetCanonicalQualType());
         
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         
@@ -3926,23 +3927,23 @@ ClangASTType::GetIndexOfChildWithName (c
             case clang::Type::Record:
                 if (GetCompleteType ())
                 {
-                    const RecordType *record_type = cast<RecordType>(qual_type.getTypePtr());
-                    const RecordDecl *record_decl = record_type->getDecl();
+                    const clang::RecordType *record_type = llvm::cast<clang::RecordType>(qual_type.getTypePtr());
+                    const clang::RecordDecl *record_decl = record_type->getDecl();
                     
                     assert(record_decl);
                     uint32_t child_idx = 0;
                     
-                    const CXXRecordDecl *cxx_record_decl = dyn_cast<CXXRecordDecl>(record_decl);
+                    const clang::CXXRecordDecl *cxx_record_decl =  llvm::dyn_cast<clang::CXXRecordDecl>(record_decl);
                     
                     if (cxx_record_decl)
                     {
-                        CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
+                        clang::CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
                         for (base_class = cxx_record_decl->bases_begin(), base_class_end = cxx_record_decl->bases_end();
                              base_class != base_class_end;
                              ++base_class)
                         {
                             // Skip empty base classes
-                            CXXRecordDecl *base_class_decl = cast<CXXRecordDecl>(base_class->getType()->getAs<RecordType>()->getDecl());
+                            clang::CXXRecordDecl *base_class_decl = llvm::cast<clang::CXXRecordDecl>(base_class->getType()->getAs<clang::RecordType>()->getDecl());
                             if (omit_empty_base_classes && ClangASTContext::RecordHasFields(base_class_decl) == false)
                                 continue;
                             
@@ -3955,8 +3956,8 @@ ClangASTType::GetIndexOfChildWithName (c
                     }
                     
                     // Try and find a field that matches NAME
-                    RecordDecl::field_iterator field, field_end;
-                    StringRef name_sref(name);
+                    clang::RecordDecl::field_iterator field, field_end;
+                    llvm::StringRef name_sref(name);
                     for (field = record_decl->field_begin(), field_end = record_decl->field_end();
                          field != field_end;
                          ++field, ++child_idx)
@@ -3972,22 +3973,22 @@ ClangASTType::GetIndexOfChildWithName (c
             case clang::Type::ObjCInterface:
                 if (GetCompleteType())
                 {
-                    StringRef name_sref(name);
-                    const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type.getTypePtr());
+                    llvm::StringRef name_sref(name);
+                    const clang::ObjCObjectType *objc_class_type =  llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr());
                     assert (objc_class_type);
                     if (objc_class_type)
                     {
                         uint32_t child_idx = 0;
-                        ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+                        clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
                         
                         if (class_interface_decl)
                         {
-                            ObjCInterfaceDecl::ivar_iterator ivar_pos, ivar_end = class_interface_decl->ivar_end();
-                            ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
+                            clang::ObjCInterfaceDecl::ivar_iterator ivar_pos, ivar_end = class_interface_decl->ivar_end();
+                            clang::ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
                             
                             for (ivar_pos = class_interface_decl->ivar_begin(); ivar_pos != ivar_end; ++ivar_pos, ++child_idx)
                             {
-                                const ObjCIvarDecl* ivar_decl = *ivar_pos;
+                                const clang::ObjCIvarDecl* ivar_decl = *ivar_pos;
                                 
                                 if (ivar_decl->getName().equals (name_sref))
                                 {
@@ -4011,14 +4012,14 @@ ClangASTType::GetIndexOfChildWithName (c
                 
             case clang::Type::ObjCObjectPointer:
                 {
-                    ClangASTType pointee_clang_type (m_ast, cast<ObjCObjectPointerType>(qual_type.getTypePtr())->getPointeeType());
+                    ClangASTType pointee_clang_type (m_ast, llvm::cast<clang::ObjCObjectPointerType>(qual_type.getTypePtr())->getPointeeType());
                     return pointee_clang_type.GetIndexOfChildWithName (name, omit_empty_base_classes);
                 }
                 break;
                 
             case clang::Type::ConstantArray:
             {
-                //                const ConstantArrayType *array = cast<ConstantArrayType>(parent_qual_type.getTypePtr());
+                //                const clang::ConstantArrayType *array = llvm::cast<clang::ConstantArrayType>(parent_qual_type.getTypePtr());
                 //                const uint64_t element_count = array->getSize().getLimitedValue();
                 //
                 //                if (idx < element_count)
@@ -4039,8 +4040,8 @@ ClangASTType::GetIndexOfChildWithName (c
                 
                 //        case clang::Type::MemberPointerType:
                 //            {
-                //                MemberPointerType *mem_ptr_type = cast<MemberPointerType>(qual_type.getTypePtr());
-                //                QualType pointee_type = mem_ptr_type->getPointeeType();
+                //                MemberPointerType *mem_ptr_type = llvm::cast<MemberPointerType>(qual_type.getTypePtr());
+                //                clang::QualType pointee_type = mem_ptr_type->getPointeeType();
                 //
                 //                if (ClangASTContext::IsAggregateType (pointee_type.getAsOpaquePtr()))
                 //                {
@@ -4054,7 +4055,7 @@ ClangASTType::GetIndexOfChildWithName (c
             case clang::Type::LValueReference:
             case clang::Type::RValueReference:
                 {
-                    const ReferenceType *reference_type = cast<ReferenceType>(qual_type.getTypePtr());
+                    const clang::ReferenceType *reference_type = llvm::cast<clang::ReferenceType>(qual_type.getTypePtr());
                     ClangASTType pointee_type (m_ast, reference_type->getPointeeType());
                     
                     if (pointee_type.IsAggregateType ())
@@ -4066,7 +4067,7 @@ ClangASTType::GetIndexOfChildWithName (c
                 
             case clang::Type::Pointer:
                 {
-                    const PointerType *pointer_type = cast<PointerType>(qual_type.getTypePtr());
+                    const clang::PointerType *pointer_type = llvm::cast<clang::PointerType>(qual_type.getTypePtr());
                     ClangASTType pointee_type (m_ast, pointer_type->getPointeeType());
                     
                     if (pointee_type.IsAggregateType ())
@@ -4095,13 +4096,13 @@ ClangASTType::GetIndexOfChildWithName (c
                 break;
                 
             case clang::Type::Elaborated:
-                return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetIndexOfChildWithName (name, omit_empty_base_classes);
+                return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetIndexOfChildWithName (name, omit_empty_base_classes);
                 
             case clang::Type::Paren:
-                return ClangASTType (m_ast, cast<clang::ParenType>(qual_type)->desugar()).GetIndexOfChildWithName (name, omit_empty_base_classes);
+                return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetIndexOfChildWithName (name, omit_empty_base_classes);
                 
             case clang::Type::Typedef:
-                return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetIndexOfChildWithName (name, omit_empty_base_classes);
+                return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetIndexOfChildWithName (name, omit_empty_base_classes);
                 
             default:
                 break;
@@ -4116,7 +4117,7 @@ ClangASTType::GetNumTemplateArguments ()
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
+        clang::QualType qual_type (GetCanonicalQualType());
         
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         switch (type_class)
@@ -4124,10 +4125,10 @@ ClangASTType::GetNumTemplateArguments ()
             case clang::Type::Record:
                 if (GetCompleteType ())
                 {
-                    const CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+                    const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
                     if (cxx_record_decl)
                     {
-                        const ClassTemplateSpecializationDecl *template_decl = dyn_cast<ClassTemplateSpecializationDecl>(cxx_record_decl);
+                        const clang::ClassTemplateSpecializationDecl *template_decl =  llvm::dyn_cast<clang::ClassTemplateSpecializationDecl>(cxx_record_decl);
                         if (template_decl)
                             return template_decl->getTemplateArgs().size();
                     }
@@ -4135,13 +4136,13 @@ ClangASTType::GetNumTemplateArguments ()
                 break;
                 
             case clang::Type::Typedef:
-                return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumTemplateArguments();
+                return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetNumTemplateArguments();
                 
             case clang::Type::Elaborated:
-                return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetNumTemplateArguments();
+                return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetNumTemplateArguments();
                 
             case clang::Type::Paren:
-                return ClangASTType (m_ast, cast<ParenType>(qual_type)->desugar()).GetNumTemplateArguments();
+                return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetNumTemplateArguments();
                 
             default:
                 break;
@@ -4155,7 +4156,7 @@ ClangASTType::GetTemplateArgument (size_
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
+        clang::QualType qual_type (GetCanonicalQualType());
         
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         switch (type_class)
@@ -4163,13 +4164,13 @@ ClangASTType::GetTemplateArgument (size_
             case clang::Type::Record:
                 if (GetCompleteType ())
                 {
-                    const CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+                    const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
                     if (cxx_record_decl)
                     {
-                        const ClassTemplateSpecializationDecl *template_decl = dyn_cast<ClassTemplateSpecializationDecl>(cxx_record_decl);
+                        const clang::ClassTemplateSpecializationDecl *template_decl =  llvm::dyn_cast<clang::ClassTemplateSpecializationDecl>(cxx_record_decl);
                         if (template_decl && arg_idx < template_decl->getTemplateArgs().size())
                         {
-                            const TemplateArgument &template_arg = template_decl->getTemplateArgs()[arg_idx];
+                            const clang::TemplateArgument &template_arg = template_decl->getTemplateArgs()[arg_idx];
                             switch (template_arg.getKind())
                             {
                                 case clang::TemplateArgument::Null:
@@ -4205,7 +4206,7 @@ ClangASTType::GetTemplateArgument (size_
                                     return ClangASTType();
                                     
                                 default:
-                                    assert (!"Unhandled TemplateArgument::ArgKind");
+                                    assert (!"Unhandled clang::TemplateArgument::ArgKind");
                                     break;
                             }
                         }
@@ -4214,13 +4215,13 @@ ClangASTType::GetTemplateArgument (size_
                 break;
                 
             case clang::Type::Typedef:
-                return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetTemplateArgument (arg_idx, kind);
+                return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetTemplateArgument (arg_idx, kind);
                 
             case clang::Type::Elaborated:
-                return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetTemplateArgument (arg_idx, kind);
+                return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetTemplateArgument (arg_idx, kind);
                 
             case clang::Type::Paren:
-                return ClangASTType (m_ast, cast<ParenType>(qual_type)->desugar()).GetTemplateArgument (arg_idx, kind);
+                return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetTemplateArgument (arg_idx, kind);
                 
             default:
                 break;
@@ -4231,7 +4232,7 @@ ClangASTType::GetTemplateArgument (size_
 }
 
 static bool
-IsOperator (const char *name, OverloadedOperatorKind &op_kind)
+IsOperator (const char *name, clang::OverloadedOperatorKind &op_kind)
 {
     if (name == nullptr || name[0] == '\0')
         return false;
@@ -4259,7 +4260,7 @@ IsOperator (const char *name, Overloaded
     
     // This is an operator, set the overloaded operator kind to invalid
     // in case this is a conversion operator...
-    op_kind = NUM_OVERLOADED_OPERATORS;
+    op_kind = clang::NUM_OVERLOADED_OPERATORS;
     
     switch (post_op_name[0])
     {
@@ -4271,175 +4272,175 @@ IsOperator (const char *name, Overloaded
             if (no_space)
                 return false;
             if  (strcmp (post_op_name, "new") == 0)
-                op_kind = OO_New;
+                op_kind = clang::OO_New;
             else if (strcmp (post_op_name, "new[]") == 0)
-                op_kind = OO_Array_New;
+                op_kind = clang::OO_Array_New;
             break;
             
         case 'd':
             if (no_space)
                 return false;
             if (strcmp (post_op_name, "delete") == 0)
-                op_kind = OO_Delete;
+                op_kind = clang::OO_Delete;
             else if (strcmp (post_op_name, "delete[]") == 0)
-                op_kind = OO_Array_Delete;
+                op_kind = clang::OO_Array_Delete;
             break;
             
         case '+':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Plus;
+                op_kind = clang::OO_Plus;
             else if (post_op_name[2] == '\0')
             {
                 if (post_op_name[1] == '=')
-                    op_kind = OO_PlusEqual;
+                    op_kind = clang::OO_PlusEqual;
                 else if (post_op_name[1] == '+')
-                    op_kind = OO_PlusPlus;
+                    op_kind = clang::OO_PlusPlus;
             }
             break;
             
         case '-':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Minus;
+                op_kind = clang::OO_Minus;
             else if (post_op_name[2] == '\0')
             {
                 switch (post_op_name[1])
                 {
-                    case '=': op_kind = OO_MinusEqual; break;
-                    case '-': op_kind = OO_MinusMinus; break;
-                    case '>': op_kind = OO_Arrow; break;
+                    case '=': op_kind = clang::OO_MinusEqual; break;
+                    case '-': op_kind = clang::OO_MinusMinus; break;
+                    case '>': op_kind = clang::OO_Arrow; break;
                 }
             }
             else if (post_op_name[3] == '\0')
             {
                 if (post_op_name[2] == '*')
-                    op_kind = OO_ArrowStar; break;
+                    op_kind = clang::OO_ArrowStar; break;
             }
             break;
             
         case '*':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Star;
+                op_kind = clang::OO_Star;
             else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-                op_kind = OO_StarEqual;
+                op_kind = clang::OO_StarEqual;
             break;
             
         case '/':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Slash;
+                op_kind = clang::OO_Slash;
             else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-                op_kind = OO_SlashEqual;
+                op_kind = clang::OO_SlashEqual;
             break;
             
         case '%':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Percent;
+                op_kind = clang::OO_Percent;
             else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-                op_kind = OO_PercentEqual;
+                op_kind = clang::OO_PercentEqual;
             break;
             
             
         case '^':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Caret;
+                op_kind = clang::OO_Caret;
             else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-                op_kind = OO_CaretEqual;
+                op_kind = clang::OO_CaretEqual;
             break;
             
         case '&':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Amp;
+                op_kind = clang::OO_Amp;
             else if (post_op_name[2] == '\0')
             {
                 switch (post_op_name[1])
                 {
-                    case '=': op_kind = OO_AmpEqual; break;
-                    case '&': op_kind = OO_AmpAmp; break;
+                    case '=': op_kind = clang::OO_AmpEqual; break;
+                    case '&': op_kind = clang::OO_AmpAmp; break;
                 }
             }
             break;
             
         case '|':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Pipe;
+                op_kind = clang::OO_Pipe;
             else if (post_op_name[2] == '\0')
             {
                 switch (post_op_name[1])
                 {
-                    case '=': op_kind = OO_PipeEqual; break;
-                    case '|': op_kind = OO_PipePipe; break;
+                    case '=': op_kind = clang::OO_PipeEqual; break;
+                    case '|': op_kind = clang::OO_PipePipe; break;
                 }
             }
             break;
             
         case '~':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Tilde;
+                op_kind = clang::OO_Tilde;
             break;
             
         case '!':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Exclaim;
+                op_kind = clang::OO_Exclaim;
             else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-                op_kind = OO_ExclaimEqual;
+                op_kind = clang::OO_ExclaimEqual;
             break;
             
         case '=':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Equal;
+                op_kind = clang::OO_Equal;
             else if (post_op_name[1] == '=' && post_op_name[2] == '\0')
-                op_kind = OO_EqualEqual;
+                op_kind = clang::OO_EqualEqual;
             break;
             
         case '<':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Less;
+                op_kind = clang::OO_Less;
             else if (post_op_name[2] == '\0')
             {
                 switch (post_op_name[1])
                 {
-                    case '<': op_kind = OO_LessLess; break;
-                    case '=': op_kind = OO_LessEqual; break;
+                    case '<': op_kind = clang::OO_LessLess; break;
+                    case '=': op_kind = clang::OO_LessEqual; break;
                 }
             }
             else if (post_op_name[3] == '\0')
             {
                 if (post_op_name[2] == '=')
-                    op_kind = OO_LessLessEqual;
+                    op_kind = clang::OO_LessLessEqual;
             }
             break;
             
         case '>':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Greater;
+                op_kind = clang::OO_Greater;
             else if (post_op_name[2] == '\0')
             {
                 switch (post_op_name[1])
                 {
-                    case '>': op_kind = OO_GreaterGreater; break;
-                    case '=': op_kind = OO_GreaterEqual; break;
+                    case '>': op_kind = clang::OO_GreaterGreater; break;
+                    case '=': op_kind = clang::OO_GreaterEqual; break;
                 }
             }
             else if (post_op_name[1] == '>' &&
                      post_op_name[2] == '=' &&
                      post_op_name[3] == '\0')
             {
-                op_kind = OO_GreaterGreaterEqual;
+                op_kind = clang::OO_GreaterGreaterEqual;
             }
             break;
             
         case ',':
             if (post_op_name[1] == '\0')
-                op_kind = OO_Comma;
+                op_kind = clang::OO_Comma;
             break;
             
         case '(':
             if (post_op_name[1] == ')' && post_op_name[2] == '\0')
-                op_kind = OO_Call;
+                op_kind = clang::OO_Call;
             break;
             
         case '[':
             if (post_op_name[1] == ']' && post_op_name[2] == '\0')
-                op_kind = OO_Subscript;
+                op_kind = clang::OO_Subscript;
             break;
     }
     
@@ -4449,7 +4450,7 @@ IsOperator (const char *name, Overloaded
 clang::RecordDecl *
 ClangASTType::GetAsRecordDecl () const
 {
-    const RecordType *record_type = dyn_cast<RecordType>(GetCanonicalQualType());
+    const clang::RecordType *record_type =  llvm::dyn_cast<clang::RecordType>(GetCanonicalQualType());
     if (record_type)
         return record_type->getDecl();
     return nullptr;
@@ -4461,10 +4462,10 @@ ClangASTType::GetAsCXXRecordDecl () cons
     return GetCanonicalQualType()->getAsCXXRecordDecl();
 }
 
-ObjCInterfaceDecl *
+clang::ObjCInterfaceDecl *
 ClangASTType::GetAsObjCInterfaceDecl () const
 {
-    const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(GetCanonicalQualType());
+    const clang::ObjCObjectType *objc_class_type =  llvm::dyn_cast<clang::ObjCObjectType>(GetCanonicalQualType());
     if (objc_class_type)
         return objc_class_type->getInterface();
     return nullptr;
@@ -4479,35 +4480,35 @@ ClangASTType::AddFieldToRecordType (cons
     if (!IsValid() || !field_clang_type.IsValid())
         return nullptr;
     
-    FieldDecl *field = nullptr;
+    clang::FieldDecl *field = nullptr;
 
     clang::Expr *bit_width = nullptr;
     if (bitfield_bit_size != 0)
     {
-        APInt bitfield_bit_size_apint(m_ast->getTypeSize(m_ast->IntTy), bitfield_bit_size);
-        bit_width = new (*m_ast)IntegerLiteral (*m_ast, bitfield_bit_size_apint, m_ast->IntTy, SourceLocation());
+        llvm::APInt bitfield_bit_size_apint(m_ast->getTypeSize(m_ast->IntTy), bitfield_bit_size);
+        bit_width = new (*m_ast)clang::IntegerLiteral (*m_ast, bitfield_bit_size_apint, m_ast->IntTy, clang::SourceLocation());
     }
 
-    RecordDecl *record_decl = GetAsRecordDecl ();
+    clang::RecordDecl *record_decl = GetAsRecordDecl ();
     if (record_decl)
     {
-        field = FieldDecl::Create (*m_ast,
-                                   record_decl,
-                                   SourceLocation(),
-                                   SourceLocation(),
-                                   name ? &m_ast->Idents.get(name) : nullptr,  // Identifier
-                                   field_clang_type.GetQualType(),          // Field type
-                                   nullptr,            // TInfo *
-                                   bit_width,       // BitWidth
-                                   false,           // Mutable
-                                   ICIS_NoInit);    // HasInit
+        field = clang::FieldDecl::Create (*m_ast,
+                                          record_decl,
+                                          clang::SourceLocation(),
+                                          clang::SourceLocation(),
+                                          name ? &m_ast->Idents.get(name) : nullptr,  // Identifier
+                                          field_clang_type.GetQualType(),             // Field type
+                                          nullptr,                                    // TInfo *
+                                          bit_width,                                  // BitWidth
+                                          false,                                      // Mutable
+                                          clang::ICIS_NoInit);                        // HasInit
         
         if (!name)
         {
             // Determine whether this field corresponds to an anonymous
             // struct or union.
-            if (const TagType *TagT = field->getType()->getAs<TagType>()) {
-                if (RecordDecl *Rec = dyn_cast<RecordDecl>(TagT->getDecl()))
+            if (const clang::TagType *TagT = field->getType()->getAs<clang::TagType>()) {
+                if (clang::RecordDecl *Rec =  llvm::dyn_cast<clang::RecordDecl>(TagT->getDecl()))
                     if (!Rec->getDeclName()) {
                         Rec->setAnonymousStructOrUnion(true);
                         field->setImplicit();
@@ -4529,7 +4530,7 @@ ClangASTType::AddFieldToRecordType (cons
     }
     else
     {
-        ObjCInterfaceDecl *class_interface_decl = GetAsObjCInterfaceDecl ();
+        clang::ObjCInterfaceDecl *class_interface_decl = GetAsObjCInterfaceDecl ();
         
         if (class_interface_decl)
         {
@@ -4537,10 +4538,10 @@ ClangASTType::AddFieldToRecordType (cons
             
             field_clang_type.GetCompleteType();
 
-            field = ObjCIvarDecl::Create (*m_ast,
+            field = clang::ObjCIvarDecl::Create (*m_ast,
                                           class_interface_decl,
-                                          SourceLocation(),
-                                          SourceLocation(),
+                                          clang::SourceLocation(),
+                                          clang::SourceLocation(),
                                           name ? &m_ast->Idents.get(name) : nullptr,   // Identifier
                                           field_clang_type.GetQualType(),           // Field type
                                           nullptr,                                     // TypeSourceInfo *
@@ -4564,49 +4565,49 @@ ClangASTType::AddFieldToRecordType (cons
 void
 ClangASTType::BuildIndirectFields ()
 {
-    RecordDecl *record_decl = GetAsRecordDecl();
+    clang::RecordDecl *record_decl = GetAsRecordDecl();
     
     if (!record_decl)
         return;
     
-    typedef llvm::SmallVector <IndirectFieldDecl *, 1> IndirectFieldVector;
+    typedef llvm::SmallVector <clang::IndirectFieldDecl *, 1> IndirectFieldVector;
     
     IndirectFieldVector indirect_fields;
-    RecordDecl::field_iterator field_pos;
-    RecordDecl::field_iterator field_end_pos = record_decl->field_end();
-    RecordDecl::field_iterator last_field_pos = field_end_pos;
+    clang::RecordDecl::field_iterator field_pos;
+    clang::RecordDecl::field_iterator field_end_pos = record_decl->field_end();
+    clang::RecordDecl::field_iterator last_field_pos = field_end_pos;
     for (field_pos = record_decl->field_begin(); field_pos != field_end_pos; last_field_pos = field_pos++)
     {
         if (field_pos->isAnonymousStructOrUnion())
         {
-            QualType field_qual_type = field_pos->getType();
+            clang::QualType field_qual_type = field_pos->getType();
             
-            const RecordType *field_record_type = field_qual_type->getAs<RecordType>();
+            const clang::RecordType *field_record_type = field_qual_type->getAs<clang::RecordType>();
             
             if (!field_record_type)
                 continue;
             
-            RecordDecl *field_record_decl = field_record_type->getDecl();
+            clang::RecordDecl *field_record_decl = field_record_type->getDecl();
             
             if (!field_record_decl)
                 continue;
             
-            for (RecordDecl::decl_iterator di = field_record_decl->decls_begin(), de = field_record_decl->decls_end();
+            for (clang::RecordDecl::decl_iterator di = field_record_decl->decls_begin(), de = field_record_decl->decls_end();
                  di != de;
                  ++di)
             {
-                if (FieldDecl *nested_field_decl = dyn_cast<FieldDecl>(*di))
+                if (clang::FieldDecl *nested_field_decl =  llvm::dyn_cast<clang::FieldDecl>(*di))
                 {
-                    NamedDecl **chain = new (*m_ast) NamedDecl*[2];
+                    clang::NamedDecl **chain = new (*m_ast) clang::NamedDecl*[2];
                     chain[0] = *field_pos;
                     chain[1] = nested_field_decl;
-                    IndirectFieldDecl *indirect_field = IndirectFieldDecl::Create(*m_ast,
-                                                                                  record_decl,
-                                                                                  SourceLocation(),
-                                                                                  nested_field_decl->getIdentifier(),
-                                                                                  nested_field_decl->getType(),
-                                                                                  chain,
-                                                                                  2);
+                    clang::IndirectFieldDecl *indirect_field = clang::IndirectFieldDecl::Create(*m_ast,
+                                                                                                record_decl,
+                                                                                                clang::SourceLocation(),
+                                                                                                nested_field_decl->getIdentifier(),
+                                                                                                nested_field_decl->getType(),
+                                                                                                chain,
+                                                                                                2);
                     
                     indirect_field->setImplicit();
                     
@@ -4615,14 +4616,14 @@ ClangASTType::BuildIndirectFields ()
                     
                     indirect_fields.push_back(indirect_field);
                 }
-                else if (IndirectFieldDecl *nested_indirect_field_decl = dyn_cast<IndirectFieldDecl>(*di))
+                else if (clang::IndirectFieldDecl *nested_indirect_field_decl =  llvm::dyn_cast<clang::IndirectFieldDecl>(*di))
                 {
                     int nested_chain_size = nested_indirect_field_decl->getChainingSize();
-                    NamedDecl **chain = new (*m_ast) NamedDecl*[nested_chain_size + 1];
+                    clang::NamedDecl **chain = new (*m_ast) clang::NamedDecl*[nested_chain_size + 1];
                     chain[0] = *field_pos;
                     
                     int chain_index = 1;
-                    for (IndirectFieldDecl::chain_iterator nci = nested_indirect_field_decl->chain_begin(),
+                    for (clang::IndirectFieldDecl::chain_iterator nci = nested_indirect_field_decl->chain_begin(),
                          nce = nested_indirect_field_decl->chain_end();
                          nci < nce;
                          ++nci)
@@ -4631,13 +4632,13 @@ ClangASTType::BuildIndirectFields ()
                         chain_index++;
                     }
                     
-                    IndirectFieldDecl *indirect_field = IndirectFieldDecl::Create(*m_ast,
-                                                                                  record_decl,
-                                                                                  SourceLocation(),
-                                                                                  nested_indirect_field_decl->getIdentifier(),
-                                                                                  nested_indirect_field_decl->getType(),
-                                                                                  chain,
-                                                                                  nested_chain_size + 1);
+                    clang::IndirectFieldDecl *indirect_field = clang::IndirectFieldDecl::Create(*m_ast,
+                                                                                                record_decl,
+                                                                                                clang::SourceLocation(),
+                                                                                                nested_indirect_field_decl->getIdentifier(),
+                                                                                                nested_indirect_field_decl->getType(),
+                                                                                                chain,
+                                                                                                nested_chain_size + 1);
                     
                     indirect_field->setImplicit();
                     
@@ -4676,17 +4677,17 @@ ClangASTType::AddVariableToRecordType (c
     if (!IsValid() || !var_type.IsValid())
         return nullptr;
     
-    RecordDecl *record_decl = GetAsRecordDecl ();
+    clang::RecordDecl *record_decl = GetAsRecordDecl ();
     if (record_decl)
     {        
-        var_decl = VarDecl::Create (*m_ast,                                     // ASTContext &
-                                    record_decl,                                // DeclContext *
-                                    SourceLocation(),                           // SourceLocation StartLoc
-                                    SourceLocation(),                           // SourceLocation IdLoc
-                                    name ? &m_ast->Idents.get(name) : nullptr,     // IdentifierInfo *
-                                    var_type.GetQualType(),                     // Variable QualType
-                                    nullptr,                                       // TypeSourceInfo *
-                                    SC_Static);                                 // StorageClass
+        var_decl = clang::VarDecl::Create (*m_ast,                                     // ASTContext &
+                                           record_decl,                                // DeclContext *
+                                           clang::SourceLocation(),                    // clang::SourceLocation StartLoc
+                                           clang::SourceLocation(),                    // clang::SourceLocation IdLoc
+                                           name ? &m_ast->Idents.get(name) : nullptr,  // clang::IdentifierInfo *
+                                           var_type.GetQualType(),                     // Variable clang::QualType
+                                           nullptr,                                    // TypeSourceInfo *
+                                           clang::SC_Static);                          // StorageClass
         if (var_decl)
         {
             var_decl->setAccess(ClangASTContext::ConvertAccessTypeToAccessSpecifier (access));
@@ -4701,7 +4702,7 @@ ClangASTType::AddVariableToRecordType (c
 }
 
 
-CXXMethodDecl *
+clang::CXXMethodDecl *
 ClangASTType::AddMethodToCXXRecordType (const char *name,
                                         const ClangASTType &method_clang_type,
                                         lldb::AccessType access,
@@ -4715,71 +4716,71 @@ ClangASTType::AddMethodToCXXRecordType (
     if (!IsValid() || !method_clang_type.IsValid() || name == nullptr || name[0] == '\0')
         return nullptr;
     
-    QualType record_qual_type(GetCanonicalQualType());
+    clang::QualType record_qual_type(GetCanonicalQualType());
     
-    CXXRecordDecl *cxx_record_decl = record_qual_type->getAsCXXRecordDecl();
+    clang::CXXRecordDecl *cxx_record_decl = record_qual_type->getAsCXXRecordDecl();
     
     if (cxx_record_decl == nullptr)
         return nullptr;
     
-    QualType method_qual_type (method_clang_type.GetQualType());
+    clang::QualType method_qual_type (method_clang_type.GetQualType());
     
-    CXXMethodDecl *cxx_method_decl = nullptr;
+    clang::CXXMethodDecl *cxx_method_decl = nullptr;
     
-    DeclarationName decl_name (&m_ast->Idents.get(name));
+    clang::DeclarationName decl_name (&m_ast->Idents.get(name));
     
-    const clang::FunctionType *function_type = dyn_cast<FunctionType>(method_qual_type.getTypePtr());
+    const clang::FunctionType *function_type =  llvm::dyn_cast<clang::FunctionType>(method_qual_type.getTypePtr());
     
     if (function_type == nullptr)
         return nullptr;
     
-    const FunctionProtoType *method_function_prototype (dyn_cast<FunctionProtoType>(function_type));
+    const clang::FunctionProtoType *method_function_prototype (llvm::dyn_cast<clang::FunctionProtoType>(function_type));
     
     if (!method_function_prototype)
         return nullptr;
     
     unsigned int num_params = method_function_prototype->getNumParams();
     
-    CXXDestructorDecl *cxx_dtor_decl(nullptr);
-    CXXConstructorDecl *cxx_ctor_decl(nullptr);
+    clang::CXXDestructorDecl *cxx_dtor_decl(nullptr);
+    clang::CXXConstructorDecl *cxx_ctor_decl(nullptr);
     
     if (is_artificial)
         return nullptr; // skip everything artificial
     
     if (name[0] == '~')
     {
-        cxx_dtor_decl = CXXDestructorDecl::Create (*m_ast,
-                                                   cxx_record_decl,
-                                                   SourceLocation(),
-                                                   DeclarationNameInfo (m_ast->DeclarationNames.getCXXDestructorName (m_ast->getCanonicalType (record_qual_type)), SourceLocation()),
-                                                   method_qual_type,
-                                                   nullptr,
-                                                   is_inline,
-                                                   is_artificial);
+        cxx_dtor_decl = clang::CXXDestructorDecl::Create (*m_ast,
+                                                          cxx_record_decl,
+                                                          clang::SourceLocation(),
+                                                          clang::DeclarationNameInfo (m_ast->DeclarationNames.getCXXDestructorName (m_ast->getCanonicalType (record_qual_type)), clang::SourceLocation()),
+                                                          method_qual_type,
+                                                          nullptr,
+                                                          is_inline,
+                                                          is_artificial);
         cxx_method_decl = cxx_dtor_decl;
     }
     else if (decl_name == cxx_record_decl->getDeclName())
     {
-        cxx_ctor_decl = CXXConstructorDecl::Create (*m_ast,
-                                                    cxx_record_decl,
-                                                    SourceLocation(),
-                                                    DeclarationNameInfo (m_ast->DeclarationNames.getCXXConstructorName (m_ast->getCanonicalType (record_qual_type)), SourceLocation()),
-                                                    method_qual_type,
-                                                    nullptr, // TypeSourceInfo *
-                                                    is_explicit,
-                                                    is_inline,
-                                                    is_artificial,
-                                                    false /*is_constexpr*/);
+        cxx_ctor_decl = clang::CXXConstructorDecl::Create (*m_ast,
+                                                           cxx_record_decl,
+                                                           clang::SourceLocation(),
+                                                           clang::DeclarationNameInfo (m_ast->DeclarationNames.getCXXConstructorName (m_ast->getCanonicalType (record_qual_type)), clang::SourceLocation()),
+                                                           method_qual_type,
+                                                           nullptr, // TypeSourceInfo *
+                                                           is_explicit,
+                                                           is_inline,
+                                                           is_artificial,
+                                                           false /*is_constexpr*/);
         cxx_method_decl = cxx_ctor_decl;
     }
     else
     {
-        clang::StorageClass SC = is_static ? SC_Static : SC_None;
-        OverloadedOperatorKind op_kind = NUM_OVERLOADED_OPERATORS;
+        clang::StorageClass SC = is_static ? clang::SC_Static : clang::SC_None;
+        clang::OverloadedOperatorKind op_kind = clang::NUM_OVERLOADED_OPERATORS;
         
         if (IsOperator (name, op_kind))
         {
-            if (op_kind != NUM_OVERLOADED_OPERATORS)
+            if (op_kind != clang::NUM_OVERLOADED_OPERATORS)
             {
                 // Check the number of operator parameters. Sometimes we have
                 // seen bad DWARF that doesn't correctly describe operators and
@@ -4788,49 +4789,49 @@ ClangASTType::AddMethodToCXXRecordType (
                 // acceptable.
                 if (!ClangASTContext::CheckOverloadedOperatorKindParameterCount (op_kind, num_params))
                     return nullptr;
-                cxx_method_decl = CXXMethodDecl::Create (*m_ast,
-                                                         cxx_record_decl,
-                                                         SourceLocation(),
-                                                         DeclarationNameInfo (m_ast->DeclarationNames.getCXXOperatorName (op_kind), SourceLocation()),
-                                                         method_qual_type,
-                                                         nullptr, // TypeSourceInfo *
-                                                         SC,
-                                                         is_inline,
-                                                         false /*is_constexpr*/,
-                                                         SourceLocation());
+                cxx_method_decl = clang::CXXMethodDecl::Create (*m_ast,
+                                                                cxx_record_decl,
+                                                                clang::SourceLocation(),
+                                                                clang::DeclarationNameInfo (m_ast->DeclarationNames.getCXXOperatorName (op_kind), clang::SourceLocation()),
+                                                                method_qual_type,
+                                                                nullptr, // TypeSourceInfo *
+                                                                SC,
+                                                                is_inline,
+                                                                false /*is_constexpr*/,
+                                                                clang::SourceLocation());
             }
             else if (num_params == 0)
             {
                 // Conversion operators don't take params...
-                cxx_method_decl = CXXConversionDecl::Create (*m_ast,
-                                                             cxx_record_decl,
-                                                             SourceLocation(),
-                                                             DeclarationNameInfo (m_ast->DeclarationNames.getCXXConversionFunctionName (m_ast->getCanonicalType (function_type->getReturnType())), SourceLocation()),
-                                                             method_qual_type,
-                                                             nullptr, // TypeSourceInfo *
-                                                             is_inline,
-                                                             is_explicit,
-                                                             false /*is_constexpr*/,
-                                                             SourceLocation());
+                cxx_method_decl = clang::CXXConversionDecl::Create (*m_ast,
+                                                                    cxx_record_decl,
+                                                                    clang::SourceLocation(),
+                                                                    clang::DeclarationNameInfo (m_ast->DeclarationNames.getCXXConversionFunctionName (m_ast->getCanonicalType (function_type->getReturnType())), clang::SourceLocation()),
+                                                                    method_qual_type,
+                                                                    nullptr, // TypeSourceInfo *
+                                                                    is_inline,
+                                                                    is_explicit,
+                                                                    false /*is_constexpr*/,
+                                                                    clang::SourceLocation());
             }
         }
         
         if (cxx_method_decl == nullptr)
         {
-            cxx_method_decl = CXXMethodDecl::Create (*m_ast,
-                                                     cxx_record_decl,
-                                                     SourceLocation(),
-                                                     DeclarationNameInfo (decl_name, SourceLocation()),
-                                                     method_qual_type,
-                                                     nullptr, // TypeSourceInfo *
-                                                     SC,
-                                                     is_inline,
-                                                     false /*is_constexpr*/,
-                                                     SourceLocation());
+            cxx_method_decl = clang::CXXMethodDecl::Create (*m_ast,
+                                                            cxx_record_decl,
+                                                            clang::SourceLocation(),
+                                                            clang::DeclarationNameInfo (decl_name, clang::SourceLocation()),
+                                                            method_qual_type,
+                                                            nullptr, // TypeSourceInfo *
+                                                            SC,
+                                                            is_inline,
+                                                            false /*is_constexpr*/,
+                                                            clang::SourceLocation());
         }
     }
     
-    AccessSpecifier access_specifier = ClangASTContext::ConvertAccessTypeToAccessSpecifier (access);
+    clang::AccessSpecifier access_specifier = ClangASTContext::ConvertAccessTypeToAccessSpecifier (access);
     
     cxx_method_decl->setAccess (access_specifier);
     cxx_method_decl->setVirtualAsWritten (is_virtual);
@@ -4840,24 +4841,24 @@ ClangASTType::AddMethodToCXXRecordType (
     
     // Populate the method decl with parameter decls
     
-    llvm::SmallVector<ParmVarDecl *, 12> params;
+    llvm::SmallVector<clang::ParmVarDecl *, 12> params;
     
     for (unsigned param_index = 0;
          param_index < num_params;
          ++param_index)
     {
-        params.push_back (ParmVarDecl::Create (*m_ast,
-                                               cxx_method_decl,
-                                               SourceLocation(),
-                                               SourceLocation(),
-                                               nullptr, // anonymous
-                                               method_function_prototype->getParamType(param_index),
-                                               nullptr,
-                                               SC_None,
-                                               nullptr));
+        params.push_back (clang::ParmVarDecl::Create (*m_ast,
+                                                      cxx_method_decl,
+                                                      clang::SourceLocation(),
+                                                      clang::SourceLocation(),
+                                                      nullptr, // anonymous
+                                                      method_function_prototype->getParamType(param_index),
+                                                      nullptr,
+                                                      clang::SC_None,
+                                                      nullptr));
     }
     
-    cxx_method_decl->setParams (ArrayRef<ParmVarDecl*>(params));
+    cxx_method_decl->setParams (llvm::ArrayRef<clang::ParmVarDecl*>(params));
     
     cxx_record_decl->addDecl (cxx_method_decl);
     
@@ -4913,21 +4914,21 @@ ClangASTType::AddMethodToCXXRecordType (
 
 #pragma mark C++ Base Classes
 
-CXXBaseSpecifier *
+clang::CXXBaseSpecifier *
 ClangASTType::CreateBaseClassSpecifier (AccessType access, bool is_virtual, bool base_of_class)
 {
     if (IsValid())
-        return new CXXBaseSpecifier (SourceRange(),
-                                     is_virtual,
-                                     base_of_class,
-                                     ClangASTContext::ConvertAccessTypeToAccessSpecifier (access),
-                                     m_ast->getTrivialTypeSourceInfo (GetQualType()),
-                                     SourceLocation());
+        return new clang::CXXBaseSpecifier (clang::SourceRange(),
+                                            is_virtual,
+                                            base_of_class,
+                                            ClangASTContext::ConvertAccessTypeToAccessSpecifier (access),
+                                            m_ast->getTrivialTypeSourceInfo (GetQualType()),
+                                            clang::SourceLocation());
     return nullptr;
 }
 
 void
-ClangASTType::DeleteBaseClassSpecifiers (CXXBaseSpecifier **base_classes, unsigned num_base_classes)
+ClangASTType::DeleteBaseClassSpecifiers (clang::CXXBaseSpecifier **base_classes, unsigned num_base_classes)
 {
     for (unsigned i=0; i<num_base_classes; ++i)
     {
@@ -4937,12 +4938,12 @@ ClangASTType::DeleteBaseClassSpecifiers
 }
 
 bool
-ClangASTType::SetBaseClassesForClassType (CXXBaseSpecifier const * const *base_classes,
+ClangASTType::SetBaseClassesForClassType (clang::CXXBaseSpecifier const * const *base_classes,
                                           unsigned num_base_classes)
 {
     if (IsValid())
     {
-        CXXRecordDecl *cxx_record_decl = GetAsCXXRecordDecl();
+        clang::CXXRecordDecl *cxx_record_decl = GetAsCXXRecordDecl();
         if (cxx_record_decl)
         {
             cxx_record_decl->setBases(base_classes, num_base_classes);
@@ -4957,8 +4958,8 @@ ClangASTType::SetObjCSuperClass (const C
 {
     if (IsValid() && superclass_clang_type.IsValid())
     {
-        ObjCInterfaceDecl *class_interface_decl = GetAsObjCInterfaceDecl ();
-        ObjCInterfaceDecl *super_interface_decl = superclass_clang_type.GetAsObjCInterfaceDecl ();
+        clang::ObjCInterfaceDecl *class_interface_decl = GetAsObjCInterfaceDecl ();
+        clang::ObjCInterfaceDecl *super_interface_decl = superclass_clang_type.GetAsObjCInterfaceDecl ();
         if (class_interface_decl && super_interface_decl)
         {
             class_interface_decl->setSuperClass(super_interface_decl);
@@ -4971,7 +4972,7 @@ ClangASTType::SetObjCSuperClass (const C
 bool
 ClangASTType::AddObjCClassProperty (const char *property_name,
                                     const ClangASTType &property_clang_type,
-                                    ObjCIvarDecl *ivar_decl,
+                                    clang::ObjCIvarDecl *ivar_decl,
                                     const char *property_setter_name,
                                     const char *property_getter_name,
                                     uint32_t property_attributes,
@@ -4980,7 +4981,7 @@ ClangASTType::AddObjCClassProperty (cons
     if (!IsValid() || !property_clang_type.IsValid() || property_name == nullptr || property_name[0] == '\0')
         return false;
         
-    ObjCInterfaceDecl *class_interface_decl = GetAsObjCInterfaceDecl ();
+    clang::ObjCInterfaceDecl *class_interface_decl = GetAsObjCInterfaceDecl ();
     
     if (class_interface_decl)
     {
@@ -4999,13 +5000,13 @@ ClangASTType::AddObjCClassProperty (cons
             else
                 prop_type_source = m_ast->getTrivialTypeSourceInfo (property_clang_type.GetQualType());
             
-            ObjCPropertyDecl *property_decl = ObjCPropertyDecl::Create (*m_ast,
-                                                                        class_interface_decl,
-                                                                        SourceLocation(), // Source Location
-                                                                        &m_ast->Idents.get(property_name),
-                                                                        SourceLocation(), //Source Location for AT
-                                                                        SourceLocation(), //Source location for (
-                                                                        prop_type_source);
+            clang::ObjCPropertyDecl *property_decl = clang::ObjCPropertyDecl::Create (*m_ast,
+                                                                                      class_interface_decl,
+                                                                                      clang::SourceLocation(), // Source Location
+                                                                                      &m_ast->Idents.get(property_name),
+                                                                                      clang::SourceLocation(), //Source Location for AT
+                                                                                      clang::SourceLocation(), //Source location for (
+                                                                                      prop_type_source);
             
             if (property_decl)
             {
@@ -5014,7 +5015,7 @@ ClangASTType::AddObjCClassProperty (cons
                 
                 class_interface_decl->addDecl (property_decl);
                 
-                Selector setter_sel, getter_sel;
+                clang::Selector setter_sel, getter_sel;
                 
                 if (property_setter_name != nullptr)
                 {
@@ -5069,75 +5070,75 @@ ClangASTType::AddObjCClassProperty (cons
                     const bool isSynthesized = false;
                     const bool isImplicitlyDeclared = true;
                     const bool isDefined = false;
-                    const ObjCMethodDecl::ImplementationControl impControl = ObjCMethodDecl::None;
+                    const clang::ObjCMethodDecl::ImplementationControl impControl = clang::ObjCMethodDecl::None;
                     const bool HasRelatedResultType = false;
                     
-                    ObjCMethodDecl *getter = ObjCMethodDecl::Create (*m_ast,
-                                                                     SourceLocation(),
-                                                                     SourceLocation(),
-                                                                     getter_sel,
-                                                                     property_clang_type_to_access.GetQualType(),
-                                                                     nullptr,
-                                                                     class_interface_decl,
-                                                                     isInstance,
-                                                                     isVariadic,
-                                                                     isSynthesized,
-                                                                     isImplicitlyDeclared,
-                                                                     isDefined,
-                                                                     impControl,
-                                                                     HasRelatedResultType);
+                    clang::ObjCMethodDecl *getter = clang::ObjCMethodDecl::Create (*m_ast,
+                                                                                   clang::SourceLocation(),
+                                                                                   clang::SourceLocation(),
+                                                                                   getter_sel,
+                                                                                   property_clang_type_to_access.GetQualType(),
+                                                                                   nullptr,
+                                                                                   class_interface_decl,
+                                                                                   isInstance,
+                                                                                   isVariadic,
+                                                                                   isSynthesized,
+                                                                                   isImplicitlyDeclared,
+                                                                                   isDefined,
+                                                                                   impControl,
+                                                                                   HasRelatedResultType);
                     
                     if (getter && metadata)
                         ClangASTContext::SetMetadata(m_ast, getter, *metadata);
                     
-                    getter->setMethodParams(*m_ast, ArrayRef<ParmVarDecl*>(), ArrayRef<SourceLocation>());
+                    getter->setMethodParams(*m_ast, llvm::ArrayRef<clang::ParmVarDecl*>(), llvm::ArrayRef<clang::SourceLocation>());
                     
                     class_interface_decl->addDecl(getter);
                 }
                 
                 if (!setter_sel.isNull() && !class_interface_decl->lookupInstanceMethod(setter_sel))
                 {
-                    QualType result_type = m_ast->VoidTy;
+                    clang::QualType result_type = m_ast->VoidTy;
                     
                     const bool isInstance = true;
                     const bool isVariadic = false;
                     const bool isSynthesized = false;
                     const bool isImplicitlyDeclared = true;
                     const bool isDefined = false;
-                    const ObjCMethodDecl::ImplementationControl impControl = ObjCMethodDecl::None;
+                    const clang::ObjCMethodDecl::ImplementationControl impControl = clang::ObjCMethodDecl::None;
                     const bool HasRelatedResultType = false;
                     
-                    ObjCMethodDecl *setter = ObjCMethodDecl::Create (*m_ast,
-                                                                     SourceLocation(),
-                                                                     SourceLocation(),
-                                                                     setter_sel,
-                                                                     result_type,
-                                                                     nullptr,
-                                                                     class_interface_decl,
-                                                                     isInstance,
-                                                                     isVariadic,
-                                                                     isSynthesized,
-                                                                     isImplicitlyDeclared,
-                                                                     isDefined,
-                                                                     impControl,
-                                                                     HasRelatedResultType);
+                    clang::ObjCMethodDecl *setter = clang::ObjCMethodDecl::Create (*m_ast,
+                                                                                   clang::SourceLocation(),
+                                                                                   clang::SourceLocation(),
+                                                                                   setter_sel,
+                                                                                   result_type,
+                                                                                   nullptr,
+                                                                                   class_interface_decl,
+                                                                                   isInstance,
+                                                                                   isVariadic,
+                                                                                   isSynthesized,
+                                                                                   isImplicitlyDeclared,
+                                                                                   isDefined,
+                                                                                   impControl,
+                                                                                   HasRelatedResultType);
                     
                     if (setter && metadata)
                         ClangASTContext::SetMetadata(m_ast, setter, *metadata);
                     
-                    llvm::SmallVector<ParmVarDecl *, 1> params;
+                    llvm::SmallVector<clang::ParmVarDecl *, 1> params;
                     
-                    params.push_back (ParmVarDecl::Create (*m_ast,
-                                                           setter,
-                                                           SourceLocation(),
-                                                           SourceLocation(),
-                                                           nullptr, // anonymous
-                                                           property_clang_type_to_access.GetQualType(),
-                                                           nullptr,
-                                                           SC_Auto,
-                                                           nullptr));
+                    params.push_back (clang::ParmVarDecl::Create (*m_ast,
+                                                                  setter,
+                                                                  clang::SourceLocation(),
+                                                                  clang::SourceLocation(),
+                                                                  nullptr, // anonymous
+                                                                  property_clang_type_to_access.GetQualType(),
+                                                                  nullptr,
+                                                                  clang::SC_Auto,
+                                                                  nullptr));
                     
-                    setter->setMethodParams(*m_ast, ArrayRef<ParmVarDecl*>(params), ArrayRef<SourceLocation>());
+                    setter->setMethodParams(*m_ast, llvm::ArrayRef<clang::ParmVarDecl*>(params), llvm::ArrayRef<clang::SourceLocation>());
                     
                     class_interface_decl->addDecl(setter);
                 }
@@ -5152,14 +5153,14 @@ ClangASTType::AddObjCClassProperty (cons
 bool
 ClangASTType::IsObjCClassTypeAndHasIVars (bool check_superclass) const
 {
-    ObjCInterfaceDecl *class_interface_decl = GetAsObjCInterfaceDecl ();
+    clang::ObjCInterfaceDecl *class_interface_decl = GetAsObjCInterfaceDecl ();
     if (class_interface_decl)
         return ObjCDeclHasIVars (class_interface_decl, check_superclass);
     return false;
 }
 
 
-ObjCMethodDecl *
+clang::ObjCMethodDecl *
 ClangASTType::AddMethodToObjCObjectType (const char *name,  // the full symbol name as seen in the symbol table ("-[NString stringWithCString:]")
                                          const ClangASTType &method_clang_type,
                                          lldb::AccessType access,
@@ -5168,7 +5169,7 @@ ClangASTType::AddMethodToObjCObjectType
     if (!IsValid() || !method_clang_type.IsValid())
         return nullptr;
 
-    ObjCInterfaceDecl *class_interface_decl = GetAsObjCInterfaceDecl();
+    clang::ObjCInterfaceDecl *class_interface_decl = GetAsObjCInterfaceDecl();
     
     if (class_interface_decl == nullptr)
         return nullptr;
@@ -5178,7 +5179,7 @@ ClangASTType::AddMethodToObjCObjectType
         return nullptr;
     
     selector_start++;
-    llvm::SmallVector<IdentifierInfo *, 12> selector_idents;
+    llvm::SmallVector<clang::IdentifierInfo *, 12> selector_idents;
     
     size_t len = 0;
     const char *start;
@@ -5193,7 +5194,7 @@ ClangASTType::AddMethodToObjCObjectType
         bool has_arg = (start[len] == ':');
         if (has_arg)
             ++num_selectors_with_args;
-        selector_idents.push_back (&m_ast->Idents.get (StringRef (start, len)));
+        selector_idents.push_back (&m_ast->Idents.get (llvm::StringRef (start, len)));
         if (has_arg)
             len += 1;
     }
@@ -5205,7 +5206,7 @@ ClangASTType::AddMethodToObjCObjectType
     clang::Selector method_selector = m_ast->Selectors.getSelector (num_selectors_with_args ? selector_idents.size() : 0,
                                                                     selector_idents.data());
     
-    QualType method_qual_type (method_clang_type.GetQualType());
+    clang::QualType method_qual_type (method_clang_type.GetQualType());
     
     // Populate the method decl with parameter decls
     const clang::Type *method_type(method_qual_type.getTypePtr());
@@ -5213,7 +5214,7 @@ ClangASTType::AddMethodToObjCObjectType
     if (method_type == nullptr)
         return nullptr;
     
-    const FunctionProtoType *method_function_prototype (dyn_cast<FunctionProtoType>(method_type));
+    const clang::FunctionProtoType *method_function_prototype (llvm::dyn_cast<clang::FunctionProtoType>(method_type));
     
     if (!method_function_prototype)
         return nullptr;
@@ -5222,27 +5223,27 @@ ClangASTType::AddMethodToObjCObjectType
     bool is_variadic = false;
     bool is_synthesized = false;
     bool is_defined = false;
-    ObjCMethodDecl::ImplementationControl imp_control = ObjCMethodDecl::None;
+    clang::ObjCMethodDecl::ImplementationControl imp_control = clang::ObjCMethodDecl::None;
     
     const unsigned num_args = method_function_prototype->getNumParams();
     
     if (num_args != num_selectors_with_args)
         return nullptr; // some debug information is corrupt.  We are not going to deal with it.
     
-    ObjCMethodDecl *objc_method_decl = ObjCMethodDecl::Create (*m_ast,
-                                                               SourceLocation(), // beginLoc,
-                                                               SourceLocation(), // endLoc,
-                                                               method_selector,
-                                                               method_function_prototype->getReturnType(),
-                                                               nullptr, // TypeSourceInfo *ResultTInfo,
-                                                               GetDeclContextForType (),
-                                                               name[0] == '-',
-                                                               is_variadic,
-                                                               is_synthesized,
-                                                               true, // is_implicitly_declared; we force this to true because we don't have source locations
-                                                               is_defined,
-                                                               imp_control,
-                                                               false /*has_related_result_type*/);
+    clang::ObjCMethodDecl *objc_method_decl = clang::ObjCMethodDecl::Create (*m_ast,
+                                                                             clang::SourceLocation(), // beginLoc,
+                                                                             clang::SourceLocation(), // endLoc,
+                                                                             method_selector,
+                                                                             method_function_prototype->getReturnType(),
+                                                                             nullptr, // TypeSourceInfo *ResultTInfo,
+                                                                             GetDeclContextForType (),
+                                                                             name[0] == '-',
+                                                                             is_variadic,
+                                                                             is_synthesized,
+                                                                             true, // is_implicitly_declared; we force this to true because we don't have source locations
+                                                                             is_defined,
+                                                                             imp_control,
+                                                                             false /*has_related_result_type*/);
     
     
     if (objc_method_decl == nullptr)
@@ -5250,22 +5251,22 @@ ClangASTType::AddMethodToObjCObjectType
     
     if (num_args > 0)
     {
-        llvm::SmallVector<ParmVarDecl *, 12> params;
+        llvm::SmallVector<clang::ParmVarDecl *, 12> params;
         
         for (unsigned param_index = 0; param_index < num_args; ++param_index)
         {
-            params.push_back (ParmVarDecl::Create (*m_ast,
-                                                   objc_method_decl,
-                                                   SourceLocation(),
-                                                   SourceLocation(),
-                                                   nullptr, // anonymous
-                                                   method_function_prototype->getParamType(param_index),
-                                                   nullptr,
-                                                   SC_Auto,
-                                                   nullptr));
+            params.push_back (clang::ParmVarDecl::Create (*m_ast,
+                                                          objc_method_decl,
+                                                          clang::SourceLocation(),
+                                                          clang::SourceLocation(),
+                                                          nullptr, // anonymous
+                                                          method_function_prototype->getParamType(param_index),
+                                                          nullptr,
+                                                          clang::SC_Auto,
+                                                          nullptr));
         }
         
-        objc_method_decl->setMethodParams(*m_ast, ArrayRef<ParmVarDecl*>(params), ArrayRef<SourceLocation>());
+        objc_method_decl->setMethodParams(*m_ast, llvm::ArrayRef<clang::ParmVarDecl*>(params), llvm::ArrayRef<clang::SourceLocation>());
     }
     
     class_interface_decl->addDecl (objc_method_decl);
@@ -5284,7 +5285,7 @@ ClangASTType::GetDeclContextForType () c
     if (!IsValid())
         return nullptr;
     
-    QualType qual_type(GetCanonicalQualType());
+    clang::QualType qual_type(GetCanonicalQualType());
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
     {
@@ -5306,13 +5307,13 @@ ClangASTType::GetDeclContextForType () c
         case clang::Type::MemberPointer:            break;
         case clang::Type::Complex:                  break;
         case clang::Type::ObjCObject:               break;
-        case clang::Type::ObjCInterface:            return cast<ObjCObjectType>(qual_type.getTypePtr())->getInterface();
-        case clang::Type::ObjCObjectPointer:        return ClangASTType (m_ast, cast<ObjCObjectPointerType>(qual_type.getTypePtr())->getPointeeType()).GetDeclContextForType();
-        case clang::Type::Record:                   return cast<RecordType>(qual_type)->getDecl();
-        case clang::Type::Enum:                     return cast<EnumType>(qual_type)->getDecl();
-        case clang::Type::Typedef:                  return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetDeclContextForType();
-        case clang::Type::Elaborated:               return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).GetDeclContextForType();
-        case clang::Type::Paren:                    return ClangASTType (m_ast, cast<ParenType>(qual_type)->desugar()).GetDeclContextForType();
+        case clang::Type::ObjCInterface:            return llvm::cast<clang::ObjCObjectType>(qual_type.getTypePtr())->getInterface();
+        case clang::Type::ObjCObjectPointer:        return ClangASTType (m_ast, llvm::cast<clang::ObjCObjectPointerType>(qual_type.getTypePtr())->getPointeeType()).GetDeclContextForType();
+        case clang::Type::Record:                   return llvm::cast<clang::RecordType>(qual_type)->getDecl();
+        case clang::Type::Enum:                     return llvm::cast<clang::EnumType>(qual_type)->getDecl();
+        case clang::Type::Typedef:                  return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).GetDeclContextForType();
+        case clang::Type::Elaborated:               return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).GetDeclContextForType();
+        case clang::Type::Paren:                    return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).GetDeclContextForType();
         case clang::Type::TypeOfExpr:               break;
         case clang::Type::TypeOf:                   break;
         case clang::Type::Decltype:                 break;
@@ -5329,6 +5330,7 @@ ClangASTType::GetDeclContextForType () c
         case clang::Type::InjectedClassName:        break;
         case clang::Type::DependentName:            break;
         case clang::Type::Atomic:                   break;
+        case clang::Type::Adjusted:                 break;
 
         // pointer type decayed from an array or function type.
         case clang::Type::Decayed:                  break;
@@ -5344,18 +5346,18 @@ ClangASTType::SetDefaultAccessForRecordF
 {
     if (IsValid())
     {
-        RecordDecl *record_decl = GetAsRecordDecl();
+        clang::RecordDecl *record_decl = GetAsRecordDecl();
         if (record_decl)
         {
             uint32_t field_idx;
-            RecordDecl::field_iterator field, field_end;
+            clang::RecordDecl::field_iterator field, field_end;
             for (field = record_decl->field_begin(), field_end = record_decl->field_end(), field_idx = 0;
                  field != field_end;
                  ++field, ++field_idx)
             {
                 // If no accessibility was assigned, assign the correct one
                 if (field_idx < num_assigned_accessibilities && assigned_accessibilities[field_idx] == clang::AS_none)
-                    field->setAccess ((AccessSpecifier)default_accessibility);
+                    field->setAccess ((clang::AccessSpecifier)default_accessibility);
             }
             return true;
         }
@@ -5370,14 +5372,14 @@ ClangASTType::SetHasExternalStorage (boo
     if (!IsValid())
         return false;
     
-    QualType qual_type (GetCanonicalQualType());
+    clang::QualType qual_type (GetCanonicalQualType());
     
     const clang::Type::TypeClass type_class = qual_type->getTypeClass();
     switch (type_class)
     {
         case clang::Type::Record:
         {
-            CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+            clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
             if (cxx_record_decl)
             {
                 cxx_record_decl->setHasExternalLexicalStorage (has_extern);
@@ -5389,7 +5391,7 @@ ClangASTType::SetHasExternalStorage (boo
             
         case clang::Type::Enum:
         {
-            EnumDecl *enum_decl = cast<EnumType>(qual_type)->getDecl();
+            clang::EnumDecl *enum_decl = llvm::cast<clang::EnumType>(qual_type)->getDecl();
             if (enum_decl)
             {
                 enum_decl->setHasExternalLexicalStorage (has_extern);
@@ -5402,11 +5404,11 @@ ClangASTType::SetHasExternalStorage (boo
         case clang::Type::ObjCObject:
         case clang::Type::ObjCInterface:
         {
-            const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type.getTypePtr());
+            const clang::ObjCObjectType *objc_class_type =  llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr());
             assert (objc_class_type);
             if (objc_class_type)
             {
-                ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+                clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
                 
                 if (class_interface_decl)
                 {
@@ -5419,13 +5421,13 @@ ClangASTType::SetHasExternalStorage (boo
             break;
             
         case clang::Type::Typedef:
-            return ClangASTType (m_ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType()).SetHasExternalStorage (has_extern);
+            return ClangASTType (m_ast, llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType()).SetHasExternalStorage (has_extern);
             
         case clang::Type::Elaborated:
-            return ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).SetHasExternalStorage (has_extern);
+            return ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).SetHasExternalStorage (has_extern);
             
         case clang::Type::Paren:
-            return ClangASTType (m_ast, cast<ParenType>(qual_type)->desugar()).SetHasExternalStorage (has_extern);
+            return ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).SetHasExternalStorage (has_extern);
             
         default:
             break;
@@ -5438,17 +5440,17 @@ ClangASTType::SetTagTypeKind (int kind)
 {
     if (IsValid())
     {
-        QualType tag_qual_type(GetQualType());
+        clang::QualType tag_qual_type(GetQualType());
         const clang::Type *clang_type = tag_qual_type.getTypePtr();
         if (clang_type)
         {
-            const TagType *tag_type = dyn_cast<TagType>(clang_type);
+            const clang::TagType *tag_type =  llvm::dyn_cast<clang::TagType>(clang_type);
             if (tag_type)
             {
-                TagDecl *tag_decl = dyn_cast<TagDecl>(tag_type->getDecl());
+                clang::TagDecl *tag_decl =  llvm::dyn_cast<clang::TagDecl>(tag_type->getDecl());
                 if (tag_decl)
                 {
-                    tag_decl->setTagKind ((TagDecl::TagKind)kind);
+                    tag_decl->setTagKind ((clang::TagDecl::TagKind)kind);
                     return true;
                 }
             }
@@ -5465,14 +5467,14 @@ ClangASTType::StartTagDeclarationDefinit
 {
     if (IsValid())
     {
-        QualType qual_type (GetQualType());
+        clang::QualType qual_type (GetQualType());
         const clang::Type *t = qual_type.getTypePtr();
         if (t)
         {
-            const TagType *tag_type = dyn_cast<TagType>(t);
+            const clang::TagType *tag_type =  llvm::dyn_cast<clang::TagType>(t);
             if (tag_type)
             {
-                TagDecl *tag_decl = tag_type->getDecl();
+                clang::TagDecl *tag_decl = tag_type->getDecl();
                 if (tag_decl)
                 {
                     tag_decl->startDefinition();
@@ -5480,10 +5482,10 @@ ClangASTType::StartTagDeclarationDefinit
                 }
             }
             
-            const ObjCObjectType *object_type = dyn_cast<ObjCObjectType>(t);
+            const clang::ObjCObjectType *object_type =  llvm::dyn_cast<clang::ObjCObjectType>(t);
             if (object_type)
             {
-                ObjCInterfaceDecl *interface_decl = object_type->getInterface();
+                clang::ObjCInterfaceDecl *interface_decl = object_type->getInterface();
                 if (interface_decl)
                 {
                     interface_decl->startDefinition();
@@ -5500,9 +5502,9 @@ ClangASTType::CompleteTagDeclarationDefi
 {
     if (IsValid())
     {
-        QualType qual_type (GetQualType());
+        clang::QualType qual_type (GetQualType());
         
-        CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
+        clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl();
         
         if (cxx_record_decl)
         {
@@ -5511,11 +5513,11 @@ ClangASTType::CompleteTagDeclarationDefi
             return true;
         }
         
-        const EnumType *enum_type = dyn_cast<EnumType>(qual_type.getTypePtr());
+        const clang::EnumType *enum_type =  llvm::dyn_cast<clang::EnumType>(qual_type.getTypePtr());
         
         if (enum_type)
         {
-            EnumDecl *enum_decl = enum_type->getDecl();
+            clang::EnumDecl *enum_decl = enum_type->getDecl();
             
             if (enum_decl)
             {
@@ -5524,7 +5526,7 @@ ClangASTType::CompleteTagDeclarationDefi
                 unsigned NumPositiveBits = 1;
                 unsigned NumNegativeBits = 0;
                                 
-                QualType promotion_qual_type;
+                clang::QualType promotion_qual_type;
                 // If the enum integer type is less than an integer in bit width,
                 // then we must promote it to an integer size.
                 if (m_ast->getTypeSize(enum_decl->getIntegerType()) < m_ast->getTypeSize(m_ast->IntTy))
@@ -5560,27 +5562,27 @@ ClangASTType::AddEnumerationValueToEnume
 {
     if (IsValid() && enumerator_clang_type.IsValid() && name && name[0])
     {
-        QualType enum_qual_type (GetCanonicalQualType());
+        clang::QualType enum_qual_type (GetCanonicalQualType());
         
         bool is_signed = false;
         enumerator_clang_type.IsIntegerType (is_signed);
         const clang::Type *clang_type = enum_qual_type.getTypePtr();
         if (clang_type)
         {
-            const EnumType *enum_type = dyn_cast<EnumType>(clang_type);
+            const clang::EnumType *enum_type =  llvm::dyn_cast<clang::EnumType>(clang_type);
             
             if (enum_type)
             {
                 llvm::APSInt enum_llvm_apsint(enum_value_bit_size, is_signed);
                 enum_llvm_apsint = enum_value;
-                EnumConstantDecl *enumerator_decl =
-                EnumConstantDecl::Create (*m_ast,
-                                          enum_type->getDecl(),
-                                          SourceLocation(),
-                                          name ? &m_ast->Idents.get(name) : nullptr,    // Identifier
-                                          enumerator_clang_type.GetQualType(),
-                                          nullptr,
-                                          enum_llvm_apsint);
+                clang::EnumConstantDecl *enumerator_decl =
+                clang::EnumConstantDecl::Create (*m_ast,
+                                                 enum_type->getDecl(),
+                                                 clang::SourceLocation(),
+                                                 name ? &m_ast->Idents.get(name) : nullptr,    // Identifier
+                                                 enumerator_clang_type.GetQualType(),
+                                                 nullptr,
+                                                 enum_llvm_apsint);
                 
                 if (enumerator_decl)
                 {
@@ -5602,14 +5604,14 @@ ClangASTType::AddEnumerationValueToEnume
 ClangASTType
 ClangASTType::GetEnumerationIntegerType () const
 {
-    QualType enum_qual_type (GetCanonicalQualType());
+    clang::QualType enum_qual_type (GetCanonicalQualType());
     const clang::Type *clang_type = enum_qual_type.getTypePtr();
     if (clang_type)
     {
-        const EnumType *enum_type = dyn_cast<EnumType>(clang_type);
+        const clang::EnumType *enum_type =  llvm::dyn_cast<clang::EnumType>(clang_type);
         if (enum_type)
         {
-            EnumDecl *enum_decl = enum_type->getDecl();
+            clang::EnumDecl *enum_decl = enum_type->getDecl();
             if (enum_decl)
                 return ClangASTType (m_ast, enum_decl->getIntegerType());
         }
@@ -5634,7 +5636,7 @@ ClangASTType::ConvertStringToFloatValue
 {
     if (IsValid())
     {
-        QualType qual_type (GetCanonicalQualType());
+        clang::QualType qual_type (GetCanonicalQualType());
         uint32_t count = 0;
         bool is_complex = false;
         if (IsFloatingPointType (count, is_complex))
@@ -5643,8 +5645,8 @@ ClangASTType::ConvertStringToFloatValue
             if (count != 1)
                 return false;
             
-            StringRef s_sref(s);
-            APFloat ap_float(m_ast->getFloatTypeSemantics(qual_type), s_sref);
+            llvm::StringRef s_sref(s);
+            llvm::APFloat ap_float(m_ast->getFloatTypeSemantics(qual_type), s_sref);
             
             const uint64_t bit_size = m_ast->getTypeSize (qual_type);
             const uint64_t byte_size = bit_size / 8;
@@ -5692,30 +5694,30 @@ ClangASTType::DumpValue (ExecutionContex
     if (!IsValid())
         return;
 
-    QualType qual_type(GetQualType());
+    clang::QualType qual_type(GetQualType());
     switch (qual_type->getTypeClass())
     {
     case clang::Type::Record:
         if (GetCompleteType ())
         {
-            const RecordType *record_type = cast<RecordType>(qual_type.getTypePtr());
-            const RecordDecl *record_decl = record_type->getDecl();
+            const clang::RecordType *record_type = llvm::cast<clang::RecordType>(qual_type.getTypePtr());
+            const clang::RecordDecl *record_decl = record_type->getDecl();
             assert(record_decl);
             uint32_t field_bit_offset = 0;
             uint32_t field_byte_offset = 0;
-            const ASTRecordLayout &record_layout = m_ast->getASTRecordLayout(record_decl);
+            const clang::ASTRecordLayout &record_layout = m_ast->getASTRecordLayout(record_decl);
             uint32_t child_idx = 0;
 
-            const CXXRecordDecl *cxx_record_decl = dyn_cast<CXXRecordDecl>(record_decl);
+            const clang::CXXRecordDecl *cxx_record_decl =  llvm::dyn_cast<clang::CXXRecordDecl>(record_decl);
             if (cxx_record_decl)
             {
                 // We might have base classes to print out first
-                CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
+                clang::CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
                 for (base_class = cxx_record_decl->bases_begin(), base_class_end = cxx_record_decl->bases_end();
                      base_class != base_class_end;
                      ++base_class)
                 {
-                    const CXXRecordDecl *base_class_decl = cast<CXXRecordDecl>(base_class->getType()->getAs<RecordType>()->getDecl());
+                    const clang::CXXRecordDecl *base_class_decl = llvm::cast<clang::CXXRecordDecl>(base_class->getType()->getAs<clang::RecordType>()->getDecl());
 
                     // Skip empty base classes
                     if (verbose == false && ClangASTContext::RecordHasFields(base_class_decl) == false)
@@ -5732,7 +5734,7 @@ ClangASTType::DumpValue (ExecutionContex
                     else
                         s->PutChar(',');
 
-                    QualType base_class_qual_type = base_class->getType();
+                    clang::QualType base_class_qual_type = base_class->getType();
                     std::string base_class_type_name(base_class_qual_type.getAsString());
 
                     // Indent and print the base class type name
@@ -5759,7 +5761,7 @@ ClangASTType::DumpValue (ExecutionContex
                 }
             }
             uint32_t field_idx = 0;
-            RecordDecl::field_iterator field, field_end;
+            clang::RecordDecl::field_iterator field, field_end;
             for (field = record_decl->field_begin(), field_end = record_decl->field_end(); field != field_end; ++field, ++field_idx, ++child_idx)
             {
                 // Print the starting squiggly bracket (if this is the
@@ -5773,7 +5775,7 @@ ClangASTType::DumpValue (ExecutionContex
                 // Indent
                 s->Printf("\n%*s", depth + DEPTH_INCREMENT, "");
 
-                QualType field_type = field->getType();
+                clang::QualType field_type = field->getType();
                 // Print the member type if requested
                 // Figure out the type byte size (field_type_info.first) and
                 // alignment (field_type_info.second) from the AST context.
@@ -5824,10 +5826,10 @@ ClangASTType::DumpValue (ExecutionContex
     case clang::Type::Enum:
         if (GetCompleteType ())
         {
-            const EnumType *enum_type = cast<EnumType>(qual_type.getTypePtr());
-            const EnumDecl *enum_decl = enum_type->getDecl();
+            const clang::EnumType *enum_type = llvm::cast<clang::EnumType>(qual_type.getTypePtr());
+            const clang::EnumDecl *enum_decl = enum_type->getDecl();
             assert(enum_decl);
-            EnumDecl::enumerator_iterator enum_pos, enum_end_pos;
+            clang::EnumDecl::enumerator_iterator enum_pos, enum_end_pos;
             lldb::offset_t offset = data_byte_offset;
             const int64_t enum_value = data.GetMaxU64Bitfield(&offset, data_byte_size, bitfield_bit_size, bitfield_bit_offset);
             for (enum_pos = enum_decl->enumerator_begin(), enum_end_pos = enum_decl->enumerator_end(); enum_pos != enum_end_pos; ++enum_pos)
@@ -5846,9 +5848,9 @@ ClangASTType::DumpValue (ExecutionContex
 
     case clang::Type::ConstantArray:
         {
-            const ConstantArrayType *array = cast<ConstantArrayType>(qual_type.getTypePtr());
+            const clang::ConstantArrayType *array = llvm::cast<clang::ConstantArrayType>(qual_type.getTypePtr());
             bool is_array_of_characters = false;
-            QualType element_qual_type = array->getElementType();
+            clang::QualType element_qual_type = array->getElementType();
 
             const clang::Type *canonical_type = element_qual_type->getCanonicalTypeInternal().getTypePtr();
             if (canonical_type)
@@ -5915,7 +5917,7 @@ ClangASTType::DumpValue (ExecutionContex
 
     case clang::Type::Typedef:
         {
-            QualType typedef_qual_type = cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType();
+            clang::QualType typedef_qual_type = llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType();
             
             ClangASTType typedef_clang_type (m_ast, typedef_qual_type);
             lldb::Format typedef_format = typedef_clang_type.GetFormat();
@@ -5939,7 +5941,7 @@ ClangASTType::DumpValue (ExecutionContex
 
     case clang::Type::Elaborated:
         {
-            QualType elaborated_qual_type = cast<ElaboratedType>(qual_type)->getNamedType();
+            clang::QualType elaborated_qual_type = llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType();
             ClangASTType elaborated_clang_type (m_ast, elaborated_qual_type);
             lldb::Format elaborated_format = elaborated_clang_type.GetFormat();
             std::pair<uint64_t, unsigned> elaborated_type_info = m_ast->getTypeInfo(elaborated_qual_type);
@@ -5962,7 +5964,7 @@ ClangASTType::DumpValue (ExecutionContex
             
     case clang::Type::Paren:
         {
-            QualType desugar_qual_type = cast<ParenType>(qual_type)->desugar();
+            clang::QualType desugar_qual_type = llvm::cast<clang::ParenType>(qual_type)->desugar();
             ClangASTType desugar_clang_type (m_ast, desugar_qual_type);
 
             lldb::Format desugar_format = desugar_clang_type.GetFormat();
@@ -6023,14 +6025,14 @@ ClangASTType::DumpTypeValue (Stream *s,
     }
     else
     {
-        QualType qual_type(GetQualType());
+        clang::QualType qual_type(GetQualType());
 
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         switch (type_class)
         {
         case clang::Type::Typedef:
             {
-                QualType typedef_qual_type = cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType();
+                clang::QualType typedef_qual_type = llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType();
                 ClangASTType typedef_clang_type (m_ast, typedef_qual_type);
                 if (format == eFormatDefault)
                     format = typedef_clang_type.GetFormat();
@@ -6053,10 +6055,10 @@ ClangASTType::DumpTypeValue (Stream *s,
             // its enumeration string value, else just display it as requested.
             if ((format == eFormatEnum || format == eFormatDefault) && GetCompleteType ())
             {
-                const EnumType *enum_type = cast<EnumType>(qual_type.getTypePtr());
-                const EnumDecl *enum_decl = enum_type->getDecl();
+                const clang::EnumType *enum_type = llvm::cast<clang::EnumType>(qual_type.getTypePtr());
+                const clang::EnumDecl *enum_decl = enum_type->getDecl();
                 assert(enum_decl);
-                EnumDecl::enumerator_iterator enum_pos, enum_end_pos;
+                clang::EnumDecl::enumerator_iterator enum_pos, enum_end_pos;
                 const bool is_signed = qual_type->isSignedIntegerOrEnumerationType();
                 lldb::offset_t offset = byte_offset;
                 if (is_signed)
@@ -6232,10 +6234,10 @@ ClangASTType::DumpTypeDescription (Strea
 {
     if (IsValid())
     {
-        QualType qual_type(GetQualType());
+        clang::QualType qual_type(GetQualType());
 
-        SmallVector<char, 1024> buf;
-        raw_svector_ostream llvm_ostrm (buf);
+        llvm::SmallVector<char, 1024> buf;
+        llvm::raw_svector_ostream llvm_ostrm (buf);
 
         const clang::Type::TypeClass type_class = qual_type->getTypeClass();
         switch (type_class)
@@ -6245,14 +6247,14 @@ ClangASTType::DumpTypeDescription (Strea
             {
                 GetCompleteType ();
                 
-                const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type.getTypePtr());
+                const clang::ObjCObjectType *objc_class_type =  llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr());
                 assert (objc_class_type);
                 if (objc_class_type)
                 {
-                    ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+                    clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
                     if (class_interface_decl)
                     {
-                        PrintingPolicy policy = m_ast->getPrintingPolicy();
+                        clang::PrintingPolicy policy = m_ast->getPrintingPolicy();
                         class_interface_decl->print(llvm_ostrm, policy, s->GetIndentLevel());
                     }
                 }
@@ -6261,10 +6263,10 @@ ClangASTType::DumpTypeDescription (Strea
         
         case clang::Type::Typedef:
             {
-                const TypedefType *typedef_type = qual_type->getAs<TypedefType>();
+                const clang::TypedefType *typedef_type = qual_type->getAs<clang::TypedefType>();
                 if (typedef_type)
                 {
-                    const TypedefNameDecl *typedef_decl = typedef_type->getDecl();
+                    const clang::TypedefNameDecl *typedef_decl = typedef_type->getDecl();
                     std::string clang_typedef_name (typedef_decl->getQualifiedNameAsString());
                     if (!clang_typedef_name.empty())
                     {
@@ -6276,20 +6278,20 @@ ClangASTType::DumpTypeDescription (Strea
             break;
 
         case clang::Type::Elaborated:
-            ClangASTType (m_ast, cast<ElaboratedType>(qual_type)->getNamedType()).DumpTypeDescription(s);
+            ClangASTType (m_ast, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType()).DumpTypeDescription(s);
             return;
 
         case clang::Type::Paren:
-            ClangASTType (m_ast, cast<ParenType>(qual_type)->desugar()).DumpTypeDescription(s);
+            ClangASTType (m_ast, llvm::cast<clang::ParenType>(qual_type)->desugar()).DumpTypeDescription(s);
             return;
 
         case clang::Type::Record:
             {
                 GetCompleteType ();
                 
-                const RecordType *record_type = cast<RecordType>(qual_type.getTypePtr());
-                const RecordDecl *record_decl = record_type->getDecl();
-                const CXXRecordDecl *cxx_record_decl = dyn_cast<CXXRecordDecl>(record_decl);
+                const clang::RecordType *record_type = llvm::cast<clang::RecordType>(qual_type.getTypePtr());
+                const clang::RecordDecl *record_decl = record_type->getDecl();
+                const clang::CXXRecordDecl *cxx_record_decl =  llvm::dyn_cast<clang::CXXRecordDecl>(record_decl);
 
                 if (cxx_record_decl)
                     cxx_record_decl->print(llvm_ostrm, m_ast->getPrintingPolicy(), s->GetIndentLevel());
@@ -6300,10 +6302,10 @@ ClangASTType::DumpTypeDescription (Strea
 
         default:
             {
-                const TagType *tag_type = dyn_cast<TagType>(qual_type.getTypePtr());
+                const clang::TagType *tag_type =  llvm::dyn_cast<clang::TagType>(qual_type.getTypePtr());
                 if (tag_type)
                 {
-                    TagDecl *tag_decl = tag_type->getDecl();
+                    clang::TagDecl *tag_decl = tag_type->getDecl();
                     if (tag_decl)
                         tag_decl->print(llvm_ostrm, 0);
                 }
@@ -6629,11 +6631,11 @@ ClangASTType::WriteToMemory (lldb_privat
 }
 
 
-//CXXRecordDecl *
+//clang::CXXRecordDecl *
 //ClangASTType::GetAsCXXRecordDecl (lldb::clang_type_t opaque_clang_qual_type)
 //{
 //    if (opaque_clang_qual_type)
-//        return QualType::getFromOpaquePtr(opaque_clang_qual_type)->getAsCXXRecordDecl();
+//        return clang::QualType::getFromOpaquePtr(opaque_clang_qual_type)->getAsCXXRecordDecl();
 //    return NULL;
 //}
 





More information about the lldb-commits mailing list