aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/tools
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2015-02-08 14:28:43 +0000
committerEd Maste <emaste@FreeBSD.org>2015-02-08 14:28:43 +0000
commit60903fda75de25012e1bc2952b120a9f78c8105c (patch)
tree1b2015f27db3ee2cc480ba3195770bcc2b41ab1d /contrib/llvm/tools
parentad8292ff2134ad78712439f231e639286841bddc (diff)
downloadsrc-60903fda75de25012e1bc2952b120a9f78c8105c.tar.gz
src-60903fda75de25012e1bc2952b120a9f78c8105c.zip
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
Notes
Notes: svn path=/projects/clang360-import/; revision=278380
Diffstat (limited to 'contrib/llvm/tools')
-rw-r--r--contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp4
-rw-r--r--contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp6
-rw-r--r--contrib/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp6
-rw-r--r--contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp36
4 files changed, 23 insertions, 29 deletions
diff --git a/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp b/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp
index 9ea5315b9db3..4906108401af 100644
--- a/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp
+++ b/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp
@@ -387,8 +387,8 @@ ClangExpressionParser::Parse (Stream &stream)
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());
diff --git a/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp b/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp
index 76cd7a8d012c..e7cb728778e6 100644
--- a/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp
+++ b/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp
@@ -304,7 +304,7 @@ IRExecutionUnit::GetRunnableInfo(Error &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,
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);
diff --git a/contrib/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp b/contrib/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp
index ad4337f5bd3e..d851ae792181 100644
--- a/contrib/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp
+++ b/contrib/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp
@@ -1801,12 +1801,10 @@ ClangASTContext::CreateFunctionType (ASTContext *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());
diff --git a/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp b/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp
index 34976b1cee2e..8b672fac4312 100644
--- a/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp
+++ b/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp
@@ -3488,9 +3488,9 @@ ClangASTType::GetChildClangTypeAtIndex (ExecutionContext *exe_ctx,
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 (ExecutionContext *exe_ctx,
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 (ExecutionContext *exe_ctx,
// 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 (ExecutionContext *exe_ctx,
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 (ExecutionContext *exe_ctx,
// 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 (ExecutionContext *exe_ctx,
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 (ExecutionContext *exe_ctx,
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 (ExecutionContext *exe_ctx,
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 (ExecutionContext *exe_ctx,
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 (ExecutionContext *exe_ctx,
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