Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Feb 2015 14:28:44 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r278380 - in projects/clang360-import/contrib/llvm/tools/lldb/source: Expression Symbol
Message-ID:  <201502081428.t18ESi5j012778@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Sun Feb  8 14:28:43 2015
New Revision: 278380
URL: https://svnweb.freebsd.org/changeset/base/278380

Log:
  Revert LLDB compatibility changes for Clang 3.5 API
  
  This reverts FreeBSD SVN r275134 and r275127, restoring the following
  upstream revisions:
  
       SVN       git
      214335  59a1f270
      214340  42f16b1e
      214501  26d6f063
      215969  a083c0db
      216603  ee9cd340
      216810  f534f503
  
  Sponsored by:	DARPA, AFRL

Modified:
  projects/clang360-import/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp
  projects/clang360-import/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp
  projects/clang360-import/contrib/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp
  projects/clang360-import/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp
Directory Properties:
  projects/clang360-import/   (props changed)
  projects/clang360-import/contrib/llvm/   (props changed)
  projects/clang360-import/contrib/llvm/tools/lldb/   (props changed)

Modified: projects/clang360-import/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp
==============================================================================
--- projects/clang360-import/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp	Sun Feb  8 11:55:29 2015	(r278379)
+++ projects/clang360-import/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp	Sun Feb  8 14:28:43 2015	(r278380)
@@ -387,8 +387,8 @@ ClangExpressionParser::Parse (Stream &st
 
     if (!created_main_file)
     {
-        MemoryBuffer *memory_buffer = MemoryBuffer::getMemBufferCopy(expr_text, __FUNCTION__);
-        SourceMgr.setMainFileID(SourceMgr.createFileID(memory_buffer));
+        std::unique_ptr<MemoryBuffer> memory_buffer = MemoryBuffer::getMemBufferCopy(expr_text, __FUNCTION__);
+        SourceMgr.setMainFileID(SourceMgr.createFileID(std::move(memory_buffer)));
     }
 
     diag_buf->BeginSourceFile(m_compiler->getLangOpts(), &m_compiler->getPreprocessor());

Modified: projects/clang360-import/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp
==============================================================================
--- projects/clang360-import/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp	Sun Feb  8 11:55:29 2015	(r278379)
+++ projects/clang360-import/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp	Sun Feb  8 14:28:43 2015	(r278380)
@@ -304,7 +304,7 @@ IRExecutionUnit::GetRunnableInfo(Error &
 
     m_module_ap->getContext().setInlineAsmDiagnosticHandler(ReportInlineAsmError, &error);
 
-    llvm::EngineBuilder builder(m_module_ap.get());
+    llvm::EngineBuilder builder(std::move(m_module_ap));
 
     builder.setEngineKind(llvm::EngineKind::JIT)
     .setErrorStr(&error_string)
@@ -333,10 +333,6 @@ IRExecutionUnit::GetRunnableInfo(Error &
         error.SetErrorStringWithFormat("Couldn't JIT the function: %s", error_string.c_str());
         return;
     }
-    else
-    {
-        m_module_ap.release(); // ownership was transferred
-    }
 
     // Make sure we see all sections, including ones that don't have relocations...
     m_execution_engine_ap->setProcessAllSections(true);

Modified: projects/clang360-import/contrib/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp
==============================================================================
--- projects/clang360-import/contrib/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp	Sun Feb  8 11:55:29 2015	(r278379)
+++ projects/clang360-import/contrib/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp	Sun Feb  8 14:28:43 2015	(r278380)
@@ -1801,12 +1801,10 @@ ClangASTContext::CreateFunctionType (AST
     // TODO: Detect calling convention in DWARF?
     FunctionProtoType::ExtProtoInfo proto_info;
     proto_info.Variadic = is_variadic;
-    proto_info.ExceptionSpecType = EST_None;
+    proto_info.ExceptionSpec = EST_None;
     proto_info.TypeQuals = type_quals;
     proto_info.RefQualifier = RQ_None;
-    proto_info.NumExceptions = 0;
-    proto_info.Exceptions = nullptr;
-    
+
     return ClangASTType (ast, ast->getFunctionType (result_type.GetQualType(),
                                                     qual_type_args,
                                                     proto_info).getAsOpaquePtr());

Modified: projects/clang360-import/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp
==============================================================================
--- projects/clang360-import/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp	Sun Feb  8 11:55:29 2015	(r278379)
+++ projects/clang360-import/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp	Sun Feb  8 14:28:43 2015	(r278380)
@@ -3488,9 +3488,9 @@ ClangASTType::GetChildClangTypeAtIndex (
                                         
                                         child_name.assign(superclass_interface_decl->getNameAsString().c_str());
                                         
-                                        std::pair<uint64_t, unsigned> ivar_type_info = m_ast->getTypeInfo(ivar_qual_type.getTypePtr());
+                                        clang::TypeInfo ivar_type_info = m_ast->getTypeInfo(ivar_qual_type.getTypePtr());
                                         
-                                        child_byte_size = ivar_type_info.first / 8;
+                                        child_byte_size = ivar_type_info.Width / 8;
                                         child_byte_offset = 0;
                                         child_is_base_class = true;
                                         
@@ -3520,9 +3520,9 @@ ClangASTType::GetChildClangTypeAtIndex (
                                     
                                     child_name.assign(ivar_decl->getNameAsString().c_str());
                                     
-                                    std::pair<uint64_t, unsigned> ivar_type_info = m_ast->getTypeInfo(ivar_qual_type.getTypePtr());
+                                    clang::TypeInfo  ivar_type_info = m_ast->getTypeInfo(ivar_qual_type.getTypePtr());
                                     
-                                    child_byte_size = ivar_type_info.first / 8;
+                                    child_byte_size = ivar_type_info.Width / 8;
                                     
                                     // Figure out the field offset within the current struct/union/class type
                                     // For ObjC objects, we can't trust the bit offset we get from the Clang AST, since
@@ -6036,7 +6036,7 @@ ClangASTType::DumpValue (ExecutionContex
                     // Indent and print the base class type name
                     s->Printf("\n%*s%s ", depth + DEPTH_INCREMENT, "", base_class_type_name.c_str());
 
-                    std::pair<uint64_t, unsigned> base_class_type_info = m_ast->getTypeInfo(base_class_qual_type);
+                    clang::TypeInfo base_class_type_info = m_ast->getTypeInfo(base_class_qual_type);
 
                     // Dump the value of the member
                     ClangASTType base_clang_type(m_ast, base_class_qual_type);
@@ -6045,7 +6045,7 @@ ClangASTType::DumpValue (ExecutionContex
                                                base_clang_type.GetFormat(),         // The format with which to display the member
                                                data,                                // Data buffer containing all bytes for this type
                                                data_byte_offset + field_byte_offset,// Offset into "data" where to grab value from
-                                               base_class_type_info.first / 8,      // Size of this type in bytes
+                                               base_class_type_info.Width / 8,      // Size of this type in bytes
                                                0,                                   // Bitfield bit size
                                                0,                                   // Bitfield bit offset
                                                show_types,                          // Boolean indicating if we should show the variable types
@@ -6075,7 +6075,7 @@ ClangASTType::DumpValue (ExecutionContex
                 // 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.
-                std::pair<uint64_t, unsigned> field_type_info = m_ast->getTypeInfo(field_type);
+                clang::TypeInfo field_type_info = m_ast->getTypeInfo(field_type);
                 assert(field_idx < record_layout.getFieldCount());
                 // Figure out the field offset within the current struct/union/class type
                 field_bit_offset = record_layout.getFieldOffset (field_idx);
@@ -6104,7 +6104,7 @@ ClangASTType::DumpValue (ExecutionContex
                                             field_clang_type.GetFormat(),   // The format with which to display the member
                                             data,                           // Data buffer containing all bytes for this type
                                             data_byte_offset + field_byte_offset,// Offset into "data" where to grab value from
-                                            field_type_info.first / 8,      // Size of this type in bytes
+                                            field_type_info.Width / 8,      // Size of this type in bytes
                                             field_bitfield_bit_size,        // Bitfield bit size
                                             field_bitfield_bit_offset,      // Bitfield bit offset
                                             show_types,                     // Boolean indicating if we should show the variable types
@@ -6154,11 +6154,11 @@ ClangASTType::DumpValue (ExecutionContex
 
             const uint64_t element_count = array->getSize().getLimitedValue();
 
-            std::pair<uint64_t, unsigned> field_type_info = m_ast->getTypeInfo(element_qual_type);
+            clang::TypeInfo field_type_info = m_ast->getTypeInfo(element_qual_type);
 
             uint32_t element_idx = 0;
             uint32_t element_offset = 0;
-            uint64_t element_byte_size = field_type_info.first / 8;
+            uint64_t element_byte_size = field_type_info.Width / 8;
             uint32_t element_stride = element_byte_size;
 
             if (is_array_of_characters)
@@ -6217,8 +6217,8 @@ ClangASTType::DumpValue (ExecutionContex
             
             ClangASTType typedef_clang_type (m_ast, typedef_qual_type);
             lldb::Format typedef_format = typedef_clang_type.GetFormat();
-            std::pair<uint64_t, unsigned> typedef_type_info = m_ast->getTypeInfo(typedef_qual_type);
-            uint64_t typedef_byte_size = typedef_type_info.first / 8;
+            clang::TypeInfo typedef_type_info = m_ast->getTypeInfo(typedef_qual_type);
+            uint64_t typedef_byte_size = typedef_type_info.Width / 8;
 
             return typedef_clang_type.DumpValue (exe_ctx,
                                                  s,                  // Stream to dump to
@@ -6240,8 +6240,8 @@ ClangASTType::DumpValue (ExecutionContex
             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);
-            uint64_t elaborated_byte_size = elaborated_type_info.first / 8;
+            clang::TypeInfo elaborated_type_info = m_ast->getTypeInfo(elaborated_qual_type);
+            uint64_t elaborated_byte_size = elaborated_type_info.Width / 8;
 
             return elaborated_clang_type.DumpValue (exe_ctx,
                                                     s,                  // Stream to dump to
@@ -6264,8 +6264,8 @@ ClangASTType::DumpValue (ExecutionContex
             ClangASTType desugar_clang_type (m_ast, desugar_qual_type);
 
             lldb::Format desugar_format = desugar_clang_type.GetFormat();
-            std::pair<uint64_t, unsigned> desugar_type_info = m_ast->getTypeInfo(desugar_qual_type);
-            uint64_t desugar_byte_size = desugar_type_info.first / 8;
+            clang::TypeInfo desugar_type_info = m_ast->getTypeInfo(desugar_qual_type);
+            uint64_t desugar_byte_size = desugar_type_info.Width / 8;
             
             return desugar_clang_type.DumpValue (exe_ctx,
                                                  s,                  // Stream to dump to
@@ -6332,8 +6332,8 @@ ClangASTType::DumpTypeValue (Stream *s,
                 ClangASTType typedef_clang_type (m_ast, typedef_qual_type);
                 if (format == eFormatDefault)
                     format = typedef_clang_type.GetFormat();
-                std::pair<uint64_t, unsigned> typedef_type_info = m_ast->getTypeInfo(typedef_qual_type);
-                uint64_t typedef_byte_size = typedef_type_info.first / 8;
+                clang::TypeInfo typedef_type_info = m_ast->getTypeInfo(typedef_qual_type);
+                uint64_t typedef_byte_size = typedef_type_info.Width / 8;
 
                 return typedef_clang_type.DumpTypeValue (s,
                                                          format,                 // The format with which to display the element



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502081428.t18ESi5j012778>